diff --git a/frontend/src/components/authorization/AuthorizationAdminBox.tsx b/frontend/src/components/authorization/AuthorizationAdminBox.tsx new file mode 100644 index 0000000..dc1061c --- /dev/null +++ b/frontend/src/components/authorization/AuthorizationAdminBox.tsx @@ -0,0 +1,61 @@ +import {navigate} from "@reach/router" +import {Box, Form, Heading, Idiomatic as I} from "@steffo/bluelib-react" +import * as React from "react" +import {useAuthorizationContext} from "../../contexts/authorization" +import {useInstanceContext} from "../../contexts/instance" + + +export interface AuthorizationAdminBoxProps { + +} + + +export function AuthorizationAdminBox({}: AuthorizationAdminBoxProps): JSX.Element { + const instance = useInstanceContext() + const authorization = useAuthorizationContext() + + const canAdministrate = + React.useMemo( + () => ( + authorization !== undefined && !authorization.state.running + ), + [authorization], + ) + + const doAdministrate = + React.useCallback( + async () => { + if(!instance) { + return + } + if(!instance.state.url) { + return + } + + await navigate(`${instance.state.url}admin`) + }, + [instance], + ) + + + return ( + + + Site administration + +

+ To configure the Sophon server, an account with superuser access is required. +

+

+ If you are the server administrator, please refer to the Sophon manual for details on how to acquire the credentials for this account. +

+
+ + + Administrate + + +
+
+ ) +} diff --git a/frontend/src/components/authorization/AuthorizationStepPage.tsx b/frontend/src/components/authorization/AuthorizationStepPage.tsx index 4a25eee..815f93e 100644 --- a/frontend/src/components/authorization/AuthorizationStepPage.tsx +++ b/frontend/src/components/authorization/AuthorizationStepPage.tsx @@ -1,6 +1,7 @@ import {Chapter} from "@steffo/bluelib-react" import * as React from "react" import {InstanceDescriptionBox} from "../instance/InstanceDescriptionBox" +import {AuthorizationAdminBox} from "./AuthorizationAdminBox" import {AuthorizationBrowseBox} from "./AuthorizationBrowseBox" import {AuthorizationLoginBox} from "./AuthorizationLoginBox" @@ -12,5 +13,6 @@ export function AuthorizationStepPage(): JSX.Element { + }