mirror of
https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak.git
synced 2026-12-03 20:12:52 +08:00
Fix workshop installs and make plugin configuration editable
This commit is contained in:
1 parent
6a35d9be3d
commit
274bd81dc3
13 files changed
+389
-32
No files matched your search
@@ -9,7 +9,7 @@
|
||||
<nav class="plugin-tabs" :aria-label="tr('store')"><button type="button" :aria-current="tab==='store'?'page':undefined" @click="tab='store'"><Icon name="compass" :size="16" />{{ text('discover') }}</button><button type="button" :aria-current="tab==='installed'?'page':undefined" @click="tab='installed'"><Icon name="grid" :size="16" />{{ tr('installed') }}<span>{{ model.installed.value.length }}</span></button></nav>
|
||||
<div class="plugin-tools"><label class="plugin-search"><Icon name="search" :size="16" /><input v-model="search" type="search" :aria-label="text('search')" :placeholder="text('search')" /></label><button class="plugin-refresh" type="button" :disabled="model.busy.value" :title="tr('refresh')" :aria-label="tr('refresh')" @click="model.load"><Icon name="refresh" :size="17" /></button></div>
|
||||
</div>
|
||||
<p v-if="model.error.value" class="plugin-feedback is-error" role="alert"><Icon name="info" :size="17" />{{ tr('error') }}: {{ model.error.value }}</p>
|
||||
<p v-if="model.error.value" class="plugin-feedback is-error" role="alert"><Icon name="info" :size="17" />{{ describeError(model.error.value) }}</p>
|
||||
<p v-if="tab==='store' && model.catalogError.value" class="plugin-feedback is-error" role="alert"><Icon name="info" :size="17" />{{ tr('catalogError') }} · {{ model.catalogError.value }}</p>
|
||||
<p v-if="notice" class="plugin-feedback" role="status"><Icon name="check" :size="17" />{{ notice }}</p>
|
||||
<div class="plugin-section-heading"><div><h3>{{ tab==='store'?text('discover'):tr('installed') }}</h3><span v-if="tab==='store'" class="plugin-source"><i></i>{{ text('source') }}</span></div><a v-if="tab==='store'" :href="PLUGIN_STORE_REPOSITORY" target="_blank" rel="noopener noreferrer"><Icon name="github" :size="16" />GitHub ↗</a><button v-else class="plugin-button" type="button" :disabled="model.busy.value" @click="fileInput?.click()"><Icon name="share" :size="15" />{{ tr('upload') }}</button></div>
|
||||
@@ -19,20 +19,79 @@
|
||||
<article v-for="entry in catalogEntries" :key="entry.id" class="plugin-market-card">
|
||||
<div class="plugin-card-visual"><div class="plugin-card-symbol"><Icon name="grid" :size="38" /></div><span>API {{ entry.manifest?.apiVersion ?? '—' }}</span><i aria-hidden="true"></i></div>
|
||||
<div class="plugin-card-body"><div class="plugin-card-title"><h4>{{ entry.manifest?.name ?? entry.id }}</h4><small>v{{ entry.manifest?.version ?? '—' }}</small></div><p class="plugin-author">{{ entry.manifest?.author }} · {{ entry.manifest?.license }}</p><p class="plugin-description">{{ entry.manifest?.description }}</p><div class="plugin-tags"><span v-for="scope in entry.manifest?.scopes" :key="scope"><Icon name="server" :size="12" />{{ tr(scope) }}</span></div><div class="plugin-permissions"><span>{{ tr('client') }}</span><span v-if="entry.manifest?.server">{{ tr('backend') }}</span></div><p v-if="entry.error" class="is-error">{{ entry.error }}</p></div>
|
||||
<footer><a :href="entry.repository" target="_blank" rel="noopener noreferrer" :aria-label="`${entry.manifest?.name ?? entry.id} · GitHub`"><Icon name="github" :size="16" />GitHub ↗</a><button class="plugin-button primary" type="button" :disabled="model.busy.value || !entry.manifest || !!entry.error" @click="install(entry)"><Icon name="download" :size="15" />{{ installLabel(entry) }}</button></footer>
|
||||
<footer><a :href="entry.repository" target="_blank" rel="noopener noreferrer" :aria-label="`${tr('viewRepository')} · ${entry.manifest?.name ?? entry.id}`"><Icon name="github" :size="16" />{{ tr('viewRepository') }} ↗</a><button class="plugin-button primary" type="button" :disabled="model.busy.value || !entry.manifest || !!entry.error" @click="install(entry)"><Icon name="download" :size="15" />{{ installLabel(entry) }}</button></footer>
|
||||
</article>
|
||||
</div>
|
||||
<div v-else class="plugin-installed-list">
|
||||
<article v-for="plugin in installedEntries" :key="plugin.manifest.id" class="plugin-installed-card">
|
||||
<header><div class="plugin-installed-icon"><Icon name="grid" :size="23" /></div><div class="plugin-installed-name"><h4>{{ plugin.manifest.name }}</h4><p>v{{ plugin.manifest.version }} · {{ plugin.manifest.author }}</p></div><span class="plugin-status" :class="{active:plugin.settings.enabled}"><i></i>{{ tr(plugin.runtime?.state ?? 'disabled') }}</span></header>
|
||||
<p class="plugin-description">{{ plugin.manifest.description }}</p><p v-if="plugin.runtime?.error" class="is-error" role="alert">{{ plugin.runtime.error }}</p><div class="plugin-installed-meta"><span><Icon name="server" :size="13" />{{ tr(plugin.settings.scope) }}</span><span>{{ plugin.manifest.license }}</span><span>API {{ plugin.manifest.apiVersion }}</span></div>
|
||||
<p class="plugin-description">{{ plugin.manifest.description }}</p><p v-if="plugin.runtime?.error" class="is-error" role="alert">{{ plugin.manifest.id === musicBotId && plugin.runtime.error === 'PLUGIN_START_FAILED' && !plugin.settings.hasServerConfig ? tr('musicBotConfigHelp') : plugin.runtime.error }}</p><div class="plugin-installed-meta"><span><Icon name="server" :size="13" />{{ tr(plugin.settings.scope) }}</span><span>{{ plugin.manifest.license }}</span><span>API {{ plugin.manifest.apiVersion }}</span><a v-if="repository(plugin.manifest.id)" :href="repository(plugin.manifest.id)" target="_blank" rel="noopener noreferrer"><Icon name="github" :size="14" />{{ tr('viewRepository') }} ↗</a></div>
|
||||
<details :open="expanded===plugin.manifest.id" @toggle="onToggle($event,plugin.manifest.id)"><summary><Icon name="settings" :size="16" />{{ text('configure') }}<Icon class="plugin-chevron" name="chevron-down" :size="15" /></summary><fieldset :disabled="model.busy.value">
|
||||
<div class="plugin-enable-row"><div><strong>{{ tr('enabled') }}</strong><p>{{ text('review') }}</p></div><label class="plugin-switch"><input v-model="model.drafts[plugin.manifest.id].enabled" type="checkbox" :aria-label="tr('enabled')" /><span></span></label></div>
|
||||
<label class="plugin-trust"><input v-model="model.drafts[plugin.manifest.id].trusted" type="checkbox" />{{ tr('trust') }}</label><p class="plugin-trust-note">{{ tr('enableNote') }}</p>
|
||||
<label class="plugin-trust"><input v-model="model.drafts[plugin.manifest.id].toolbarPinned" type="checkbox" />{{ tr('toolbarPin') }}</label>
|
||||
<label>{{ tr('scope') }}<select v-model="model.drafts[plugin.manifest.id].scope"><option v-for="scope in plugin.manifest.scopes" :key="scope" :value="scope">{{ tr(scope) }}</option></select></label>
|
||||
<label v-if="model.drafts[plugin.manifest.id].scope==='server'">{{ tr('targets') }}<textarea v-model="model.drafts[plugin.manifest.id].targets" rows="3" maxlength="15000" placeholder="voice.example.com:9987"></textarea></label>
|
||||
<details class="plugin-advanced"><summary>{{ text('advanced') }}<Icon name="chevron-down" :size="14" /></summary><label>{{ tr('config') }}<textarea v-model="model.drafts[plugin.manifest.id].config" rows="5" maxlength="65536" spellcheck="false"></textarea></label><template v-if="plugin.manifest.server"><label>{{ tr('privateConfig') }}<small>{{ tr(plugin.settings.hasServerConfig?'secretSaved':'secretEmpty') }}</small><select v-model="model.drafts[plugin.manifest.id].serverConfigAction"><option value="keep">{{ tr('keep') }}</option><option value="replace">{{ tr('replace') }}</option><option value="remove">{{ tr('erase') }}</option></select><textarea v-if="model.drafts[plugin.manifest.id].serverConfigAction==='replace'" v-model="model.drafts[plugin.manifest.id].serverConfig" rows="5" maxlength="65536" spellcheck="false" autocomplete="off" autocapitalize="off" autocorrect="off"></textarea></label></template></details>
|
||||
<details class="plugin-advanced">
|
||||
<summary>{{ text('advanced') }}<Icon name="chevron-down" :size="14" /></summary>
|
||||
<template v-if="plugin.manifest.id === musicBotId && plugin.manifest.server">
|
||||
<p class="plugin-config-help">{{ tr('musicBotConfigHelp') }}</p>
|
||||
<a class="plugin-setup-link" :href="`${musicBotRepository}#配置`" target="_blank" rel="noopener noreferrer">{{ tr('setupGuide') }} ↗</a>
|
||||
<label>{{ tr('privateConfig') }}
|
||||
<small>{{ tr(plugin.settings.hasServerConfig ? 'secretSaved' : 'secretEmpty') }}</small>
|
||||
<select v-model="model.drafts[plugin.manifest.id].serverConfigAction">
|
||||
<option value="keep">{{ tr('keep') }}</option><option value="replace">{{ tr('replace') }}</option><option value="remove">{{ tr('erase') }}</option>
|
||||
</select>
|
||||
</label>
|
||||
<div v-if="model.drafts[plugin.manifest.id].serverConfigAction === 'replace'" class="plugin-config-grid">
|
||||
<div v-for="field in musicBotPrivateFields" :key="field.key" class="plugin-config-field">
|
||||
<div v-if="field.type === 'json'" role="group" :aria-label="field.key">
|
||||
<p>{{ field.key }}</p>
|
||||
<PluginConfigValue fixed string-children :labels="valueLabels" :model-value="model.musicBotCollection(plugin.manifest.id, 'privateFields', field.key)" @update:model-value="model.setMusicBotCollection(plugin.manifest.id, 'privateFields', field.key, $event)" />
|
||||
</div>
|
||||
<label v-else>{{ field.key }}{{ field.key === 'apiKey' ? ' *' : '' }}
|
||||
<input v-model="model.drafts[plugin.manifest.id].privateFields[field.key]" :type="field.type" :placeholder="field.placeholder" :aria-required="field.key === 'apiKey'" :autocomplete="field.type === 'password' ? 'new-password' : 'off'" spellcheck="false" />
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<p class="plugin-config-help">{{ tr('config') }}</p>
|
||||
<div class="plugin-config-grid">
|
||||
<div v-for="field in musicBotPublicFields" :key="field.key" class="plugin-config-field">
|
||||
<div v-if="field.type === 'json'" role="group" :aria-label="field.key">
|
||||
<p>{{ field.key }}</p>
|
||||
<PluginConfigValue fixed string-children :labels="valueLabels" :model-value="model.musicBotCollection(plugin.manifest.id, 'publicFields', field.key)" @update:model-value="model.setMusicBotCollection(plugin.manifest.id, 'publicFields', field.key, $event)" />
|
||||
</div>
|
||||
<label v-else>{{ field.key }}
|
||||
<select v-if="field.choices" v-model="model.drafts[plugin.manifest.id].publicFields[field.key]">
|
||||
<option value="">{{ tr('configDefault') }} ({{ field.placeholder }})</option>
|
||||
<option v-for="choice in field.choices" :key="choice" :value="choice">{{ choice }}</option>
|
||||
</select>
|
||||
<input v-else v-model="model.drafts[plugin.manifest.id].publicFields[field.key]" :type="field.type" :placeholder="field.placeholder" spellcheck="false" />
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<template v-else>
|
||||
<div class="plugin-config-group" role="group" :aria-label="tr('config')">
|
||||
<p>{{ tr('config') }}</p>
|
||||
<PluginConfigValue :labels="valueLabels" :model-value="model.configValue(plugin.manifest.id, 'config')" @update:model-value="model.setConfigValue(plugin.manifest.id, 'config', $event)" />
|
||||
</div>
|
||||
<template v-if="plugin.manifest.server">
|
||||
<p class="plugin-config-help">
|
||||
{{ tr('privateConfigHelp') }}
|
||||
</p>
|
||||
<label>{{ tr('privateConfig') }}
|
||||
<small>{{ tr(plugin.settings.hasServerConfig?'secretSaved':'secretEmpty') }}</small>
|
||||
<select v-model="model.drafts[plugin.manifest.id].serverConfigAction">
|
||||
<option value="keep">{{ tr('keep') }}</option><option value="replace">{{ tr('replace') }}</option><option value="remove">{{ tr('erase') }}</option>
|
||||
</select>
|
||||
</label>
|
||||
<div v-if="model.drafts[plugin.manifest.id].serverConfigAction==='replace'" class="plugin-config-group" role="group" :aria-label="tr('privateConfig')">
|
||||
<PluginConfigValue secret :labels="valueLabels" :model-value="model.configValue(plugin.manifest.id, 'serverConfig')" @update:model-value="model.setConfigValue(plugin.manifest.id, 'serverConfig', $event)" />
|
||||
</div>
|
||||
</template>
|
||||
</template>
|
||||
</details>
|
||||
<div class="plugin-settings-actions"><button v-if="plugin.manifest.server" class="plugin-button" type="button" :disabled="!plugin.settings.enabled" @click="model.restart(plugin)">{{ tr('restart') }}</button><button class="plugin-button danger" type="button" @click="remove(plugin)"><Icon name="trash" :size="14" />{{ tr('remove') }}</button><button class="plugin-button primary" type="button" @click="save(plugin)"><Icon name="check" :size="15" />{{ tr('save') }}</button></div>
|
||||
</fieldset></details>
|
||||
</article>
|
||||
@@ -44,18 +103,30 @@
|
||||
<script setup lang="ts">
|
||||
import { computed, ref } from 'vue';
|
||||
import Icon from '../Icon.vue';
|
||||
import PluginConfigValue from './PluginConfigValue.vue';
|
||||
import type { SiteLanguage } from '../../../../src/site-copy.js';
|
||||
import { PLUGIN_STORE_REPOSITORY, type InstalledPlugin, type PluginStoreEntry, type PluginManifest } from '../../../../src/shared/plugins.js';
|
||||
import type { useAdminPlugins } from '../../composables/useAdminPlugins.js';
|
||||
import { musicBotId, musicBotPrivateFields, musicBotPublicFields, musicBotRepository, type useAdminPlugins } from '../../composables/useAdminPlugins.js';
|
||||
import { pluginTranslations, type PluginTextKey } from '../../i18n/plugins.js';
|
||||
import { pluginStoreTranslations, type PluginStoreTextKey } from '../../i18n/plugin-store.js';
|
||||
const props=defineProps<{model:ReturnType<typeof useAdminPlugins>;language:SiteLanguage}>();
|
||||
const tr=(key:PluginTextKey)=>pluginTranslations[props.language][key],text=(key:PluginStoreTextKey)=>pluginStoreTranslations[props.language][key];
|
||||
const valueLabels=computed(()=>({type:tr('valueType'),key:tr('fieldKey'),value:tr('fieldValue'),add:tr('addField'),remove:tr('remove')}));
|
||||
function describeError(code:string) {
|
||||
if(code==='TSMB_API_KEY_REQUIRED')return tr('musicBotConfigHelp');
|
||||
if(code==='PLUGIN_CHECKSUM')return tr('storeChecksum');
|
||||
if(code==='PLUGIN_PACKAGE_MISMATCH')return tr('storeMismatch');
|
||||
return `${tr('error')} (${code})`;
|
||||
}
|
||||
const tab=ref<'store'|'installed'>('store'),search=ref(''),expanded=ref(''),notice=ref(''),fileInput=ref<HTMLInputElement|null>(null);
|
||||
const enabledCount=computed(()=>props.model.installed.value.filter(p=>p.settings.enabled).length);
|
||||
const matches=(manifest:PluginManifest|null,id:string)=>[manifest?.name,manifest?.author,manifest?.description,id].join(' ').toLocaleLowerCase().includes(search.value.trim().toLocaleLowerCase());
|
||||
const catalogEntries=computed(()=>(props.model.catalog.value?.entries??[]).filter(e=>matches(e.manifest,e.id)));
|
||||
const installedEntries=computed(()=>props.model.installed.value.filter(p=>matches(p.manifest,p.manifest.id)));
|
||||
function repository(id:string){
|
||||
if(id===musicBotId)return musicBotRepository;
|
||||
return props.model.catalog.value?.entries.find(entry=>entry.id===id)?.repository;
|
||||
}
|
||||
function installLabel(entry:PluginStoreEntry){const local=props.model.installed.value.find(p=>p.manifest.id===entry.id);return !local?text('add'):local.manifest.version===entry.manifest?.version?text('reinstall'):text('update');}
|
||||
async function install(entry:PluginStoreEntry){notice.value='';await props.model.install(entry);if(!props.model.error.value){tab.value='installed';expanded.value=entry.id;notice.value=text('installedNotice');}}
|
||||
async function upload(event:Event){const input=event.target as HTMLInputElement,file=input.files?.[0];if(file){notice.value='';await props.model.upload(file);if(!props.model.error.value){tab.value='installed';notice.value=text('installedNotice');}}input.value='';}
|
||||
@@ -64,6 +135,13 @@ function remove(plugin:InstalledPlugin){if(window.confirm(tr('removed'))){notice
|
||||
function onToggle(event:Event,id:string){if((event.target as HTMLDetailsElement).open)expanded.value=id;else if(expanded.value===id)expanded.value='';}
|
||||
</script>
|
||||
<style scoped>
|
||||
.plugin-admin .plugin-config-help{margin:0 0 12px;color:var(--admin-muted);font-size:12px;line-height:1.6}
|
||||
.plugin-setup-link,.plugin-installed-meta a{color:var(--admin-accent);display:inline-flex;align-items:center;gap:5px}
|
||||
.plugin-setup-link{margin-bottom:12px;font-size:12px}
|
||||
.plugin-config-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,210px),1fr));column-gap:16px}
|
||||
.plugin-config-grid input{box-sizing:border-box;width:100%;min-width:0;padding:10px 12px;border:1px solid var(--admin-border);border-radius:8px;background:var(--admin-field);color:var(--admin-text);font-size:12px}
|
||||
.plugin-config-field,.plugin-config-group{font-size:12px;color:var(--admin-muted);min-width:0}
|
||||
.plugin-config-field [role=group],.plugin-config-group{display:grid;gap:8px;margin-bottom:12px}
|
||||
section.page-content.plugin-admin{display:grid;grid-template-columns:minmax(0,1fr);grid-auto-rows:max-content;align-content:start;gap:24px;color:var(--admin-text);min-width:0}
|
||||
.plugin-admin :is(h2,h3,h4,p){margin:0}.plugin-admin :is(button,input,select,textarea){font:inherit}.plugin-admin button{cursor:pointer}.plugin-admin button:disabled{opacity:.5;cursor:wait}
|
||||
.plugin-hero{position:relative;display:flex;align-items:center;justify-content:space-between;gap:28px;overflow:hidden;padding:32px;border:1px solid var(--admin-border);border-radius:20px;background:radial-gradient(ellipse at 100% 0,color-mix(in srgb,var(--admin-accent) 12%,transparent),transparent 65%),var(--admin-surface)}
|
||||
|
||||
@@ -0,0 +1,102 @@
|
||||
<template>
|
||||
<div class="config-value">
|
||||
<select v-if="!fixed" :aria-label="labels.type" :value="kind" @change="changeType">
|
||||
<option v-for="type in types" :key="type">{{ type }}</option>
|
||||
</select>
|
||||
<template v-if="objectRows">
|
||||
<div v-for="[key, value] in objectRows" :key="key" class="config-row">
|
||||
<span class="config-key">{{ key }}</span>
|
||||
<PluginConfigValue :model-value="value" :labels="labels" :secret="secret" :fixed="stringChildren" @update:model-value="setKey(key, $event)" />
|
||||
<button type="button" :aria-label="`${labels.remove} ${key}`" @click="removeKey(key)">×</button>
|
||||
</div>
|
||||
<div class="config-add">
|
||||
<input v-model="newKey" :aria-label="labels.key" :placeholder="labels.key" autocomplete="off" @keydown.enter.prevent="addKey" />
|
||||
<button type="button" :disabled="!canAddKey" @click="addKey">{{ labels.add }}</button>
|
||||
</div>
|
||||
</template>
|
||||
<template v-else-if="Array.isArray(modelValue)">
|
||||
<div v-for="(value, index) in modelValue" :key="index" class="config-row">
|
||||
<span class="config-key">{{ index + 1 }}</span>
|
||||
<PluginConfigValue :model-value="value" :labels="labels" :secret="secret" :fixed="stringChildren" @update:model-value="setItem(index, $event)" />
|
||||
<button type="button" :aria-label="`${labels.remove} ${index + 1}`" @click="removeItem(index)">×</button>
|
||||
</div>
|
||||
<button type="button" @click="emit('update:modelValue', [...modelValue, ''])">{{ labels.add }}</button>
|
||||
</template>
|
||||
<select v-else-if="typeof modelValue === 'boolean'" :aria-label="labels.value" :value="String(modelValue)" @change="emit('update:modelValue', inputValue($event) === 'true')">
|
||||
<option value="true">true</option>
|
||||
<option value="false">false</option>
|
||||
</select>
|
||||
<input v-else-if="typeof modelValue === 'number'" :aria-label="labels.value" type="number" step="any" :value="modelValue" @input="setNumber" />
|
||||
<input v-else-if="typeof modelValue === 'string'" :aria-label="labels.value" :type="secret ? 'password' : 'text'" :value="modelValue" :autocomplete="secret ? 'new-password' : 'off'" spellcheck="false" @input="emit('update:modelValue', inputValue($event))" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { computed, ref } from 'vue';
|
||||
import type { JsonValue } from '../../../../src/shared/plugins.js';
|
||||
|
||||
const props = defineProps<{
|
||||
modelValue: JsonValue;
|
||||
labels: { type: string; key: string; value: string; add: string; remove: string };
|
||||
secret?: boolean;
|
||||
fixed?: boolean;
|
||||
stringChildren?: boolean;
|
||||
}>();
|
||||
const emit = defineEmits<{ 'update:modelValue': [value: JsonValue] }>();
|
||||
const defaults: Record<string, JsonValue> = { text: '', number: 0, boolean: false, list: [], object: {}, null: null };
|
||||
const types = Object.keys(defaults);
|
||||
const kind = computed(() => {
|
||||
const value = props.modelValue;
|
||||
if (value === null) return 'null';
|
||||
if (Array.isArray(value)) return 'list';
|
||||
return typeof value === 'string' ? 'text' : typeof value;
|
||||
});
|
||||
const objectValue = computed(() => kind.value === 'object' ? props.modelValue as Record<string, JsonValue> : null);
|
||||
const objectRows = computed(() => objectValue.value && Object.entries(objectValue.value));
|
||||
const newKey = ref('');
|
||||
const canAddKey = computed(() => Boolean(newKey.value.trim()) && !Object.hasOwn(objectValue.value ?? {}, newKey.value.trim()));
|
||||
|
||||
function inputValue(event: Event): string {
|
||||
return (event.target as HTMLInputElement | HTMLSelectElement).value;
|
||||
}
|
||||
function changeType(event: Event) {
|
||||
const type = inputValue(event);
|
||||
if (Object.hasOwn(defaults, type)) emit('update:modelValue', defaults[type]);
|
||||
}
|
||||
function setNumber(event: Event) {
|
||||
const value = (event.target as HTMLInputElement).valueAsNumber;
|
||||
if (Number.isFinite(value)) emit('update:modelValue', value);
|
||||
}
|
||||
function setKey(key: string, value: JsonValue) {
|
||||
emit('update:modelValue', {...objectValue.value, [key]:value});
|
||||
}
|
||||
function addKey() {
|
||||
if (!canAddKey.value) return;
|
||||
setKey(newKey.value.trim(), '');
|
||||
newKey.value = '';
|
||||
}
|
||||
function removeKey(key: string) {
|
||||
const next = {...objectValue.value};
|
||||
delete next[key];
|
||||
emit('update:modelValue', next);
|
||||
}
|
||||
function setItem(index: number, value: JsonValue) {
|
||||
if (!Array.isArray(props.modelValue)) return;
|
||||
emit('update:modelValue', props.modelValue.map((item, i) => i === index ? value : item));
|
||||
}
|
||||
function removeItem(index: number) {
|
||||
if (!Array.isArray(props.modelValue)) return;
|
||||
emit('update:modelValue', props.modelValue.filter((_, i) => i !== index));
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.config-value{min-width:0;display:grid;gap:8px;align-content:start}
|
||||
.config-row{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,2fr) auto;align-items:start;gap:8px}
|
||||
.config-key{padding-top:9px;overflow-wrap:anywhere}
|
||||
.config-add{display:flex;gap:8px}
|
||||
.config-value :is(input,select,button){box-sizing:border-box;min-width:0;padding:7px 9px;border:1px solid var(--admin-border);border-radius:8px;background:var(--admin-field);color:var(--admin-text)}
|
||||
.config-add input{flex:1}
|
||||
.config-value>button,.config-value>select{justify-self:start}
|
||||
@media(max-width:600px){.config-row{grid-template-columns:minmax(0,1fr) auto}.config-key{grid-column:1/-1;padding-top:0}}
|
||||
</style>
|
||||
@@ -1,23 +1,104 @@
|
||||
import { reactive, ref, shallowRef } from 'vue';
|
||||
import { createAdminRequests } from '../services/admin-requests.js';
|
||||
import { isAdminRequestCancelled, type AdminApi } from '../services/admin-api.js';
|
||||
import { parsePluginPackage, PLUGIN_LIMIT_BYTES, type InstalledPlugin, type PluginCatalog, type PluginStoreEntry, type PluginRuntimeSettings, type PluginSettingsInput } from '../../../src/shared/plugins.js';
|
||||
import { AdminApiError, isAdminRequestCancelled, type AdminApi } from '../services/admin-api.js';
|
||||
import { parsePluginPackage, pluginRecord, PLUGIN_LIMIT_BYTES, type InstalledPlugin, type JsonValue, type PluginCatalog, type PluginStoreEntry, type PluginRuntimeSettings, type PluginSettingsInput } from '../../../src/shared/plugins.js';
|
||||
|
||||
export const musicBotId = 'community.webspeak-tsmb';
|
||||
export const musicBotRepository = 'https://github.com/Funvvell/webspeak-plugin-tsmb';
|
||||
|
||||
interface ConfigField {
|
||||
key: string;
|
||||
type: 'url' | 'password' | 'text' | 'number' | 'json' | 'select' | 'boolean';
|
||||
placeholder?: string;
|
||||
choices?: readonly string[];
|
||||
}
|
||||
|
||||
export const musicBotPrivateFields: readonly ConfigField[] = [
|
||||
{key:'baseUrl',type:'url',placeholder:'http://127.0.0.1:3000'},
|
||||
{key:'apiKey',type:'password',placeholder:'tsmb_…'},
|
||||
{key:'requestTimeoutMs',type:'number',placeholder:'8000'},
|
||||
{key:'connectTimeoutMs',type:'number',placeholder:'4000'},
|
||||
{key:'maxResponseBytes',type:'number',placeholder:'1048576'},
|
||||
{key:'maxCoverBytes',type:'number',placeholder:'2097152'},
|
||||
{key:'coverAllowedHosts',type:'json',placeholder:'[]'},
|
||||
];
|
||||
|
||||
export const musicBotPublicFields: readonly ConfigField[] = [
|
||||
{key:'botId',type:'text'},
|
||||
{key:'botIdByScope',type:'json',placeholder:'{}'},
|
||||
{key:'webUiUrl',type:'url'},
|
||||
{key:'controlPolicy',type:'select',choices:['everyone','host','readonly'],placeholder:'everyone'},
|
||||
{key:'pollIntervalMs',type:'number',placeholder:'2000'},
|
||||
{key:'progressIntervalMs',type:'number',placeholder:'500'},
|
||||
{key:'searchLimit',type:'number',placeholder:'20'},
|
||||
{key:'searchMaxLimit',type:'number',placeholder:'50'},
|
||||
{key:'searchOffsetMax',type:'number',placeholder:'500'},
|
||||
{key:'maxQueueDisplay',type:'number',placeholder:'50'},
|
||||
{key:'lyricsEnabled',type:'boolean',choices:['true','false'],placeholder:'true'},
|
||||
{key:'coverProxyEnabled',type:'boolean',choices:['true','false'],placeholder:'true'},
|
||||
{key:'heartbeatMs',type:'number',placeholder:'10000'},
|
||||
{key:'idleRoomTTLms',type:'number',placeholder:'1800000'},
|
||||
{key:'locale',type:'text',placeholder:'auto'},
|
||||
];
|
||||
|
||||
function makeConfigDraft(fields: readonly ConfigField[], config?: JsonValue): Record<string, string> {
|
||||
return Object.fromEntries(fields.map(({key,type}) => {
|
||||
const value = pluginRecord(config) ? config[key] : undefined;
|
||||
return [key, value === undefined ? '' : type === 'json' ? JSON.stringify(value) : String(value)];
|
||||
}));
|
||||
}
|
||||
|
||||
function readConfigFields(fields: readonly ConfigField[], draft: Record<string, string>, existing?: JsonValue): Record<string, JsonValue> {
|
||||
const config = pluginRecord(existing) ? {...existing} as Record<string, JsonValue> : {};
|
||||
for (const {key,type} of fields) {
|
||||
const input = String(draft[key] ?? '').trim();
|
||||
if (!input) { delete config[key]; continue; }
|
||||
if (type === 'number' || type === 'json' || type === 'boolean') {
|
||||
try {
|
||||
const value: JsonValue = JSON.parse(input);
|
||||
if (type === 'number' && !Number.isSafeInteger(value)) throw new Error();
|
||||
if (key === 'coverAllowedHosts' && (!Array.isArray(value) || !value.every(host => typeof host === 'string'))) throw new Error();
|
||||
if (key === 'botIdByScope' && (!pluginRecord(value) || !Object.values(value).every(id => typeof id === 'string'))) throw new Error();
|
||||
config[key] = value;
|
||||
} catch { throw new Error(`Invalid value: ${key}`); }
|
||||
} else {
|
||||
config[key] = input;
|
||||
}
|
||||
}
|
||||
return config;
|
||||
}
|
||||
|
||||
export function useAdminPlugins(api: AdminApi) {
|
||||
const installed=shallowRef<InstalledPlugin[]>([]),catalog=shallowRef<PluginCatalog|null>(null),runtime=shallowRef<PluginRuntimeSettings|null>(null);
|
||||
const origin=ref(''),busy=ref(false),error=ref(''),catalogError=ref(''),requests=createAdminRequests();
|
||||
const drafts=reactive<Record<string,{enabled:boolean;trusted:boolean;toolbarPinned:boolean;scope:'server'|'instance';targets:string;config:string;serverConfigAction:'keep'|'replace'|'remove';serverConfig:string}>>({});
|
||||
const drafts=reactive<Record<string,{enabled:boolean;trusted:boolean;toolbarPinned:boolean;scope:'server'|'instance';targets:string;config:string;serverConfigAction:'keep'|'replace'|'remove';serverConfig:string;publicFields:Record<string,string>;privateFields:Record<string,string>}>>({});
|
||||
function apply(records:InstalledPlugin[]){
|
||||
installed.value=records;
|
||||
for(const record of records)if(!drafts[record.manifest.id])drafts[record.manifest.id]={enabled:record.settings.enabled,trusted:record.settings.trusted,toolbarPinned:record.settings.toolbarPinned,scope:record.settings.scope,targets:record.settings.targets.join('\n'),config:JSON.stringify(record.settings.config,null,2),serverConfigAction:'keep',serverConfig:''};
|
||||
for(const record of records)if(!drafts[record.manifest.id]){
|
||||
const musicBot = record.manifest.id === musicBotId;
|
||||
drafts[record.manifest.id]={enabled:record.settings.enabled,trusted:record.settings.trusted,toolbarPinned:record.settings.toolbarPinned,scope:record.settings.scope,targets:record.settings.targets.join('\n'),config:JSON.stringify(record.settings.config,null,2),serverConfigAction:'keep',serverConfig:'',publicFields:musicBot?makeConfigDraft(musicBotPublicFields,record.settings.config):{},privateFields:musicBot?makeConfigDraft(musicBotPrivateFields):{}};
|
||||
}
|
||||
for(const id of Object.keys(drafts))if(!records.some(r=>r.manifest.id===id))delete drafts[id];
|
||||
}
|
||||
async function work(run:(signal:AbortSignal,current:()=>boolean)=>Promise<void>){
|
||||
if(busy.value)return;const request=requests.begin('plugins');busy.value=true;error.value='';
|
||||
const timer=setTimeout(()=>{if(request.isCurrent()){error.value='PLUGIN_TIMEOUT';requests.cancel('plugins');busy.value=false;}},90_000);
|
||||
try{await run(request.signal,request.isCurrent);}catch(e){if(request.isCurrent()&&!isAdminRequestCancelled(e))error.value=e instanceof Error?e.message:'PLUGIN_FAILED';}
|
||||
try{await run(request.signal,request.isCurrent);}catch(e){if(request.isCurrent()&&!isAdminRequestCancelled(e))error.value=e instanceof AdminApiError?e.code:e instanceof Error?e.message:'PLUGIN_FAILED';}
|
||||
finally{clearTimeout(timer);if(request.isCurrent())busy.value=false;request.finish();}
|
||||
}
|
||||
function configValue(id: string, key: 'config' | 'serverConfig'): JsonValue {
|
||||
return JSON.parse(drafts[id][key] || '{}') as JsonValue;
|
||||
}
|
||||
function setConfigValue(id: string, key: 'config' | 'serverConfig', value: JsonValue) {
|
||||
drafts[id][key] = JSON.stringify(value);
|
||||
}
|
||||
function musicBotCollection(id: string, section: 'publicFields' | 'privateFields', key: string): JsonValue {
|
||||
const value = drafts[id][section][key];
|
||||
return value ? JSON.parse(value) as JsonValue : key === 'coverAllowedHosts' ? [] : {};
|
||||
}
|
||||
function setMusicBotCollection(id: string, section: 'publicFields' | 'privateFields', key: string, value: JsonValue) {
|
||||
drafts[id][section][key] = JSON.stringify(value);
|
||||
}
|
||||
function load(){return work(async(signal,current)=>{
|
||||
const records=await api.plugins(signal);if(current())apply(records.plugins);
|
||||
const settings=await api.pluginRuntime(signal);if(current()){runtime.value=settings.runtime;origin.value=settings.runtime.publicOrigin;}
|
||||
@@ -29,7 +110,13 @@ export function useAdminPlugins(api: AdminApi) {
|
||||
});}
|
||||
function save(record:InstalledPlugin){return work(async(signal,current)=>{
|
||||
const draft=drafts[record.manifest.id],captured=JSON.stringify(draft);
|
||||
const settings:PluginSettingsInput={enabled:draft.enabled,trusted:draft.trusted,toolbarPinned:draft.toolbarPinned,scope:draft.scope,targets:draft.targets.split(/\r?\n/).map(t=>t.trim()).filter(Boolean),config:JSON.parse(draft.config),serverConfigAction:draft.serverConfigAction,...(draft.serverConfigAction==='replace'?{serverConfig:JSON.parse(draft.serverConfig)}:{})};
|
||||
const musicBot=record.manifest.id===musicBotId;
|
||||
const settings:PluginSettingsInput={enabled:draft.enabled,trusted:draft.trusted,toolbarPinned:draft.toolbarPinned,scope:draft.scope,targets:draft.targets.split(/\r?\n/).map(t=>t.trim()).filter(Boolean),config:musicBot?readConfigFields(musicBotPublicFields,draft.publicFields,record.settings.config):JSON.parse(draft.config),serverConfigAction:draft.serverConfigAction};
|
||||
if(draft.serverConfigAction==='replace'){
|
||||
settings.serverConfig=musicBot?readConfigFields(musicBotPrivateFields,draft.privateFields):JSON.parse(draft.serverConfig);
|
||||
if(musicBot && pluginRecord(settings.serverConfig) && (typeof settings.serverConfig.apiKey !== 'string' || !/^tsmb_[A-Za-z0-9_-]{20,}$/.test(settings.serverConfig.apiKey))) throw new Error('TSMB_API_KEY_REQUIRED');
|
||||
}
|
||||
if(musicBot && draft.enabled && (draft.serverConfigAction==='remove' || (draft.serverConfigAction==='keep' && !record.settings.hasServerConfig))) throw new Error('TSMB_API_KEY_REQUIRED');
|
||||
const result=await api.configurePlugin(record.manifest.id,record.revision,settings,signal);
|
||||
if(current()){if(JSON.stringify(drafts[record.manifest.id])===captured)delete drafts[record.manifest.id];apply(installed.value.map(p=>p.manifest.id===record.manifest.id?result.plugin:p));}
|
||||
});}
|
||||
@@ -41,7 +128,7 @@ export function useAdminPlugins(api: AdminApi) {
|
||||
const result=await api.uploadPlugin(pack,installed.value.find(p=>p.manifest.id===pack.manifest.id)?.revision??null,signal);
|
||||
if(current()){delete drafts[pack.manifest.id];apply([...installed.value.filter(p=>p.manifest.id!==pack.manifest.id),result.plugin]);}
|
||||
});}
|
||||
function cancelRequests(){requests.reset();busy.value=false;for(const draft of Object.values(drafts)){draft.serverConfig='';draft.serverConfigAction='keep';}}
|
||||
function cancelRequests(){requests.reset();busy.value=false;for(const draft of Object.values(drafts)){draft.serverConfig='';draft.serverConfigAction='keep';for(const key of Object.keys(draft.privateFields))draft.privateFields[key]='';}}
|
||||
function reset(){cancelRequests();installed.value=[];catalog.value=null;runtime.value=null;origin.value='';error.value='';catalogError.value='';for(const id of Object.keys(drafts))delete drafts[id];}
|
||||
return {installed,catalog,runtime,origin,busy,error,catalogError,drafts,load,install,save,restart,saveRuntime,remove,upload,cancelRequests,reset};
|
||||
return {installed,catalog,runtime,origin,busy,error,catalogError,drafts,load,install,save,restart,saveRuntime,remove,upload,cancelRequests,reset,configValue,setConfigValue,musicBotCollection,setMusicBotCollection};
|
||||
}
|
||||
@@ -35,6 +35,8 @@ export function useAdminSkins(options: Options) {
|
||||
const code = error instanceof AdminApiError ? error.code : "";
|
||||
if (["SKIN_STORE_CHANGED", "SKIN_STORE_INSTALLED_CHANGED", "SKIN_STORE_NOT_NEWER"].includes(code)) return options.tr("skinStoreChanged");
|
||||
if (code === "SKIN_STORE_INCOMPATIBLE") return options.tr("skinStoreIncompatible");
|
||||
if (code === "SKIN_STORE_CHECKSUM") return options.tr("skinStoreChecksum");
|
||||
if (code === "SKIN_STORE_PACKAGE_MISMATCH") return options.tr("skinStoreMismatch");
|
||||
if (code.startsWith("SKIN_") && code !== "SKIN_STORE_UNAVAILABLE" && code !== "SKIN_STORAGE_UNAVAILABLE") return options.tr("skinStoreInvalid");
|
||||
return options.tr("skinStoreUnavailable");
|
||||
}
|
||||
|
||||
+65
-10
@@ -13,7 +13,7 @@ const en = {
|
||||
"server": "TS server scope",
|
||||
"instance": "WebSpeak instance scope",
|
||||
"targets": "Allowed TS targets (one host:port per line)",
|
||||
"config": "Public configuration (JSON; visible to users)",
|
||||
"config": "Public settings",
|
||||
"enabled": "Enable plugin",
|
||||
"lead": "Reviewed applications with standard browser capabilities and optional Node services. Updates require renewed trust.",
|
||||
"empty": "No plugins available",
|
||||
@@ -33,7 +33,18 @@ const en = {
|
||||
"originHelp": "Use a separate HTTPS origin, such as https://apps.example.com, proxying to the runtime port. Blank enables local automatic addressing only.",
|
||||
"trust": "I have reviewed and trust this application and its dependencies",
|
||||
"toolbarPin": "Pin this app in the voice toolbar",
|
||||
"privateConfig": "Private backend configuration (JSON; encrypted at rest)",
|
||||
"privateConfig": "Private backend settings (encrypted at rest)",
|
||||
"privateConfigHelp": "The fields depend on this plugin. Copy the private settings from its setup guide and use Replace secret configuration to save them.",
|
||||
"musicBotConfigHelp": "Enter the API Key created in TSMusicBot WebUI with a member or administrator account. The baseUrl must be reachable from the WebSpeak server. Optional fields use the plugin defaults when blank.",
|
||||
"viewRepository": "View repository",
|
||||
"configDefault": "Use default",
|
||||
"valueType": "Value type",
|
||||
"fieldKey": "Field name",
|
||||
"fieldValue": "Value",
|
||||
"addField": "Add",
|
||||
"storeChecksum": "Package checksum differs from the catalog. Refresh the store and retry.",
|
||||
"storeMismatch": "The package version, scope, or entry points differ from the catalog.",
|
||||
"setupGuide": "Plugin setup guide",
|
||||
"keep": "Keep existing secret configuration",
|
||||
"replace": "Replace secret configuration",
|
||||
"erase": "Remove secret configuration",
|
||||
@@ -65,7 +76,7 @@ zh:{
|
||||
"server": "TS 服务器范围",
|
||||
"instance": "WebSpeak 实例范围",
|
||||
"targets": "允许的 TS 地址(每行一个 host:port)",
|
||||
"config": "公开配置(JSON;用户可见)",
|
||||
"config": "公开配置",
|
||||
"enabled": "启用插件",
|
||||
"lead": "经审核的应用,可使用标准浏览器能力和可选的 Node 服务。更新后需要重新信任。",
|
||||
"empty": "暂无可用插件",
|
||||
@@ -85,7 +96,18 @@ zh:{
|
||||
"originHelp": "配置独立的 HTTPS 源,如 https://apps.example.com,并反向代理到运行时端口。留空仅支持本地自动地址。",
|
||||
"trust": "我已审核并信任此应用及其依赖",
|
||||
"toolbarPin": "在语音工具栏中固定此应用",
|
||||
"privateConfig": "后端私密配置(JSON;加密存储)",
|
||||
"privateConfig": "后端私密配置(加密存储)",
|
||||
"privateConfigHelp": "字段由插件定义。按插件仓库里的配置说明填写,在这里选择“替换”后保存。",
|
||||
"musicBotConfigHelp": "API Key 在 TSMusicBot 自己的 WebUI 用成员或管理员账号创建。baseUrl 填 WebSpeak 服务端能访问的机器人地址。选填项留空时使用插件默认值。",
|
||||
"viewRepository": "查看仓库",
|
||||
"configDefault": "使用默认值",
|
||||
"valueType": "字段类型",
|
||||
"fieldKey": "字段名",
|
||||
"fieldValue": "字段值",
|
||||
"addField": "添加",
|
||||
"storeChecksum": "安装包的 SHA‑256 与商店记录不符。请刷新商店后重试。",
|
||||
"storeMismatch": "安装包的版本、作用域或入口与商店记录不一致。",
|
||||
"setupGuide": "插件配置说明",
|
||||
"keep": "保留现有私密配置",
|
||||
"replace": "替换私密配置",
|
||||
"erase": "删除私密配置",
|
||||
@@ -114,7 +136,7 @@ de:{
|
||||
"server": "TS-Server-Bereich",
|
||||
"instance": "WebSpeak-Instanz-Bereich",
|
||||
"targets": "Erlaubte TS-Ziele (host:port pro Zeile)",
|
||||
"config": "Öffentliche Konfiguration (JSON; für Nutzer sichtbar)",
|
||||
"config": "Öffentliche Einstellungen",
|
||||
"enabled": "Plugin aktivieren",
|
||||
"lead": "Geprüfte Anwendungen mit Browserfunktionen und optionalen Node-Diensten. Updates erfordern erneutes Vertrauen.",
|
||||
"empty": "Keine Plugins verfügbar",
|
||||
@@ -134,7 +156,18 @@ de:{
|
||||
"originHelp": "Separate HTTPS-Origin, z. B. https://apps.example.com, auf den Runtime-Port weiterleiten. Leer nur für lokale automatische Adressen.",
|
||||
"trust": "Ich habe diese Anwendung und ihre Abhängigkeiten geprüft und vertraue ihnen",
|
||||
"toolbarPin": "Diese App in der Sprachsymbolleiste anheften",
|
||||
"privateConfig": "Private Backend-Konfiguration (JSON; verschlüsselt gespeichert)",
|
||||
"privateConfig": "Private Backend-Einstellungen (verschlüsselt gespeichert)",
|
||||
"privateConfigHelp": "Die Felder hängen vom Plugin ab. Übernehmen Sie die privaten Einstellungen aus der Anleitung und wählen Sie „Ersetzen“.",
|
||||
"musicBotConfigHelp": "Erstellen Sie den API-Schlüssel in der TSMusicBot-WebUI als Mitglied oder Administrator. baseUrl muss für den WebSpeak-Server erreichbar sein. Leere optionale Felder verwenden Standardwerte.",
|
||||
"viewRepository": "Repository ansehen",
|
||||
"configDefault": "Standardwert",
|
||||
"valueType": "Werttyp",
|
||||
"fieldKey": "Feldname",
|
||||
"fieldValue": "Wert",
|
||||
"addField": "Hinzufügen",
|
||||
"storeChecksum": "Die Paketprüfsumme weicht vom Katalog ab. Aktualisieren Sie den Store.",
|
||||
"storeMismatch": "Version, Geltungsbereich oder Einstiegspunkte weichen vom Katalog ab.",
|
||||
"setupGuide": "Plugin-Konfigurationsanleitung",
|
||||
"keep": "Vorhandene private Konfiguration behalten",
|
||||
"replace": "Private Konfiguration ersetzen",
|
||||
"erase": "Private Konfiguration löschen",
|
||||
@@ -163,7 +196,7 @@ ru:{
|
||||
"server": "Область TS-сервера",
|
||||
"instance": "Область экземпляра WebSpeak",
|
||||
"targets": "Разрешённые адреса TS (host:port, по одному в строке)",
|
||||
"config": "Публичные настройки (JSON; видны пользователям)",
|
||||
"config": "Публичные настройки",
|
||||
"enabled": "Включить плагин",
|
||||
"lead": "Проверенные приложения с возможностями браузера и необязательными сервисами Node. Обновления требуют повторного доверия.",
|
||||
"empty": "Нет доступных плагинов",
|
||||
@@ -183,7 +216,18 @@ ru:{
|
||||
"originHelp": "Отдельный HTTPS-источник, например https://apps.example.com, с проксированием на порт среды. Пустое поле — только для локальных адресов.",
|
||||
"trust": "Я проверил приложение и зависимости и доверяю им",
|
||||
"toolbarPin": "Закрепить приложение на панели голосовой комнаты",
|
||||
"privateConfig": "Приватные настройки сервиса (JSON; хранятся зашифрованными)",
|
||||
"privateConfig": "Приватные настройки сервиса (хранятся зашифрованными)",
|
||||
"privateConfigHelp": "Поля зависят от плагина. Скопируйте настройки из его инструкции и выберите замену приватных настроек.",
|
||||
"musicBotConfigHelp": "Создайте API Key в WebUI TSMusicBot под учётной записью участника или администратора. Адрес baseUrl должен быть доступен серверу WebSpeak. Пустые поля используют значения по умолчанию.",
|
||||
"viewRepository": "Открыть репозиторий",
|
||||
"configDefault": "По умолчанию",
|
||||
"valueType": "Тип значения",
|
||||
"fieldKey": "Имя поля",
|
||||
"fieldValue": "Значение",
|
||||
"addField": "Добавить",
|
||||
"storeChecksum": "Контрольная сумма пакета не совпадает с каталогом. Обновите каталог.",
|
||||
"storeMismatch": "Версия, область или точки входа пакета не совпадают с каталогом.",
|
||||
"setupGuide": "Инструкция по настройке плагина",
|
||||
"keep": "Сохранить текущие приватные настройки",
|
||||
"replace": "Заменить приватные настройки",
|
||||
"erase": "Удалить приватные настройки",
|
||||
@@ -212,7 +256,7 @@ ja:{
|
||||
"server": "TS サーバー範囲",
|
||||
"instance": "WebSpeak インスタンス範囲",
|
||||
"targets": "許可する TS アドレス(1行に host:port)",
|
||||
"config": "公開設定(JSON、ユーザーに公開)",
|
||||
"config": "公開設定",
|
||||
"enabled": "有効にする",
|
||||
"lead": "標準ブラウザー機能と任意の Node サービスを使う審査済みアプリです。更新後は再度信頼を確認します。",
|
||||
"empty": "利用できるプラグインがありません",
|
||||
@@ -232,7 +276,18 @@ ja:{
|
||||
"originHelp": "https://apps.example.com のような別 HTTPS オリジンを実行ポートへ転送します。空欄はローカル自動アドレス専用です。",
|
||||
"trust": "アプリと依存関係を審査し、信頼します",
|
||||
"toolbarPin": "このアプリをボイスツールバーに固定",
|
||||
"privateConfig": "バックエンドの秘密設定(JSON、暗号化して保存)",
|
||||
"privateConfig": "バックエンドの秘密設定(暗号化して保存)",
|
||||
"privateConfigHelp": "設定項目はプラグインごとに異なります。設定ガイドに従い、秘密設定の置換を選んで保存してください。",
|
||||
"musicBotConfigHelp": "API Key は TSMusicBot WebUI でメンバーまたは管理者として発行します。baseUrl は WebSpeak サーバーから接続できる URL です。任意項目が空欄の場合は既定値が使われます。",
|
||||
"viewRepository": "リポジトリを見る",
|
||||
"configDefault": "既定値を使用",
|
||||
"valueType": "値の種類",
|
||||
"fieldKey": "項目名",
|
||||
"fieldValue": "値",
|
||||
"addField": "追加",
|
||||
"storeChecksum": "パッケージのチェックサムがカタログと一致しません。ストアを更新してください。",
|
||||
"storeMismatch": "パッケージのバージョン、スコープ、またはエントリがカタログと一致しません。",
|
||||
"setupGuide": "プラグイン設定ガイド",
|
||||
"keep": "現在の秘密設定を保持",
|
||||
"replace": "秘密設定を置換",
|
||||
"erase": "秘密設定を削除",
|
||||
|
||||
@@ -3,6 +3,7 @@ const zh = {
|
||||
skinStoreSource: "分发索引", skinStoreRefresh: "刷新商店", skinStoreRepository: "查看仓库", skinStoreInstall: "安装", skinStoreUpdate: "更新",
|
||||
skinStoreInstalling: "正在下载并校验…", skinStoreInstalled: "已安装", skinStoreNewer: "本地版本较新", skinStoreEmpty: "商店暂时没有皮肤。",
|
||||
skinStoreIncompatible: "需要更高版本的 WebSpeak", skinStoreUnavailable: "无法访问皮肤仓库,请稍后刷新重试;实例已有皮肤不受影响。",
|
||||
skinStoreChecksum: "皮肤包的 SHA‑256 与商店记录不符。请刷新商店后重试。", skinStoreMismatch: "皮肤包的版本或最低 WebSpeak 版本与商店记录不一致。",
|
||||
skinStoreInvalid: "仓库元数据或皮肤包校验失败,未安装此皮肤。", skinStoreChanged: "商店或实例皮肤已发生变化,请刷新后重试。",
|
||||
skinStoreConfirm: "要用商店版本替换当前实例中的这个皮肤吗?", skinStoreSuccess: "皮肤已安装,可在“实例皮肤”中管理。",
|
||||
skinStorePermissionNote: "安装不会更改默认皮肤,也不会代替访客批准皮肤组件权限。更新保留实例的启停状态。",
|
||||
@@ -14,6 +15,7 @@ const en = {
|
||||
skinStoreSource: "Distribution index", skinStoreRefresh: "Refresh store", skinStoreRepository: "View repository", skinStoreInstall: "Install", skinStoreUpdate: "Update",
|
||||
skinStoreInstalling: "Downloading and validating…", skinStoreInstalled: "Installed", skinStoreNewer: "Local version is newer", skinStoreEmpty: "No skins are available yet.",
|
||||
skinStoreIncompatible: "Requires a newer WebSpeak version", skinStoreUnavailable: "The skin repository is unavailable. Refresh to retry; installed skins are unaffected.",
|
||||
skinStoreChecksum: "The package checksum differs from the catalog. Refresh and try again.", skinStoreMismatch: "The package version or minimum WebSpeak version differs from the catalog.",
|
||||
skinStoreInvalid: "Repository metadata or package validation failed. The skin was not installed.", skinStoreChanged: "The store or installed skin has changed. Refresh before retrying.",
|
||||
skinStoreConfirm: "Replace this instance's installed skin with the store version?", skinStoreSuccess: "Skin installed. Manage it under Instance skins.",
|
||||
skinStorePermissionNote: "Installing does not change the default skin or approve component permissions for visitors. Updates preserve the instance's enabled state.",
|
||||
@@ -24,6 +26,7 @@ const de = {
|
||||
skinStoreSource: "Verteilungsindex", skinStoreRefresh: "Store aktualisieren", skinStoreRepository: "Repository öffnen", skinStoreInstall: "Installieren", skinStoreUpdate: "Aktualisieren",
|
||||
skinStoreInstalling: "Download und Prüfung…", skinStoreInstalled: "Installiert", skinStoreNewer: "Lokale Version ist neuer", skinStoreEmpty: "Noch keine Skins verfügbar.",
|
||||
skinStoreIncompatible: "Neuere WebSpeak-Version erforderlich", skinStoreUnavailable: "Skin-Repository nicht erreichbar. Bitte erneut laden; installierte Skins bleiben verfügbar.",
|
||||
skinStoreChecksum: "Die Paketprüfsumme weicht vom Katalog ab. Bitte aktualisieren und erneut versuchen.", skinStoreMismatch: "Paketversion oder minimale WebSpeak-Version weicht vom Katalog ab.",
|
||||
skinStoreInvalid: "Repository-Metadaten oder Paketprüfung fehlgeschlagen. Der Skin wurde nicht installiert.", skinStoreChanged: "Store oder installierter Skin wurde geändert. Bitte zuerst aktualisieren.",
|
||||
skinStoreConfirm: "Den installierten Skin dieser Instanz durch die Store-Version ersetzen?", skinStoreSuccess: "Skin installiert. Verwaltung unter Instanz-Skins.",
|
||||
skinStorePermissionNote: "Die Installation ändert weder den Standard-Skin noch die Berechtigungen der Besucher. Updates behalten den Aktivierungszustand bei.",
|
||||
@@ -34,6 +37,7 @@ const ru = {
|
||||
skinStoreSource: "Каталог распространения", skinStoreRefresh: "Обновить магазин", skinStoreRepository: "Открыть репозиторий", skinStoreInstall: "Установить", skinStoreUpdate: "Обновить",
|
||||
skinStoreInstalling: "Загрузка и проверка…", skinStoreInstalled: "Установлена", skinStoreNewer: "Локальная версия новее", skinStoreEmpty: "В магазине пока нет тем.",
|
||||
skinStoreIncompatible: "Нужна более новая версия WebSpeak", skinStoreUnavailable: "Репозиторий темы недоступен. Обновите каталог позже; установленные темы продолжат работать.",
|
||||
skinStoreChecksum: "Контрольная сумма пакета не совпадает с каталогом. Обновите каталог и повторите попытку.", skinStoreMismatch: "Версия пакета или минимальная версия WebSpeak не совпадает с каталогом.",
|
||||
skinStoreInvalid: "Ошибка проверки метаданных или пакета. Тема не установлена.", skinStoreChanged: "Каталог или установленная тема изменились. Обновите данные и повторите попытку.",
|
||||
skinStoreConfirm: "Заменить установленную тему этого экземпляра версией из магазина?", skinStoreSuccess: "Тема установлена. Управление доступно в разделе «Темы экземпляра».",
|
||||
skinStorePermissionNote: "Установка не меняет тему по умолчанию и не выдаёт разрешения за посетителей. Обновления сохраняют состояние включения темы.",
|
||||
@@ -44,6 +48,7 @@ const ja = {
|
||||
skinStoreSource: "配布インデックス", skinStoreRefresh: "ストアを更新", skinStoreRepository: "リポジトリを開く", skinStoreInstall: "インストール", skinStoreUpdate: "更新",
|
||||
skinStoreInstalling: "ダウンロード・検証中…", skinStoreInstalled: "インストール済み", skinStoreNewer: "ローカルのバージョンが新しい", skinStoreEmpty: "公開されているスキンはまだありません。",
|
||||
skinStoreIncompatible: "新しい WebSpeak が必要です", skinStoreUnavailable: "リポジトリに接続できません。後で再読み込みしてください。既存のスキンには影響しません。",
|
||||
skinStoreChecksum: "パッケージのチェックサムがカタログと一致しません。更新して再試行してください。", skinStoreMismatch: "パッケージのバージョンまたは最低 WebSpeak バージョンがカタログと一致しません。",
|
||||
skinStoreInvalid: "メタデータまたはパッケージの検証に失敗しました。スキンはインストールされていません。", skinStoreChanged: "ストアまたは既存のスキンが変更されました。更新して再試行してください。",
|
||||
skinStoreConfirm: "このインスタンスの既存のスキンをストア版に置き換えますか?", skinStoreSuccess: "インストールしました。「インスタンスのスキン」で管理できます。",
|
||||
skinStorePermissionNote: "デフォルトスキンと訪問者の権限承認は変更しません。更新時も有効・無効の設定を維持します。",
|
||||
|
||||
Reference in new issue
Block a user