Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a button to go to admin page from the root-admin #2023

Merged
merged 1 commit into from
Jun 11, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
69 changes: 51 additions & 18 deletions src/app/js/root-admin/Tenants.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,15 @@ import {
GridToolbarDensitySelector,
GridToolbarFilterButton,
} from '@mui/x-data-grid';
import { Button, Link, Tooltip, Typography } from '@mui/material';
import {
Box,
Button,
IconButton,
Link,
Tooltip,
Typography,
} from '@mui/material';
import AdminPanelSettingsIcon from '@mui/icons-material/AdminPanelSettings';

const baseUrl = getHost();

Expand Down Expand Up @@ -241,9 +249,7 @@ const Tenants = ({ handleLogout }) => {
renderCell: (params) => {
const name = params.row.name;
return (
<Link
href={`${baseUrl}/instance/${name}`}
target="_blank"
<Box
sx={{
overflow: 'hidden',
textOverflow: 'ellipsis',
Expand All @@ -255,9 +261,6 @@ const Tenants = ({ handleLogout }) => {
display: 'flex',
alignItems: 'center',
padding: '0 16px',
'&:visited': {
color: '#0069A9',
},
'&:focus': {
borderBottom: '1px solid',
background: '#D9F3FF',
Expand All @@ -267,15 +270,43 @@ const Tenants = ({ handleLogout }) => {
background: '#D9F3FF',
textDecoration: 'none',
},
'&:active': {
background: '#0069A9',
color: '#D9F3FF',
},
}}
title={params.value}
>
{params.value}
</Link>
<Link
href={`${baseUrl}/instance/${name}`}
target="_blank"
title={params.value}
color="primary"
sx={{
overflow: 'hidden',
textOverflow: 'ellipsis',
whiteSpace: 'nowrap',
outline: 'none',
textDecoration: 'none',
height: '100%',
width: '100%',
display: 'flex',
alignItems: 'center',
padding: '0 16px',
'&:focus': {
textDecoration: 'none',
},
'&:hover': {
textDecoration: 'none',
},
}}
>
{params.value}
</Link>
<IconButton
size="large"
href={`${baseUrl}/instance/${name}/admin`}
parmentf marked this conversation as resolved.
Show resolved Hide resolved
target="_blank"
color="primary"
>
<AdminPanelSettingsIcon />
</IconButton>
</Box>
);
},
},
Expand Down Expand Up @@ -378,12 +409,13 @@ const Tenants = ({ handleLogout }) => {
flex: 1,
renderCell: (params) => {
return (
<Button
<IconButton
parmentf marked this conversation as resolved.
Show resolved Hide resolved
color="warning"
size="large"
onClick={() => setTenantToUpdate(params.row)}
>
<EditIcon />
</Button>
</IconButton>
);
},
},
Expand All @@ -396,12 +428,13 @@ const Tenants = ({ handleLogout }) => {
return null;
}
return (
<Button
<IconButton
color="error"
size="large"
onClick={() => setOpenDeleteTenantDialog(params.row)}
>
<DeleteIcon />
</Button>
</IconButton>
);
},
},
Expand Down
Loading