diff --git a/packages/client/client/components/layout/content.vue b/packages/client/client/components/layout/content.vue
index 93085de..b9c8fc1 100644
--- a/packages/client/client/components/layout/content.vue
+++ b/packages/client/client/components/layout/content.vue
@@ -27,6 +27,15 @@
@media screen and (max-width: 480px) {
--content-padding: 1.5rem;
}
+
+ h1 {
+ font-size: 1.5rem;
+ margin: 2rem 0;
+ }
+
+ h2 {
+ font-size: 1.25rem;
+ }
}
diff --git a/plugins/manager/client/components/index.vue b/plugins/manager/client/components/index.vue
index 11657e5..b46158b 100644
--- a/plugins/manager/client/components/index.vue
+++ b/plugins/manager/client/components/index.vue
@@ -42,11 +42,13 @@
+ {{ currentEntry.name }}
正在加载插件信息……
+ {{ currentEntry.name }}
插件信息失败,这可能是插件本身的问题所致。
@@ -57,6 +59,7 @@
/>
+ {{ currentEntry.name }}
此插件尚未安装。
diff --git a/plugins/manager/client/components/tree.vue b/plugins/manager/client/components/tree.vue
index 621d7d8..9b41ad8 100644
--- a/plugins/manager/client/components/tree.vue
+++ b/plugins/manager/client/components/tree.vue
@@ -1,9 +1,15 @@
-
-
-
+
+
+
+
+
+
+
+
+
{
}
function getLabel(node: EntryNode) {
- if (node.data.isGroup) {
- return '分组:' + (node.data.label || node.data.id)
- } else {
- return node.data.label || node.data.name
- }
+ return node.data.label || node.data.name
}
function allowDrag(node: EntryNode) {
@@ -148,7 +150,7 @@ const optionProps: TreeOptionProps = {
if (!entry.isGroup && !(entry.name in ctx.manager.data.value.packages)) words.push('not-found')
if (entry.id === ctx.manager.currentEntry?.id) words.push('is-active')
const change = ctx.manager.changes[entry.id]
- if (!deepEqual(change.config, entry.config)) {
+ if (change && !deepEqual(change.config, entry.config)) {
words.push('is-edited')
}
return words.join(' ')
@@ -173,10 +175,6 @@ watch(keyword, (val) => {
line-height: 2.25rem;
}
- .search {
- padding: 0 1.5rem;
- }
-
.k-icon-filter {
height: 15px;
}
diff --git a/plugins/manager/client/dialogs/group.vue b/plugins/manager/client/dialogs/group.vue
index 23a4333..672e94f 100644
--- a/plugins/manager/client/dialogs/group.vue
+++ b/plugins/manager/client/dialogs/group.vue
@@ -1,14 +1,14 @@
- 取消
+ 取消
确定
@@ -38,8 +38,9 @@ watch(createGroup, (value) => {
async function action() {
const id = await send('manager.config.create', {
name: 'cordis/group',
- parent: createGroup.value!.id,
+ parent: createGroup.value,
label: input.value || undefined,
+ config: [],
})
router.replace('/plugins/' + id)
ctx.manager.dialogCreateGroup = undefined
diff --git a/plugins/manager/client/dialogs/remove.vue b/plugins/manager/client/dialogs/remove.vue
index 80a7259..6ad8da1 100644
--- a/plugins/manager/client/dialogs/remove.vue
+++ b/plugins/manager/client/dialogs/remove.vue
@@ -3,14 +3,14 @@
v-model="show"
title="确认移除"
destroy-on-close
- @closed="remove = undefined"
+ @closed="ctx.manager.dialogRemove = undefined"
>
确定要移除{{ remove.isGroup ? `分组 ${remove.label || remove.id}` : `插件 ${remove.label || remove.name}` }} 吗?此操作不可撤销!
取消
- 确定
+ 确定
@@ -30,9 +30,9 @@ watch(remove, (value) => {
show.value = true
})
-async function removeItem() {
+async function action() {
show.value = false
- ctx.manager.remove(remove!)
+ ctx.manager.remove(remove.value!)
// tree?.activate()
}
diff --git a/plugins/manager/client/dialogs/select.vue b/plugins/manager/client/dialogs/select.vue
index 65bca6c..25c24c7 100644
--- a/plugins/manager/client/dialogs/select.vue
+++ b/plugins/manager/client/dialogs/select.vue
@@ -1,14 +1,15 @@
选择插件
-
+
@@ -39,12 +40,15 @@
import { router, send, useContext, useI18nText } from '@cordisjs/client'
import { computed, nextTick, ref, watch } from 'vue'
+import { useAutoFocus } from '../utils'
const ctx = useContext()
const tt = useI18nText()
const keyword = ref('')
-const input = ref()
+const inputEl = ref()
+
+const handleOpen = useAutoFocus(inputEl)
const packages = computed(() => Object.values(ctx.manager.data.value.packages).filter((local) => {
return local.package.name.includes(keyword.value.toLowerCase())
@@ -56,7 +60,7 @@ function joinName(name: string, base: string) {
}
async function configure(name: string) {
- const parent = ctx.manager.dialogSelect!.id
+ const parent = ctx.manager.dialogSelect
ctx.manager.dialogSelect = undefined
keyword.value = ''
const id = await send('manager.config.create', {
@@ -67,12 +71,6 @@ async function configure(name: string) {
router.push('/plugins/' + id)
}
-watch(() => ctx.manager.dialogSelect, async (value) => {
- if (!value) return
- await nextTick()
- await input.value.focus()
-}, { flush: 'post' })
-