Skip to content

Commit

Permalink
feat: 新版挂件-动态读取配置
Browse files Browse the repository at this point in the history
  • Loading branch information
terwer committed Jun 24, 2023
1 parent de09930 commit 5234e76
Show file tree
Hide file tree
Showing 13 changed files with 558 additions and 45 deletions.
4 changes: 4 additions & 0 deletions components.d.ts
Expand Up @@ -24,6 +24,8 @@ declare module '@vue/runtime-core' {
ElInput: typeof import('element-plus/es')['ElInput']
ElMain: typeof import('element-plus/es')['ElMain']
ElOption: typeof import('element-plus/es')['ElOption']
ElRadio: typeof import('element-plus/es')['ElRadio']
ElRadioGroup: typeof import('element-plus/es')['ElRadioGroup']
ElScrollbar: typeof import('element-plus/es')['ElScrollbar']
ElSelect: typeof import('element-plus/es')['ElSelect']
ElSpace: typeof import('element-plus/es')['ElSpace']
Expand All @@ -36,12 +38,14 @@ declare module '@vue/runtime-core' {
HexoTest: typeof import('./src/components/test/HexoTest.vue')['default']
HugoTest: typeof import('./src/components/test/HugoTest.vue')['default']
KmsTest: typeof import('./src/components/test/kmsTest.vue')['default']
MetaweblogSetting: typeof import('./src/components/set/singleplatform/MetaweblogSetting.vue')['default']
PlatformSetting: typeof import('./src/components/set/PlatformSetting.vue')['default']
PublishIndex: typeof import('./src/components/publish/PublishIndex.vue')['default']
PublishSetting: typeof import('./src/components/set/PublishSetting.vue')['default']
RouterLink: typeof import('vue-router')['RouterLink']
RouterView: typeof import('vue-router')['RouterView']
SetIndex: typeof import('./src/components/set/SetIndex.vue')['default']
SinglePlatformSetting: typeof import('./src/components/set/SinglePlatformSetting.vue')['default']
SiyuanTest: typeof import('./src/components/test/SiyuanTest.vue')['default']
TypechoTest: typeof import('./src/components/test/TypechoTest.vue')['default']
VitepressTest: typeof import('./src/components/test/VitepressTest.vue')['default']
Expand Down
File renamed without changes.
File renamed without changes.
94 changes: 94 additions & 0 deletions src/adaptors/base/metaweblog/config/MetaweblogConfig.ts
@@ -0,0 +1,94 @@
/*
* Copyright (c) 2023, Terwer . All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Terwer designates this
* particular file as subject to the "Classpath" exception as provided
* by Terwer in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Terwer, Shenzhen, Guangdong, China, youweics@163.com
* or visit www.terwer.space if you need additional information or have any
* questions.
*/

import { BlogConfig, PageType, PageTypeEnum } from "zhi-blog-api"
import { MetaweblogPlaceholder } from "~/src/adaptors/base/metaweblog/config/MetaweblogPlaceholder.ts"

/**
* Metaweblog配置类
*/
export class MetaweblogConfig extends BlogConfig {
/**
* 首页
*/
public override home = ""

/**
* API地址
*/
public override apiUrl = ""
/**
* 用户名
*/
public override username = ""
/**
* 密码
*/
public override password = ""

/**
* 是否发布
*/
public override apiStatus = false

/**
* 博客名(API获取)
*/
public override blogName = ""

/**
* 文章别名key
*/
public override posidKey = ""

/**
* 文章预览链接
*/
public override previewUrl = ""

/**
* 文章类型
*/
public override pageType = PageTypeEnum.Markdown

/**
* 操作提示
*/
public override placeholder = {} as MetaweblogPlaceholder

constructor(home: string, apiUrl: string, username: string, password: string) {
super()
this.home = home
this.apiUrl = apiUrl
this.username = username
this.password = password
this.apiStatus = false
this.blogName = ""
this.posidKey = ""
this.previewUrl = ""
this.pageType = PageTypeEnum.Markdown
this.placeholder = new MetaweblogPlaceholder()
}
}
78 changes: 78 additions & 0 deletions src/adaptors/base/metaweblog/config/MetaweblogPlaceholder.ts
@@ -0,0 +1,78 @@
/*
* Copyright (c) 2023, Terwer . All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Terwer designates this
* particular file as subject to the "Classpath" exception as provided
* by Terwer in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Terwer, Shenzhen, Guangdong, China, youweics@163.com
* or visit www.terwer.space if you need additional information or have any
* questions.
*/

import { BlogPlaceholder } from "zhi-blog-api"

/**
* Metaweblog 操作提示
*/
export class MetaweblogPlaceholder extends BlogPlaceholder {
/**
* 首页操作提示
*/
public override homePlaceholder = ""

/**
* API 地址操作提示
*/
public override apiUrlPlaceholder = ""

/**
* 用户名操作提示
*/
public override usernamePlaceholder = ""

/**
* 密码操作提示
*/
public override passwordPlaceholder = ""

/**
* API状态是否正常操作提示
*/
public override apiStatusPlaceholder = false

/**
* 博客名(API获取)操作提示
*/
public override blogNamePlaceholder = ""

/**
* 文章别名key操作提示
*/
public override posidKeyPlaceholder = ""
/**
* 文章预览链接操作提示
*/
public override previewUrlPlaceholder = ""
/**
* 文章类型操作提示
*/
public override pageTypePlaceholder = ""

constructor() {
super()
}
}

0 comments on commit 5234e76

Please sign in to comment.