feat: expand standalone workbench panels
这个提交存在于:
父节点
92a5a8c8f1
当前提交
e7ea442374
共有 14 个文件被更改,包括 536 次插入 和 89 次删除
|
|
@ -6,9 +6,26 @@ export const endpoints = {
|
|||
profiles: "profiles",
|
||||
quickProfileDraft: "profiles/quick-draft",
|
||||
jobs: "jobs",
|
||||
jobCancel: (taskId: string) => `jobs/${taskId}/cancel`,
|
||||
jobRetry: (taskId: string) => `jobs/${taskId}/retry`,
|
||||
jobDeadLetterRetry: "jobs/dead-letter/retry",
|
||||
jobDeadLetterMoveFailed: "jobs/dead-letter/move-failed",
|
||||
settingsSchema: "settings/schema",
|
||||
settingsCurrent: "settings/current",
|
||||
settingsReload: "settings/reload",
|
||||
settingsExport: "settings/export",
|
||||
storageStatus: "storage/status",
|
||||
mediaSign: "media/sign",
|
||||
materialCategories: "material-categories",
|
||||
materials: "materials",
|
||||
material: (materialId: string) => `materials/${materialId}`,
|
||||
materialRecognize: (materialId: string) => `materials/${materialId}/recognize`,
|
||||
materialConfirm: (materialId: string) => `materials/${materialId}/confirm`,
|
||||
wardrobe: (profileId: string) => `profiles/${profileId}/wardrobe`,
|
||||
wardrobeMatch: (profileId: string) => `profiles/${profileId}/wardrobe/match`,
|
||||
apiDiscoveryDialects: "api-discovery/dialects",
|
||||
apiDiscoveryProbeModel: "api-discovery/probe-model",
|
||||
apiDiscoveryCapabilities: "api-discovery/capabilities",
|
||||
apiDiscoveryManualOverride: "api-discovery/manual-override",
|
||||
webManifest: "web/manifest",
|
||||
} as const
|
||||
|
|
|
|||
|
|
@ -0,0 +1,17 @@
|
|||
export interface ApiDialect {
|
||||
dialect: string
|
||||
label: string
|
||||
capabilities: string[]
|
||||
}
|
||||
|
||||
export interface CapabilityProfile {
|
||||
capability_profile_id: string
|
||||
provider_id: string
|
||||
model_id: string
|
||||
dialect: string
|
||||
status: "confirmed_supported" | "confirmed_unsupported" | "unconfirmed" | string
|
||||
capabilities: Record<string, unknown>
|
||||
probe_result: Record<string, unknown>
|
||||
created_at?: string
|
||||
updated_at?: string
|
||||
}
|
||||
|
|
@ -0,0 +1,32 @@
|
|||
export interface MaterialCategory {
|
||||
category_id: string
|
||||
name: string
|
||||
parent_id?: string | null
|
||||
category_type: string
|
||||
sort_order: number
|
||||
metadata: Record<string, unknown>
|
||||
created_at: string
|
||||
updated_at: string
|
||||
}
|
||||
|
||||
export interface Material {
|
||||
material_id: string
|
||||
category_id?: string | null
|
||||
display_name: string
|
||||
image_uri?: string | null
|
||||
thumbnail_uri?: string | null
|
||||
prompt?: string | null
|
||||
negative_prompt?: string | null
|
||||
tags: string[]
|
||||
recognition_status: string
|
||||
metadata: Record<string, unknown>
|
||||
created_at: string
|
||||
updated_at: string
|
||||
}
|
||||
|
||||
export interface MaterialListResult {
|
||||
items: Material[]
|
||||
total: number
|
||||
page: number
|
||||
page_size: number
|
||||
}
|
||||
|
|
@ -17,3 +17,13 @@ export interface CurrentSettings {
|
|||
config_path: string
|
||||
config: Record<string, unknown>
|
||||
}
|
||||
|
||||
export interface ReloadSettingsResult {
|
||||
reloaded: boolean
|
||||
config: Record<string, unknown>
|
||||
}
|
||||
|
||||
export interface ExportSettingsResult {
|
||||
redacted: boolean
|
||||
config: Record<string, unknown>
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,22 @@
|
|||
export interface WardrobeItem {
|
||||
wardrobe_item_id: string
|
||||
profile_id: string
|
||||
material_id: string
|
||||
wardrobe_category: string
|
||||
tags: string[]
|
||||
season?: string | null
|
||||
style?: string | null
|
||||
is_favorite: boolean
|
||||
usage_count: number
|
||||
last_used_at?: string | null
|
||||
created_at: string
|
||||
updated_at: string
|
||||
}
|
||||
|
||||
export interface WardrobeMatchResult {
|
||||
profile_id?: string
|
||||
items?: WardrobeItem[]
|
||||
matched_items?: WardrobeItem[]
|
||||
selected?: WardrobeItem | null
|
||||
[key: string]: unknown
|
||||
}
|
||||
|
|
@ -1,15 +1,23 @@
|
|||
<script setup lang="ts">
|
||||
import { computed, onMounted, ref } from "vue"
|
||||
import { endpoints } from "../../shared/api/endpoints"
|
||||
import { getJson } from "../../shared/api/client"
|
||||
import { getJson, postJson } from "../../shared/api/client"
|
||||
import type { UiBootstrap } from "../../shared/types/bootstrap"
|
||||
import type { DashboardSummary } from "../../shared/types/dashboard"
|
||||
import type { ApiDialect, CapabilityProfile } from "../../shared/types/discovery"
|
||||
import type { JobListResult } from "../../shared/types/job"
|
||||
import type { MaterialCategory, MaterialListResult } from "../../shared/types/material"
|
||||
import type { ProfileListResult } from "../../shared/types/profile"
|
||||
import type { CurrentSettings, SettingsSchema } from "../../shared/types/settings"
|
||||
import type {
|
||||
CurrentSettings,
|
||||
ExportSettingsResult,
|
||||
ReloadSettingsResult,
|
||||
SettingsSchema,
|
||||
} from "../../shared/types/settings"
|
||||
import type { StorageStatus } from "../../shared/types/storage"
|
||||
import type { WardrobeItem, WardrobeMatchResult } from "../../shared/types/wardrobe"
|
||||
|
||||
type ViewKey = "dashboard" | "profiles" | "jobs" | "settings"
|
||||
type ViewKey = "dashboard" | "profiles" | "materials" | "wardrobe" | "jobs" | "discovery" | "settings"
|
||||
|
||||
const activeView = ref<ViewKey>("dashboard")
|
||||
const bootstrap = ref<UiBootstrap | null>(null)
|
||||
|
|
@ -19,13 +27,38 @@ const jobs = ref<JobListResult | null>(null)
|
|||
const settingsSchema = ref<SettingsSchema | null>(null)
|
||||
const currentSettings = ref<CurrentSettings | null>(null)
|
||||
const storage = ref<StorageStatus | null>(null)
|
||||
const materialCategories = ref<MaterialCategory[]>([])
|
||||
const materials = ref<MaterialListResult | null>(null)
|
||||
const wardrobe = ref<WardrobeItem[]>([])
|
||||
const dialects = ref<ApiDialect[]>([])
|
||||
const capabilities = ref<CapabilityProfile[]>([])
|
||||
const wardrobeMatch = ref<WardrobeMatchResult | null>(null)
|
||||
const lastOperation = ref("")
|
||||
const loading = ref(true)
|
||||
const busy = ref("")
|
||||
const error = ref("")
|
||||
|
||||
const selectedProfileId = computed(() => profiles.value?.items[0]?.profile_id ?? "")
|
||||
const selectedProfileName = computed(() => profiles.value?.items[0]?.name ?? "未选择角色")
|
||||
const queueTotal = computed(() => {
|
||||
const queue = dashboard.value?.queue
|
||||
return queue ? queue.pending + queue.running + queue.failed + queue.dead_letter : 0
|
||||
})
|
||||
const pendingRecognition = computed(
|
||||
() => materials.value?.items.filter((item) => item.recognition_status !== "confirmed").length ?? 0,
|
||||
)
|
||||
const activeTitle = computed(() => {
|
||||
const titles: Record<ViewKey, string> = {
|
||||
dashboard: "运行概览",
|
||||
profiles: "角色",
|
||||
materials: "素材库",
|
||||
wardrobe: "角色衣橱",
|
||||
jobs: "任务队列",
|
||||
discovery: "能力探测",
|
||||
settings: "设置",
|
||||
}
|
||||
return titles[activeView.value]
|
||||
})
|
||||
|
||||
onMounted(load)
|
||||
|
||||
|
|
@ -33,16 +66,31 @@ async function load() {
|
|||
loading.value = true
|
||||
error.value = ""
|
||||
try {
|
||||
const [bootstrapData, dashboardData, profileData, jobData, schemaData, settingsData, storageData] =
|
||||
await Promise.all([
|
||||
getJson<UiBootstrap>(endpoints.uiBootstrap),
|
||||
getJson<DashboardSummary>(endpoints.dashboardSummary),
|
||||
getJson<ProfileListResult>(endpoints.profiles, { page: 1, page_size: 20 }),
|
||||
getJson<JobListResult>(endpoints.jobs, { page: 1, page_size: 20 }),
|
||||
getJson<SettingsSchema>(endpoints.settingsSchema),
|
||||
getJson<CurrentSettings>(endpoints.settingsCurrent),
|
||||
getJson<StorageStatus>(endpoints.storageStatus),
|
||||
])
|
||||
const [
|
||||
bootstrapData,
|
||||
dashboardData,
|
||||
profileData,
|
||||
jobData,
|
||||
schemaData,
|
||||
settingsData,
|
||||
storageData,
|
||||
categoryData,
|
||||
materialData,
|
||||
dialectData,
|
||||
capabilityData,
|
||||
] = await Promise.all([
|
||||
getJson<UiBootstrap>(endpoints.uiBootstrap),
|
||||
getJson<DashboardSummary>(endpoints.dashboardSummary),
|
||||
getJson<ProfileListResult>(endpoints.profiles, { page: 1, page_size: 20 }),
|
||||
getJson<JobListResult>(endpoints.jobs, { page: 1, page_size: 20 }),
|
||||
getJson<SettingsSchema>(endpoints.settingsSchema),
|
||||
getJson<CurrentSettings>(endpoints.settingsCurrent),
|
||||
getJson<StorageStatus>(endpoints.storageStatus),
|
||||
getJson<MaterialCategory[]>(endpoints.materialCategories),
|
||||
getJson<MaterialListResult>(endpoints.materials, { page: 1, page_size: 24 }),
|
||||
getJson<ApiDialect[]>(endpoints.apiDiscoveryDialects),
|
||||
getJson<CapabilityProfile[]>(endpoints.apiDiscoveryCapabilities),
|
||||
])
|
||||
bootstrap.value = bootstrapData
|
||||
dashboard.value = dashboardData
|
||||
profiles.value = profileData
|
||||
|
|
@ -50,6 +98,11 @@ async function load() {
|
|||
settingsSchema.value = schemaData
|
||||
currentSettings.value = settingsData
|
||||
storage.value = storageData
|
||||
materialCategories.value = categoryData
|
||||
materials.value = materialData
|
||||
dialects.value = dialectData
|
||||
capabilities.value = capabilityData
|
||||
await loadWardrobe(profileData.items[0]?.profile_id)
|
||||
} catch (err) {
|
||||
error.value = err instanceof Error ? err.message : "加载失败"
|
||||
} finally {
|
||||
|
|
@ -57,12 +110,102 @@ async function load() {
|
|||
}
|
||||
}
|
||||
|
||||
async function loadWardrobe(profileId?: string) {
|
||||
if (!profileId) {
|
||||
wardrobe.value = []
|
||||
return
|
||||
}
|
||||
wardrobe.value = await getJson<WardrobeItem[]>(endpoints.wardrobe(profileId))
|
||||
}
|
||||
|
||||
async function runOperation(label: string, action: () => Promise<unknown>, refresh = true) {
|
||||
busy.value = label
|
||||
error.value = ""
|
||||
try {
|
||||
const result = await action()
|
||||
lastOperation.value = `${label}完成`
|
||||
if (label === "导出设置") {
|
||||
lastOperation.value = `导出设置完成,配置已脱敏:${Boolean((result as ExportSettingsResult).redacted)}`
|
||||
}
|
||||
if (refresh) {
|
||||
await load()
|
||||
}
|
||||
} catch (err) {
|
||||
error.value = err instanceof Error ? err.message : `${label}失败`
|
||||
} finally {
|
||||
busy.value = ""
|
||||
}
|
||||
}
|
||||
|
||||
function retryJob(taskId: string) {
|
||||
return runOperation("重试任务", () => postJson(endpoints.jobRetry(taskId)))
|
||||
}
|
||||
|
||||
function cancelJob(taskId: string) {
|
||||
return runOperation("取消任务", () => postJson(endpoints.jobCancel(taskId)))
|
||||
}
|
||||
|
||||
function moveFailedJobs() {
|
||||
return runOperation("转入死信", () => postJson(endpoints.jobDeadLetterMoveFailed, { limit: 20 }))
|
||||
}
|
||||
|
||||
function retryDeadLetters() {
|
||||
return runOperation("重试死信", () => postJson(endpoints.jobDeadLetterRetry, { limit: 20 }))
|
||||
}
|
||||
|
||||
function safeProbeModel() {
|
||||
const dialect = dialects.value[0]?.dialect ?? "unknown"
|
||||
return runOperation("安全探测", () =>
|
||||
postJson<CapabilityProfile>(endpoints.apiDiscoveryProbeModel, {
|
||||
provider_id: "local-preview",
|
||||
model_id: "metadata-only",
|
||||
dialect,
|
||||
capabilities: { supports: ["text_to_image"] },
|
||||
}),
|
||||
)
|
||||
}
|
||||
|
||||
function matchWardrobe() {
|
||||
const profileId = selectedProfileId.value
|
||||
if (!profileId) return Promise.resolve()
|
||||
return runOperation(
|
||||
"衣橱匹配",
|
||||
async () => {
|
||||
wardrobeMatch.value = await postJson<WardrobeMatchResult>(endpoints.wardrobeMatch(profileId), {
|
||||
tags: ["daily"],
|
||||
})
|
||||
return wardrobeMatch.value
|
||||
},
|
||||
false,
|
||||
)
|
||||
}
|
||||
|
||||
function reloadSettings() {
|
||||
return runOperation(
|
||||
"重载设置",
|
||||
async () => {
|
||||
const result = await postJson<ReloadSettingsResult>(endpoints.settingsReload)
|
||||
currentSettings.value = { config_path: currentSettings.value?.config_path ?? "***PATH***", config: result.config }
|
||||
return result
|
||||
},
|
||||
false,
|
||||
)
|
||||
}
|
||||
|
||||
function exportSettings() {
|
||||
return runOperation("导出设置", () => getJson<ExportSettingsResult>(endpoints.settingsExport), false)
|
||||
}
|
||||
|
||||
function formatBytes(value = 0) {
|
||||
if (value < 1024) return `${value} B`
|
||||
if (value < 1024 * 1024) return `${(value / 1024).toFixed(1)} KB`
|
||||
if (value < 1024 * 1024 * 1024) return `${(value / 1024 / 1024).toFixed(1)} MB`
|
||||
return `${(value / 1024 / 1024 / 1024).toFixed(1)} GB`
|
||||
}
|
||||
|
||||
function storageRootBytes(uriPrefix: string) {
|
||||
return storage.value?.roots.find((root) => root.uri_prefix === uriPrefix)?.bytes ?? 0
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
|
@ -79,9 +222,18 @@ function formatBytes(value = 0) {
|
|||
<button type="button" :class="{ active: activeView === 'profiles' }" @click="activeView = 'profiles'">
|
||||
角色
|
||||
</button>
|
||||
<button type="button" :class="{ active: activeView === 'materials' }" @click="activeView = 'materials'">
|
||||
素材
|
||||
</button>
|
||||
<button type="button" :class="{ active: activeView === 'wardrobe' }" @click="activeView = 'wardrobe'">
|
||||
衣橱
|
||||
</button>
|
||||
<button type="button" :class="{ active: activeView === 'jobs' }" @click="activeView = 'jobs'">
|
||||
队列
|
||||
</button>
|
||||
<button type="button" :class="{ active: activeView === 'discovery' }" @click="activeView = 'discovery'">
|
||||
探测
|
||||
</button>
|
||||
<button type="button" :class="{ active: activeView === 'settings' }" @click="activeView = 'settings'">
|
||||
设置
|
||||
</button>
|
||||
|
|
@ -91,14 +243,18 @@ function formatBytes(value = 0) {
|
|||
<section class="workspace">
|
||||
<header class="topbar">
|
||||
<div>
|
||||
<h1>{{ activeView === "dashboard" ? "ImageStudio" : "" }}</h1>
|
||||
<p>{{ dashboard?.plugin_status ?? "loading" }}</p>
|
||||
<h1>{{ activeTitle }}</h1>
|
||||
<p>{{ dashboard?.plugin_status ?? "loading" }} · {{ lastOperation || "等待操作" }}</p>
|
||||
</div>
|
||||
<div class="actions">
|
||||
<button type="button" :disabled="Boolean(busy)" @click="load">
|
||||
{{ busy || "刷新" }}
|
||||
</button>
|
||||
</div>
|
||||
<button type="button" @click="load">刷新</button>
|
||||
</header>
|
||||
|
||||
<section v-if="error" class="notice">{{ error }}</section>
|
||||
<section v-else-if="loading" class="notice">加载中</section>
|
||||
<section v-if="error" class="notice error">{{ error }}</section>
|
||||
<section v-else-if="loading" class="notice">加载中...</section>
|
||||
|
||||
<template v-else>
|
||||
<section v-if="activeView === 'dashboard'" class="dashboard-grid">
|
||||
|
|
@ -111,48 +267,154 @@ function formatBytes(value = 0) {
|
|||
<strong>{{ queueTotal }}</strong>
|
||||
</article>
|
||||
<article>
|
||||
<span>存储</span>
|
||||
<strong>{{ formatBytes(storage?.total_bytes ?? dashboard?.storage.total_bytes) }}</strong>
|
||||
<span>素材</span>
|
||||
<strong>{{ materials?.total ?? 0 }}</strong>
|
||||
</article>
|
||||
<article>
|
||||
<span>图片</span>
|
||||
<strong>{{ dashboard?.recent_images.length ?? 0 }}</strong>
|
||||
<span>存储</span>
|
||||
<strong>{{ formatBytes(storage?.total_bytes ?? dashboard?.storage.total_bytes) }}</strong>
|
||||
</article>
|
||||
</section>
|
||||
|
||||
<section v-if="activeView === 'profiles'" class="list-view">
|
||||
<header>
|
||||
<h2>角色</h2>
|
||||
<h2>角色列表</h2>
|
||||
<span>{{ profiles?.total ?? 0 }}</span>
|
||||
</header>
|
||||
<ul>
|
||||
<li v-for="profile in profiles?.items ?? []" :key="profile.profile_id">
|
||||
<strong>{{ profile.name }}</strong>
|
||||
<span>{{ profile.status }}</span>
|
||||
<div>
|
||||
<strong>{{ profile.name }}</strong>
|
||||
<small>{{ profile.profile_id }}</small>
|
||||
</div>
|
||||
<span class="badge">{{ profile.status }}</span>
|
||||
</li>
|
||||
<li v-if="!profiles?.items.length" class="empty">暂无角色</li>
|
||||
</ul>
|
||||
</section>
|
||||
|
||||
<section v-if="activeView === 'materials'" class="split-view">
|
||||
<div class="list-view">
|
||||
<header>
|
||||
<h2>素材分类</h2>
|
||||
<span>{{ materialCategories.length }}</span>
|
||||
</header>
|
||||
<ul>
|
||||
<li v-for="category in materialCategories" :key="category.category_id">
|
||||
<div>
|
||||
<strong>{{ category.name }}</strong>
|
||||
<small>{{ category.category_type }}</small>
|
||||
</div>
|
||||
<span>{{ category.sort_order }}</span>
|
||||
</li>
|
||||
<li v-if="!materialCategories.length" class="empty">暂无分类</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="list-view">
|
||||
<header>
|
||||
<h2>素材条目</h2>
|
||||
<span>{{ pendingRecognition }} 待确认</span>
|
||||
</header>
|
||||
<ul>
|
||||
<li v-for="material in materials?.items ?? []" :key="material.material_id">
|
||||
<div>
|
||||
<strong>{{ material.display_name }}</strong>
|
||||
<small>{{ material.image_uri ?? "未绑定图片" }}</small>
|
||||
</div>
|
||||
<span class="badge">{{ material.recognition_status }}</span>
|
||||
</li>
|
||||
<li v-if="!materials?.items.length" class="empty">暂无素材</li>
|
||||
</ul>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section v-if="activeView === 'wardrobe'" class="list-view">
|
||||
<header>
|
||||
<h2>{{ selectedProfileName }}</h2>
|
||||
<button type="button" :disabled="!selectedProfileId || Boolean(busy)" @click="matchWardrobe">
|
||||
匹配
|
||||
</button>
|
||||
</header>
|
||||
<ul>
|
||||
<li v-for="item in wardrobe" :key="item.wardrobe_item_id">
|
||||
<div>
|
||||
<strong>{{ item.wardrobe_category }}</strong>
|
||||
<small>{{ item.material_id }} · {{ item.tags.join(", ") || "无标签" }}</small>
|
||||
</div>
|
||||
<span>{{ item.usage_count }}</span>
|
||||
</li>
|
||||
<li v-if="!wardrobe.length" class="empty">暂无衣橱条目</li>
|
||||
</ul>
|
||||
<pre v-if="wardrobeMatch">{{ JSON.stringify(wardrobeMatch, null, 2) }}</pre>
|
||||
</section>
|
||||
|
||||
<section v-if="activeView === 'jobs'" class="list-view">
|
||||
<header>
|
||||
<h2>队列</h2>
|
||||
<span>{{ jobs?.total ?? 0 }}</span>
|
||||
<h2>任务队列</h2>
|
||||
<div class="inline-actions">
|
||||
<button type="button" :disabled="Boolean(busy)" @click="moveFailedJobs">失败转死信</button>
|
||||
<button type="button" :disabled="Boolean(busy)" @click="retryDeadLetters">重试死信</button>
|
||||
</div>
|
||||
</header>
|
||||
<ul>
|
||||
<li v-for="job in jobs?.items ?? []" :key="job.task_id">
|
||||
<strong>{{ job.task_id }}</strong>
|
||||
<span>{{ job.status }}</span>
|
||||
<div>
|
||||
<strong>{{ job.task_id }}</strong>
|
||||
<small>{{ job.task_type }} · {{ job.progress }}%</small>
|
||||
</div>
|
||||
<div class="inline-actions">
|
||||
<span class="badge">{{ job.status }}</span>
|
||||
<button v-if="job.status === 'failed'" type="button" @click="retryJob(job.task_id)">重试</button>
|
||||
<button v-if="job.status === 'pending'" type="button" @click="cancelJob(job.task_id)">取消</button>
|
||||
</div>
|
||||
</li>
|
||||
<li v-if="!jobs?.items.length" class="empty">暂无任务</li>
|
||||
</ul>
|
||||
</section>
|
||||
|
||||
<section v-if="activeView === 'discovery'" class="split-view">
|
||||
<div class="list-view">
|
||||
<header>
|
||||
<h2>协议方言</h2>
|
||||
<button type="button" :disabled="Boolean(busy)" @click="safeProbeModel">安全探测</button>
|
||||
</header>
|
||||
<ul>
|
||||
<li v-for="dialect in dialects" :key="dialect.dialect">
|
||||
<div>
|
||||
<strong>{{ dialect.label }}</strong>
|
||||
<small>{{ dialect.capabilities.join(", ") || "待确认" }}</small>
|
||||
</div>
|
||||
<span>{{ dialect.dialect }}</span>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="list-view">
|
||||
<header>
|
||||
<h2>能力档案</h2>
|
||||
<span>{{ capabilities.length }}</span>
|
||||
</header>
|
||||
<ul>
|
||||
<li v-for="profile in capabilities" :key="profile.capability_profile_id">
|
||||
<div>
|
||||
<strong>{{ profile.provider_id }} / {{ profile.model_id }}</strong>
|
||||
<small>{{ profile.dialect }}</small>
|
||||
</div>
|
||||
<span class="badge">{{ profile.status }}</span>
|
||||
</li>
|
||||
<li v-if="!capabilities.length" class="empty">暂无能力档案</li>
|
||||
</ul>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section v-if="activeView === 'settings'" class="settings-view">
|
||||
<div class="toolbar">
|
||||
<button type="button" :disabled="Boolean(busy)" @click="reloadSettings">重载</button>
|
||||
<button type="button" :disabled="Boolean(busy)" @click="exportSettings">导出脱敏配置</button>
|
||||
</div>
|
||||
<div class="settings-sections">
|
||||
<article v-for="section in settingsSchema?.sections ?? []" :key="section.key">
|
||||
<h2>{{ section.title }}</h2>
|
||||
<span>{{ section.fields.length }}</span>
|
||||
<span>{{ section.fields.length }} 项</span>
|
||||
</article>
|
||||
</div>
|
||||
<pre>{{ JSON.stringify(currentSettings?.config ?? {}, null, 2) }}</pre>
|
||||
|
|
@ -175,6 +437,21 @@ function formatBytes(value = 0) {
|
|||
<dt>Failed</dt>
|
||||
<dd>{{ dashboard?.queue.failed ?? 0 }}</dd>
|
||||
</div>
|
||||
<div>
|
||||
<dt>Dead</dt>
|
||||
<dd>{{ dashboard?.queue.dead_letter ?? 0 }}</dd>
|
||||
</div>
|
||||
</dl>
|
||||
<h2>存储</h2>
|
||||
<dl>
|
||||
<div>
|
||||
<dt>Images</dt>
|
||||
<dd>{{ formatBytes(storageRootBytes("storage://images/")) }}</dd>
|
||||
</div>
|
||||
<div>
|
||||
<dt>Materials</dt>
|
||||
<dd>{{ formatBytes(storageRootBytes("storage://materials/")) }}</dd>
|
||||
</div>
|
||||
</dl>
|
||||
</aside>
|
||||
</main>
|
||||
|
|
@ -220,7 +497,8 @@ function formatBytes(value = 0) {
|
|||
.brand span,
|
||||
p,
|
||||
dt,
|
||||
.empty {
|
||||
.empty,
|
||||
small {
|
||||
color: #667085;
|
||||
}
|
||||
|
||||
|
|
@ -231,16 +509,24 @@ nav {
|
|||
|
||||
button {
|
||||
min-height: 36px;
|
||||
border: 1px solid transparent;
|
||||
border: 1px solid #c7d0da;
|
||||
border-radius: 6px;
|
||||
color: #1b2430;
|
||||
background: transparent;
|
||||
background: #ffffff;
|
||||
font: inherit;
|
||||
text-align: left;
|
||||
text-align: center;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
button:disabled {
|
||||
cursor: wait;
|
||||
opacity: 0.62;
|
||||
}
|
||||
|
||||
nav button {
|
||||
border-color: transparent;
|
||||
background: transparent;
|
||||
text-align: left;
|
||||
padding: 0 10px;
|
||||
}
|
||||
|
||||
|
|
@ -255,17 +541,31 @@ button.active {
|
|||
padding: 24px;
|
||||
}
|
||||
|
||||
.topbar {
|
||||
.topbar,
|
||||
.list-view header,
|
||||
.toolbar,
|
||||
.inline-actions {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
gap: 16px;
|
||||
gap: 12px;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.topbar button {
|
||||
.topbar,
|
||||
.list-view header {
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.actions,
|
||||
.inline-actions {
|
||||
flex-wrap: wrap;
|
||||
justify-content: flex-end;
|
||||
}
|
||||
|
||||
.topbar button,
|
||||
.toolbar button,
|
||||
.list-view header button,
|
||||
.inline-actions button {
|
||||
padding: 0 14px;
|
||||
border-color: #c7d0da;
|
||||
background: #ffffff;
|
||||
}
|
||||
|
||||
h1,
|
||||
|
|
@ -299,13 +599,27 @@ pre {
|
|||
padding: 14px;
|
||||
}
|
||||
|
||||
.dashboard-grid {
|
||||
.error {
|
||||
border-color: #f0b4b4;
|
||||
color: #8a1f1f;
|
||||
background: #fff7f7;
|
||||
}
|
||||
|
||||
.dashboard-grid,
|
||||
.split-view {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(4, minmax(130px, 1fr));
|
||||
gap: 12px;
|
||||
margin-top: 18px;
|
||||
}
|
||||
|
||||
.dashboard-grid {
|
||||
grid-template-columns: repeat(4, minmax(130px, 1fr));
|
||||
}
|
||||
|
||||
.split-view {
|
||||
grid-template-columns: repeat(2, minmax(0, 1fr));
|
||||
}
|
||||
|
||||
article {
|
||||
display: grid;
|
||||
gap: 8px;
|
||||
|
|
@ -326,13 +640,12 @@ article strong {
|
|||
margin-top: 18px;
|
||||
}
|
||||
|
||||
.list-view {
|
||||
padding: 16px;
|
||||
.split-view .list-view {
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
.list-view header {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
.list-view {
|
||||
padding: 16px;
|
||||
}
|
||||
|
||||
ul {
|
||||
|
|
@ -348,15 +661,43 @@ li {
|
|||
justify-content: space-between;
|
||||
gap: 12px;
|
||||
min-width: 0;
|
||||
padding: 10px 0;
|
||||
border-top: 1px solid #eef1f5;
|
||||
}
|
||||
|
||||
li:first-child {
|
||||
border-top: 0;
|
||||
}
|
||||
|
||||
li > div {
|
||||
display: grid;
|
||||
gap: 3px;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
li strong,
|
||||
li span {
|
||||
li span,
|
||||
li small {
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.badge {
|
||||
align-self: center;
|
||||
max-width: 180px;
|
||||
border-radius: 999px;
|
||||
padding: 4px 9px;
|
||||
color: #1f4d62;
|
||||
background: #e5f1f7;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.toolbar {
|
||||
justify-content: flex-start;
|
||||
margin: 18px 0 12px;
|
||||
}
|
||||
|
||||
.settings-sections {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(3, minmax(120px, 1fr));
|
||||
|
|
@ -369,12 +710,13 @@ pre {
|
|||
margin: 12px 0 0;
|
||||
padding: 14px;
|
||||
font-size: 12px;
|
||||
line-height: 1.5;
|
||||
}
|
||||
|
||||
dl {
|
||||
display: grid;
|
||||
gap: 12px;
|
||||
margin-top: 14px;
|
||||
margin: 14px 0 24px;
|
||||
}
|
||||
|
||||
dl div {
|
||||
|
|
@ -382,7 +724,7 @@ dl div {
|
|||
justify-content: space-between;
|
||||
}
|
||||
|
||||
@media (max-width: 1100px) {
|
||||
@media (max-width: 1160px) {
|
||||
.web-shell {
|
||||
grid-template-columns: 190px minmax(0, 1fr);
|
||||
}
|
||||
|
|
@ -392,7 +734,7 @@ dl div {
|
|||
}
|
||||
}
|
||||
|
||||
@media (max-width: 760px) {
|
||||
@media (max-width: 820px) {
|
||||
.web-shell {
|
||||
grid-template-columns: 1fr;
|
||||
}
|
||||
|
|
@ -411,8 +753,15 @@ dl div {
|
|||
}
|
||||
|
||||
.dashboard-grid,
|
||||
.split-view,
|
||||
.settings-sections {
|
||||
grid-template-columns: 1fr;
|
||||
}
|
||||
|
||||
.topbar,
|
||||
.list-view header {
|
||||
align-items: flex-start;
|
||||
flex-direction: column;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
|
|||
文件差异因一行或多行过长而隐藏
文件差异因一行或多行过长而隐藏
|
|
@ -1,3 +1,3 @@
|
|||
<script type="module" crossorigin src="/assets/index-DJoLO_ft.js"></script>
|
||||
<script type="module" crossorigin src="/assets/index-C3__Rxat.js"></script>
|
||||
<link rel="stylesheet" crossorigin href="/assets/index-KxvCyOGk.css">
|
||||
<div id="app"></div>
|
||||
|
|
|
|||
17
web/assets/index-ByLkWMta.js
普通文件
17
web/assets/index-ByLkWMta.js
普通文件
文件差异因一行或多行过长而隐藏
文件差异因一行或多行过长而隐藏
|
|
@ -1 +0,0 @@
|
|||
.web-shell[data-v-34b16aee]{box-sizing:border-box;display:grid;grid-template-columns:220px minmax(0,1fr) 260px;min-height:100vh;color:#1b2430;background:#f5f6f8;font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,sans-serif}.sidebar[data-v-34b16aee],.inspector[data-v-34b16aee]{background:#fff}.sidebar[data-v-34b16aee]{border-right:1px solid #d9e0e8;padding:20px}.inspector[data-v-34b16aee]{border-left:1px solid #d9e0e8;padding:20px}.brand[data-v-34b16aee]{display:grid;gap:4px;margin-bottom:24px}.brand strong[data-v-34b16aee]{font-size:19px}.brand span[data-v-34b16aee],p[data-v-34b16aee],dt[data-v-34b16aee],.empty[data-v-34b16aee]{color:#667085}nav[data-v-34b16aee]{display:grid;gap:6px}button[data-v-34b16aee]{min-height:36px;border:1px solid transparent;border-radius:6px;color:#1b2430;background:transparent;font:inherit;text-align:left;cursor:pointer}nav button[data-v-34b16aee]{padding:0 10px}button.active[data-v-34b16aee]{border-color:#b8d8cf;color:#164f43;background:#e5f4ef}.workspace[data-v-34b16aee]{min-width:0;padding:24px}.topbar[data-v-34b16aee]{display:flex;justify-content:space-between;gap:16px;align-items:center}.topbar button[data-v-34b16aee]{padding:0 14px;border-color:#c7d0da;background:#fff}h1[data-v-34b16aee],h2[data-v-34b16aee],p[data-v-34b16aee],dl[data-v-34b16aee],dd[data-v-34b16aee]{margin:0}h1[data-v-34b16aee]{min-height:30px;font-size:26px}h2[data-v-34b16aee]{font-size:15px}.notice[data-v-34b16aee],article[data-v-34b16aee],.list-view[data-v-34b16aee],pre[data-v-34b16aee]{border:1px solid #d9e0e8;border-radius:8px;background:#fff}.notice[data-v-34b16aee]{margin-top:18px;padding:14px}.dashboard-grid[data-v-34b16aee]{display:grid;grid-template-columns:repeat(4,minmax(130px,1fr));gap:12px;margin-top:18px}article[data-v-34b16aee]{display:grid;gap:8px;padding:16px}article span[data-v-34b16aee]{color:#667085;font-size:13px}article strong[data-v-34b16aee]{font-size:24px}.list-view[data-v-34b16aee],.settings-view[data-v-34b16aee]{margin-top:18px}.list-view[data-v-34b16aee]{padding:16px}.list-view header[data-v-34b16aee]{display:flex;justify-content:space-between}ul[data-v-34b16aee]{display:grid;gap:10px;margin:14px 0 0;padding:0;list-style:none}li[data-v-34b16aee]{display:flex;justify-content:space-between;gap:12px;min-width:0}li strong[data-v-34b16aee],li span[data-v-34b16aee]{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.settings-sections[data-v-34b16aee]{display:grid;grid-template-columns:repeat(3,minmax(120px,1fr));gap:12px}pre[data-v-34b16aee]{overflow:auto;max-height:420px;margin:12px 0 0;padding:14px;font-size:12px}dl[data-v-34b16aee]{display:grid;gap:12px;margin-top:14px}dl div[data-v-34b16aee]{display:flex;justify-content:space-between}@media(max-width:1100px){.web-shell[data-v-34b16aee]{grid-template-columns:190px minmax(0,1fr)}.inspector[data-v-34b16aee]{display:none}}@media(max-width:760px){.web-shell[data-v-34b16aee]{grid-template-columns:1fr}.sidebar[data-v-34b16aee]{border-right:0;border-bottom:1px solid #d9e0e8}nav[data-v-34b16aee]{grid-template-columns:repeat(4,minmax(0,1fr))}nav button[data-v-34b16aee]{text-align:center}.dashboard-grid[data-v-34b16aee],.settings-sections[data-v-34b16aee]{grid-template-columns:1fr}}
|
||||
|
|
@ -0,0 +1 @@
|
|||
.web-shell[data-v-b270185f]{box-sizing:border-box;display:grid;grid-template-columns:220px minmax(0,1fr) 260px;min-height:100vh;color:#1b2430;background:#f5f6f8;font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,sans-serif}.sidebar[data-v-b270185f],.inspector[data-v-b270185f]{background:#fff}.sidebar[data-v-b270185f]{border-right:1px solid #d9e0e8;padding:20px}.inspector[data-v-b270185f]{border-left:1px solid #d9e0e8;padding:20px}.brand[data-v-b270185f]{display:grid;gap:4px;margin-bottom:24px}.brand strong[data-v-b270185f]{font-size:19px}.brand span[data-v-b270185f],p[data-v-b270185f],dt[data-v-b270185f],.empty[data-v-b270185f],small[data-v-b270185f]{color:#667085}nav[data-v-b270185f]{display:grid;gap:6px}button[data-v-b270185f]{min-height:36px;border:1px solid #c7d0da;border-radius:6px;color:#1b2430;background:#fff;font:inherit;text-align:center;cursor:pointer}button[data-v-b270185f]:disabled{cursor:wait;opacity:.62}nav button[data-v-b270185f]{border-color:transparent;background:transparent;text-align:left;padding:0 10px}button.active[data-v-b270185f]{border-color:#b8d8cf;color:#164f43;background:#e5f4ef}.workspace[data-v-b270185f]{min-width:0;padding:24px}.topbar[data-v-b270185f],.list-view header[data-v-b270185f],.toolbar[data-v-b270185f],.inline-actions[data-v-b270185f]{display:flex;gap:12px;align-items:center}.topbar[data-v-b270185f],.list-view header[data-v-b270185f]{justify-content:space-between}.actions[data-v-b270185f],.inline-actions[data-v-b270185f]{flex-wrap:wrap;justify-content:flex-end}.topbar button[data-v-b270185f],.toolbar button[data-v-b270185f],.list-view header button[data-v-b270185f],.inline-actions button[data-v-b270185f]{padding:0 14px}h1[data-v-b270185f],h2[data-v-b270185f],p[data-v-b270185f],dl[data-v-b270185f],dd[data-v-b270185f]{margin:0}h1[data-v-b270185f]{min-height:30px;font-size:26px}h2[data-v-b270185f]{font-size:15px}.notice[data-v-b270185f],article[data-v-b270185f],.list-view[data-v-b270185f],pre[data-v-b270185f]{border:1px solid #d9e0e8;border-radius:8px;background:#fff}.notice[data-v-b270185f]{margin-top:18px;padding:14px}.error[data-v-b270185f]{border-color:#f0b4b4;color:#8a1f1f;background:#fff7f7}.dashboard-grid[data-v-b270185f],.split-view[data-v-b270185f]{display:grid;gap:12px;margin-top:18px}.dashboard-grid[data-v-b270185f]{grid-template-columns:repeat(4,minmax(130px,1fr))}.split-view[data-v-b270185f]{grid-template-columns:repeat(2,minmax(0,1fr))}article[data-v-b270185f]{display:grid;gap:8px;padding:16px}article span[data-v-b270185f]{color:#667085;font-size:13px}article strong[data-v-b270185f]{font-size:24px}.list-view[data-v-b270185f],.settings-view[data-v-b270185f]{margin-top:18px}.split-view .list-view[data-v-b270185f]{margin-top:0}.list-view[data-v-b270185f]{padding:16px}ul[data-v-b270185f]{display:grid;gap:10px;margin:14px 0 0;padding:0;list-style:none}li[data-v-b270185f]{display:flex;justify-content:space-between;gap:12px;min-width:0;padding:10px 0;border-top:1px solid #eef1f5}li[data-v-b270185f]:first-child{border-top:0}li>div[data-v-b270185f]{display:grid;gap:3px;min-width:0}li strong[data-v-b270185f],li span[data-v-b270185f],li small[data-v-b270185f]{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.badge[data-v-b270185f]{align-self:center;max-width:180px;border-radius:999px;padding:4px 9px;color:#1f4d62;background:#e5f1f7;font-size:12px}.toolbar[data-v-b270185f]{justify-content:flex-start;margin:18px 0 12px}.settings-sections[data-v-b270185f]{display:grid;grid-template-columns:repeat(3,minmax(120px,1fr));gap:12px}pre[data-v-b270185f]{overflow:auto;max-height:420px;margin:12px 0 0;padding:14px;font-size:12px;line-height:1.5}dl[data-v-b270185f]{display:grid;gap:12px;margin:14px 0 24px}dl div[data-v-b270185f]{display:flex;justify-content:space-between}@media(max-width:1160px){.web-shell[data-v-b270185f]{grid-template-columns:190px minmax(0,1fr)}.inspector[data-v-b270185f]{display:none}}@media(max-width:820px){.web-shell[data-v-b270185f]{grid-template-columns:1fr}.sidebar[data-v-b270185f]{border-right:0;border-bottom:1px solid #d9e0e8}nav[data-v-b270185f]{grid-template-columns:repeat(4,minmax(0,1fr))}nav button[data-v-b270185f]{text-align:center}.dashboard-grid[data-v-b270185f],.split-view[data-v-b270185f],.settings-sections[data-v-b270185f]{grid-template-columns:1fr}.topbar[data-v-b270185f],.list-view header[data-v-b270185f]{align-items:flex-start;flex-direction:column}}
|
||||
|
|
@ -1,3 +1,3 @@
|
|||
<script type="module" crossorigin src="/api/v1/plugins/extensions/astrbot_plugin_imagestudio/web/assets/index-C821iZVM.js"></script>
|
||||
<link rel="stylesheet" crossorigin href="/api/v1/plugins/extensions/astrbot_plugin_imagestudio/web/assets/index-DlB5CKB0.css">
|
||||
<script type="module" crossorigin src="/api/v1/plugins/extensions/astrbot_plugin_imagestudio/web/assets/index-ByLkWMta.js"></script>
|
||||
<link rel="stylesheet" crossorigin href="/api/v1/plugins/extensions/astrbot_plugin_imagestudio/web/assets/index-Ds4SgEOP.css">
|
||||
<div id="app"></div>
|
||||
|
|
|
|||
正在加载…
添加表格
在新工单中引用