浏览代码

v0.2.0-unstable3

Yann Stepienik 2 年之前
父节点
当前提交
fd568de0d0
共有 3 个文件被更改,包括 15 次插入15 次删除
  1. 12 11
      client/src/components/tableView/prettyTableView.jsx
  2. 2 3
      client/src/pages/config/users/proxyman.jsx
  3. 1 1
      package.json

+ 12 - 11
client/src/components/tableView/prettyTableView.jsx

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

+ 2 - 3
client/src/pages/config/users/proxyman.jsx

@@ -170,7 +170,7 @@ const ProxyManagement = () => {
       {routes && <PrettyTableView 
         data={routes}
         getKey={(r) => r.Name + r.Target + r.Mode}
-        onRowClick={(r) => {navigate('/ui/config-url/' + r.Name)}}
+        linkTo={(r) => '/ui/config-url/' + r.Name}
         columns={[
           { 
             title: '', 
@@ -184,14 +184,13 @@ const ProxyManagement = () => {
             style: {
               textDecoration: 'inherit',
             },
+            underline: true,
             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: '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: 'Mode', field: (r) => <RouteMode route={r} /> },
           { title: 'Target', search: (r) => r.Target, field: (r) => <><RouteMode route={r} /> <Chip label={r.Target} /></> },
           { title: 'Security', field: (r) => <RouteSecurity route={r} />,
           style: {minWidth: '70px'} },

+ 1 - 1
package.json

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