Expose asset pack import dry run in frontend
这个提交存在于:
父节点
04944fba53
当前提交
7edd813d4b
共有 10 个文件被更改,包括 81 次插入 和 25 次删除
|
|
@ -61,6 +61,7 @@ export const endpoints = {
|
|||
materialRecognize: (materialId: string) => `materials/${materialId}/recognize`,
|
||||
materialReRecognize: (materialId: string) => `materials/${materialId}/re-recognize`,
|
||||
materialConfirm: (materialId: string) => `materials/${materialId}/confirm`,
|
||||
assetImportPack: "assets/import-pack",
|
||||
wardrobe: (profileId: string) => `profiles/${profileId}/wardrobe`,
|
||||
wardrobeImportMaterial: (profileId: string) => `profiles/${profileId}/wardrobe/import-material`,
|
||||
wardrobeItems: (profileId: string) => `profiles/${profileId}/wardrobe/items`,
|
||||
|
|
|
|||
10
frontend/shared/types/assets.ts
普通文件
10
frontend/shared/types/assets.ts
普通文件
|
|
@ -0,0 +1,10 @@
|
|||
export interface AssetImportPlan {
|
||||
dry_run: boolean
|
||||
status: string
|
||||
package_uri: string
|
||||
files: number
|
||||
bytes: number
|
||||
manifest_candidates: string[]
|
||||
import_enabled: boolean
|
||||
execution_enabled: boolean
|
||||
}
|
||||
|
|
@ -2,6 +2,7 @@
|
|||
import { computed, onMounted, ref } from "vue"
|
||||
import { endpoints } from "../../shared/api/endpoints"
|
||||
import { getJson, postJson, request } from "../../shared/api/client"
|
||||
import type { AssetImportPlan } from "../../shared/types/assets"
|
||||
import type { UiBootstrap } from "../../shared/types/bootstrap"
|
||||
import type { DashboardSummary } from "../../shared/types/dashboard"
|
||||
import type { ApiDialect, CapabilityProfile, RenderPlanValidationResult } from "../../shared/types/discovery"
|
||||
|
|
@ -235,6 +236,8 @@ const text = {
|
|||
diffResult: "\u53d8\u66f4\u5bf9\u6bd4",
|
||||
storage: "\u5b58\u50a8",
|
||||
storageMigrate: "\u8fc1\u79fb\u9884\u68c0",
|
||||
assetImportPack: "\u8d44\u4ea7\u5305\u9884\u68c0",
|
||||
packageUri: "\u5305 URI",
|
||||
sourceUri: "\u6e90 URI",
|
||||
targetUri: "\u76ee\u6807 URI",
|
||||
fileCount: "\u6587\u4ef6\u6570",
|
||||
|
|
@ -286,6 +289,7 @@ const integrationEventLogs = ref<LogBundle["integrations"]>([])
|
|||
const eventStream = ref<EventStreamResult | null>(null)
|
||||
const signedMedia = ref<MediaSignResult | null>(null)
|
||||
const storageMigrationPlan = ref<StorageMigrationPlan | null>(null)
|
||||
const assetImportPlan = ref<AssetImportPlan | null>(null)
|
||||
const settingsDraft = ref("")
|
||||
const settingsImportDraft = ref("")
|
||||
const settingsSnapshots = ref<SettingsSnapshot[]>([])
|
||||
|
|
@ -398,6 +402,9 @@ const storageMigrationDraft = ref({
|
|||
source_uri: "storage://images/sample.bin",
|
||||
target_uri: "storage://archives/sample.bin",
|
||||
})
|
||||
const assetImportDraft = ref({
|
||||
package_uri: "storage://materials/pack",
|
||||
})
|
||||
const categoryDraft = ref({
|
||||
category_id: "",
|
||||
name: "",
|
||||
|
|
@ -1677,6 +1684,20 @@ function planStorageMigration() {
|
|||
false,
|
||||
)
|
||||
}
|
||||
|
||||
function planAssetImportPack() {
|
||||
return runOperation(
|
||||
text.assetImportPack,
|
||||
async () => {
|
||||
assetImportPlan.value = await postJson<AssetImportPlan>(endpoints.assetImportPack, {
|
||||
package_uri: assetImportDraft.value.package_uri,
|
||||
dry_run: true,
|
||||
})
|
||||
return assetImportPlan.value
|
||||
},
|
||||
false,
|
||||
)
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
|
@ -2886,6 +2907,30 @@ function planStorageMigration() {
|
|||
<dd>{{ storageMigrationPlan.dry_run }}</dd>
|
||||
</div>
|
||||
</dl>
|
||||
<h2>{{ text.assetImportPack }}</h2>
|
||||
<div class="inspector-form">
|
||||
<label>
|
||||
<span>{{ text.packageUri }}</span>
|
||||
<input v-model="assetImportDraft.package_uri" type="text" />
|
||||
</label>
|
||||
<button type="button" :disabled="Boolean(busy) || !assetImportDraft.package_uri" @click="planAssetImportPack">
|
||||
{{ text.assetImportPack }}
|
||||
</button>
|
||||
</div>
|
||||
<dl v-if="assetImportPlan">
|
||||
<div>
|
||||
<dt>{{ text.fileCount }}</dt>
|
||||
<dd>{{ assetImportPlan.files }}</dd>
|
||||
</div>
|
||||
<div>
|
||||
<dt>{{ text.storage }}</dt>
|
||||
<dd>{{ formatBytes(assetImportPlan.bytes) }}</dd>
|
||||
</div>
|
||||
<div>
|
||||
<dt>Manifest</dt>
|
||||
<dd>{{ assetImportPlan.manifest_candidates.length }}</dd>
|
||||
</div>
|
||||
</dl>
|
||||
</aside>
|
||||
</main>
|
||||
</template>
|
||||
|
|
|
|||
文件差异因一行或多行过长而隐藏
|
|
@ -1,3 +1,3 @@
|
|||
<script type="module" crossorigin src="/assets/index-Cds4ME1g.js"></script>
|
||||
<script type="module" crossorigin src="/assets/index-CKDvZfFU.js"></script>
|
||||
<link rel="stylesheet" crossorigin href="/assets/index-DJ52Rx93.css">
|
||||
<div id="app"></div>
|
||||
|
|
|
|||
文件差异因一行或多行过长而隐藏
文件差异因一行或多行过长而隐藏
文件差异因一行或多行过长而隐藏
17
web/assets/index-Sl8IwODU.js
普通文件
17
web/assets/index-Sl8IwODU.js
普通文件
文件差异因一行或多行过长而隐藏
|
|
@ -1,3 +1,3 @@
|
|||
<script type="module" crossorigin src="/api/v1/plugins/extensions/astrbot_plugin_imagestudio/web/assets/index-CPaM0DMS.js"></script>
|
||||
<link rel="stylesheet" crossorigin href="/api/v1/plugins/extensions/astrbot_plugin_imagestudio/web/assets/index-BpA_z04Q.css">
|
||||
<script type="module" crossorigin src="/api/v1/plugins/extensions/astrbot_plugin_imagestudio/web/assets/index-Sl8IwODU.js"></script>
|
||||
<link rel="stylesheet" crossorigin href="/api/v1/plugins/extensions/astrbot_plugin_imagestudio/web/assets/index-C4Ku8Roa.css">
|
||||
<div id="app"></div>
|
||||
|
|
|
|||
正在加载…
添加表格
在新工单中引用