-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
349 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
module.exports = { | ||
...require('../.prettierrc'), | ||
...require('../../.prettierrc'), | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,41 @@ | ||
(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', | ||
]; | ||
|
||
const e = {}; | ||
|
||
Object.entries(env).forEach(([key, value]) => { | ||
if (whiteList.includes(key)) { | ||
e[key] = value; | ||
} | ||
}) | ||
|
||
|
||
return { | ||
locales: config.available_locales, | ||
env, | ||
env: e, | ||
}; | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import Service, {ServiceBaseProps} from "./Service.tsx"; | ||
import AdminPanelSettingsIcon from '@mui/icons-material/AdminPanelSettings'; | ||
import ApiIcon from '@mui/icons-material/Api'; | ||
|
||
type Props = { | ||
apiUrl: string; | ||
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} | ||
/> | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,65 @@ | ||
import {Container, Grid} from "@mui/material"; | ||
import Service from "./Service"; | ||
import ClientApp from "./ClientApp.tsx"; | ||
import config from "./config.ts"; | ||
|
||
type Props = {}; | ||
|
||
export default function Root({}: Props) { | ||
const { | ||
DATABOX_API_URL, | ||
EXPOSE_API_URL, | ||
UPLOADER_API_URL, | ||
NOTIFY_API_URL, | ||
KEYCLOAK_URL, | ||
DATABOX_CLIENT_URL, | ||
EXPOSE_CLIENT_URL, | ||
UPLOADER_CLIENT_URL, | ||
} = config.env; | ||
|
||
console.log('config.env', config.env); | ||
|
||
return <>Dashboard!</> | ||
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> | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
import {Button, Card, CardActions, CardContent, CardMedia, Grid, IconButton, Typography,} from '@mui/material'; | ||
import {JSX, PropsWithChildren, ReactNode} from "react"; | ||
|
||
type BaseProps = { | ||
title: string; | ||
mainUrl?: string; | ||
description?: ReactNode; | ||
logo?: string; | ||
}; | ||
|
||
type AppLink = { | ||
icon: ReactNode; | ||
title: string; | ||
href: string; | ||
} | ||
|
||
type Props = { | ||
links?: AppLink[]; | ||
} & BaseProps; | ||
|
||
export type {BaseProps as ServiceBaseProps}; | ||
|
||
export default function Service({ | ||
title, | ||
logo, | ||
description, | ||
mainUrl, | ||
links = [], | ||
}: Props) { | ||
return <Grid | ||
item | ||
xs={6} | ||
sm={4} | ||
md={3} | ||
> | ||
<Card> | ||
<Link | ||
href={mainUrl} | ||
> | ||
<CardMedia | ||
sx={(theme) => ({ | ||
height: 140, | ||
backgroundSize: 'contain', | ||
backgroundColor: theme.palette.background.default, | ||
})} | ||
image={logo} | ||
title="green iguana" | ||
/> | ||
</Link> | ||
<CardContent> | ||
<Link href={mainUrl}> | ||
<Typography gutterBottom variant="h5" component="div"> | ||
{title} | ||
</Typography> | ||
</Link> | ||
{description && <Typography variant="body2" color="text.secondary"> | ||
{description} | ||
</Typography>} | ||
</CardContent> | ||
<CardActions> | ||
{links.map(({href, icon, title}, i) => <IconButton | ||
size="small" | ||
key={i} | ||
href={href} | ||
title={title} | ||
> | ||
{icon} | ||
</IconButton>)} | ||
</CardActions> | ||
</Card> | ||
</Grid> | ||
} | ||
|
||
function Link({href, children}: PropsWithChildren<{ | ||
href: string | undefined; | ||
}>) { | ||
if (href) { | ||
return <a | ||
style={{ | ||
textDecoration: 'none', | ||
}} | ||
href={href} | ||
target={'_blank'} | ||
rel={'noreferrer noopener'} | ||
> | ||
{children} | ||
</a> | ||
} | ||
|
||
return children as JSX.Element; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.