codexmate 0.0.21 → 0.0.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +390 -284
- package/README.zh.md +322 -0
- package/cli/agents-files.js +224 -162
- package/cli/archive-helpers.js +446 -446
- package/cli/auth-profiles.js +359 -359
- package/cli/builtin-proxy.js +1044 -580
- package/cli/claude-proxy.js +998 -998
- package/cli/config-bootstrap.js +384 -384
- package/cli/config-health.js +338 -338
- package/cli/openai-bridge.js +950 -0
- package/cli/openclaw-config.js +629 -629
- package/cli/session-usage.concurrent.js +28 -0
- package/cli/session-usage.js +112 -0
- package/cli/session-usage.models.js +176 -0
- package/cli/skills.js +1141 -1141
- package/cli/zip-commands.js +510 -510
- package/cli.js +13214 -13129
- package/lib/cli-file-utils.js +151 -151
- package/lib/cli-models-utils.js +419 -419
- package/lib/cli-network-utils.js +164 -164
- package/lib/cli-path-utils.js +69 -69
- package/lib/cli-session-utils.js +121 -121
- package/lib/cli-sessions.js +386 -386
- package/lib/cli-utils.js +155 -155
- package/lib/download-artifacts.js +77 -77
- package/lib/mcp-stdio.js +440 -440
- package/lib/task-orchestrator.js +869 -869
- package/lib/text-diff.js +303 -303
- package/lib/workflow-engine.js +340 -340
- package/package.json +74 -74
- package/res/json5.min.js +1 -1
- package/res/logo.png +0 -0
- package/res/vue.global.prod.js +13 -13
- package/web-ui/app.js +626 -530
- package/web-ui/index.html +34 -33
- package/web-ui/logic.agents-diff.mjs +386 -386
- package/web-ui/logic.claude.mjs +168 -168
- package/web-ui/logic.mjs +5 -5
- package/web-ui/logic.runtime.mjs +128 -124
- package/web-ui/logic.sessions.mjs +614 -581
- package/web-ui/modules/api.mjs +90 -90
- package/web-ui/modules/app.computed.dashboard.mjs +126 -113
- package/web-ui/modules/app.computed.index.mjs +17 -15
- package/web-ui/modules/app.computed.main-tabs.mjs +202 -195
- package/web-ui/modules/app.computed.session.mjs +653 -507
- package/web-ui/modules/app.constants.mjs +15 -15
- package/web-ui/modules/app.methods.agents.mjs +544 -493
- package/web-ui/modules/app.methods.claude-config.mjs +174 -174
- package/web-ui/modules/app.methods.codex-config.mjs +795 -640
- package/web-ui/modules/app.methods.index.mjs +92 -88
- package/web-ui/modules/app.methods.install.mjs +177 -149
- package/web-ui/modules/app.methods.navigation.mjs +662 -619
- package/web-ui/modules/app.methods.openclaw-core.mjs +814 -814
- package/web-ui/modules/app.methods.openclaw-editing.mjs +372 -372
- package/web-ui/modules/app.methods.openclaw-persist.mjs +369 -369
- package/web-ui/modules/app.methods.providers.mjs +404 -363
- package/web-ui/modules/app.methods.runtime.mjs +323 -323
- package/web-ui/modules/app.methods.session-actions.mjs +537 -520
- package/web-ui/modules/app.methods.session-browser.mjs +691 -626
- package/web-ui/modules/app.methods.session-timeline.mjs +448 -448
- package/web-ui/modules/app.methods.session-trash.mjs +422 -422
- package/web-ui/modules/app.methods.startup-claude.mjs +417 -412
- package/web-ui/modules/app.methods.task-orchestration.mjs +556 -471
- package/web-ui/modules/config-mode.computed.mjs +126 -126
- package/web-ui/modules/config-template-confirm-pref.mjs +33 -0
- package/web-ui/modules/i18n.mjs +1823 -0
- package/web-ui/modules/plugins.computed.mjs +3 -0
- package/web-ui/modules/plugins.methods.mjs +3 -0
- package/web-ui/modules/plugins.storage.mjs +11 -0
- package/web-ui/modules/sessions-filters-url.mjs +85 -0
- package/web-ui/modules/skills.computed.mjs +107 -107
- package/web-ui/modules/skills.methods.mjs +481 -481
- package/web-ui/partials/index/layout-footer.html +13 -13
- package/web-ui/partials/index/layout-header.html +461 -402
- package/web-ui/partials/index/modal-config-template-agents.html +175 -125
- package/web-ui/partials/index/modal-confirm-toast.html +32 -32
- package/web-ui/partials/index/modal-health-check.html +72 -72
- package/web-ui/partials/index/modal-openclaw-config.html +280 -280
- package/web-ui/partials/index/modal-skills.html +200 -184
- package/web-ui/partials/index/modals-basic.html +165 -156
- package/web-ui/partials/index/panel-config-claude.html +159 -126
- package/web-ui/partials/index/panel-config-codex.html +255 -237
- package/web-ui/partials/index/panel-config-openclaw.html +78 -78
- package/web-ui/partials/index/panel-docs.html +147 -130
- package/web-ui/partials/index/panel-market.html +174 -174
- package/web-ui/partials/index/panel-orchestration.html +388 -397
- package/web-ui/partials/index/panel-plugins.html +273 -0
- package/web-ui/partials/index/panel-sessions.html +298 -292
- package/web-ui/partials/index/panel-settings.html +258 -190
- package/web-ui/partials/index/panel-usage.html +353 -213
- package/web-ui/session-helpers.mjs +573 -559
- package/web-ui/source-bundle.cjs +233 -233
- package/web-ui/styles/base-theme.css +264 -271
- package/web-ui/styles/controls-forms.css +369 -360
- package/web-ui/styles/docs-panel.css +247 -182
- package/web-ui/styles/feedback.css +108 -108
- package/web-ui/styles/health-check-dialog.css +144 -144
- package/web-ui/styles/layout-shell.css +602 -376
- package/web-ui/styles/modals-core.css +464 -464
- package/web-ui/styles/navigation-panels.css +390 -348
- package/web-ui/styles/openclaw-structured.css +266 -266
- package/web-ui/styles/plugins-panel.css +523 -0
- package/web-ui/styles/responsive.css +456 -450
- package/web-ui/styles/sessions-list.css +400 -400
- package/web-ui/styles/sessions-preview.css +411 -411
- package/web-ui/styles/sessions-toolbar-trash.css +268 -243
- package/web-ui/styles/sessions-usage.css +879 -628
- package/web-ui/styles/settings-panel.css +166 -0
- package/web-ui/styles/skills-list.css +303 -296
- package/web-ui/styles/skills-market.css +406 -335
- package/web-ui/styles/task-orchestration.css +822 -776
- package/web-ui/styles/titles-cards.css +408 -408
- package/web-ui/styles.css +20 -18
- package/web-ui.html +17 -17
- package/README.en.md +0 -349
|
@@ -0,0 +1,273 @@
|
|
|
1
|
+
<div
|
|
2
|
+
v-show="mainTab === 'plugins'"
|
|
3
|
+
class="mode-content"
|
|
4
|
+
id="panel-plugins"
|
|
5
|
+
role="tabpanel"
|
|
6
|
+
aria-labelledby="tab-plugins">
|
|
7
|
+
<div class="plugins-layout">
|
|
8
|
+
<aside class="plugins-sidebar" :aria-label="t('plugins.sidebar.ariaList')">
|
|
9
|
+
<div class="selector-header plugins-sidebar-header">
|
|
10
|
+
<div>
|
|
11
|
+
<span class="selector-title">{{ t('plugins.sidebar.title') }}</span>
|
|
12
|
+
<div class="plugins-panel-note">{{ t('plugins.sidebar.note') }}</div>
|
|
13
|
+
</div>
|
|
14
|
+
<div class="settings-tab-actions">
|
|
15
|
+
<button type="button" class="btn-tool btn-tool-compact" @click="loadPluginsOverview({ forceRefresh: true, silent: false })" :disabled="loading || !!initError || pluginsLoading">
|
|
16
|
+
{{ pluginsLoading ? t('plugins.refreshing') : t('plugins.refresh') }}
|
|
17
|
+
</button>
|
|
18
|
+
</div>
|
|
19
|
+
</div>
|
|
20
|
+
|
|
21
|
+
<div class="plugins-list" role="list">
|
|
22
|
+
<button
|
|
23
|
+
v-for="plugin in pluginsCatalog"
|
|
24
|
+
:key="'plugin-' + plugin.id"
|
|
25
|
+
type="button"
|
|
26
|
+
:class="['plugins-item', { active: pluginsActiveId === plugin.id }]"
|
|
27
|
+
:aria-current="pluginsActiveId === plugin.id ? 'page' : null"
|
|
28
|
+
:disabled="loading || !!initError || pluginsLoading"
|
|
29
|
+
@click="selectPlugin(plugin.id)">
|
|
30
|
+
<div class="plugins-item-main">
|
|
31
|
+
<div class="plugins-item-title">{{ plugin.title }}</div>
|
|
32
|
+
<div class="plugins-item-meta">{{ plugin.description }}</div>
|
|
33
|
+
</div>
|
|
34
|
+
<span :class="['pill', plugin.tone]">{{ plugin.statusLabel }}</span>
|
|
35
|
+
</button>
|
|
36
|
+
</div>
|
|
37
|
+
</aside>
|
|
38
|
+
|
|
39
|
+
<section class="plugins-main" :aria-label="t('plugins.main.ariaWorkspace')">
|
|
40
|
+
<div v-if="pluginsLoading" class="skills-empty-state">{{ t('common.loading') }}</div>
|
|
41
|
+
<div v-else-if="pluginsError" class="skills-empty-state">
|
|
42
|
+
<div class="plugins-panel-note">{{ pluginsError }}</div>
|
|
43
|
+
<button type="button" class="btn-mini" @click="loadPluginsOverview({ forceRefresh: true, silent: false })" :disabled="loading || !!initError || pluginsLoading">{{ t('common.refresh') }}</button>
|
|
44
|
+
</div>
|
|
45
|
+
<div v-else-if="pluginsActiveId === 'prompt-templates'" class="plugins-panel">
|
|
46
|
+
<div class="plugins-panel-head">
|
|
47
|
+
<div class="plugins-panel-title">{{ t('plugins.promptTemplates.title') }}</div>
|
|
48
|
+
<div class="plugins-panel-subtitle">{{ t('plugins.promptTemplates.subtitle') }}</div>
|
|
49
|
+
</div>
|
|
50
|
+
|
|
51
|
+
<div class="prompt-templates-modebar" role="tablist" :aria-label="t('plugins.promptTemplates.mode.aria')">
|
|
52
|
+
<button
|
|
53
|
+
type="button"
|
|
54
|
+
role="tab"
|
|
55
|
+
:aria-selected="promptTemplatesMode === 'compose'"
|
|
56
|
+
:class="['mode-pill', { active: promptTemplatesMode === 'compose' }]"
|
|
57
|
+
@click="promptTemplatesMode = 'compose'">{{ t('plugins.promptTemplates.mode.compose') }}</button>
|
|
58
|
+
<button
|
|
59
|
+
type="button"
|
|
60
|
+
role="tab"
|
|
61
|
+
:aria-selected="promptTemplatesMode !== 'compose'"
|
|
62
|
+
:class="['mode-pill', { active: promptTemplatesMode !== 'compose' }]"
|
|
63
|
+
@click="promptTemplatesMode = 'manage'">{{ t('plugins.promptTemplates.mode.manage') }}</button>
|
|
64
|
+
</div>
|
|
65
|
+
|
|
66
|
+
<div v-if="promptTemplatesMode === 'compose'" class="prompt-compose">
|
|
67
|
+
<div class="prompt-compose-workspace">
|
|
68
|
+
<div class="prompt-compose-selected">
|
|
69
|
+
<div class="prompt-compose-selected-title">{{ (promptComposerActiveTemplate && promptComposerActiveTemplate.name) ? promptComposerActiveTemplate.name : t('plugins.promptTemplates.compose.chooseTemplate') }}</div>
|
|
70
|
+
<div class="prompt-compose-selected-meta">{{ (promptComposerActiveTemplate && promptComposerActiveTemplate.description) ? promptComposerActiveTemplate.description : t('plugins.promptTemplates.compose.chooseTemplateHint') }}</div>
|
|
71
|
+
</div>
|
|
72
|
+
|
|
73
|
+
<div class="prompt-compose-form">
|
|
74
|
+
<label class="form-label">{{ t('plugins.promptTemplates.compose.selectTemplate') }}</label>
|
|
75
|
+
<select
|
|
76
|
+
class="form-select prompt-compose-template-select"
|
|
77
|
+
:value="promptComposerSelectedTemplateId"
|
|
78
|
+
@change="selectPromptComposerTemplate($event.target.value)"
|
|
79
|
+
:disabled="pluginsLoading || !promptTemplatesList.length">
|
|
80
|
+
<option v-for="tpl in promptTemplatesList" :key="'compose-tpl-' + tpl.id" :value="tpl.id">
|
|
81
|
+
{{ tpl.name }}{{ tpl.isBuiltin ? '(内置)' : '' }}
|
|
82
|
+
</option>
|
|
83
|
+
</select>
|
|
84
|
+
|
|
85
|
+
<div v-if="!promptComposerActiveTemplate" class="plugins-panel-note">{{ t('plugins.promptTemplates.compose.empty') }}</div>
|
|
86
|
+
<div v-else-if="!promptComposerActiveTemplate.isBuiltin" class="plugins-panel-note">{{ t('plugins.promptTemplates.compose.varsHint') }}</div>
|
|
87
|
+
<div v-if="promptComposerActiveTemplate && !promptComposerActiveTemplate.isBuiltin" class="prompt-compose-actions">
|
|
88
|
+
<button
|
|
89
|
+
type="button"
|
|
90
|
+
class="btn-mini"
|
|
91
|
+
@click="selectPromptTemplate(promptComposerSelectedTemplateId)"
|
|
92
|
+
:disabled="pluginsLoading || !promptComposerSelectedTemplateId">{{ t('plugins.promptTemplates.compose.goManage') }}</button>
|
|
93
|
+
</div>
|
|
94
|
+
</div>
|
|
95
|
+
|
|
96
|
+
<div v-if="promptComposerActiveTemplate && promptComposerActiveTemplate.vars && promptComposerActiveTemplate.vars.length" class="prompt-vars-block">
|
|
97
|
+
<div class="prompt-vars-head">
|
|
98
|
+
<div>
|
|
99
|
+
<div class="prompt-vars-title">{{ t('plugins.promptTemplates.vars.title') }}</div>
|
|
100
|
+
<div v-if="!promptComposerActiveTemplate.isBuiltin" class="plugins-panel-note">{{ t('plugins.promptTemplates.compose.varsHint') }}</div>
|
|
101
|
+
<div v-if="promptComposerMissingVars.length" class="plugins-panel-note">未填 {{ promptComposerMissingVars.length }} 项</div>
|
|
102
|
+
</div>
|
|
103
|
+
<div class="prompt-editor-actions">
|
|
104
|
+
<button v-if="promptComposerMissingVars.length" type="button" class="btn-mini" @click="focusPromptComposerFirstMissingVar" :disabled="pluginsLoading">跳到未填</button>
|
|
105
|
+
<button type="button" class="btn-mini" @click="resetPromptComposerVarValues" :disabled="pluginsLoading">{{ t('plugins.promptTemplates.vars.reset') }}</button>
|
|
106
|
+
</div>
|
|
107
|
+
</div>
|
|
108
|
+
<div class="prompt-vars-grid">
|
|
109
|
+
<label v-for="(name, idx) in promptComposerActiveTemplate.vars" :key="'prompt-compose-var-' + name" class="prompt-var-row">
|
|
110
|
+
<span class="prompt-var-label mono">{{ name }}</span>
|
|
111
|
+
<template v-if="idx === 0">
|
|
112
|
+
<input ref="promptComposerFirstField" :class="['form-input', 'prompt-var-input', { 'is-missing': promptComposerMissingVars.includes(name) }]" type="text" :value="promptComposerVarValues[name] || ''" @input="setPromptComposerVarValue(name, $event.target.value)" :placeholder="t('plugins.promptTemplates.vars.valuePlaceholder', { name })">
|
|
113
|
+
</template>
|
|
114
|
+
<template v-else>
|
|
115
|
+
<input :class="['form-input', 'prompt-var-input', { 'is-missing': promptComposerMissingVars.includes(name) }]" type="text" :value="promptComposerVarValues[name] || ''" @input="setPromptComposerVarValue(name, $event.target.value)" :placeholder="t('plugins.promptTemplates.vars.valuePlaceholder', { name })">
|
|
116
|
+
</template>
|
|
117
|
+
</label>
|
|
118
|
+
</div>
|
|
119
|
+
</div>
|
|
120
|
+
|
|
121
|
+
<div class="prompt-preview-block prompt-compose-preview">
|
|
122
|
+
<div class="prompt-vars-head">
|
|
123
|
+
<div>
|
|
124
|
+
<div class="prompt-vars-title">{{ t('plugins.promptTemplates.compose.outputTitle') }}</div>
|
|
125
|
+
<div class="plugins-panel-note">{{ t('plugins.promptTemplates.compose.outputHint') }}</div>
|
|
126
|
+
</div>
|
|
127
|
+
<button type="button" class="btn-mini" @click="copyPromptComposerRendered" :disabled="pluginsLoading || !promptComposerRendered">{{ t('plugins.promptTemplates.compose.copy') }}</button>
|
|
128
|
+
</div>
|
|
129
|
+
<textarea class="form-input prompt-preview-textarea" :value="promptComposerRendered" rows="10" readonly spellcheck="false" aria-label="Rendered prompt (composer)"></textarea>
|
|
130
|
+
</div>
|
|
131
|
+
</div>
|
|
132
|
+
</div>
|
|
133
|
+
|
|
134
|
+
<div v-else class="prompt-templates-grid">
|
|
135
|
+
<div class="prompt-templates-pane prompt-templates-pane-list">
|
|
136
|
+
<div class="prompt-templates-toolbar">
|
|
137
|
+
<input
|
|
138
|
+
class="form-input"
|
|
139
|
+
type="text"
|
|
140
|
+
v-model.trim="promptTemplatesKeyword"
|
|
141
|
+
aria-label="Search templates"
|
|
142
|
+
:placeholder="t('plugins.promptTemplates.manage.searchPlaceholder')">
|
|
143
|
+
<button type="button" class="btn-mini" @click="createPromptTemplate" :disabled="pluginsLoading">{{ t('plugins.promptTemplates.manage.create') }}</button>
|
|
144
|
+
<button type="button" class="btn-mini" @click="exportPromptTemplates" :disabled="pluginsLoading || !promptTemplatesList.length">{{ t('plugins.promptTemplates.manage.export') }}</button>
|
|
145
|
+
<button type="button" class="btn-mini" @click="triggerPromptTemplatesImport" :disabled="pluginsLoading">{{ t('plugins.promptTemplates.manage.import') }}</button>
|
|
146
|
+
</div>
|
|
147
|
+
|
|
148
|
+
<div v-if="pluginsLoading && !promptTemplatesLoadedOnce" class="skills-empty-state">{{ t('plugins.promptTemplates.manage.loading') }}</div>
|
|
149
|
+
<div v-else-if="!filteredPromptTemplates.length" class="skills-empty-state">{{ t('plugins.promptTemplates.manage.empty') }}</div>
|
|
150
|
+
<div v-else class="prompt-templates-list" role="list">
|
|
151
|
+
<button
|
|
152
|
+
v-for="tpl in filteredPromptTemplates"
|
|
153
|
+
:key="'prompt-template-' + tpl.id"
|
|
154
|
+
type="button"
|
|
155
|
+
:class="['prompt-template-item', { active: promptTemplateSelectedId === tpl.id }]"
|
|
156
|
+
:aria-current="promptTemplateSelectedId === tpl.id ? 'page' : null"
|
|
157
|
+
@click="selectPromptTemplate(tpl.id)">
|
|
158
|
+
<div class="prompt-template-item-main">
|
|
159
|
+
<div class="prompt-template-item-title">{{ tpl.name }}</div>
|
|
160
|
+
<div class="prompt-template-item-meta">
|
|
161
|
+
<span class="mono">{{ t('plugins.promptTemplates.manage.vars', { count: tpl.varCount }) }}</span>
|
|
162
|
+
<span>·</span>
|
|
163
|
+
<span class="mono">{{ tpl.updatedLabel }}</span>
|
|
164
|
+
</div>
|
|
165
|
+
</div>
|
|
166
|
+
<span :class="['pill', tpl.isBuiltin ? 'configured' : 'source']">{{ tpl.isBuiltin ? t('plugins.promptTemplates.manage.builtin') : t('plugins.promptTemplates.manage.custom') }}</span>
|
|
167
|
+
</button>
|
|
168
|
+
</div>
|
|
169
|
+
</div>
|
|
170
|
+
|
|
171
|
+
<div class="prompt-templates-pane prompt-templates-pane-editor">
|
|
172
|
+
<div v-if="!promptTemplateDraft" class="skills-empty-state">{{ t('plugins.promptTemplates.editor.selectHint') }}</div>
|
|
173
|
+
<template v-else>
|
|
174
|
+
<div class="prompt-editor-head">
|
|
175
|
+
<div class="prompt-editor-title-row">
|
|
176
|
+
<input class="form-input prompt-editor-name" type="text" v-model.trim="promptTemplateDraft.name" :disabled="promptTemplateDraft.isBuiltin" :placeholder="t('plugins.promptTemplates.editor.namePlaceholder')" aria-label="Template name">
|
|
177
|
+
<div v-if="!promptTemplateDraft.isBuiltin" class="prompt-editor-actions">
|
|
178
|
+
<button type="button" class="btn-mini" @click="duplicatePromptTemplate" :disabled="pluginsLoading">{{ t('plugins.promptTemplates.editor.duplicate') }}</button>
|
|
179
|
+
<button type="button" class="btn-mini delete" @click="deletePromptTemplate" :disabled="pluginsLoading">{{ t('plugins.promptTemplates.editor.delete') }}</button>
|
|
180
|
+
<button type="button" class="btn-mini" @click="savePromptTemplate" :disabled="pluginsLoading">{{ t('plugins.promptTemplates.editor.save') }}</button>
|
|
181
|
+
</div>
|
|
182
|
+
</div>
|
|
183
|
+
<div v-if="promptTemplateDraft.isBuiltin" class="plugins-panel-note">
|
|
184
|
+
{{ t('plugins.promptTemplates.editor.builtinReadOnly') }}
|
|
185
|
+
</div>
|
|
186
|
+
<input class="form-input" type="text" v-model.trim="promptTemplateDraft.description" :disabled="promptTemplateDraft.isBuiltin" :placeholder="t('plugins.promptTemplates.editor.descPlaceholder')" aria-label="Template description">
|
|
187
|
+
</div>
|
|
188
|
+
|
|
189
|
+
<div class="prompt-editor-body">
|
|
190
|
+
<label class="form-label">{{ t('plugins.promptTemplates.editor.templateLabel') }}</label>
|
|
191
|
+
<textarea
|
|
192
|
+
class="form-input prompt-editor-textarea"
|
|
193
|
+
v-model="promptTemplateDraft.template"
|
|
194
|
+
:disabled="promptTemplateDraft.isBuiltin"
|
|
195
|
+
rows="10"
|
|
196
|
+
spellcheck="false"
|
|
197
|
+
aria-label="Template body"
|
|
198
|
+
:placeholder="t('plugins.promptTemplates.editor.templatePlaceholder')"></textarea>
|
|
199
|
+
|
|
200
|
+
<div class="prompt-vars-block">
|
|
201
|
+
<div class="prompt-vars-head">
|
|
202
|
+
<div>
|
|
203
|
+
<div class="prompt-vars-title">{{ t('plugins.promptTemplates.vars.title') }}</div>
|
|
204
|
+
<div class="plugins-panel-note">{{ t('plugins.promptTemplates.vars.hint') }}</div>
|
|
205
|
+
</div>
|
|
206
|
+
<div v-if="!promptTemplateDraft.isBuiltin" class="prompt-editor-actions">
|
|
207
|
+
<button type="button" class="btn-mini" @click="addPromptTemplateVariable" :disabled="pluginsLoading">{{ t('plugins.promptTemplates.vars.add') }}</button>
|
|
208
|
+
<button type="button" class="btn-mini" @click="resetPromptVariableValues" :disabled="pluginsLoading">{{ t('plugins.promptTemplates.vars.reset') }}</button>
|
|
209
|
+
</div>
|
|
210
|
+
</div>
|
|
211
|
+
|
|
212
|
+
<div v-if="!promptTemplateVars.length" class="prompt-vars-empty">{{ t('plugins.promptTemplates.vars.empty') }}</div>
|
|
213
|
+
<div v-else class="prompt-vars-grid">
|
|
214
|
+
<label v-for="name in promptTemplateVars" :key="'prompt-var-' + name" class="prompt-var-row">
|
|
215
|
+
<span class="prompt-var-label mono">{{ name }}</span>
|
|
216
|
+
<input class="form-input prompt-var-input" type="text" :readonly="promptTemplateDraft.isBuiltin" :value="promptTemplateVarValues[name] || ''" @input="setPromptVariableValue(name, $event.target.value)" :placeholder="t('plugins.promptTemplates.vars.valuePlaceholder', { name })">
|
|
217
|
+
</label>
|
|
218
|
+
</div>
|
|
219
|
+
</div>
|
|
220
|
+
|
|
221
|
+
<div class="prompt-preview-block">
|
|
222
|
+
<div class="prompt-vars-head">
|
|
223
|
+
<div>
|
|
224
|
+
<div class="prompt-vars-title">{{ t('plugins.promptTemplates.preview.title') }}</div>
|
|
225
|
+
<div class="plugins-panel-note">{{ t('plugins.promptTemplates.preview.hint') }}</div>
|
|
226
|
+
</div>
|
|
227
|
+
<button type="button" class="btn-mini" @click="copyRenderedPrompt" :disabled="pluginsLoading">{{ t('plugins.promptTemplates.preview.copy') }}</button>
|
|
228
|
+
</div>
|
|
229
|
+
<textarea class="form-input prompt-preview-textarea" :value="renderedPrompt" rows="10" readonly spellcheck="false" aria-label="Rendered prompt"></textarea>
|
|
230
|
+
</div>
|
|
231
|
+
</div>
|
|
232
|
+
</template>
|
|
233
|
+
</div>
|
|
234
|
+
</div>
|
|
235
|
+
</div>
|
|
236
|
+
|
|
237
|
+
<div v-else class="skills-empty-state">{{ t('plugins.promptTemplates.noPluginSelected') }}</div>
|
|
238
|
+
</section>
|
|
239
|
+
</div>
|
|
240
|
+
</div>
|
|
241
|
+
|
|
242
|
+
<input
|
|
243
|
+
ref="promptTemplatesImportInput"
|
|
244
|
+
type="file"
|
|
245
|
+
accept=".json,application/json"
|
|
246
|
+
style="display:none"
|
|
247
|
+
@change="handlePromptTemplatesImportChange">
|
|
248
|
+
|
|
249
|
+
<!-- 新增变量(Prompt Templates) -->
|
|
250
|
+
<div v-if="showPromptTemplateVarModal" class="modal-overlay" @click.self="closePromptTemplateVarModal">
|
|
251
|
+
<div class="modal" role="dialog" aria-modal="true" aria-labelledby="add-prompt-var-modal-title">
|
|
252
|
+
<div class="modal-title" id="add-prompt-var-modal-title">{{ t('plugins.promptTemplates.varModal.title') }}</div>
|
|
253
|
+
|
|
254
|
+
<div class="form-group">
|
|
255
|
+
<label class="form-label">{{ t('plugins.promptTemplates.varModal.nameLabel') }}</label>
|
|
256
|
+
<input
|
|
257
|
+
ref="promptTemplateVarNameInput"
|
|
258
|
+
v-model.trim="promptTemplateVarDraftName"
|
|
259
|
+
:class="['form-input', { invalid: !!promptTemplateVarDraftError }]"
|
|
260
|
+
:placeholder="t('placeholder.varNameExample')"
|
|
261
|
+
autocomplete="off"
|
|
262
|
+
spellcheck="false"
|
|
263
|
+
@keydown.enter.prevent="confirmAddPromptTemplateVariable">
|
|
264
|
+
<div v-if="promptTemplateVarDraftError" class="form-hint form-error">{{ promptTemplateVarDraftError }}</div>
|
|
265
|
+
<div v-else class="form-hint">{{ t('hint.varNameRules') }}</div>
|
|
266
|
+
</div>
|
|
267
|
+
|
|
268
|
+
<div class="btn-group">
|
|
269
|
+
<button class="btn btn-cancel" @click="closePromptTemplateVarModal">{{ t('plugins.promptTemplates.varModal.cancel') }}</button>
|
|
270
|
+
<button class="btn btn-confirm" @click="confirmAddPromptTemplateVariable">{{ t('plugins.promptTemplates.varModal.add') }}</button>
|
|
271
|
+
</div>
|
|
272
|
+
</div>
|
|
273
|
+
</div>
|