|
|
@@ -0,0 +1,50 @@
|
|
|
+import type {
|
|
|
+ NextPage, GetServerSideProps, GetServerSidePropsContext,
|
|
|
+} from 'next';
|
|
|
+import { useTranslation } from 'next-i18next';
|
|
|
+import dynamic from 'next/dynamic';
|
|
|
+import Head from 'next/head';
|
|
|
+
|
|
|
+import type { CrowiRequest } from '~/interfaces/crowi-request';
|
|
|
+import type { CommonProps } from '~/pages/utils/commons';
|
|
|
+import { generateCustomTitle } from '~/pages/utils/commons';
|
|
|
+
|
|
|
+import { retrieveServerSideProps } from '../../utils/admin-page-util';
|
|
|
+
|
|
|
+const AdminLayout = dynamic(() => import('~/components/Layout/AdminLayout'), { ssr: false });
|
|
|
+const ForbiddenPage = dynamic(() => import('~/client/components/Admin/ForbiddenPage').then(mod => mod.ForbiddenPage), { ssr: false });
|
|
|
+
|
|
|
+type Props = CommonProps & {
|
|
|
+ //
|
|
|
+};
|
|
|
+
|
|
|
+const AdminOpenaiPage: NextPage<Props> = (props) => {
|
|
|
+ const { t } = useTranslation('admin');
|
|
|
+
|
|
|
+ const title = t('openai_management.openai_management');
|
|
|
+ const headTitle = generateCustomTitle(props, title);
|
|
|
+
|
|
|
+ if (props.isAccessDeniedForNonAdminUser) {
|
|
|
+ return <ForbiddenPage />;
|
|
|
+ }
|
|
|
+
|
|
|
+ return (
|
|
|
+ <AdminLayout componentTitle={title}>
|
|
|
+ <Head>
|
|
|
+ <title>{headTitle}</title>
|
|
|
+ </Head>
|
|
|
+ </AdminLayout>
|
|
|
+ );
|
|
|
+};
|
|
|
+
|
|
|
+const injectServerConfigurations = async(context: GetServerSidePropsContext, props: Props): Promise<void> => {
|
|
|
+ const req: CrowiRequest = context.req as CrowiRequest;
|
|
|
+ const { crowi } = req;
|
|
|
+};
|
|
|
+
|
|
|
+export const getServerSideProps: GetServerSideProps = async(context: GetServerSidePropsContext) => {
|
|
|
+ const props = await retrieveServerSideProps(context, injectServerConfigurations);
|
|
|
+ return props;
|
|
|
+};
|
|
|
+
|
|
|
+export default AdminOpenaiPage;
|