-
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.
* PS-600 add session expiration modal * upgrade liform-react * PS-598 fix indexer rendition definition duplicates
- Loading branch information
Showing
133 changed files
with
3,355 additions
and
1,174 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
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
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,136 @@ | ||
import {Alert, Chip, Container, Grid, Typography, useMediaQuery, useTheme,} 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'; | ||
import keycloakImg from './images/keycloak.png'; | ||
import databoxImg from './images/databox.png'; | ||
import uploaderImg from './images/uploader.png'; | ||
import exposeImg from './images/expose.png'; | ||
import notifyImg from './images/notify.png'; | ||
import DashboardBar from "./DashboardBar"; | ||
import {useKeycloakUser} from '@alchemy/react-auth' | ||
import AdminPanelSettingsIcon from "@mui/icons-material/AdminPanelSettings"; | ||
|
||
type Props = {}; | ||
|
||
export default function Dashboard({}: Props) { | ||
const theme = useTheme(); | ||
const isLarge = useMediaQuery(theme.breakpoints.up('sm')); | ||
const {user} = useKeycloakUser(); | ||
|
||
const { | ||
DATABOX_API_URL, | ||
EXPOSE_API_URL, | ||
UPLOADER_API_URL, | ||
NOTIFY_API_URL, | ||
DATABOX_CLIENT_URL, | ||
EXPOSE_CLIENT_URL, | ||
UPLOADER_CLIENT_URL, | ||
STACK_NAME, | ||
DEV_MODE, | ||
STACK_VERSION, | ||
} = config.env; | ||
|
||
console.debug('config', config); | ||
|
||
return ( | ||
<Container> | ||
{isLarge && ( | ||
<DashboardBar> | ||
<Typography | ||
variant={'h1'} | ||
sx={{ | ||
'.MuiChip-root': { | ||
ml: 2, | ||
}, | ||
}} | ||
> | ||
{STACK_NAME} | ||
{user && <Chip | ||
icon={<SellIcon/>} | ||
label={STACK_VERSION} | ||
color={'info'} | ||
/>} | ||
</Typography> | ||
</DashboardBar> | ||
)} | ||
|
||
{user && isLarge && DEV_MODE && ( | ||
<Alert | ||
sx={{ | ||
mt: 2, | ||
}} | ||
severity={'info'} | ||
> | ||
Developer Mode is enabled | ||
</Alert> | ||
)} | ||
|
||
<Grid | ||
sx={{ | ||
pt: 2, | ||
}} | ||
container | ||
spacing={2} | ||
> | ||
<Service | ||
mainUrl={`${config.keycloakUrl}/admin/${config.realmName}/console`} | ||
title={`Identity Manager`} | ||
description={`Keycloak IAM`} | ||
logo={keycloakImg} | ||
links={[ | ||
{ | ||
icon: <AdminPanelSettingsIcon />, | ||
href: `${config.keycloakUrl}/admin/master/console`, | ||
title: `Master Admin`, | ||
}, | ||
]} | ||
/> | ||
{DATABOX_API_URL && ( | ||
<ClientApp | ||
apiUrl={DATABOX_API_URL} | ||
clientUrl={DATABOX_CLIENT_URL} | ||
title={`Databox`} | ||
description={`Your DAM`} | ||
logo={databoxImg} | ||
/> | ||
)} | ||
{EXPOSE_API_URL && ( | ||
<ClientApp | ||
apiUrl={EXPOSE_API_URL} | ||
clientUrl={EXPOSE_CLIENT_URL} | ||
title={`Expose`} | ||
description={`Share Publications`} | ||
logo={exposeImg} | ||
/> | ||
)} | ||
{UPLOADER_API_URL && ( | ||
<ClientApp | ||
apiUrl={UPLOADER_API_URL} | ||
clientUrl={UPLOADER_CLIENT_URL} | ||
title={`Uploader`} | ||
description={`Standalone Asset deposit`} | ||
logo={uploaderImg} | ||
/> | ||
)} | ||
{NOTIFY_API_URL && ( | ||
<Service | ||
mainUrl={`${NOTIFY_API_URL}/admin`} | ||
title={`Notify Admin`} | ||
description={`Mail Sender`} | ||
logo={notifyImg} | ||
links={[ | ||
{ | ||
icon: <ApiIcon/>, | ||
href: NOTIFY_API_URL, | ||
title: `API documentation of Notify`, | ||
}, | ||
]} | ||
/> | ||
)} | ||
</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,53 @@ | ||
import AppBar from '@mui/material/AppBar'; | ||
import Toolbar from '@mui/material/Toolbar'; | ||
import {PropsWithChildren} from "react"; | ||
import {useKeycloakUrls, useKeycloakUser} from '@alchemy/react-auth'; | ||
import config from "./config.ts"; | ||
import {keycloakClient} from "./lib/apiClient.ts"; | ||
import MenuItem from "@mui/material/MenuItem"; | ||
import Box from "@mui/material/Box"; | ||
import {UserMenu} from '@alchemy/phrasea-ui'; | ||
import {useTranslation} from "react-i18next"; | ||
|
||
type Props = PropsWithChildren<{}>; | ||
|
||
export default function DashboardBar({ | ||
children | ||
}: Props) { | ||
const menuHeight = 42; | ||
const {t} = useTranslation(); | ||
const {getLoginUrl, getAccountUrl} = useKeycloakUrls({ | ||
autoConnectIdP: config.autoConnectIdP, | ||
keycloakClient, | ||
}); | ||
|
||
const {user, logout} = useKeycloakUser(); | ||
|
||
return ( | ||
<AppBar position="sticky"> | ||
<Toolbar> | ||
<div style={{ | ||
flexGrow: 1 | ||
}}> | ||
{children} | ||
</div> | ||
|
||
|
||
<Box sx={{flexGrow: 0}}> | ||
{!user ? ( | ||
<MenuItem component={'a'} href={getLoginUrl()}> | ||
{t('menu.sign_in', 'Sign in')} | ||
</MenuItem> | ||
) : ( | ||
<UserMenu | ||
menuHeight={menuHeight} | ||
username={user?.username} | ||
accountUrl={getAccountUrl()} | ||
onLogout={logout} | ||
/> | ||
)} | ||
</Box> | ||
</Toolbar> | ||
</AppBar> | ||
); | ||
} |
Oops, something went wrong.