mirror of
https://github.com/Buriburizaem0n/admin-frontend-domain.git
synced 2026-05-06 05:38:51 +00:00
refactor: enum i18n
This commit is contained in:
@@ -81,7 +81,7 @@ export default function AlertRulePage() {
|
||||
{
|
||||
header: t("TriggerMode"),
|
||||
accessorKey: "trigger Mode",
|
||||
accessorFn: (row) => triggerModes(t)[row.trigger_mode] || "",
|
||||
accessorFn: (row) => triggerModes[row.trigger_mode] || "",
|
||||
},
|
||||
{
|
||||
header: t("Rules"),
|
||||
|
||||
+1
-1
@@ -74,7 +74,7 @@ export default function CronPage() {
|
||||
{
|
||||
header: t("Type"),
|
||||
accessorKey: "taskType",
|
||||
accessorFn: (row) => cronTypes(t)[row.task_type] || "",
|
||||
accessorFn: (row) => cronTypes[row.task_type] || "",
|
||||
},
|
||||
{
|
||||
header: t("CronExpression"),
|
||||
|
||||
+23
-23
@@ -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 && (
|
||||
<div className="mt-2 text-sm text-yellow-700 dark:text-yellow-200 bg-yellow-100 dark:bg-yellow-900 border border-yellow-200 dark:border-yellow-700 rounded-md p-2">
|
||||
<div className="font-medium text-lg mb-1">
|
||||
{t("CommunityThemeWarning")}
|
||||
<div className="mt-2 text-sm text-yellow-700 dark:text-yellow-200 bg-yellow-100 dark:bg-yellow-900 border border-yellow-200 dark:border-yellow-700 rounded-md p-2">
|
||||
<div className="font-medium text-lg mb-1">
|
||||
{t("CommunityThemeWarning")}
|
||||
</div>
|
||||
<div className="text-yellow-700 dark:text-yellow-200">
|
||||
{t("CommunityThemeDescription")}
|
||||
</div>
|
||||
</div>
|
||||
<div className="text-yellow-700 dark:text-yellow-200">
|
||||
{t("CommunityThemeDescription")}
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
)}
|
||||
</FormItem>
|
||||
)}
|
||||
/>
|
||||
@@ -383,7 +383,7 @@ export default function SettingsPage() {
|
||||
</FormControl>
|
||||
<SelectContent>
|
||||
{Object.entries(
|
||||
settingCoverageTypes(t),
|
||||
settingCoverageTypes,
|
||||
).map(([k, v]) => (
|
||||
<SelectItem key={k} value={k}>
|
||||
{v}
|
||||
|
||||
+4
-4
@@ -70,7 +70,7 @@ export default function WAFPage() {
|
||||
accessorKey: "lastBlockReason",
|
||||
accessorFn: (row) => row.last_block_reason,
|
||||
cell: ({ row }) => (
|
||||
<span>{wafBlockReasons(t)[row.original.last_block_reason] || ""}</span>
|
||||
<span>{wafBlockReasons[row.original.last_block_reason] || ""}</span>
|
||||
),
|
||||
},
|
||||
{
|
||||
@@ -141,9 +141,9 @@ export default function WAFPage() {
|
||||
{header.isPlaceholder
|
||||
? null
|
||||
: flexRender(
|
||||
header.column.columnDef.header,
|
||||
header.getContext(),
|
||||
)}
|
||||
header.column.columnDef.header,
|
||||
header.getContext(),
|
||||
)}
|
||||
</TableHead>
|
||||
)
|
||||
})}
|
||||
|
||||
Reference in New Issue
Block a user