v0.2.0-unstable3

This commit is contained in:
Yann Stepienik 2023-04-28 20:46:49 +01:00
parent 803df9c684
commit fd568de0d0
3 changed files with 15 additions and 15 deletions

View file

@ -65,22 +65,23 @@ const PrettyTableView = ({ getKey, data, columns, onRowClick, linkTo }) => {
'&:hover': { '&:hover': {
backgroundColor: 'rgba(0, 0, 0, 0.06)', backgroundColor: 'rgba(0, 0, 0, 0.06)',
borderColor: 'gray', borderColor: 'gray',
textDecoration: 'underline', '&:hover .emphasis': {
textDecoration: 'underline'
}
}, },
}} }}
> >
{columns.map((column) => ( {columns.map((column) => (
<TableCell sx={column.style}> <TableCell
{!column.clickable ? <Link component={(linkTo && !column.clickable) ? Link : 'td'}
to={linkTo && linkTo(row, key)} to={linkTo(row, key)}
style={{ className={column.underline ? 'emphasis' : ''}
color: 'inherit', sx={{
textDecoration: 'inherit', textDecoration: 'none',
}} ...column.style,
> }}>
{column.field(row, key)} {column.field(row, key)}
</Link> : column.field(row, key)}
</TableCell> </TableCell>
))} ))}
</TableRow> </TableRow>

View file

@ -170,7 +170,7 @@ const ProxyManagement = () => {
{routes && <PrettyTableView {routes && <PrettyTableView
data={routes} data={routes}
getKey={(r) => r.Name + r.Target + r.Mode} getKey={(r) => r.Name + r.Target + r.Mode}
onRowClick={(r) => {navigate('/ui/config-url/' + r.Name)}} linkTo={(r) => '/ui/config-url/' + r.Name}
columns={[ columns={[
{ {
title: '', title: '',
@ -184,14 +184,13 @@ const ProxyManagement = () => {
style: { style: {
textDecoration: 'inherit', textDecoration: 'inherit',
}, },
underline: true,
field: (r) => <> field: (r) => <>
<div style={{display:'inline-block', textDecoration: 'inherit', fontSize:'125%', color: isDark ? theme.palette.primary.light : theme.palette.primary.dark}}>{r.Name}</div><br/> <div style={{display:'inline-block', textDecoration: 'inherit', fontSize:'125%', color: isDark ? theme.palette.primary.light : theme.palette.primary.dark}}>{r.Name}</div><br/>
<div style={{display:'inline-block', textDecoration: 'inherit', fontSize: '90%', opacity: '90%'}}>{r.Description}</div> <div style={{display:'inline-block', textDecoration: 'inherit', fontSize: '90%', opacity: '90%'}}>{r.Description}</div>
</> </>
}, },
// { title: 'Description', field: (r) => shorten(r.Description), style:{fontSize: '90%', opacity: '90%'} },
{ title: 'Origin', clickable:true, search: (r) => r.Host + ' ' + r.PathPrefix, field: (r) => <HostChip route={r} /> }, { title: 'Origin', clickable:true, search: (r) => r.Host + ' ' + r.PathPrefix, field: (r) => <HostChip route={r} /> },
// { title: 'Mode', field: (r) => <RouteMode route={r} /> },
{ title: 'Target', search: (r) => r.Target, field: (r) => <><RouteMode route={r} /> <Chip label={r.Target} /></> }, { title: 'Target', search: (r) => r.Target, field: (r) => <><RouteMode route={r} /> <Chip label={r.Target} /></> },
{ title: 'Security', field: (r) => <RouteSecurity route={r} />, { title: 'Security', field: (r) => <RouteSecurity route={r} />,
style: {minWidth: '70px'} }, style: {minWidth: '70px'} },

View file

@ -1,6 +1,6 @@
{ {
"name": "cosmos-server", "name": "cosmos-server",
"version": "0.2.0-unstable2", "version": "0.2.0-unstable3",
"description": "", "description": "",
"main": "test-server.js", "main": "test-server.js",
"bugs": { "bugs": {