feat: add job filtering and detail panel
这个提交存在于:
父节点
7e63fa31bf
当前提交
72caaa9390
共有 10 个文件被更改,包括 105 次插入 和 28 次删除
|
|
@ -21,6 +21,7 @@ export const endpoints = {
|
||||||
imageUnselect: (imageId: string) => `images/${imageId}/unselect`,
|
imageUnselect: (imageId: string) => `images/${imageId}/unselect`,
|
||||||
imageArchive: (imageId: string) => `images/${imageId}/archive`,
|
imageArchive: (imageId: string) => `images/${imageId}/archive`,
|
||||||
jobs: "jobs",
|
jobs: "jobs",
|
||||||
|
job: (taskId: string) => `jobs/${taskId}`,
|
||||||
jobCancel: (taskId: string) => `jobs/${taskId}/cancel`,
|
jobCancel: (taskId: string) => `jobs/${taskId}/cancel`,
|
||||||
jobRetry: (taskId: string) => `jobs/${taskId}/retry`,
|
jobRetry: (taskId: string) => `jobs/${taskId}/retry`,
|
||||||
jobDeadLetterRetry: "jobs/dead-letter/retry",
|
jobDeadLetterRetry: "jobs/dead-letter/retry",
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,11 @@ export interface GenerationJob {
|
||||||
status: string
|
status: string
|
||||||
model_route?: string | null
|
model_route?: string | null
|
||||||
progress: number
|
progress: number
|
||||||
|
idempotency_key?: string | null
|
||||||
|
request?: Record<string, unknown>
|
||||||
|
result?: Record<string, unknown>
|
||||||
error_message?: string | null
|
error_message?: string | null
|
||||||
|
metadata?: Record<string, unknown>
|
||||||
created_at: string
|
created_at: string
|
||||||
updated_at: string
|
updated_at: string
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@ import type { DashboardSummary } from "../../shared/types/dashboard"
|
||||||
import type { ApiDialect, CapabilityProfile, RenderPlanValidationResult } from "../../shared/types/discovery"
|
import type { ApiDialect, CapabilityProfile, RenderPlanValidationResult } from "../../shared/types/discovery"
|
||||||
import type { GenerationImage, NodeGenerateResult } from "../../shared/types/image"
|
import type { GenerationImage, NodeGenerateResult } from "../../shared/types/image"
|
||||||
import type { DailyOutfitResult } from "../../shared/types/integration"
|
import type { DailyOutfitResult } from "../../shared/types/integration"
|
||||||
import type { JobListResult } from "../../shared/types/job"
|
import type { GenerationJob, JobListResult } from "../../shared/types/job"
|
||||||
import type { LogBundle } from "../../shared/types/logs"
|
import type { LogBundle } from "../../shared/types/logs"
|
||||||
import type { Material, MaterialCategory, MaterialListResult } from "../../shared/types/material"
|
import type { Material, MaterialCategory, MaterialListResult } from "../../shared/types/material"
|
||||||
import type { CharacterProfile, ProfileListResult, QuickProfileDraftResult } from "../../shared/types/profile"
|
import type { CharacterProfile, ProfileListResult, QuickProfileDraftResult } from "../../shared/types/profile"
|
||||||
|
|
@ -127,6 +127,12 @@ const text = {
|
||||||
retryDead: "\u91cd\u8bd5\u6b7b\u4fe1",
|
retryDead: "\u91cd\u8bd5\u6b7b\u4fe1",
|
||||||
retry: "\u91cd\u8bd5",
|
retry: "\u91cd\u8bd5",
|
||||||
cancel: "\u53d6\u6d88",
|
cancel: "\u53d6\u6d88",
|
||||||
|
filter: "\u7b5b\u9009",
|
||||||
|
detail: "\u8be6\u60c5",
|
||||||
|
jobDetail: "\u4efb\u52a1\u8be6\u60c5",
|
||||||
|
allStatuses: "\u5168\u90e8\u72b6\u6001",
|
||||||
|
allProfiles: "\u5168\u90e8\u89d2\u8272",
|
||||||
|
allWorkflows: "\u5168\u90e8\u5de5\u4f5c\u6d41",
|
||||||
emptyJobs: "\u6682\u65e0\u4efb\u52a1",
|
emptyJobs: "\u6682\u65e0\u4efb\u52a1",
|
||||||
dialects: "\u534f\u8bae\u65b9\u8a00",
|
dialects: "\u534f\u8bae\u65b9\u8a00",
|
||||||
safeProbe: "\u5b89\u5168\u63a2\u6d4b",
|
safeProbe: "\u5b89\u5168\u63a2\u6d4b",
|
||||||
|
|
@ -191,6 +197,7 @@ const selectedNodeId = ref("")
|
||||||
const nodeImages = ref<GenerationImage[]>([])
|
const nodeImages = ref<GenerationImage[]>([])
|
||||||
const nodeGenerateResult = ref<NodeGenerateResult | null>(null)
|
const nodeGenerateResult = ref<NodeGenerateResult | null>(null)
|
||||||
const jobs = ref<JobListResult | null>(null)
|
const jobs = ref<JobListResult | null>(null)
|
||||||
|
const selectedJob = ref<GenerationJob | null>(null)
|
||||||
const settingsSchema = ref<SettingsSchema | null>(null)
|
const settingsSchema = ref<SettingsSchema | null>(null)
|
||||||
const currentSettings = ref<CurrentSettings | null>(null)
|
const currentSettings = ref<CurrentSettings | null>(null)
|
||||||
const storage = ref<StorageStatus | null>(null)
|
const storage = ref<StorageStatus | null>(null)
|
||||||
|
|
@ -226,6 +233,11 @@ const nodeGenerateDraft = ref({
|
||||||
prompt: "",
|
prompt: "",
|
||||||
negative_prompt: "",
|
negative_prompt: "",
|
||||||
})
|
})
|
||||||
|
const jobFilters = ref({
|
||||||
|
status: "",
|
||||||
|
profile_id: "",
|
||||||
|
workflow_id: "",
|
||||||
|
})
|
||||||
const materialDraft = ref({
|
const materialDraft = ref({
|
||||||
display_name: "",
|
display_name: "",
|
||||||
image_uri: "",
|
image_uri: "",
|
||||||
|
|
@ -270,6 +282,7 @@ const confirmedMaterials = computed(() =>
|
||||||
(materials.value?.items ?? []).filter((item) => item.recognition_status === "confirmed"),
|
(materials.value?.items ?? []).filter((item) => item.recognition_status === "confirmed"),
|
||||||
)
|
)
|
||||||
const selectedNode = computed(() => workflowDetail.value?.nodes.find((node) => node.node_id === selectedNodeId.value) ?? null)
|
const selectedNode = computed(() => workflowDetail.value?.nodes.find((node) => node.node_id === selectedNodeId.value) ?? null)
|
||||||
|
const taskStatuses = ["created", "queued", "running", "completed", "succeeded", "failed", "cancelled", "dead_letter"]
|
||||||
const activeTitle = computed(() => {
|
const activeTitle = computed(() => {
|
||||||
const titles: Record<ViewKey, string> = {
|
const titles: Record<ViewKey, string> = {
|
||||||
dashboard: text.dashboard,
|
dashboard: text.dashboard,
|
||||||
|
|
@ -359,6 +372,16 @@ function settledValue<T>(result: PromiseSettledResult<T[]>): T[] {
|
||||||
return result.status === "fulfilled" ? result.value : []
|
return result.status === "fulfilled" ? result.value : []
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async function loadJobs() {
|
||||||
|
jobs.value = await getJson<JobListResult>(endpoints.jobs, {
|
||||||
|
status: jobFilters.value.status || undefined,
|
||||||
|
profile_id: jobFilters.value.profile_id || undefined,
|
||||||
|
workflow_id: jobFilters.value.workflow_id || undefined,
|
||||||
|
page: 1,
|
||||||
|
page_size: 20,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
async function loadWardrobe(profileId?: string) {
|
async function loadWardrobe(profileId?: string) {
|
||||||
if (!profileId) {
|
if (!profileId) {
|
||||||
wardrobe.value = []
|
wardrobe.value = []
|
||||||
|
|
@ -441,6 +464,17 @@ function cancelJob(taskId: string) {
|
||||||
return runOperation(text.cancel, () => postJson(endpoints.jobCancel(taskId)))
|
return runOperation(text.cancel, () => postJson(endpoints.jobCancel(taskId)))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function loadJobDetail(taskId: string) {
|
||||||
|
return runOperation(
|
||||||
|
text.detail,
|
||||||
|
async () => {
|
||||||
|
selectedJob.value = await getJson<GenerationJob>(endpoints.job(taskId))
|
||||||
|
return selectedJob.value
|
||||||
|
},
|
||||||
|
false,
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
function resetProfileDraft() {
|
function resetProfileDraft() {
|
||||||
profileDraft.value = {
|
profileDraft.value = {
|
||||||
name: "",
|
name: "",
|
||||||
|
|
@ -1356,6 +1390,34 @@ function storageRootBytes(uriPrefix: string) {
|
||||||
<button type="button" :disabled="Boolean(busy)" @click="retryDeadLetters">{{ text.retryDead }}</button>
|
<button type="button" :disabled="Boolean(busy)" @click="retryDeadLetters">{{ text.retryDead }}</button>
|
||||||
</div>
|
</div>
|
||||||
</header>
|
</header>
|
||||||
|
<div class="form-grid">
|
||||||
|
<label>
|
||||||
|
<span>Status</span>
|
||||||
|
<select v-model="jobFilters.status">
|
||||||
|
<option value="">{{ text.allStatuses }}</option>
|
||||||
|
<option v-for="status in taskStatuses" :key="status" :value="status">{{ status }}</option>
|
||||||
|
</select>
|
||||||
|
</label>
|
||||||
|
<label>
|
||||||
|
<span>{{ text.profiles }}</span>
|
||||||
|
<select v-model="jobFilters.profile_id">
|
||||||
|
<option value="">{{ text.allProfiles }}</option>
|
||||||
|
<option v-for="profile in profiles?.items ?? []" :key="profile.profile_id" :value="profile.profile_id">
|
||||||
|
{{ profile.name }}
|
||||||
|
</option>
|
||||||
|
</select>
|
||||||
|
</label>
|
||||||
|
<label>
|
||||||
|
<span>{{ text.workflows }}</span>
|
||||||
|
<select v-model="jobFilters.workflow_id">
|
||||||
|
<option value="">{{ text.allWorkflows }}</option>
|
||||||
|
<option v-for="workflow in workflows" :key="workflow.workflow_id" :value="workflow.workflow_id">
|
||||||
|
{{ workflow.display_name }}
|
||||||
|
</option>
|
||||||
|
</select>
|
||||||
|
</label>
|
||||||
|
<button type="button" :disabled="Boolean(busy)" @click="loadJobs">{{ text.filter }}</button>
|
||||||
|
</div>
|
||||||
<ul>
|
<ul>
|
||||||
<li v-for="job in jobs?.items ?? []" :key="job.task_id">
|
<li v-for="job in jobs?.items ?? []" :key="job.task_id">
|
||||||
<div>
|
<div>
|
||||||
|
|
@ -1364,16 +1426,26 @@ function storageRootBytes(uriPrefix: string) {
|
||||||
</div>
|
</div>
|
||||||
<div class="inline-actions">
|
<div class="inline-actions">
|
||||||
<span class="badge">{{ job.status }}</span>
|
<span class="badge">{{ job.status }}</span>
|
||||||
<button v-if="job.status === 'failed'" type="button" @click="retryJob(job.task_id)">
|
<button v-if="['failed', 'dead_letter', 'cancelled'].includes(job.status)" type="button" @click="retryJob(job.task_id)">
|
||||||
{{ text.retry }}
|
{{ text.retry }}
|
||||||
</button>
|
</button>
|
||||||
<button v-if="job.status === 'pending'" type="button" @click="cancelJob(job.task_id)">
|
<button v-if="!['completed', 'succeeded', 'cancelled'].includes(job.status)" type="button" @click="cancelJob(job.task_id)">
|
||||||
{{ text.cancel }}
|
{{ text.cancel }}
|
||||||
</button>
|
</button>
|
||||||
|
<button type="button" :disabled="Boolean(busy)" @click="loadJobDetail(job.task_id)">
|
||||||
|
{{ text.detail }}
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
<li v-if="!jobs?.items.length" class="empty">{{ text.emptyJobs }}</li>
|
<li v-if="!jobs?.items.length" class="empty">{{ text.emptyJobs }}</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
<section v-if="selectedJob" class="editor-panel">
|
||||||
|
<header>
|
||||||
|
<h2>{{ text.jobDetail }}</h2>
|
||||||
|
<span>{{ selectedJob.status }}</span>
|
||||||
|
</header>
|
||||||
|
<pre>{{ JSON.stringify(selectedJob, null, 2) }}</pre>
|
||||||
|
</section>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<section v-if="activeView === 'discovery'" class="split-view">
|
<section v-if="activeView === 'discovery'" class="split-view">
|
||||||
|
|
|
||||||
文件差异因一行或多行过长而隐藏
|
|
@ -1,3 +1,3 @@
|
||||||
<script type="module" crossorigin src="/assets/index-CduHkhQE.js"></script>
|
<script type="module" crossorigin src="/assets/index-CcPvFarb.js"></script>
|
||||||
<link rel="stylesheet" crossorigin href="/assets/index-KxvCyOGk.css">
|
<link rel="stylesheet" crossorigin href="/assets/index-KxvCyOGk.css">
|
||||||
<div id="app"></div>
|
<div id="app"></div>
|
||||||
|
|
|
||||||
文件差异因一行或多行过长而隐藏
17
web/assets/index-BTjymfnK.js
普通文件
17
web/assets/index-BTjymfnK.js
普通文件
文件差异因一行或多行过长而隐藏
文件差异因一行或多行过长而隐藏
文件差异因一行或多行过长而隐藏
|
|
@ -1,3 +1,3 @@
|
||||||
<script type="module" crossorigin src="/api/v1/plugins/extensions/astrbot_plugin_imagestudio/web/assets/index-DtDjEMov.js"></script>
|
<script type="module" crossorigin src="/api/v1/plugins/extensions/astrbot_plugin_imagestudio/web/assets/index-BTjymfnK.js"></script>
|
||||||
<link rel="stylesheet" crossorigin href="/api/v1/plugins/extensions/astrbot_plugin_imagestudio/web/assets/index-BUBaapAF.css">
|
<link rel="stylesheet" crossorigin href="/api/v1/plugins/extensions/astrbot_plugin_imagestudio/web/assets/index-BMrshMnb.css">
|
||||||
<div id="app"></div>
|
<div id="app"></div>
|
||||||
|
|
|
||||||
正在加载…
添加表格
在新工单中引用