feat: add daily outfit workbench panel
这个提交存在于:
父节点
afbc19e76c
当前提交
e7ef2f0508
共有 10 个文件被更改,包括 90 次插入 和 24 次删除
|
|
@ -29,6 +29,8 @@ export const endpoints = {
|
|||
wardrobeImportMaterial: (profileId: string) => `profiles/${profileId}/wardrobe/import-material`,
|
||||
wardrobeItem: (profileId: string, wardrobeItemId: string) => `profiles/${profileId}/wardrobe/${wardrobeItemId}`,
|
||||
wardrobeMatch: (profileId: string) => `profiles/${profileId}/wardrobe/match`,
|
||||
privateCompanionDailyOutfit: "integrations/private-companion/daily-outfit",
|
||||
integrationEventLogs: "integrations/logs",
|
||||
apiDiscoveryDialects: "api-discovery/dialects",
|
||||
apiDiscoveryProbeModel: "api-discovery/probe-model",
|
||||
apiDiscoveryCapabilities: "api-discovery/capabilities",
|
||||
|
|
|
|||
|
|
@ -0,0 +1,7 @@
|
|||
export interface DailyOutfitResult {
|
||||
matched: boolean
|
||||
selected_materials: Array<Record<string, unknown>>
|
||||
final_prompt: string
|
||||
job_id?: string | null
|
||||
fallback_used: boolean
|
||||
}
|
||||
|
|
@ -5,6 +5,7 @@ import { getJson, postJson, request } from "../../shared/api/client"
|
|||
import type { UiBootstrap } from "../../shared/types/bootstrap"
|
||||
import type { DashboardSummary } from "../../shared/types/dashboard"
|
||||
import type { ApiDialect, CapabilityProfile, RenderPlanValidationResult } from "../../shared/types/discovery"
|
||||
import type { DailyOutfitResult } from "../../shared/types/integration"
|
||||
import type { JobListResult } from "../../shared/types/job"
|
||||
import type { LogBundle } from "../../shared/types/logs"
|
||||
import type { Material, MaterialCategory, MaterialListResult } from "../../shared/types/material"
|
||||
|
|
@ -63,6 +64,12 @@ const text = {
|
|||
selectMaterial: "\u9009\u62e9\u7d20\u6750",
|
||||
wardrobeImported: "\u8863\u6a71\u6761\u76ee\u5df2\u52a0\u5165",
|
||||
wardrobeDeleted: "\u8863\u6a71\u6761\u76ee\u5df2\u5220\u9664",
|
||||
dailyOutfit: "\u6bcf\u65e5\u7a7f\u642d",
|
||||
categories: "\u5206\u7c7b",
|
||||
mood: "\u5fc3\u60c5",
|
||||
weather: "\u5929\u6c14",
|
||||
keywords: "\u5173\u952e\u8bcd",
|
||||
outfitGenerated: "\u6bcf\u65e5\u7a7f\u642d\u5df2\u751f\u6210",
|
||||
dashboard: "\u8fd0\u884c\u6982\u89c8",
|
||||
profiles: "\u89d2\u8272",
|
||||
materials: "\u7d20\u6750\u5e93",
|
||||
|
|
@ -75,7 +82,7 @@ const text = {
|
|||
profileCreated: "\u89d2\u8272\u5df2\u521b\u5efa",
|
||||
profileDeleted: "\u89d2\u8272\u5df2\u5220\u9664",
|
||||
emptyProfiles: "\u6682\u65e0\u89d2\u8272",
|
||||
categories: "\u7d20\u6750\u5206\u7c7b",
|
||||
materialCategories: "\u7d20\u6750\u5206\u7c7b",
|
||||
materialItems: "\u7d20\u6750\u6761\u76ee",
|
||||
emptyCategories: "\u6682\u65e0\u5206\u7c7b",
|
||||
emptyMaterials: "\u6682\u65e0\u7d20\u6750",
|
||||
|
|
@ -187,6 +194,13 @@ const wardrobeDraft = ref({
|
|||
season: "",
|
||||
style: "",
|
||||
})
|
||||
const dailyOutfitDraft = ref({
|
||||
categories: "top,bottom,dress,shoes,accessory",
|
||||
mood: "",
|
||||
weather: "",
|
||||
keywords: "",
|
||||
})
|
||||
const dailyOutfitResult = ref<DailyOutfitResult | null>(null)
|
||||
const renderPlanDraft = ref({
|
||||
provider_id: "",
|
||||
model_id: "",
|
||||
|
|
@ -505,6 +519,27 @@ function deleteWardrobeItem(wardrobeItemId: string) {
|
|||
)
|
||||
}
|
||||
|
||||
function requestDailyOutfit() {
|
||||
const profileId = selectedProfileId.value
|
||||
if (!profileId) return Promise.resolve()
|
||||
return runOperation(
|
||||
text.dailyOutfit,
|
||||
async () => {
|
||||
dailyOutfitResult.value = await postJson<DailyOutfitResult>(endpoints.privateCompanionDailyOutfit, {
|
||||
profile_id: profileId,
|
||||
categories: splitCsv(dailyOutfitDraft.value.categories),
|
||||
mood: dailyOutfitDraft.value.mood,
|
||||
weather: dailyOutfitDraft.value.weather,
|
||||
keywords: splitCsv(dailyOutfitDraft.value.keywords),
|
||||
request_source: "astrbot_plugin_private_companion",
|
||||
})
|
||||
lastOperation.value = text.outfitGenerated
|
||||
return dailyOutfitResult.value
|
||||
},
|
||||
false,
|
||||
)
|
||||
}
|
||||
|
||||
function reloadSettings() {
|
||||
return runOperation(
|
||||
text.reload,
|
||||
|
|
@ -797,7 +832,7 @@ function storageRootBytes(uriPrefix: string) {
|
|||
<section v-if="activeView === 'materials'" class="split-view">
|
||||
<div class="list-view">
|
||||
<header>
|
||||
<h2>{{ text.categories }}</h2>
|
||||
<h2>{{ text.materialCategories }}</h2>
|
||||
<span>{{ materialCategories.length }}</span>
|
||||
</header>
|
||||
<ul>
|
||||
|
|
@ -937,6 +972,28 @@ function storageRootBytes(uriPrefix: string) {
|
|||
<li v-if="!wardrobe.length" class="empty">{{ text.emptyWardrobe }}</li>
|
||||
</ul>
|
||||
<pre v-if="wardrobeMatch">{{ JSON.stringify(wardrobeMatch, null, 2) }}</pre>
|
||||
<div class="form-grid">
|
||||
<label>
|
||||
<span>{{ text.categories }}</span>
|
||||
<input v-model="dailyOutfitDraft.categories" type="text" />
|
||||
</label>
|
||||
<label>
|
||||
<span>{{ text.mood }}</span>
|
||||
<input v-model="dailyOutfitDraft.mood" type="text" />
|
||||
</label>
|
||||
<label>
|
||||
<span>{{ text.weather }}</span>
|
||||
<input v-model="dailyOutfitDraft.weather" type="text" />
|
||||
</label>
|
||||
<label>
|
||||
<span>{{ text.keywords }}</span>
|
||||
<input v-model="dailyOutfitDraft.keywords" type="text" />
|
||||
</label>
|
||||
<button type="button" :disabled="Boolean(busy) || !selectedProfileId" @click="requestDailyOutfit">
|
||||
{{ text.dailyOutfit }}
|
||||
</button>
|
||||
</div>
|
||||
<pre v-if="dailyOutfitResult">{{ JSON.stringify(dailyOutfitResult, null, 2) }}</pre>
|
||||
</section>
|
||||
|
||||
<section v-if="activeView === 'jobs'" class="list-view">
|
||||
|
|
|
|||
文件差异因一行或多行过长而隐藏
|
|
@ -1,3 +1,3 @@
|
|||
<script type="module" crossorigin src="/assets/index-B6yxsdBD.js"></script>
|
||||
<script type="module" crossorigin src="/assets/index-DxDyhkQX.js"></script>
|
||||
<link rel="stylesheet" crossorigin href="/assets/index-KxvCyOGk.css">
|
||||
<div id="app"></div>
|
||||
|
|
|
|||
文件差异因一行或多行过长而隐藏
17
web/assets/index-CMIPJ6y1.js
普通文件
17
web/assets/index-CMIPJ6y1.js
普通文件
文件差异因一行或多行过长而隐藏
文件差异因一行或多行过长而隐藏
文件差异因一行或多行过长而隐藏
|
|
@ -1,3 +1,3 @@
|
|||
<script type="module" crossorigin src="/api/v1/plugins/extensions/astrbot_plugin_imagestudio/web/assets/index-CiytwhbS.js"></script>
|
||||
<link rel="stylesheet" crossorigin href="/api/v1/plugins/extensions/astrbot_plugin_imagestudio/web/assets/index-C-dyO4IO.css">
|
||||
<script type="module" crossorigin src="/api/v1/plugins/extensions/astrbot_plugin_imagestudio/web/assets/index-CMIPJ6y1.js"></script>
|
||||
<link rel="stylesheet" crossorigin href="/api/v1/plugins/extensions/astrbot_plugin_imagestudio/web/assets/index-DJ-aUUSl.css">
|
||||
<div id="app"></div>
|
||||
|
|
|
|||
正在加载…
添加表格
在新工单中引用