Skip to content

Commit d2c2670

Browse files
committed
bugfix: sound replace task not success
1 parent f4f6131 commit d2c2670

File tree

13 files changed

+55
-28
lines changed

13 files changed

+55
-28
lines changed

electron/aigcserver/EasyServer.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -127,9 +127,7 @@ export const EasyServer = function (config: any) {
127127
await Files.copy(validQueueFiles[0].pathname, configJson);
128128
await Files.deletes(validQueueFiles[0].pathname);
129129
this._controllerRunIfNeeded(configJson, option);
130-
return true;
131130
}
132-
return false;
133131
};
134132
let timer = null;
135133
if (option.timeout > 0) {
@@ -142,8 +140,8 @@ export const EasyServer = function (config: any) {
142140
}
143141
}
144142
this.ServerApi.file.appendText(this.ServerInfo.logFile, "timeout", {isDataPath: true});
145-
if (controllerWatching.resolve) {
146-
controllerWatching.resolve(undefined);
143+
if (controllerWatching.reject) {
144+
controllerWatching.reject(undefined);
147145
}
148146
}, option.timeout * 1000);
149147
}
@@ -191,8 +189,9 @@ export const EasyServer = function (config: any) {
191189
clearTimeout(timer);
192190
controller = null;
193191
hasMoreQueue()
194-
if (controllerWatching.reject && !controllerWatching.promiseResolved) {
195-
controllerWatching.reject(undefined);
192+
if (controllerWatching.resolve && !controllerWatching.promiseResolved) {
193+
controllerWatching.promiseResolved = true;
194+
controllerWatching.resolve(undefined);
196195
}
197196
},
198197
error: (_data, code) => {
@@ -202,6 +201,7 @@ export const EasyServer = function (config: any) {
202201
controller = null;
203202
hasMoreQueue()
204203
if (controllerWatching.reject && !controllerWatching.promiseResolved) {
204+
controllerWatching.promiseResolved = true;
205205
controllerWatching.reject(undefined);
206206
}
207207
},

src/components/Server/ServerActionInfoDialog.vue

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,21 @@ const visible = ref(false);
1616
const show = async () => {
1717
visible.value = true;
1818
const serverInfo = await serverStore.serverInfo(props.record);
19-
const res = await window.$mapi.server.config(serverInfo);
19+
const res = await $mapi.server.config(serverInfo);
2020
httpUrl.value = res.data?.httpUrl || "";
2121
content.value = buildServerContent(res.data);
2222
};
2323
2424
const doOpenHttpUrl = () => {
2525
if (httpUrl.value) {
26-
window.$mapi.app.openExternal(httpUrl.value);
26+
$mapi.app.openExternal(httpUrl.value);
2727
}
2828
};
2929
30+
const doOpenDir = (path: string) => {
31+
$mapi.app.openPath(path);
32+
};
33+
3034
defineExpose({
3135
show,
3236
});
@@ -73,7 +77,8 @@ defineExpose({
7377
</div>
7478
<div
7579
v-if="record.type === EnumServerType.LOCAL_DIR"
76-
class="rounded py-1 px-1 text-xs bg-gray-100"
80+
class="rounded-lg py-1 px-1 text-xs bg-gray-100 cursor-pointer"
81+
@click="doOpenDir(props.record.localPath!)"
7782
>
7883
{{ props.record.localPath }}
7984
</div>
@@ -82,7 +87,7 @@ defineExpose({
8287
<div class="flex mb-4">
8388
<div class="w-20">{{ $t("功能") }}</div>
8489
<div>
85-
<a-tag v-for="label in functionToLabels(record.functions)" class="mr-1">
90+
<a-tag v-for="label in functionToLabels(record.functions)" class="mr-1 rounded-lg">
8691
{{ label }}
8792
</a-tag>
8893
</div>

src/components/Server/ServerAddDialog.vue

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ const modelInfo = ref({
3131
settings: [],
3232
setting: {},
3333
isSupport: false,
34+
config: {} as Record<string, any>,
3435
});
3536
const isImporting = ref(false);
3637
const logStatus = ref("");
@@ -69,6 +70,7 @@ const emptyModelInfo = () => {
6970
modelInfo.value.settings = [];
7071
modelInfo.value.setting = {};
7172
modelInfo.value.isSupport = false;
73+
modelInfo.value.config = {};
7274
resolvePanel.value?.reset();
7375
};
7476
@@ -87,6 +89,7 @@ const doSubmitLocalDir = async () => {
8789
localPath: modelInfo.value.path,
8890
settings: modelInfo.value.settings,
8991
setting: modelInfo.value.setting,
92+
config: modelInfo.value.config,
9093
} as ServerRecord);
9194
};
9295
@@ -162,6 +165,7 @@ const doSelectLocalDir = async () => {
162165
modelInfo.value.functions = json.functions || [];
163166
modelInfo.value.settings = json.settings || {};
164167
modelInfo.value.setting = json.setting || {};
168+
modelInfo.value.config = json;
165169
modelInfo.value.isSupport = await $mapi.server.isSupport({
166170
localPath: serverPath,
167171
name: modelInfo.value.name,

src/components/common/ImagePreviewBox.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ const processedUrl = computed(() => {
2424
});
2525
2626
const currentWidth = computed(() => (isZoomed.value ? props.largeWidth || "100%" : props.width || "10rem"));
27-
const currentHeight = computed(() => (isZoomed.value ? props.largeHeight || "90vh" : props.height || "10rem"));
27+
const currentHeight = computed(() => (isZoomed.value ? props.largeHeight || "70vh" : props.height || "10rem"));
2828
2929
const toggleZoom = () => {
3030
isZoomed.value = !isZoomed.value;

src/components/common/VideoPreviewBox.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ const processedUrl = computed(() => {
2323
});
2424
2525
const currentWidth = computed(() => (isZoomed.value ? props.largeWidth || "100%" : props.width || "20rem"));
26-
const currentHeight = computed(() => (isZoomed.value ? props.largeHeight || "90vh" : props.height || "12rem"));
26+
const currentHeight = computed(() => (isZoomed.value ? props.largeHeight || "70vh" : props.height || "12rem"));
2727
2828
const toggleZoom = () => {
2929
isZoomed.value = !isZoomed.value;
@@ -34,7 +34,7 @@ const toggleZoom = () => {
3434
<div class="inline-block relative bg-gray-200 p-2 rounded-lg">
3535
<video :src="processedUrl" :style="{ width: currentWidth, height: currentHeight }"
3636
controls preload="none"
37-
class="object-contain border rounded"/>
37+
class="object-contain border rounded bg-black"/>
3838
<div @click="toggleZoom"
3939
class="cursor-pointer w-6 h-6 text-center leading-6 absolute top-4 left-4 bg-black bg-opacity-50 text-white rounded hover:bg-opacity-75">
4040
<icon-zoom-in v-if="!isZoomed"/>

src/lang/en-US.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,7 @@
179179
"0d02bde4": "Upgrade to Pro to enjoy cloud models",
180180
"0d3fccdb": "Click to copy text",
181181
"0e6adf4b": "Live streaming knowledge base updated",
182+
"0e88e8ae": "连续调用加速已开启",
182183
"0eed4342": "Task submitted successfully, waiting for video generation to complete",
183184
"0f921fa0": "Confirm deletion of {count} records?",
184185
"1058053f": "将长文本内容转换为音频文件",
@@ -393,6 +394,7 @@
393394
"37f71c6b": "Hardware Requirements",
394395
"380d81ad": "Please enter recognition text",
395396
"382747b5": "Confirm Cropping",
397+
"388a7d95": "一键优化时间线",
396398
"38d6305f": "Confirm Submission",
397399
"38d76226": "Confirm Text",
398400
"3914e591": "Use Now",
@@ -536,6 +538,7 @@
536538
"6750687f": "Facial interference detected",
537539
"67a69ed1": "For example: GPT-3.5",
538540
"6863573b": "Insufficient user quota",
541+
"68e00582": "重新校验文字",
539542
"6a5462b9": "Please select model to test",
540543
"6a6f7787": "No downloadable records",
541544
"6a7ee8a1": "Use CPU",

src/lang/source.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
"shou": "0035dafb",
2323
"{extensions}": "5cfe7472",
2424
"{title}不能为空": "4707f570",
25+
"一键优化时间线": "388a7d95",
2526
"一键复制不同角色声音": "3297ed40",
2627
"一键运行": "25b6e62a",
2728
"上传": "0009c256",
@@ -520,6 +521,7 @@
520521
"连接中": "02286f86",
521522
"连接网络设备": "37ce23fb",
522523
"连接设备": "42ed4ed0",
524+
"连续调用加速已开启": "0e88e8ae",
523525
"退出": "0011c1fa",
524526
"适配": "0012018b",
525527
"选择": "0011d400",
@@ -541,6 +543,7 @@
541543
"重排确认": "43cbe71b",
542544
"重新加载": "43cf49a0",
543545
"重新录制": "43d09644",
546+
"重新校验文字": "68e00582",
544547
"重新选择": "43d68cc3",
545548
"重试任务": "445dccae",
546549
"重试成功": "44601c37",

src/lang/zh-CN.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,7 @@
179179
"0d02bde4": "升级Pro版,畅享云模型",
180180
"0d3fccdb": "点击文字复制",
181181
"0e6adf4b": "直播知识库已更新",
182+
"0e88e8ae": "连续调用加速已开启",
182183
"0eed4342": "任务已经提交成功,等待视频生成完成",
183184
"0f921fa0": "确定删除 {count} 条记录?",
184185
"1058053f": "将长文本内容转换为音频文件",
@@ -390,6 +391,7 @@
390391
"37f71c6b": "硬件要求",
391392
"380d81ad": "请输入识别文本",
392393
"382747b5": "确定裁剪",
394+
"388a7d95": "一键优化时间线",
393395
"38d6305f": "确认提交",
394396
"38d76226": "确认文字",
395397
"3914e591": "立即使用",
@@ -530,6 +532,7 @@
530532
"6750687f": "面部有干扰",
531533
"67a69ed1": "例如 GPT-3.5",
532534
"6863573b": "用户配额不足",
535+
"68e00582": "重新校验文字",
533536
"6a5462b9": "请选择要检测的模型",
534537
"6a6f7787": "没有可以下载的记录",
535538
"6a7ee8a1": "使用CPU",

src/pages/Apps/SoundReplace/components/SoundReplaceItem.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ const doCombineConfirm = async () => {
123123
<div class="mt-3 flex">
124124
<div class="w-24 flex-shrink-0">
125125
<div class="inline-block text-center">
126-
<i class="iconfont icon-video-text"></i>
126+
<icon-ordered-list />
127127
{{ $t("重排确认") }}
128128
</div>
129129
</div>

src/pages/Apps/SoundReplace/task.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,7 @@ export const SoundReplace: TaskBiz = {
242242
return "success";
243243
}
244244
jobResult.CombineConfirm.status = "success";
245+
jobResult.step = "End";
245246
await TaskService.update(bizId, {
246247
jobResult,
247248
});

0 commit comments

Comments
 (0)