diff --git a/plugins/commands/client/command.vue b/plugins/commands/client/command.vue
index 73a686f2..bde94a95 100644
--- a/plugins/commands/client/command.vue
+++ b/plugins/commands/client/command.vue
@@ -13,30 +13,29 @@
-
+
-
-
-
-
-
- {{ name }} |
+
+
+ {{ name }}
+ {{ stringify(alias) ? `(${stringify(alias)})` : '' }}
+ |
{{ index > 0 ? '设为默认' : '显示名称' }}
-
+
{{ command.initial.aliases[name] ? '禁用' : '删除' }}
恢复
|
-
- 添加别名
-
选项:{{ option.syntax }}
-
-
+
+
+
+
+
+
+
取消
- 确定
+ 确定
@@ -67,9 +88,11 @@
@@ -161,4 +211,12 @@ async function onEnter() {
color: var(--k-color-disabled);
}
+tr {
+ transition: var(--color-transition);
+}
+
+tr:hover {
+ background-color: var(--el-fill-color);
+}
+
diff --git a/plugins/commands/src/index.ts b/plugins/commands/src/index.ts
index 5d48e942..74c6843e 100644
--- a/plugins/commands/src/index.ts
+++ b/plugins/commands/src/index.ts
@@ -10,6 +10,7 @@ declare module '@koishijs/console' {
'command/update'(name: string, config: Pick): void
'command/teleport'(name: string, parent: string): void
'command/aliases'(name: string, aliases: Dict): void
+ 'command/parse'(name: string, source: string): Argv
}
}
@@ -375,6 +376,11 @@ export class CommandManager {
this.remove(name)
this.refresh()
}, { authority: 4 })
+
+ ctx.console.addListener('command/parse', (name, source) => {
+ const command = this.ctx.$commander.get(name)
+ return command.parse(source)
+ })
})
}
}