diff --git a/plugins/frontend/manager/client/settings/plugin.vue b/plugins/frontend/manager/client/settings/plugin.vue
index f04dcc32df..1875a11600 100644
--- a/plugins/frontend/manager/client/settings/plugin.vue
+++ b/plugins/frontend/manager/client/settings/plugin.vue
@@ -14,10 +14,10 @@
停用插件
- 重载配置
+ 重载配置
- 启用插件
+ 启用插件
保存配置
@@ -29,17 +29,17 @@
-
- 尚未将当前插件列入依赖,点击添加。
+
+ 尚未将当前插件列入依赖,点击添加。
-
+
此插件将会提供 {{ name }} 服务,但此服务已被其他插件实现。
-
- 此插件{{ data.id ? '提供了' : '将会提供' }} {{ name }} 服务。
+
+ 此插件{{ local.id ? '提供了' : '将会提供' }} {{ name }} 服务。
@@ -66,11 +66,16 @@
({{ local ? `${fulfilled ? '已' : '未'}启用` : '未安装,点击添加' }})
+
+
+ 此插件已在运行且不可重用,启用可能会导致非预期的问题。
+
+
-
+
此插件未声明配置项,这可能并非预期行为{{ hint }}。
-
+
{{ hint }}
@@ -112,13 +117,14 @@ const name = computed(() => {
].find(name => name in store.packages)
})
-const data = computed(() => getMixedMeta(name.value))
+const local = computed(() => store.packages[name.value])
+const remote = computed(() => store.market[name.value])
const env = computed(() => envMap.value[name.value])
-const hint = computed(() => data.value.workspace ? ',请检查源代码' : ',请联系插件作者')
+const hint = computed(() => local.value.workspace ? ',请检查源代码' : ',请联系插件作者')
const hasUpdate = computed(() => {
- if (!data.value.versions || data.value.workspace) return
- return data.value.versions[0].version !== data.value.version
+ if (!remote.value?.versions || local.value.workspace) return
+ return remote.value.versions[0].version !== local.value.version
})
function execute(event: 'unload' | 'reload') {
diff --git a/plugins/frontend/manager/client/settings/utils.ts b/plugins/frontend/manager/client/settings/utils.ts
index 4511118ef1..d03ba48a1f 100644
--- a/plugins/frontend/manager/client/settings/utils.ts
+++ b/plugins/frontend/manager/client/settings/utils.ts
@@ -23,7 +23,8 @@ export interface EnvInfo {
impl: string[]
deps: Dict
using: Dict
- invalid?: boolean
+ disabled?: boolean
+ type?: 'warning'
console?: boolean
}
@@ -42,7 +43,7 @@ function getEnvInfo(name: string) {
}
const fulfilled = name in store.services
- if (required && !fulfilled) result.invalid = true
+ if (required && !fulfilled) result.disabled = true
result.using[name] = { name, required, fulfilled }
if (!fulfilled) {
result.using[name].available = Object.values(store.market || {})
@@ -74,13 +75,23 @@ function getEnvInfo(name: string) {
if (name === '@koishijs/plugin-console') continue
const available = name in store.packages
const fulfilled = !!store.packages[name]?.id
- if (!fulfilled) result.invalid = true
+ if (!fulfilled) result.disabled = true
result.deps[name] = { name, required: true, fulfilled, local: available }
for (const impl of getMixedMeta(name).manifest.service.implements) {
delete result.using[impl]
}
}
+ // check reusability
+ if (local.id && !local.forkable) {
+ result.type = 'warning'
+ }
+
+ // check schema
+ if (!local.schema) {
+ result.type = 'warning'
+ }
+
return result
}