feat: add storage and script failure notifications

This commit is contained in:
2026-05-31 19:35:06 +08:00
parent fd5be2cc8e
commit b82110461a
7 changed files with 381 additions and 11 deletions
+52
View File
@@ -61,9 +61,17 @@
--el-border-color-light: var(--border-subtle);
--el-border-radius-base: var(--radius-sm);
--el-bg-color: transparent;
--el-bg-color-page: var(--bg-base);
--el-bg-color-overlay: var(--surface);
--el-fill-color: var(--surface-muted);
--el-fill-color-blank: var(--surface);
--el-fill-color-light: var(--surface-muted);
--el-fill-color-lighter: var(--surface-strong);
--el-fill-color-dark: var(--surface-raised);
--el-fill-color-darker: var(--surface-strong);
--el-disabled-bg-color: var(--surface-muted);
--el-disabled-text-color: var(--text-soft);
--el-text-color-placeholder: var(--text-soft);
--el-mask-color: rgba(15, 23, 42, 0.54);
}
@@ -123,9 +131,17 @@ html[data-theme="dark"] {
--el-text-color-secondary: var(--text-muted);
--el-border-color: var(--border-base);
--el-border-color-light: var(--border-subtle);
--el-bg-color-page: var(--bg-base);
--el-bg-color-overlay: var(--surface);
--el-fill-color: var(--surface-muted);
--el-fill-color-blank: var(--surface);
--el-fill-color-light: var(--surface-muted);
--el-fill-color-lighter: var(--surface-strong);
--el-fill-color-dark: var(--surface-raised);
--el-fill-color-darker: var(--surface-strong);
--el-disabled-bg-color: var(--surface-muted);
--el-disabled-text-color: var(--text-soft);
--el-text-color-placeholder: var(--text-soft);
--el-mask-color: rgba(3, 7, 14, 0.72);
}
@@ -255,6 +271,7 @@ select:focus-visible {
.surface-card {
position: relative;
overflow: hidden;
--el-card-bg-color: transparent;
border-radius: var(--radius-md);
border: 1px solid var(--border-subtle);
background:
@@ -573,9 +590,33 @@ html[data-theme="dark"] .stat-card {
.el-card {
--el-card-border-color: transparent;
--el-card-bg-color: transparent;
background: transparent;
}
.el-tabs--border-card {
border-color: var(--border-subtle);
background: var(--surface);
}
.el-tabs--border-card > .el-tabs__content {
background: transparent;
color: var(--text-primary);
}
.el-tabs--border-card > .el-tabs__header {
background: transparent;
}
.el-tabs--border-card > .el-tabs__header .el-tabs__item {
color: var(--text-secondary);
}
.el-tabs--border-card > .el-tabs__header .el-tabs__item.is-active {
color: var(--text-primary);
background: var(--surface-raised);
}
.el-button {
min-height: var(--control-height);
padding: 0 15px;
@@ -802,6 +843,17 @@ html[data-theme="dark"] .stat-card {
box-shadow: var(--shadow-float);
}
.el-message-box,
.el-popover.el-popper,
.el-select__popper.el-popper,
.el-picker__popper.el-popper,
.el-dropdown__popper.el-popper .el-dropdown-menu {
border-color: var(--border-subtle);
background: linear-gradient(180deg, var(--surface-raised), var(--surface));
color: var(--text-primary);
box-shadow: var(--shadow-float);
}
.el-dialog__header {
margin: 0;
padding: 22px 24px 10px;
+2
View File
@@ -458,6 +458,8 @@ export interface SystemSettings {
segmentCompletedScriptPath: string;
segmentCompletedScriptContent: string;
eventScriptTimeoutSeconds: number;
eventScriptRetryAttempts: number;
eventScriptRetryDelaySeconds: number;
enableEmailNotification: boolean;
emailSmtpHost: string;
emailSmtpPort: number;
+22 -4
View File
@@ -168,6 +168,8 @@ const form = reactive<SettingsFormModel>({
segmentCompletedScriptPath: "",
segmentCompletedScriptContent: "",
eventScriptTimeoutSeconds: 60,
eventScriptRetryAttempts: 3,
eventScriptRetryDelaySeconds: 10,
enableEmailNotification: false,
emailSmtpHost: "",
emailSmtpPort: 587,
@@ -1480,16 +1482,26 @@ watch(
<el-form label-position="top">
<el-row :gutter="16">
<el-col :span="8">
<el-col :span="6">
<el-form-item label="启用事件脚本">
<el-switch v-model="form.enableEventScripts" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-col :span="6">
<el-form-item label="脚本超时(秒)">
<el-input-number v-model="form.eventScriptTimeoutSeconds" :min="1" :max="3600" />
</el-form-item>
</el-col>
<el-col :span="5">
<el-form-item label="重试次数">
<el-input-number v-model="form.eventScriptRetryAttempts" :min="0" :max="20" />
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="重试间隔(秒)">
<el-input-number v-model="form.eventScriptRetryDelaySeconds" :min="0" :max="3600" />
</el-form-item>
</el-col>
</el-row>
</el-form>
@@ -1676,6 +1688,10 @@ watch(
The official Docker image includes <code>curl</code> and <code>jq</code> by default. If you run on a host machine or a custom image, rely on the commands available in that environment.
</div>
<div class="event-script-help__intro">
Set <code>Retry attempts</code> to <code>0</code> to disable automatic retries. Retry exhaustion failures are sent through the existing exception notification channel.
</div>
<div class="event-script-example">
<div class="event-script-example__label">Environment variable examples</div>
<div class="event-script-example__grid">
@@ -1699,7 +1715,8 @@ watch(
<el-card class="surface-card settings-card settings-grid__full" shadow="never">
<h3 class="section-title">Webhook 閫氱煡</h3>
<p class="section-subtitle">Send fixed JSON POST payloads with custom headers. Currently only live-started and exception events are sent.</p>
<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">
@@ -1772,7 +1789,8 @@ watch(
<el-card class="surface-card settings-card settings-grid__full" shadow="never">
<h3 class="section-title">欢閫氱煡</h3>
<p class="section-subtitle">Configure SMTP plus HTML templates for live-started and exception alerts. Tests use the current unsaved form values directly.</p>
<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">