diff --git a/plugins/frontend/manager/client/settings/group.vue b/plugins/frontend/manager/client/settings/group.vue index d4466b8187..1a6f59925e 100644 --- a/plugins/frontend/manager/client/settings/group.vue +++ b/plugins/frontend/manager/client/settings/group.vue @@ -9,7 +9,7 @@ 添加插件 添加分组 - 移除分组 + 移除分组
diff --git a/plugins/frontend/manager/client/settings/plugin.vue b/plugins/frontend/manager/client/settings/plugin.vue index 92dec604b8..afdce08e1f 100644 --- a/plugins/frontend/manager/client/settings/plugin.vue +++ b/plugins/frontend/manager/client/settings/plugin.vue @@ -86,7 +86,7 @@ import { send, store, clone, router } from '@koishijs/client' import { computed, ref, watch } from 'vue' -import { envMap, Tree, removeItem } from './utils' +import { envMap, Tree, removeItem, separator } from './utils' import KAlias from './alias.vue' import KDepLink from './dep-link.vue' @@ -114,8 +114,8 @@ const type = computed(() => { }) const name = computed(() => { - const { label, target: temporary } = props.current - const shortname = temporary || label + const { label, target } = props.current + const shortname = target || label if (shortname.includes('/')) { const [left, right] = shortname.split('/') return [`${left}/koishi-plugin-${right}`].find(name => name in store.packages) @@ -139,7 +139,7 @@ const hasUpdate = computed(() => { function execute(event: 'unload' | 'reload') { send(`manager/${event}`, props.current.path, config.value, props.current.target) if (props.current.target) { - const segments = props.current.path.split('/') + const segments = props.current.path.split(separator) segments[segments.length - 1] = props.current.target router.replace('/plugins/' + segments.join('/')) } diff --git a/plugins/frontend/manager/client/settings/tree.vue b/plugins/frontend/manager/client/settings/tree.vue index 1cb48099c2..4fd1a030ad 100644 --- a/plugins/frontend/manager/client/settings/tree.vue +++ b/plugins/frontend/manager/client/settings/tree.vue @@ -42,7 +42,7 @@ import { ref, computed, onActivated, nextTick, watch } from 'vue' import { send } from '@koishijs/client' -import { Tree, plugins, setPath, addItem } from './utils' +import { Tree, plugins, setPath, addItem, separator } from './utils' const props = defineProps<{ modelValue: string @@ -73,7 +73,7 @@ interface Node { function allowDrop(source: Node, target: Node, type: 'inner' | 'prev' | 'next') { if (type !== 'inner') return target.data.path !== '' - const segments = target.data.path.split('/') + const segments = target.data.path.split(separator) return segments[segments.length - 1].startsWith('group:') } @@ -95,10 +95,11 @@ function handleDrop(source: Node, target: Node, position: 'before' | 'after' | ' const ctxPath = parent.data.path const index = parent.childNodes.findIndex(node => node.data.path === oldPath) send('manager/teleport', oldPath, ctxPath, index) - const segments1 = oldPath.split('/') - const segments2 = ctxPath ? ctxPath.split('/') : [] + const segments1 = oldPath.split(separator) + const segments2 = ctxPath ? ctxPath.split(separator) : [] segments2.push(segments1.pop()) setPath(oldPath, segments2.join('/')) + ;/(? { } private resolve(path: string) { - const segments = path.split('/') + const segments = path.split(separator) let ctx = this.loader.entry let name = segments.shift() while (segments.length) {