Explorar o código

Modified the code based off FB

Shunm634-source %!s(int64=3) %!d(string=hai) anos
pai
achega
1d986d0550

+ 22 - 7
packages/app/src/pages/installer.page.tsx

@@ -6,7 +6,7 @@ import {
 } from 'next';
 } from 'next';
 import { serverSideTranslations } from 'next-i18next/serverSideTranslations';
 import { serverSideTranslations } from 'next-i18next/serverSideTranslations';
 
 
-import { CrowiRequest } from '~/interfaces/crowi-request';
+import { RawLayout } from '~/components/Layout/RawLayout';
 
 
 import InstallerForm from '../components/InstallerForm';
 import InstallerForm from '../components/InstallerForm';
 import {
 import {
@@ -14,8 +14,9 @@ import {
   useAppTitle, useSiteUrl, useConfidential,
   useAppTitle, useSiteUrl, useConfidential,
 } from '../stores/context';
 } from '../stores/context';
 
 
+
 import {
 import {
-  CommonProps, getNextI18NextConfig, getServerSideCommonProps,
+  CommonProps, getNextI18NextConfig, getServerSideCommonProps, useCustomTitle,
 } from './commons';
 } from './commons';
 
 
 
 
@@ -29,9 +30,6 @@ async function injectNextI18NextConfigurations(context: GetServerSidePropsContex
 type Props = CommonProps & {
 type Props = CommonProps & {
 
 
   pageWithMetaStr: string,
   pageWithMetaStr: string,
-
-  isForbidden: boolean,
-  isNotFound: boolean,
 };
 };
 
 
 const InstallerPage: NextPage<Props> = (props: Props) => {
 const InstallerPage: NextPage<Props> = (props: Props) => {
@@ -45,15 +43,32 @@ const InstallerPage: NextPage<Props> = (props: Props) => {
   // page
   // page
   useCurrentPagePath(props.currentPathname);
   useCurrentPagePath(props.currentPathname);
 
 
+  const classNames: string[] = [];
+
   return (
   return (
     <>
     <>
-      <InstallerForm />
+      <RawLayout title={useCustomTitle(props, 'GROWI')} className={classNames.join(' ')}>
+        <div id="page-wrapper">
+          <div className="main container-fluid">
+
+            <div className="row">
+              <div className="col-md-12">
+                <div className="login-header mx-auto">
+                  <h1 className="my-3">GROWI</h1>
+                </div>
+              </div>
+              <div className="col-md-12">
+                <InstallerForm />
+              </div>
+            </div>
+          </div>
+        </div>
+      </RawLayout>
     </>
     </>
   );
   );
 };
 };
 
 
 export const getServerSideProps: GetServerSideProps = async(context: GetServerSidePropsContext) => {
 export const getServerSideProps: GetServerSideProps = async(context: GetServerSidePropsContext) => {
-  const req: CrowiRequest = context.req as CrowiRequest;
   const result = await getServerSideCommonProps(context);
   const result = await getServerSideCommonProps(context);
 
 
   // check for presence
   // check for presence

+ 2 - 2
packages/app/src/server/routes/index.js

@@ -94,8 +94,8 @@ module.exports = function(crowi, app) {
   // installer
   // installer
   if (!isInstalled) {
   if (!isInstalled) {
     const installer = require('./installer')(crowi);
     const installer = require('./installer')(crowi);
-    app.get('/installer'              , applicationNotInstalled, next.delegateToNext, installer.index);
-    app.post('/installer'             , applicationNotInstalled , registerFormValidator.registerRules(), registerFormValidator.registerValidation, csrfProtection, installer.install);
+    app.get('/installer'              , applicationNotInstalled, next.delegateToNext);
+    app.post('/installer'             , applicationNotInstalled , registerFormValidator.registerRules(), registerFormValidator.registerValidation, csrfProtection, addActivity, installer.install);
     return;
     return;
   }
   }