fix: restore settings page chinese text

This commit is contained in:
2026-05-31 20:07:18 +08:00
parent f7fa02d13c
commit b2aaef093d
+43 -43
View File
@@ -377,7 +377,7 @@ const eventScriptEnvironmentExamples = [
];
const eventScriptModeOptions = [
{ label: "璺緞", value: "path" },
{ label: "路径", value: "path" },
{ label: "脚本文本", value: "inline" }
];
@@ -461,12 +461,12 @@ const canSendTestWebhook = computed(() => Boolean(form.webhookUrl.trim()));
const segmentedExamplePath = computed(() => {
const extension = form.defaultOutputFormat === 1 ? "ts" : "mp4";
return `Douyin/2026/04/15/主播名?221530_origin_主播名直播标题_123456789_00001.${extension}`;
return `Douyin/2026/04/15/主播名_221530_origin_主播名_直播标题_123456789_00001.${extension}`;
});
const nestedSegmentedExamplePath = computed(() => {
const extension = form.defaultOutputFormat === 1 ? "ts" : "mp4";
return `Douyin/origin/2026/04/15/主播名?221530_origin_主播名直播标题_123456789/221530_origin_主播名直播标题_123456789_00001.${extension}`;
return `Douyin/origin/2026/04/15/主播名_221530_origin_主播名_直播标题_123456789/221530_origin_主播名_直播标题_123456789_00001.${extension}`;
});
async function loadSettings() {
@@ -571,7 +571,7 @@ async function sendTestEmail() {
emailExceptionBodyTemplateHtml: form.emailExceptionBodyTemplateHtml
});
ElMessage.success("娴嬭瘯閭欢宸插彂閫侊紝璇锋鏌ユ敹浠剁");
ElMessage.success("测试邮件已发送,请检查收件箱");
} catch (error) {
ElMessage.error(getApiErrorMessage(error, "Failed to send test email."));
} finally {
@@ -630,7 +630,7 @@ async function runRetentionCleanup() {
await startRetentionCleanupTracking(data);
ElMessage.success("Retention cleanup background task created.");
} catch (error) {
ElMessage.error(getApiErrorMessage(error, "淇濈暀娓呯悊鎵ц澶辫触"));
ElMessage.error(getApiErrorMessage(error, "保留清理执行失败"));
} finally {
runningRetentionCleanup.value = false;
}
@@ -962,15 +962,15 @@ watch(
<div class="settings-grid" v-loading="loading">
<el-tabs v-model="activeSettingTab" type="border-card" class="settings-tabs">
<el-tab-pane label="褰曞埗" name="recording">
<el-tab-pane label="录制" name="recording">
<el-card class="surface-card settings-card" shadow="never">
<h3 class="section-title">褰曞埗鍩虹</h3>
<h3 class="section-title">录制基础</h3>
<p class="section-subtitle">默认画质输出格式分段策略ffmpeg 模板和网络容错等录制基础参数在此集中管理</p>
<el-form label-position="top">
<el-row :gutter="16">
<el-col :span="12">
<el-form-item label="ffmpeg 璺緞">
<el-form-item label="ffmpeg 路径">
<el-input v-model="form.ffmpegPath" />
</el-form-item>
</el-col>
@@ -1183,13 +1183,13 @@ watch(
</el-card>
<el-card class="surface-card settings-card" shadow="never">
<h3 class="section-title">寮瑰箷褰曞埗</h3>
<h3 class="section-title">弹幕录制</h3>
<p class="section-subtitle">Control parallel danmaku XML recording, non-chat event capture, and retry / polling pacing.</p>
<el-form label-position="top">
<el-row :gutter="16">
<el-col :span="12">
<el-form-item label="鍚敤寮瑰箷褰曞埗">
<el-form-item label="启用弹幕录制">
<el-switch v-model="form.enableDanmakuRecording" />
</el-form-item>
</el-col>
@@ -1223,11 +1223,11 @@ watch(
</el-card>
<el-card class="surface-card settings-card settings-grid__full" shadow="never">
<h3 class="section-title">緞妯</h3>
<h3 class="section-title">路径模板</h3>
<p class="section-subtitle">Both directory and filename templates support variables. Segmented layouts are fully controlled by the templates themselves.</p>
<el-form label-position="top">
<el-form-item label="鐩綍妯℃澘">
<el-form-item label="目录模板">
<el-input
v-model="form.outputDirectoryTemplate"
type="textarea"
@@ -1248,8 +1248,8 @@ watch(
<div class="example-box">
<div class="example-box__label">示例输出</div>
<div class="monospace example-box__value">榛樿鍒嗘锛歿{ segmentedExamplePath }}</div>
<div class="monospace example-box__value">綍妯澘鍚?{fileStem}锛歿{ nestedSegmentedExamplePath }}</div>
<div class="monospace example-box__value">默认分段{{ segmentedExamplePath }}</div>
<div class="monospace example-box__value">目录模板含 {fileStem}{{ nestedSegmentedExamplePath }}</div>
</div>
<div class="helper-panel">
@@ -1304,7 +1304,7 @@ watch(
<el-form label-position="top">
<el-row :gutter="16">
<el-col :span="6">
<el-form-item label="鍚敤涓婁紶">
<el-form-item label="启用上传">
<el-switch v-model="form.enableFileUpload" />
</el-form-item>
</el-col>
@@ -1319,12 +1319,12 @@ watch(
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="鍒悕鐢ㄤ簬鐩綍">
<el-form-item label="别名用于目录">
<el-switch v-model="form.useAliasForStorage" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="涓婁紶鐩爣">
<el-form-item label="上传目标">
<el-select v-model="form.uploadTarget" :disabled="!form.enableFileUpload">
<el-option
v-for="option in uploadTargetOptions"
@@ -1341,7 +1341,7 @@ watch(
<div v-if="form.enableFileUpload && form.uploadTarget === 1" class="template-section">
<div class="template-section__header">
<div>
<h4 class="template-section__title">WebDAV </h4>
<h4 class="template-section__title">WebDAV 目标</h4>
<p class="template-section__subtitle">Create remote directories from recording-relative paths and upload the video plus danmaku files.</p>
</div>
</div>
@@ -1354,7 +1354,7 @@ watch(
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="鍩虹璺緞">
<el-form-item label="基础路径">
<el-input v-model="form.webDavUpload.basePath" placeholder="/live-recorder" />
</el-form-item>
</el-col>
@@ -1375,7 +1375,7 @@ watch(
<div v-if="form.enableFileUpload && form.uploadTarget === 2" class="template-section">
<div class="template-section__header">
<div>
<h4 class="template-section__title">S3 </h4>
<h4 class="template-section__title">S3 目标</h4>
<p class="template-section__subtitle">Supports custom endpoint, bucket, region, and prefix settings for object-storage compatible services.</p>
</div>
</div>
@@ -1422,7 +1422,8 @@ watch(
</div>
<div class="helper-panel">
姩涓婁紶鍥哄畾澶勭悊鈥滆棰戞枃浠?+ 瀵瑰簲寮瑰箷 XML鈥濄傚彧鏈変袱鑰呴兘涓婁紶鎴愬姛骞朵笖浣犳墦寮鈥滀笂浼犲悗鍒犳湰鍦扳濇椂锛岀郴缁熸墠浼氭竻鐞嗘湰鍦版枃浠躲? </div>
自动上传固定处理视频文件 + 对应弹幕 XML只有两者都上传成功并且你打开上传后删本地系统才会清理本地文件
</div>
</el-card>
<el-card v-if="false" class="surface-card settings-card settings-grid__full" shadow="never">
@@ -1534,7 +1535,7 @@ watch(
</el-button>
</div>
</div>
<el-form-item v-if="form.liveStartedScriptMode === 'path'" label="鑴氭湰璺緞">
<el-form-item v-if="form.liveStartedScriptMode === 'path'" label="脚本路径">
<el-input v-model="form.liveStartedScriptPath" placeholder="/app/scripts/live-started.sh" />
</el-form-item>
<el-form-item v-else label="脚本文本">
@@ -1588,7 +1589,7 @@ watch(
</el-button>
</div>
</div>
<el-form-item v-if="form.liveEndedScriptMode === 'path'" label="鑴氭湰璺緞">
<el-form-item v-if="form.liveEndedScriptMode === 'path'" label="脚本路径">
<el-input v-model="form.liveEndedScriptPath" placeholder="/app/scripts/live-ended.sh" />
</el-form-item>
<el-form-item v-else label="脚本文本">
@@ -1609,7 +1610,7 @@ watch(
{{ scriptTestResults.live_ended?.detail }}
</div>
<div v-if="scriptTestResults.live_ended?.customLogOutput" class="test-result__detail">
畾涔夋棩蹇楄緭鍑猴細{{ scriptTestResults.live_ended?.customLogOutput }}
自定义日志输出{{ scriptTestResults.live_ended?.customLogOutput }}
</div>
</div>
</div>
@@ -1663,7 +1664,7 @@ watch(
{{ scriptTestResults.segment_completed?.detail }}
</div>
<div v-if="scriptTestResults.segment_completed?.customLogOutput" class="test-result__detail">
畾涔夋棩蹇楄緭鍑猴細{{ scriptTestResults.segment_completed?.customLogOutput }}
自定义日志输出{{ scriptTestResults.segment_completed?.customLogOutput }}
</div>
</div>
</div>
@@ -1711,22 +1712,21 @@ watch(
</el-card>
</el-tab-pane>
<el-tab-pane label="閫氱煡" name="notifications">
<el-tab-pane label="通知" name="notifications">
<el-card class="surface-card settings-card settings-grid__full" shadow="never">
<h3 class="section-title">Webhook 閫氱煡</h3>
<h3 class="section-title">Webhook 通知</h3>
<p class="section-subtitle">Send fixed JSON POST payloads with custom headers. Exception notifications also cover low-storage stop events and event-script failures after retries are exhausted.</p>
<el-form label-position="top">
<el-row :gutter="16">
<el-col :span="6">
<el-form-item label="鍚敤 Webhook">
<el-form-item label="启用 Webhook">
<el-switch v-model="form.enableWebhookNotification" />
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="寮€鎾€氱煡">
<el-form-item label="开播通知">
<el-switch v-model="form.notifyWebhookOnLiveStarted" />
</el-form-item>
</el-col>
@@ -1748,7 +1748,7 @@ watch(
</el-col>
<el-col :span="24">
<el-form-item label="鑷畾涔夎姹傚ご">
<el-form-item label="自定义请求头">
<el-input
v-model="form.webhookHeaders"
type="textarea"
@@ -1758,7 +1758,7 @@ watch(
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="鑷畾涔?JSON Body 妯℃澘">
<el-form-item label="自定义 JSON Body 模板">
<el-input
v-model="form.webhookBodyTemplate"
type="textarea"
@@ -1788,19 +1788,18 @@ watch(
</el-card>
<el-card class="surface-card settings-card settings-grid__full" shadow="never">
<h3 class="section-title">欢閫氱煡</h3>
<h3 class="section-title">邮件通知</h3>
<p class="section-subtitle">Configure SMTP plus HTML templates for live-started and exception alerts. Exception notifications also cover low-storage stop events and event-script failures after retries are exhausted.</p>
<el-form label-position="top">
<el-row :gutter="16">
<el-col :span="6">
<el-form-item label="鍚敤閭欢閫氱煡">
<el-form-item label="启用邮件通知">
<el-switch v-model="form.enableEmailNotification" />
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="鍚敤 SSL">
<el-form-item label="启用 SSL">
<el-switch v-model="form.emailUseSsl" />
</el-form-item>
</el-col>
@@ -1853,7 +1852,7 @@ watch(
v-model="form.emailToAddresses"
type="textarea"
:rows="3"
placeholder="澶氫釜鍦板潃鍙敤閫楀彿銆佸垎鍙锋垨鎹㈣鍒嗛殧"
placeholder="多个地址可用逗号、分号或换行分隔"
/>
</el-form-item>
</el-col>
@@ -1867,11 +1866,11 @@ watch(
</div>
</div>
<el-form-item label="涓婚妯℃澘">
<el-form-item label="主题模板">
<el-input v-model="form.emailLiveStartedSubjectTemplate" />
</el-form-item>
<el-form-item label="HTML 姝f枃妯℃澘">
<el-form-item label="HTML 正文模板">
<el-input v-model="form.emailLiveStartedBodyTemplateHtml" type="textarea" :rows="10" />
</el-form-item>
</div>
@@ -1881,16 +1880,16 @@ watch(
<div class="template-section">
<div class="template-section__header">
<div>
<h4 class="template-section__title">异常提醒</h4>
<h4 class="template-section__title">异常提醒模板</h4>
<p class="template-section__subtitle">Exception emails inject source, summary, detail, task context values, and optional event script output into the HTML body.</p>
</div>
</div>
<el-form-item label="涓婚妯℃澘">
<el-form-item label="主题模板">
<el-input v-model="form.emailExceptionSubjectTemplate" />
</el-form-item>
<el-form-item label="HTML 姝f枃妯℃澘">
<el-form-item label="HTML 正文模板">
<el-input v-model="form.emailExceptionBodyTemplateHtml" type="textarea" :rows="12" />
</el-form-item>
</div>
@@ -1906,11 +1905,12 @@ watch(
</div>
<div class="helper-panel">
欢妯澘閲岀殑 <code v-pre>{{detectedAtUtc}}</code> ?<code v-pre>{{occurredAtUtc}}</code> 瀛楁鍚嶄繚鎸佷笉鍙橈紝浣嗗疄闄呮覆鏌撳煎凡缁忕粺涓鏀规垚鍖椾含鏃堕棿锛圲TC+8锛夈? <code v-pre>{{eventScriptOutput}}</code> 鍒欏搴旇剼鏈氳繃鑷畾涔夋棩蹇楁枃浠惰緭鍑虹殑鏂囨湰鍐呭? </div>
邮件模板里的 <code v-pre>{{detectedAtUtc}}</code> <code v-pre>{{occurredAtUtc}}</code> 字段名保持不变但实际渲染值已经统一改成北京时间UTC+8<code v-pre>{{eventScriptOutput}}</code> 则对应脚本通过自定义日志文件输出的文本内容
</div>
<div class="action-strip">
<div class="helper-text">Sending a test email does not save settings. The email renders both the live-started and exception template examples.</div>
<el-button :loading="testingEmail" :disabled="!canSendTestEmail" @click="sendTestEmail">娴嬭瘯閭</el-button>
<el-button :loading="testingEmail" :disabled="!canSendTestEmail" @click="sendTestEmail">测试邮件</el-button>
</div>
</el-card>
@@ -2012,7 +2012,7 @@ watch(
v-model="form.douyinCookie"
type="textarea"
:rows="4"
placeholder="鍙矘璐?ttwid銆乵sToken 绛?Cookie"
placeholder="可粘贴 ttwid、msToken Cookie"
/>
</el-form-item>
</el-form>