diff --git a/src/components/alert-rule.tsx b/src/components/alert-rule.tsx index 640e649..edf487b 100644 --- a/src/components/alert-rule.tsx +++ b/src/components/alert-rule.tsx @@ -93,18 +93,18 @@ export const AlertRuleCard: React.FC = ({ data, mutate }) => resolver: zodResolver(alertRuleFormSchema), defaultValues: data ? { - ...data, - rules_raw: JSON.stringify(data.rules), - } + ...data, + rules_raw: JSON.stringify(data.rules), + } : { - name: "", - rules_raw: "", - rules: [], - fail_trigger_tasks: [], - recover_trigger_tasks: [], - notification_group_id: 0, - trigger_mode: 0, - }, + name: "", + rules_raw: "", + rules: [], + fail_trigger_tasks: [], + recover_trigger_tasks: [], + notification_group_id: 0, + trigger_mode: 0, + }, resetOptions: { keepDefaultValues: false, }, @@ -205,13 +205,11 @@ export const AlertRuleCard: React.FC = ({ data, mutate }) => - {Object.entries(triggerModes).map( - ([k, v]) => ( - - {v} - - ), - )} + {Object.entries(triggerModes).map(([k, v]) => ( + + {v} + + ))} diff --git a/src/components/cron.tsx b/src/components/cron.tsx index d5a3845..151c244 100644 --- a/src/components/cron.tsx +++ b/src/components/cron.tsx @@ -67,13 +67,13 @@ export const CronCard: React.FC = ({ data, mutate }) => { defaultValues: data ? data : { - name: "", - task_type: 0, - scheduler: "", - servers: [], - cover: 0, - notification_group_id: 0, - }, + name: "", + task_type: 0, + scheduler: "", + servers: [], + cover: 0, + notification_group_id: 0, + }, resetOptions: { keepDefaultValues: false, }, diff --git a/src/locales/en/translation.json b/src/locales/en/translation.json index 1757d98..80951b9 100644 --- a/src/locales/en/translation.json +++ b/src/locales/en/translation.json @@ -7,14 +7,14 @@ }, "Username": "Username", "Password": "Password", - "LoginFirst": "Please log in first", - "CurrentTime": "Current time", + "LoginFirst": "Please Log in first", + "CurrentTime": "Current Time", "Results": { "UsernameMin": "Username must be at least {{number}} characters.", "PasswordRequired": "Password cannot be empty.", "ErrorFetchingResource": "Error Fetching Resource : {{error}}", "SelectAtLeastOneServer": "Please select at least one server.", - "UnExpectedError": "UnExpected Error, Please see the console for details.", + "UnExpectedError": "Unexpected error, Please see the console for details.", "ForceUpdate": "Forced upgrade:", "NoRowsAreSelected": "No rows are selected", "ThisOperationIsUnrecoverable": "This operation cannot be undone!", @@ -42,7 +42,7 @@ "Version": "Version", "Unknown": "unknown", "Enable": "Enable", - "HideForGuest": "Hidden from visitors", + "HideForGuest": "Hidden from Visitors", "InstallCommands": "Installation command", "Note": "Note", "Success": "Success", @@ -52,7 +52,7 @@ "Loading": "Loading", "NoResults": "No results", "Actions": "Actions", - "EditServer": "Edit server", + "EditServer": "Edit Server", "Weight": "Weight (the larger the number, the higher it is displayed)", "DDNSProfiles": "DDNS Profile IDs", "SeparateWithComma": "(Separate with comma)", @@ -61,76 +61,76 @@ "Submit": "Submit", "Target": "Target", "Coverage": "Coverage", - "CoverAll": "Cover all", - "IgnoreAll": "Ignore all", + "CoverAll": "Cover All", + "IgnoreAll": "Ignore All", "SpecificServers": "Specific server", "Type": "Type", "Interval": "Interval", - "NotifierGroupID": "Notification group ID", + "NotifierGroupID": "Notifier Group ID", "Trigger": "On Trigger", "TasksToTriggerOnAlert": "The task that triggered the alert", "TasksToTriggerAfterRecovery": "Tasks to be triggered after recovery", "Confirm": "Confirm", - "ConfirmDeletion": "Confirm deletion?", + "ConfirmDeletion": "Confirm Deletion?", "Services": "Services", "ShowInService": "Show in Service", "Coverages": { - "Excludes": "Excludes specific servers", - "Only": "Only specific servers", + "Excludes": "Excludes Specific Servers", + "Only": "Only Specific Servers", "Alarmed": "Executed on the server that triggered the alarm" }, "EnableFailureNotification": "Enable Failure Notification", - "MaximumLatency": "Maximum Latency Time (ms)", - "MinimumLatency": "Minimum delay time (milliseconds)", - "EnableLatencyNotification": "Enable delayed notifications", + "MaximumLatency": "Maximum Delay (ms)", + "MinimumLatency": "Minimum Delay (milliseconds)", + "EnableLatencyNotification": "Enable Latency Notification", "EnableTriggerTask": "Enable Trigger Task", - "CronExpression": "Cron expression", - "Command": "Order", - "NotifierGroup": "Notification group", - "SendSuccessNotification": "Send success notification", + "CronExpression": "Cron Expression", + "Command": "Command", + "NotifierGroup": "Notifier Group", + "SendSuccessNotification": "Send Success Notification", "LastExecution": "Last Execution", "Result": "Result", - "Scheduled": "Scheduled tasks", + "Scheduled": "Scheduled Tasks", "Notifier": "Notifier", "AlertRule": "Alert rules", "VerifyTLS": "Verify TLS", - "TriggerMode": "Trigger mode", + "TriggerMode": "Trigger Mode", "Rules": "Rules", - "RequestMethod": "Request method", - "RequestHeader": "Request header", + "RequestMethod": "Request Method", + "RequestHeader": "Request Header", "DoNotSendTestMessage": "Do Not Send Test Message", "Always": "Always", "Once": "Once", "Provider": "Provider", - "Domains": "domain name", - "MaximumRetryAttempts": "Maximum number of retries", + "Domains": "Domains", + "MaximumRetryAttempts": "Maximum time for retry attempts", "Refresh": "Refresh", "CopyPath": "Copy path", "Goto": "Go to", - "UpdateProfile": "Update profile", - "NewUsername": "New username", - "OriginalPassword": "Original password", + "UpdateProfile": "Update Profile", + "NewUsername": "New Username", + "OriginalPassword": "Original Password", "NewPassword": "New Password", "EditDDNS": "Edit DDNS", "CreateDDNS": "Create DDNS", "Credential": "Credential", - "RequestType": "Request type", - "RequestBody": "Request body", + "RequestType": "Request Type", + "RequestBody": "Request Body", "FileManager": "Pseudo File Manager", "Downloading": "Downloading", "Uploading": "Uploading", - "EditNAT": "Edit intranet penetration", - "CreateNAT": "Create intranet penetration", - "LocalService": "Local service", - "BindHostname": "Bind domain name", - "EditServerGroup": "Edit server group", - "CreateServerGroup": "Create server group", + "EditNAT": "Edit NAT Configuration", + "CreateNAT": "Create NAT Configuration", + "LocalService": "Local Service", + "BindHostname": "Bind Domain Name", + "EditServerGroup": "Edit Server Group", + "CreateServerGroup": "Create Server Group", "User": "User", - "WAF": "Web application firewall", - "SiteName": "Site name", - "DashboardOriginalHost": "Agent docking address [domain name/IP:port]", + "WAF": "Web Application Firewall", + "SiteName": "Site Name", + "DashboardOriginalHost": "Agent connecting address [domain name/IP:port]", "ConfigTLS": "Use TLS to connect Agent", - "LoginFailed": "Login failed", + "LoginFailed": "Login Failed", "BruteForceAttackingToken": "Brute Force Attacking Token", "BruteForceAttackingAgentSecret": "Brute Force Attacking Agent Secret", "Language": "Language", @@ -139,19 +139,19 @@ "CustomPublicDNSNameserversforDDNS": "Custom Public DNS Nameservers for DDNS", "RealIPHeader": "Real IP request header", "UseDirectConnectingIP": "Use direct connection IP", - "IPChangeNotification": "IP Change notification", + "IPChangeNotification": "IP Change Notification", "FullIPNotification": "Show Full IP Address in Notification Messages", - "EditService": "Edit service", - "CreateService": "Create service", - "EditTask": "Edit task", - "CreateTask": "Create task", - "CreateNotifier": "Create notification", - "EditNotifier": "Edit notification", - "EditAlertRule": "Edit alarm rules", - "CreateAlertRule": "Create alert rules", - "EditNotifierGroup": "Edit notification group", - "CreateNotifierGroup": "Create notification group", - "NewUser": "New user", + "EditService": "Edit Service", + "CreateService": "Create Service", + "EditTask": "Edit Task", + "CreateTask": "Create Task", + "CreateNotifier": "Create Notifier", + "EditNotifier": "Edit Notifier", + "EditAlertRule": "Edit Alert Rules", + "CreateAlertRule": "Create Alert Rules", + "EditNotifierGroup": "Edit Notifier Group", + "CreateNotifierGroup": "Create Notifier Group", + "NewUser": "New User", "Count": "Count", "LastBlockReason": "Last Block Reason", "LastBlockTime": "Last ban time", @@ -161,6 +161,6 @@ "Community": "Community", "Official": "Official", "CommunityThemeWarning": "You are using a community theme", - "CommunityThemeDescription": "This theme is provided by the community, use it at your own risk", + "CommunityThemeDescription": "This theme is provided by the community, use at your own risk", "Cancel": "Cancel" } diff --git a/src/locales/it/translation.json b/src/locales/it/translation.json index d172811..1843a4b 100644 --- a/src/locales/it/translation.json +++ b/src/locales/it/translation.json @@ -119,8 +119,8 @@ "FileManager": "Gestore di File Pseudo", "Downloading": "Download in corso", "Uploading": "Caricamento", - "EditNAT": "Modifica la penetrazione della intranet", - "CreateNAT": "Creare penetrazione intranet", + "EditNAT": "Modifica configurazione NAT", + "CreateNAT": "Crea configurazione NAT", "LocalService": "servizio locale", "BindHostname": "Associa il nome di dominio", "EditServerGroup": "Modifica gruppo di server", diff --git a/src/locales/zh-CN/translation.json b/src/locales/zh-CN/translation.json index 9d95530..041cc5e 100644 --- a/src/locales/zh-CN/translation.json +++ b/src/locales/zh-CN/translation.json @@ -115,12 +115,12 @@ "CreateDDNS": "创建DDNS", "Credential": "凭据", "RequestType": "请求类型", - "RequestBody": "请求主体", + "RequestBody": "请求体", "FileManager": "文件列表", "Downloading": "下载中", "Uploading": "上传中", - "EditNAT": "编辑内网穿透", - "CreateNAT": "创建内网穿透", + "EditNAT": "编辑内网穿透配置", + "CreateNAT": "创建内网穿透配置", "LocalService": "本地服务", "BindHostname": "绑定域名", "EditServerGroup": "编辑服务器分组", diff --git a/src/locales/zh-TW/translation.json b/src/locales/zh-TW/translation.json index 8166a56..957e5e5 100644 --- a/src/locales/zh-TW/translation.json +++ b/src/locales/zh-TW/translation.json @@ -115,12 +115,12 @@ "CreateDDNS": "建立DDNS", "Credential": "憑證", "RequestType": "請求類型", - "RequestBody": "請求主體", + "RequestBody": "請求體", "FileManager": "檔案列表", "Downloading": "下載中", "Uploading": "上傳中", - "EditNAT": "編輯內網穿透", - "CreateNAT": "創建內網穿透", + "EditNAT": "編輯內網穿透配置", + "CreateNAT": "創建內網穿透配置", "LocalService": "本地服務", "BindHostname": "綁定域名", "EditServerGroup": "編輯伺服器分組", diff --git a/src/routes/settings.tsx b/src/routes/settings.tsx index a2cdd10..62d2626 100644 --- a/src/routes/settings.tsx +++ b/src/routes/settings.tsx @@ -64,7 +64,7 @@ export default function SettingsPage() { }, [error]) useEffect(() => { - ; (async () => { + ;(async () => { try { const c = await getSettings() setConfig(c) @@ -78,20 +78,20 @@ export default function SettingsPage() { resolver: zodResolver(settingFormSchema), defaultValues: config ? { - ...config, - site_name: config.site_name || "", - user_template: - config.user_template || - Object.keys(config.frontend_templates.filter((t) => !t.is_admin) || {})[0] || - "user-dist", - } + ...config, + site_name: config.site_name || "", + user_template: + config.user_template || + Object.keys(config.frontend_templates.filter((t) => !t.is_admin) || {})[0] || + "user-dist", + } : { - ip_change_notification_group_id: 0, - cover: 1, - site_name: "", - language: "", - user_template: "user-dist", - }, + ip_change_notification_group_id: 0, + cover: 1, + site_name: "", + language: "", + user_template: "user-dist", + }, resetOptions: { keepDefaultValues: false, }, @@ -236,15 +236,15 @@ export default function SettingsPage() { {!config?.frontend_templates?.find( (t) => t.path === field.value, )?.is_official && ( -
-
- {t("CommunityThemeWarning")} -
-
- {t("CommunityThemeDescription")} -
+
+
+ {t("CommunityThemeWarning")}
- )} +
+ {t("CommunityThemeDescription")} +
+
+ )} )} /> diff --git a/src/routes/waf.tsx b/src/routes/waf.tsx index d8a6dc9..b236ac3 100644 --- a/src/routes/waf.tsx +++ b/src/routes/waf.tsx @@ -69,9 +69,7 @@ export default function WAFPage() { header: t("LastBlockReason"), accessorKey: "lastBlockReason", accessorFn: (row) => row.last_block_reason, - cell: ({ row }) => ( - {wafBlockReasons[row.original.last_block_reason] || ""} - ), + cell: ({ row }) => {wafBlockReasons[row.original.last_block_reason] || ""}, }, { header: t("LastBlockTime"), @@ -141,9 +139,9 @@ export default function WAFPage() { {header.isPlaceholder ? null : flexRender( - header.column.columnDef.header, - header.getContext(), - )} + header.column.columnDef.header, + header.getContext(), + )} ) })} diff --git a/src/types/cron.ts b/src/types/cron.ts index 03b7685..6506952 100644 --- a/src/types/cron.ts +++ b/src/types/cron.ts @@ -9,4 +9,4 @@ export const cronCoverageTypes: Record = { 0: i18n.t("Coverages.Only"), 1: i18n.t("Coverages.Excludes"), 2: i18n.t("Coverages.Alarmed"), -} \ No newline at end of file +} diff --git a/src/types/service.ts b/src/types/service.ts index 8ce8db3..1a2889d 100644 --- a/src/types/service.ts +++ b/src/types/service.ts @@ -9,4 +9,4 @@ export const serviceTypes: Record = { export const serviceCoverageTypes: Record = { 0: i18n.t("Coverages.Excludes"), 1: i18n.t("Coverages.Only"), -} \ No newline at end of file +}