Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion web/src/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
7 changes: 6 additions & 1 deletion web/src/locales/zh.json
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,12 @@
"notificationHours": "通知时段",
"notificationHoursHint": "每小时仅发送一次通知。不选则每小时都会发送通知。",
"notificationHoursClear": "清空",
"notificationHoursNoLimit": "不限制"
"notificationHoursNoLimit": "不限制",
"smtpHost": "SMTP 主机",
"smtpPort": "SMTP 端口",
"smtpUsername": "SMTP 用户名",
"smtpPassword": "SMTP 密码",
"smtpFrom": "发件地址"
},
"setup": {
"title": "初始化",
Expand Down
38 changes: 37 additions & 1 deletion web/src/pages/channels/ChannelPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -88,9 +90,43 @@ const CHANNELS: ChannelDef[] = [
{
key: "to",
label: "To Address",
labelKey: "channels.toAddress",
type: "text",
placeholder: "<EMAIL_ADDRESS>",
},
{
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",
},
],
},
{
Expand Down Expand Up @@ -330,7 +366,7 @@ function ChannelCard({
{channel.fields.map((field) => (
<div key={field.key}>
<label className="block text-xs font-medium text-foreground mb-1">
{field.label}
{field.labelKey ? t(field.labelKey) : field.label}
</label>
<FormField
def={field}
Expand Down
Loading