Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
4rthem committed Dec 13, 2023
1 parent 015aaef commit bff5abd
Show file tree
Hide file tree
Showing 7 changed files with 234 additions and 201 deletions.
49 changes: 24 additions & 25 deletions dashboard/client/config-compiler.js
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
(function (config, env) {
const whiteList = [
'DATABOX_API_URL',
'DATABOX_CLIENT_URL',
'DEV_MODE',
'DISPLAY_SERVICES_MENU',
'DOCKER_TAG',
'ELASTICHQ_URL',
'EXPOSE_API_URL',
'EXPOSE_CLIENT_URL',
'KEYCLOAK_URL',
'MAILHOG_URL',
'MATOMO_URL',
'NOTIFY_API_URL',
'PGADMIN_URL',
'PHPMYADMIN_URL',
'RABBITMQ_CONSOLE_URL',
'REPORT_API_URL',
'SAML_URL',
'SAML2_URL',
'STACK_NAME',
'TRAEFIK_CONSOLE_URL',
'UPLOADER_API_URL',
'UPLOADER_CLIENT_URL',
'ZIPPY_URL',
'DATABOX_API_URL',
'DATABOX_CLIENT_URL',
'DEV_MODE',
'DISPLAY_SERVICES_MENU',
'ELASTICHQ_URL',
'EXPOSE_API_URL',
'EXPOSE_CLIENT_URL',
'KEYCLOAK_URL',
'MAILHOG_URL',
'MATOMO_URL',
'NOTIFY_API_URL',
'PGADMIN_URL',
'PHPMYADMIN_URL',
'RABBITMQ_CONSOLE_URL',
'REPORT_API_URL',
'SAML2_URL',
'SAML_URL',
'STACK_NAME',
'STACK_VERSION',
'TRAEFIK_CONSOLE_URL',
'UPLOADER_API_URL',
'UPLOADER_CLIENT_URL',
'ZIPPY_URL',
];

const e = {};
Expand All @@ -31,8 +31,7 @@
if (whiteList.includes(key)) {
e[key] = value;
}
})

});

return {
locales: config.available_locales,
Expand Down
43 changes: 20 additions & 23 deletions dashboard/client/src/ClientApp.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import Service, {ServiceBaseProps} from "./Service.tsx";
import Service, {ServiceBaseProps} from './Service.tsx';
import AdminPanelSettingsIcon from '@mui/icons-material/AdminPanelSettings';
import ApiIcon from '@mui/icons-material/Api';

Expand All @@ -7,26 +7,23 @@ type Props = {
clientUrl: string;
} & ServiceBaseProps;

export default function ClientApp({
apiUrl,
clientUrl,
...props
}: Props) {

return <Service
mainUrl={clientUrl}
links={[
{
icon: <AdminPanelSettingsIcon/>,
href: `${apiUrl}/admin`,
title: `Admin of ${props.title}`
},
{
icon: <ApiIcon/>,
href: apiUrl,
title: `API documentation of ${props.title}`
},
]}
{...props}
/>
export default function ClientApp({apiUrl, clientUrl, ...props}: Props) {
return (
<Service
mainUrl={clientUrl}
links={[
{
icon: <AdminPanelSettingsIcon />,
href: `${apiUrl}/admin`,
title: `Admin of ${props.title}`,
},
{
icon: <ApiIcon />,
href: apiUrl,
title: `API documentation of ${props.title}`,
},
]}
{...props}
/>
);
}
139 changes: 92 additions & 47 deletions dashboard/client/src/Root.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import {Container, Grid} from "@mui/material";
import Service from "./Service";
import ClientApp from "./ClientApp.tsx";
import config from "./config.ts";
import {Alert, Chip, Container, Grid, Typography} from '@mui/material';
import Service from './Service';
import ClientApp from './ClientApp.tsx';
import config from './config.ts';
import ApiIcon from "@mui/icons-material/Api";
import SellIcon from '@mui/icons-material/Sell';

type Props = {};

Expand All @@ -15,51 +17,94 @@ export default function Root({}: Props) {
DATABOX_CLIENT_URL,
EXPOSE_CLIENT_URL,
UPLOADER_CLIENT_URL,
STACK_NAME,
DEV_MODE,
STACK_VERSION,
} = config.env;

console.log('config.env', config.env);

return <Container>
<Grid
sx={{
pt: 2,
}}
container
spacing={2}
>
<Service
mainUrl={KEYCLOAK_URL}
title={`Identity Manager`}
description={`Keycloak IAM`}
logo={'/src/images/keycloak.png'}
/>
{DATABOX_API_URL && <ClientApp
apiUrl={DATABOX_API_URL}
clientUrl={DATABOX_CLIENT_URL}
title={`Databox`}
description={`Your DAM`}
logo={'/src/images/databox.png'}
/>}
{EXPOSE_API_URL && <ClientApp
apiUrl={EXPOSE_API_URL}
clientUrl={EXPOSE_CLIENT_URL}
title={`Expose`}
description={`Share Publications`}
logo={'/src/images/expose.png'}
/>}
{UPLOADER_API_URL && <ClientApp
apiUrl={UPLOADER_API_URL}
clientUrl={UPLOADER_CLIENT_URL}
title={`Uploader`}
description={`Standalone Asset deposit`}
logo={'/src/images/uploader.png'}
/>}
{NOTIFY_API_URL && <Service
mainUrl={`${NOTIFY_API_URL}/admin`}
title={`Notify`}
description={`Mail Sender`}
logo={'/src/images/notify.png'}
/>}
</Grid>
</Container>
return (
<Container>
<Typography
variant={'h1'}
sx={{
'.MuiChip-root': {
ml: 2,
fontWeight: 400,
}
}}
>
{STACK_NAME}
<Chip
icon={<SellIcon/>}
label={STACK_VERSION}
/>
</Typography>

{DEV_MODE && <Alert
sx={{
mt: 2,
}}
severity={'info'}
>Developer Mode is enabled</Alert>}

<Grid
sx={{
pt: 2,
}}
container
spacing={2}
>
<Service
mainUrl={KEYCLOAK_URL}
title={`Identity Manager`}
description={`Keycloak IAM`}
logo={'/src/images/keycloak.png'}
/>
{DATABOX_API_URL && (
<ClientApp
apiUrl={DATABOX_API_URL}
clientUrl={DATABOX_CLIENT_URL}
title={`Databox`}
description={`Your DAM`}
logo={'/src/images/databox.png'}
/>
)}
{EXPOSE_API_URL && (
<ClientApp
apiUrl={EXPOSE_API_URL}
clientUrl={EXPOSE_CLIENT_URL}
title={`Expose`}
description={`Share Publications`}
logo={'/src/images/expose.png'}
/>
)}
{UPLOADER_API_URL && (
<ClientApp
apiUrl={UPLOADER_API_URL}
clientUrl={UPLOADER_CLIENT_URL}
title={`Uploader`}
description={`Standalone Asset deposit`}
logo={'/src/images/uploader.png'}
/>
)}
{NOTIFY_API_URL && (
<Service
mainUrl={`${NOTIFY_API_URL}/admin`}
title={`Notify Admin`}
description={`Mail Sender`}
logo={'/src/images/notify.png'}
links={[
{
icon: <ApiIcon />,
href: NOTIFY_API_URL,
title: `API documentation of Notify`,
},
]}
/>
)}
</Grid>
</Container>
);
}
Loading

0 comments on commit bff5abd

Please sign in to comment.