fix: complete 0.5.1 demo workflows
This commit is contained in:
@@ -20,6 +20,7 @@ const actionError = ref('')
|
||||
const showInstall = ref(false)
|
||||
const activeTab = ref<'info' | 'settings' | 'commands'>('info')
|
||||
const pluginCommands = ref<PluginCommand[]>([])
|
||||
const restoreNoticeKey = ref(0)
|
||||
|
||||
onMounted(() => { void pluginStore.loadPlugins() })
|
||||
|
||||
@@ -42,6 +43,12 @@ async function toggle(id: string, enabled: boolean) {
|
||||
} catch (error) { actionError.value = error instanceof Error ? error.message : t('状态更新失败', 'Status update failed') }
|
||||
}
|
||||
|
||||
function installed() {
|
||||
showInstall.value = false
|
||||
actionError.value = ''
|
||||
restoreNoticeKey.value += 1
|
||||
}
|
||||
|
||||
async function grant(id: string, permissions: string[]) {
|
||||
if (!(await askConfirm(`${t('将授权:', 'Grant permissions: ')}${permissions.join(', ')}。${t('是否继续?', 'Continue?')}`))) return
|
||||
try { await pluginStore.grantPermissions(id, permissions) }
|
||||
@@ -65,9 +72,9 @@ const hasCommandContribution = computed(() =>
|
||||
|
||||
<template>
|
||||
<section class="feature-page">
|
||||
<ExtensionRestoreNotice kind="plugin" />
|
||||
<ExtensionRestoreNotice :key="restoreNoticeKey" kind="plugin" />
|
||||
<ActionDialog v-if="actionDialog" v-bind="actionDialog" @resolve="resolveAction" />
|
||||
<ExtensionInstallDialog v-if="showInstall" kind="Plugin" :install="pluginStore.installPlugin" @close="showInstall = false" @installed="showInstall = false; actionError = ''" />
|
||||
<ExtensionInstallDialog v-if="showInstall" kind="Plugin" :install="pluginStore.installPlugin" @close="showInstall = false" @installed="installed" />
|
||||
<header class="feature-header">
|
||||
<div><h1>{{ t('Plugin 与 MCP', 'Plugins and MCP') }}</h1><p>{{ t('管理插件生命周期、MCP Host、权限和受控 Contribution。', 'Manage plugin lifecycles, MCP hosts, permissions, and controlled contributions.') }}</p></div>
|
||||
<button class="button-primary" @click="showInstall = true">{{ t('安装 Plugin', 'Install Plugin') }}</button>
|
||||
|
||||
@@ -14,8 +14,15 @@ import UserSkillEditor from './UserSkillEditor.vue'
|
||||
const skillStore = useSkillStore()
|
||||
const actionError = ref('')
|
||||
const showInstall = ref(false)
|
||||
const restoreNoticeKey = ref(0)
|
||||
onMounted(() => { void skillStore.loadSkills() })
|
||||
|
||||
function installed() {
|
||||
showInstall.value = false
|
||||
actionError.value = ''
|
||||
restoreNoticeKey.value += 1
|
||||
}
|
||||
|
||||
|
||||
async function toggle(skillId: string, enabled: boolean) {
|
||||
try { enabled ? await skillStore.disableSkill(skillId) : await skillStore.enableSkill(skillId) } catch (error) { actionError.value = error instanceof Error ? error.message : t('状态更新失败', 'Status update failed') }
|
||||
@@ -28,9 +35,9 @@ async function uninstall(skillId: string, name: string) {
|
||||
|
||||
<template>
|
||||
<section class="feature-page">
|
||||
<ExtensionRestoreNotice kind="skill" />
|
||||
<ExtensionRestoreNotice :key="restoreNoticeKey" kind="skill" />
|
||||
<ActionDialog v-if="actionDialog" v-bind="actionDialog" @resolve="resolveAction" />
|
||||
<ExtensionInstallDialog v-if="showInstall" kind="Skill" :install="skillStore.installSkill" @close="showInstall = false" @installed="showInstall = false; actionError = ''" />
|
||||
<ExtensionInstallDialog v-if="showInstall" kind="Skill" :install="skillStore.installSkill" @close="showInstall = false" @installed="installed" />
|
||||
<header class="feature-header"><div><h1>{{ t('Skill 管理', 'Skill Management') }}</h1><p>{{ t('查看工作流使用的 Tool、权限、检索配置和模型要求。', 'Review the tools, permissions, retrieval settings, and model requirements used by workflows.') }}</p></div><button class="button-primary" @click="showInstall = true">{{ t('安装 Skill', 'Install Skill') }}</button></header>
|
||||
<UserSkillEditor />
|
||||
<div v-if="skillStore.error || actionError" class="error-banner">{{ skillStore.error || actionError }}</div>
|
||||
|
||||
Reference in New Issue
Block a user