mirror of
https://github.com/fosrl/pangolin.git
synced 2026-03-03 09:16:40 +00:00
I18n components (#27)
* New translation keys in en-US locale * New translation keys in de-DE locale * New translation keys in fr-FR locale * New translation keys in it-IT locale * New translation keys in pl-PL locale * New translation keys in pt-PT locale * New translation keys in tr-TR locale * Move into function * Replace string matching to boolean check * Add FIXIT in UsersTable * Use localization for size units * Missed and restored translation keys * fixup! New translation keys in tr-TR locale * Add translation keys in components
This commit is contained in:
@@ -162,9 +162,10 @@ export default function ResourceAuthenticationPage() {
|
||||
rolesResponse.data.data.roles
|
||||
.map((role) => ({
|
||||
id: role.roleId.toString(),
|
||||
text: role.name
|
||||
text: role.name,
|
||||
isAdmin: role.isAdmin
|
||||
}))
|
||||
.filter((role) => role.text !== "Admin")
|
||||
.filter((role) => !role.isAdmin)
|
||||
);
|
||||
|
||||
usersRolesForm.setValue(
|
||||
@@ -172,9 +173,10 @@ export default function ResourceAuthenticationPage() {
|
||||
resourceRolesResponse.data.data.roles
|
||||
.map((i) => ({
|
||||
id: i.roleId.toString(),
|
||||
text: i.name
|
||||
text: i.name,
|
||||
isAdmin: i.isAdmin
|
||||
}))
|
||||
.filter((role) => role.text !== "Admin")
|
||||
.filter((role) => !role.isAdmin)
|
||||
);
|
||||
|
||||
setAllUsers(
|
||||
|
||||
@@ -88,17 +88,6 @@ type LocalRule = ArrayElement<ListResourceRulesResponse["rules"]> & {
|
||||
updated?: boolean;
|
||||
};
|
||||
|
||||
const RuleAction = {
|
||||
ACCEPT: "Always Allow",
|
||||
DROP: "Always Deny"
|
||||
} as const;
|
||||
|
||||
const RuleMatch = {
|
||||
PATH: "Path",
|
||||
IP: "IP",
|
||||
CIDR: "IP Range"
|
||||
} as const;
|
||||
|
||||
export default function ResourceRules(props: {
|
||||
params: Promise<{ resourceId: number }>;
|
||||
}) {
|
||||
@@ -113,6 +102,17 @@ export default function ResourceRules(props: {
|
||||
const router = useRouter();
|
||||
const t = useTranslations();
|
||||
|
||||
const RuleAction = {
|
||||
ACCEPT: t('alwaysAllow'),
|
||||
DROP: t('alwaysDeny')
|
||||
} as const;
|
||||
|
||||
const RuleMatch = {
|
||||
PATH: t('path'),
|
||||
IP: "IP",
|
||||
CIDR: t('ipAddressRange')
|
||||
} as const;
|
||||
|
||||
const addRuleForm = useForm({
|
||||
resolver: zodResolver(addRuleSchema),
|
||||
defaultValues: {
|
||||
|
||||
Reference in New Issue
Block a user