|
|
@@ -1,6 +1,7 @@
|
|
|
import React from 'react';
|
|
|
|
|
|
import { isClient, objectIdUtils } from '@growi/core';
|
|
|
+import mongoose from 'mongoose';
|
|
|
import {
|
|
|
NextPage, GetServerSideProps, GetServerSidePropsContext,
|
|
|
} from 'next';
|
|
|
@@ -28,8 +29,10 @@ import AdminSamlSecurityContainer from '~/client/services/AdminSamlSecurityConta
|
|
|
import AdminSlackIntegrationLegacyContainer from '~/client/services/AdminSlackIntegrationLegacyContainer';
|
|
|
import AdminTwitterSecurityContainer from '~/client/services/AdminTwitterSecurityContainer';
|
|
|
import AdminUsersContainer from '~/client/services/AdminUsersContainer';
|
|
|
+import { ActivatePluginService, GrowiPluginManifestEntries } from '~/client/services/activate-plugin';
|
|
|
import { SupportedActionType } from '~/interfaces/activity';
|
|
|
import { CrowiRequest } from '~/interfaces/crowi-request';
|
|
|
+import { GrowiPlugin } from '~/interfaces/plugin';
|
|
|
import ConfigLoader from '~/server/service/config-loader';
|
|
|
import {
|
|
|
useCurrentUser, /* useSearchServiceConfigured, */ useIsAclEnabled, useIsMailerSetup, useIsSearchServiceReachable, useSiteUrl,
|
|
|
@@ -81,6 +84,8 @@ type Props = CommonProps & {
|
|
|
auditLogEnabled: boolean,
|
|
|
auditLogAvailableActions: SupportedActionType[],
|
|
|
|
|
|
+ pluginManifestEntries: any,
|
|
|
+
|
|
|
siteUrl: string,
|
|
|
};
|
|
|
|
|
|
@@ -180,8 +185,8 @@ const AdminMarkdownSettingsPage: NextPage<Props> = (props: Props) => {
|
|
|
title: t('audit_log_management.audit_log'),
|
|
|
component: <AuditLogManagement />,
|
|
|
},
|
|
|
- 'plugins-extention': {
|
|
|
- title: 'Plugins Extention',
|
|
|
+ 'plugins-extension': {
|
|
|
+ title: 'Plugins Extension',
|
|
|
component: <PluginsExtensionPageContents />,
|
|
|
},
|
|
|
};
|
|
|
@@ -315,6 +320,15 @@ async function injectNextI18NextConfigurations(context: GetServerSidePropsContex
|
|
|
props._nextI18Next = nextI18NextConfig._nextI18Next;
|
|
|
}
|
|
|
|
|
|
+async function getPluginProps(ctx, props): Promise<any> {
|
|
|
+ // const initialProps: DocumentInitialProps = await Document.getInitialProps(ctx);
|
|
|
+
|
|
|
+ const GrowiPlugin = mongoose.model<GrowiPlugin>('GrowiPlugin');
|
|
|
+ const growiPlugins = await GrowiPlugin.find({ isEnabled: true });
|
|
|
+ const pluginManifestEntries: GrowiPluginManifestEntries = await ActivatePluginService.retrievePluginManifests(growiPlugins);
|
|
|
+ props.pluginManifestEntries = JSON.parse(JSON.stringify(pluginManifestEntries));
|
|
|
+}
|
|
|
+
|
|
|
export const getServerSideProps: GetServerSideProps = async(context: GetServerSidePropsContext) => {
|
|
|
const req: CrowiRequest = context.req as CrowiRequest;
|
|
|
|
|
|
@@ -334,6 +348,7 @@ export const getServerSideProps: GetServerSideProps = async(context: GetServerSi
|
|
|
|
|
|
injectServerConfigurations(context, props);
|
|
|
await injectNextI18NextConfigurations(context, props, ['admin']);
|
|
|
+ await getPluginProps(context, props);
|
|
|
|
|
|
return {
|
|
|
props,
|