diff --git a/web/src/locales/en.json b/web/src/locales/en.json index 959c75c..702d87c 100644 --- a/web/src/locales/en.json +++ b/web/src/locales/en.json @@ -369,7 +369,12 @@ "notificationHours": "Notification Hours", "notificationHoursHint": "Notifications are sent at most once per hour. Leave empty to allow every hour.", "notificationHoursClear": "Clear", - "notificationHoursNoLimit": "No restriction" + "notificationHoursNoLimit": "No restriction", + "smtpHost": "SMTP Host", + "smtpPort": "SMTP Port", + "smtpUsername": "SMTP Username", + "smtpPassword": "SMTP Password", + "smtpFrom": "From Address" }, "setup": { "title": "Setup", diff --git a/web/src/locales/zh.json b/web/src/locales/zh.json index 4f43858..303a36c 100644 --- a/web/src/locales/zh.json +++ b/web/src/locales/zh.json @@ -369,7 +369,12 @@ "notificationHours": "通知时段", "notificationHoursHint": "每小时仅发送一次通知。不选则每小时都会发送通知。", "notificationHoursClear": "清空", - "notificationHoursNoLimit": "不限制" + "notificationHoursNoLimit": "不限制", + "smtpHost": "SMTP 主机", + "smtpPort": "SMTP 端口", + "smtpUsername": "SMTP 用户名", + "smtpPassword": "SMTP 密码", + "smtpFrom": "发件地址" }, "setup": { "title": "初始化", diff --git a/web/src/pages/channels/ChannelPage.tsx b/web/src/pages/channels/ChannelPage.tsx index 45ef214..b34707b 100644 --- a/web/src/pages/channels/ChannelPage.tsx +++ b/web/src/pages/channels/ChannelPage.tsx @@ -13,6 +13,8 @@ import type { NotificationConfig } from "@/types"; interface ChannelFieldDef { key: string; label: string; + /** i18n key; preferred over `label` when present */ + labelKey?: string; type: "text" | "password" | "textarea" | "select"; options?: string[]; placeholder?: string; @@ -88,9 +90,43 @@ const CHANNELS: ChannelDef[] = [ { key: "to", label: "To Address", + labelKey: "channels.toAddress", type: "text", placeholder: "", }, + { + key: "smtp_host", + label: "SMTP Host", + labelKey: "channels.smtpHost", + type: "text", + placeholder: "smtp.example.com", + }, + { + key: "smtp_port", + label: "SMTP Port", + labelKey: "channels.smtpPort", + type: "text", + placeholder: "465", + }, + { + key: "smtp_username", + label: "SMTP Username", + labelKey: "channels.smtpUsername", + type: "text", + }, + { + key: "smtp_password", + label: "SMTP Password", + labelKey: "channels.smtpPassword", + type: "password", + }, + { + key: "smtp_from", + label: "From Address", + labelKey: "channels.smtpFrom", + type: "text", + placeholder: "noreply@example.com", + }, ], }, { @@ -330,7 +366,7 @@ function ChannelCard({ {channel.fields.map((field) => (