mirror of
https://github.com/fosrl/pangolin.git
synced 2026-02-15 01:16:38 +00:00
Format all files
This commit is contained in:
@@ -34,14 +34,16 @@ export default async function SettingsLayout(props: SettingsLayoutProps) {
|
||||
|
||||
const navItems = [
|
||||
{
|
||||
title: t('apiKeysPermissionsTitle'),
|
||||
title: t("apiKeysPermissionsTitle"),
|
||||
href: "/admin/api-keys/{apiKeyId}/permissions"
|
||||
}
|
||||
];
|
||||
|
||||
return (
|
||||
<>
|
||||
<SettingsSectionTitle title={t('apiKeysSettings', {apiKeyName: apiKey?.name})} />
|
||||
<SettingsSectionTitle
|
||||
title={t("apiKeysSettings", { apiKeyName: apiKey?.name })}
|
||||
/>
|
||||
|
||||
<ApiKeyProvider apiKey={apiKey}>
|
||||
<HorizontalTabs items={navItems}>{children}</HorizontalTabs>
|
||||
|
||||
@@ -45,10 +45,10 @@ export default function Page() {
|
||||
.catch((e) => {
|
||||
toast({
|
||||
variant: "destructive",
|
||||
title: t('apiKeysPermissionsErrorLoadingActions'),
|
||||
title: t("apiKeysPermissionsErrorLoadingActions"),
|
||||
description: formatAxiosError(
|
||||
e,
|
||||
t('apiKeysPermissionsErrorLoadingActions')
|
||||
t("apiKeysPermissionsErrorLoadingActions")
|
||||
)
|
||||
});
|
||||
});
|
||||
@@ -79,18 +79,18 @@ export default function Page() {
|
||||
)
|
||||
})
|
||||
.catch((e) => {
|
||||
console.error(t('apiKeysErrorSetPermission'), e);
|
||||
console.error(t("apiKeysErrorSetPermission"), e);
|
||||
toast({
|
||||
variant: "destructive",
|
||||
title: t('apiKeysErrorSetPermission'),
|
||||
title: t("apiKeysErrorSetPermission"),
|
||||
description: formatAxiosError(e)
|
||||
});
|
||||
});
|
||||
|
||||
if (actionsRes && actionsRes.status === 200) {
|
||||
toast({
|
||||
title: t('apiKeysPermissionsUpdated'),
|
||||
description: t('apiKeysPermissionsUpdatedDescription')
|
||||
title: t("apiKeysPermissionsUpdated"),
|
||||
description: t("apiKeysPermissionsUpdatedDescription")
|
||||
});
|
||||
}
|
||||
|
||||
@@ -104,10 +104,12 @@ export default function Page() {
|
||||
<SettingsSection>
|
||||
<SettingsSectionHeader>
|
||||
<SettingsSectionTitle>
|
||||
{t('apiKeysPermissionsTitle')}
|
||||
{t("apiKeysPermissionsTitle")}
|
||||
</SettingsSectionTitle>
|
||||
<SettingsSectionDescription>
|
||||
{t('apiKeysPermissionsGeneralSettingsDescription')}
|
||||
{t(
|
||||
"apiKeysPermissionsGeneralSettingsDescription"
|
||||
)}
|
||||
</SettingsSectionDescription>
|
||||
</SettingsSectionHeader>
|
||||
<SettingsSectionBody>
|
||||
@@ -125,7 +127,7 @@ export default function Page() {
|
||||
loading={loadingSavePermissions}
|
||||
disabled={loadingSavePermissions}
|
||||
>
|
||||
{t('apiKeysPermissionsSave')}
|
||||
{t("apiKeysPermissionsSave")}
|
||||
</Button>
|
||||
</SettingsSectionFooter>
|
||||
</SettingsSectionBody>
|
||||
|
||||
@@ -30,7 +30,7 @@ import { createApiClient, formatAxiosError } from "@app/lib/api";
|
||||
import { useEnvContext } from "@app/hooks/useEnvContext";
|
||||
import { toast } from "@app/hooks/useToast";
|
||||
import { AxiosResponse } from "axios";
|
||||
import { useRouter } from "next/navigation";
|
||||
import { useRouter } from "next/navigation";
|
||||
import {
|
||||
CreateOrgApiKeyBody,
|
||||
CreateOrgApiKeyResponse
|
||||
@@ -64,10 +64,10 @@ export default function Page() {
|
||||
name: z
|
||||
.string()
|
||||
.min(2, {
|
||||
message: t('nameMin', {len: 2})
|
||||
message: t("nameMin", { len: 2 })
|
||||
})
|
||||
.max(255, {
|
||||
message: t('nameMax', {len: 255})
|
||||
message: t("nameMax", { len: 255 })
|
||||
})
|
||||
});
|
||||
|
||||
@@ -82,7 +82,7 @@ export default function Page() {
|
||||
return data.copied;
|
||||
},
|
||||
{
|
||||
message: t('apiKeysConfirmCopy2'),
|
||||
message: t("apiKeysConfirmCopy2"),
|
||||
path: ["copied"]
|
||||
}
|
||||
);
|
||||
@@ -115,7 +115,7 @@ export default function Page() {
|
||||
.catch((e) => {
|
||||
toast({
|
||||
variant: "destructive",
|
||||
title: t('apiKeysErrorCreate'),
|
||||
title: t("apiKeysErrorCreate"),
|
||||
description: formatAxiosError(e)
|
||||
});
|
||||
});
|
||||
@@ -136,10 +136,10 @@ export default function Page() {
|
||||
)
|
||||
})
|
||||
.catch((e) => {
|
||||
console.error(t('apiKeysErrorSetPermission'), e);
|
||||
console.error(t("apiKeysErrorSetPermission"), e);
|
||||
toast({
|
||||
variant: "destructive",
|
||||
title: t('apiKeysErrorSetPermission'),
|
||||
title: t("apiKeysErrorSetPermission"),
|
||||
description: formatAxiosError(e)
|
||||
});
|
||||
});
|
||||
@@ -172,8 +172,8 @@ export default function Page() {
|
||||
<>
|
||||
<div className="flex justify-between">
|
||||
<HeaderTitle
|
||||
title={t('apiKeysCreate')}
|
||||
description={t('apiKeysCreateDescription')}
|
||||
title={t("apiKeysCreate")}
|
||||
description={t("apiKeysCreateDescription")}
|
||||
/>
|
||||
<Button
|
||||
variant="outline"
|
||||
@@ -181,7 +181,7 @@ export default function Page() {
|
||||
router.push(`/admin/api-keys`);
|
||||
}}
|
||||
>
|
||||
{t('apiKeysSeeAll')}
|
||||
{t("apiKeysSeeAll")}
|
||||
</Button>
|
||||
</div>
|
||||
|
||||
@@ -193,7 +193,7 @@ export default function Page() {
|
||||
<SettingsSection>
|
||||
<SettingsSectionHeader>
|
||||
<SettingsSectionTitle>
|
||||
{t('apiKeysTitle')}
|
||||
{t("apiKeysTitle")}
|
||||
</SettingsSectionTitle>
|
||||
</SettingsSectionHeader>
|
||||
<SettingsSectionBody>
|
||||
@@ -214,7 +214,7 @@ export default function Page() {
|
||||
render={({ field }) => (
|
||||
<FormItem>
|
||||
<FormLabel>
|
||||
{t('name')}
|
||||
{t("name")}
|
||||
</FormLabel>
|
||||
<FormControl>
|
||||
<Input
|
||||
@@ -235,10 +235,12 @@ export default function Page() {
|
||||
<SettingsSection>
|
||||
<SettingsSectionHeader>
|
||||
<SettingsSectionTitle>
|
||||
{t('apiKeysGeneralSettings')}
|
||||
{t("apiKeysGeneralSettings")}
|
||||
</SettingsSectionTitle>
|
||||
<SettingsSectionDescription>
|
||||
{t('apiKeysGeneralSettingsDescription')}
|
||||
{t(
|
||||
"apiKeysGeneralSettingsDescription"
|
||||
)}
|
||||
</SettingsSectionDescription>
|
||||
</SettingsSectionHeader>
|
||||
<SettingsSectionBody>
|
||||
@@ -258,14 +260,14 @@ export default function Page() {
|
||||
<SettingsSection>
|
||||
<SettingsSectionHeader>
|
||||
<SettingsSectionTitle>
|
||||
{t('apiKeysList')}
|
||||
{t("apiKeysList")}
|
||||
</SettingsSectionTitle>
|
||||
</SettingsSectionHeader>
|
||||
<SettingsSectionBody>
|
||||
<InfoSections cols={2}>
|
||||
<InfoSection>
|
||||
<InfoSectionTitle>
|
||||
{t('name')}
|
||||
{t("name")}
|
||||
</InfoSectionTitle>
|
||||
<InfoSectionContent>
|
||||
<CopyToClipboard
|
||||
@@ -275,7 +277,7 @@ export default function Page() {
|
||||
</InfoSection>
|
||||
<InfoSection>
|
||||
<InfoSectionTitle>
|
||||
{t('created')}
|
||||
{t("created")}
|
||||
</InfoSectionTitle>
|
||||
<InfoSectionContent>
|
||||
{moment(
|
||||
@@ -288,10 +290,10 @@ export default function Page() {
|
||||
<Alert variant="neutral">
|
||||
<InfoIcon className="h-4 w-4" />
|
||||
<AlertTitle className="font-semibold">
|
||||
{t('apiKeysSave')}
|
||||
{t("apiKeysSave")}
|
||||
</AlertTitle>
|
||||
<AlertDescription>
|
||||
{t('apiKeysSaveDescription')}
|
||||
{t("apiKeysSaveDescription")}
|
||||
</AlertDescription>
|
||||
</Alert>
|
||||
|
||||
@@ -358,7 +360,7 @@ export default function Page() {
|
||||
router.push(`/admin/api-keys`);
|
||||
}}
|
||||
>
|
||||
{t('cancel')}
|
||||
{t("cancel")}
|
||||
</Button>
|
||||
)}
|
||||
{!apiKey && (
|
||||
@@ -370,7 +372,7 @@ export default function Page() {
|
||||
form.handleSubmit(onSubmit)();
|
||||
}}
|
||||
>
|
||||
{t('generate')}
|
||||
{t("generate")}
|
||||
</Button>
|
||||
)}
|
||||
|
||||
@@ -381,7 +383,7 @@ export default function Page() {
|
||||
copiedForm.handleSubmit(onCopiedSubmit)();
|
||||
}}
|
||||
>
|
||||
{t('done')}
|
||||
{t("done")}
|
||||
</Button>
|
||||
)}
|
||||
</div>
|
||||
|
||||
@@ -34,8 +34,8 @@ export default async function ApiKeysPage(props: ApiKeyPageProps) {
|
||||
return (
|
||||
<>
|
||||
<SettingsSectionTitle
|
||||
title={t('apiKeysManage')}
|
||||
description={t('apiKeysDescription')}
|
||||
title={t("apiKeysManage")}
|
||||
description={t("apiKeysDescription")}
|
||||
/>
|
||||
|
||||
<ApiKeysTable apiKeys={rows} />
|
||||
|
||||
Reference in New Issue
Block a user