From 56017726ec6c4b1d2c4bb7c4f3abbbd156bc7cfa Mon Sep 17 00:00:00 2001 From: YokiiroBW Date: Sun, 5 Jul 2026 17:28:16 +0800 Subject: [PATCH] feat: align frontend API contract paths --- frontend/shared/api/endpoints.ts | 7 ++++++- frontend/standalone-web/src/App.vue | 18 ++++++++++++------ .../{index-C5fg2wzC.js => index-DjwdLJJW.js} | 8 ++++---- pages/imagestudio/index.html | 2 +- web/assets/index-BJain7ke.css | 1 - web/assets/index-DUTzELa3.css | 1 + web/assets/index-RNTM2n1r.js | 17 +++++++++++++++++ web/assets/index-zEa7J3GQ.js | 17 ----------------- web/index.html | 4 ++-- 9 files changed, 43 insertions(+), 32 deletions(-) rename pages/imagestudio/assets/{index-C5fg2wzC.js => index-DjwdLJJW.js} (61%) delete mode 100644 web/assets/index-BJain7ke.css create mode 100644 web/assets/index-DUTzELa3.css create mode 100644 web/assets/index-RNTM2n1r.js delete mode 100644 web/assets/index-zEa7J3GQ.js diff --git a/frontend/shared/api/endpoints.ts b/frontend/shared/api/endpoints.ts index 0bc2dd1..12951a5 100644 --- a/frontend/shared/api/endpoints.ts +++ b/frontend/shared/api/endpoints.ts @@ -6,6 +6,7 @@ export const endpoints = { dashboardSummary: "dashboard/summary", profiles: "profiles", profile: (profileId: string) => `profiles/${profileId}`, + profileArchive: (profileId: string) => `profiles/${profileId}/archive`, quickProfileDraft: "profiles/quick-draft", profileWorkflows: (profileId: string) => `profiles/${profileId}/workflows`, workflow: (workflowId: string) => `workflows/${workflowId}`, @@ -20,6 +21,7 @@ export const endpoints = { nodeGenerate: (nodeId: string) => `nodes/${nodeId}/generate`, nodeRetry: (nodeId: string) => `nodes/${nodeId}/retry`, nodeComplete: (nodeId: string) => `nodes/${nodeId}/complete`, + nodeMarkCompleted: (nodeId: string) => `nodes/${nodeId}/mark-completed`, nodeSelectImage: (nodeId: string) => `nodes/${nodeId}/select-image`, nodeAdoptImage: (nodeId: string) => `nodes/${nodeId}/adopt-image`, nodeReview: (nodeId: string) => `nodes/${nodeId}/review`, @@ -54,10 +56,13 @@ export const endpoints = { materialUpload: "materials/upload", material: (materialId: string) => `materials/${materialId}`, materialRecognize: (materialId: string) => `materials/${materialId}/recognize`, + materialReRecognize: (materialId: string) => `materials/${materialId}/re-recognize`, materialConfirm: (materialId: string) => `materials/${materialId}/confirm`, wardrobe: (profileId: string) => `profiles/${profileId}/wardrobe`, wardrobeImportMaterial: (profileId: string) => `profiles/${profileId}/wardrobe/import-material`, - wardrobeItem: (profileId: string, wardrobeItemId: string) => `profiles/${profileId}/wardrobe/${wardrobeItemId}`, + wardrobeItems: (profileId: string) => `profiles/${profileId}/wardrobe/items`, + wardrobeItem: (profileId: string, wardrobeItemId: string) => `profiles/${profileId}/wardrobe/items/${wardrobeItemId}`, + wardrobeLegacyItem: (profileId: string, wardrobeItemId: string) => `profiles/${profileId}/wardrobe/${wardrobeItemId}`, wardrobeMatch: (profileId: string) => `profiles/${profileId}/wardrobe/match`, privateCompanionDailyOutfit: "integrations/private-companion/daily-outfit", integrationEventLogs: "integrations/logs", diff --git a/frontend/standalone-web/src/App.vue b/frontend/standalone-web/src/App.vue index 0763c54..ab6a64d 100644 --- a/frontend/standalone-web/src/App.vue +++ b/frontend/standalone-web/src/App.vue @@ -64,6 +64,7 @@ const text = { select: "\u9009\u62e9", unselect: "\u53d6\u9009", recognize: "\u8bc6\u522b", + reRecognize: "\u91cd\u65b0\u8bc6\u522b", confirm: "\u786e\u8ba4", edit: "\u7f16\u8f91", update: "\u66f4\u65b0", @@ -1006,7 +1007,7 @@ function completeNode(nodeId: string) { return runOperation( text.complete, async () => { - const node = await postJson(endpoints.nodeComplete(nodeId)) + const node = await postJson(endpoints.nodeMarkCompleted(nodeId)) await refreshSelectedWorkflow() lastOperation.value = text.nodeCompleted return node @@ -1174,7 +1175,7 @@ function importWardrobeMaterial() { return runOperation( text.importToWardrobe, async () => { - const item = await postJson(endpoints.wardrobeImportMaterial(profileId), { + const item = await postJson(endpoints.wardrobeItems(profileId), { material_id: wardrobeDraft.value.material_id, wardrobe_category: wardrobeDraft.value.wardrobe_category, tags: splitCsv(wardrobeDraft.value.tags), @@ -1555,8 +1556,13 @@ function uploadMaterialDraft() { ) } -function recognizeMaterial(materialId: string) { - return runOperation(text.recognize, () => postJson(endpoints.materialRecognize(materialId))) +function recognizeOrRefreshMaterial(material: Material) { + const endpoint = + material.recognition_status === "confirmed" + ? endpoints.materialReRecognize(material.material_id) + : endpoints.materialRecognize(material.material_id) + const label = material.recognition_status === "confirmed" ? text.reRecognize : text.recognize + return runOperation(label, () => postJson(endpoint)) } function confirmMaterial(material: Material) { @@ -2118,8 +2124,8 @@ function storageRootBytes(uriPrefix: string) { -