From 9513d5ea02640ed61191fdafbe3918f7c34c73b2 Mon Sep 17 00:00:00 2001 From: Will Sheng <92167095+syf20020816@users.noreply.github.com> Date: Thu, 25 Dec 2025 17:49:51 +0800 Subject: [PATCH] add video and link to show deploy video for VoceSpace (#282) --- src/routes/setting/config/Vocespace.tsx | 67 ++++++++++++++----------- 1 file changed, 37 insertions(+), 30 deletions(-) diff --git a/src/routes/setting/config/Vocespace.tsx b/src/routes/setting/config/Vocespace.tsx index 6c2f2a69..a48bb6b5 100644 --- a/src/routes/setting/config/Vocespace.tsx +++ b/src/routes/setting/config/Vocespace.tsx @@ -33,10 +33,16 @@ export function ConfigVocespace() { const handleUpdate = async () => { const _values = values as VocespaceConfig; + if (_values.url.trim() === "" && _values.enabled) { alert("Custom domain is required when enabling Vocespace."); return; } + + if (!_values.server_type) { + _values.server_type = "vps"; + } + // 后端快速返回结果,只要检测环境可以执行就立即返回成功,不然会一直pending等待,导致前端超时 const res = await updateConfig(_values); @@ -50,7 +56,11 @@ export function ConfigVocespace() { } else { // 生成 sh文件让用户下载 const el = document.createElement("a"); - const file = new Blob([data as unknown as string], { type: "text/plain" }); + let shell = (data as unknown as string) + .replaceAll("{{", "{") + .replaceAll("}}", "}") + .replaceAll("{.Names}", "{{.Names}}"); + const file = new Blob([shell], { type: "text/plain" }); el.href = URL.createObjectURL(file); el.download = "deploy_vocespace.sh"; document.body.appendChild(el); // Required for this to work in FireFox @@ -102,33 +112,9 @@ export function ConfigVocespace() {