table formatting

This commit is contained in:
proddy
2024-10-12 01:06:09 +01:00
parent 4fac364600
commit ebd7d86502
2 changed files with 36 additions and 16 deletions

View File

@@ -103,6 +103,10 @@ const Dashboard = () => {
// border-top: 1px solid #0000; // border-top: 1px solid #0000;
// border-bottom: 1px solid #0000; // border-bottom: 1px solid #0000;
} }
&.tr.tr-body.row-select.row-select-single-selected {
background-color: #177ac9;
font-weight: normal;
}
&:hover .td { &:hover .td {
background-color: #177ac9; background-color: #177ac9;
// border-top: 1px solid #177ac9; // border-top: 1px solid #177ac9;
@@ -206,8 +210,10 @@ const Dashboard = () => {
(parseInt(id.slice(0, 2), 16) & mask) === mask; (parseInt(id.slice(0, 2), 16) & mask) === mask;
const editDashboardValue = (di: DashboardItem) => { const editDashboardValue = (di: DashboardItem) => {
setSelectedDashboardItem(di); if (me.admin && di.dv?.c) {
setDeviceValueDialogOpen(true); setSelectedDashboardItem(di);
setDeviceValueDialogOpen(true);
}
}; };
const handleShowAll = ( const handleShowAll = (
@@ -282,7 +288,11 @@ const Dashboard = () => {
{(tableList: DashboardItem[]) => ( {(tableList: DashboardItem[]) => (
<Body> <Body>
{tableList.map((di: DashboardItem) => ( {tableList.map((di: DashboardItem) => (
<Row key={di.id} item={di}> <Row
key={di.id}
item={di}
onClick={() => editDashboardValue(di)}
>
{di.id > 99 ? ( {di.id > 99 ? (
<> <>
<Cell>{showName(di)}</Cell> <Cell>{showName(di)}</Cell>

View File

@@ -148,22 +148,23 @@ const Devices = () => {
} }
`, `,
Row: ` Row: `
background-color: #1E1E1E;
position: relative;
cursor: pointer; cursor: pointer;
background-color: #1E1E1E;
// position: relative;
.td { .td {
padding: 8px; padding: 8px;
border-top: 1px solid #565656; // border-top: 1px solid #565656;
border-bottom: 1px solid #565656; // border-bottom: 1px solid #565656;
} }
&.tr.tr-body.row-select.row-select-single-selected { &.tr.tr-body.row-select.row-select-single-selected {
background-color: #3d4752; background-color: #177ac9;
font-weight: normal; font-weight: normal;
} }
&:hover .td { // &:hover .td {
border-top: 1px solid #177ac9; // background-color: #177ac9;
border-bottom: 1px solid #177ac9; // border-top: 1px solid #177ac9;
} // border-bottom: 1px solid #177ac9;
// }
` `
}); });
@@ -174,14 +175,18 @@ const Devices = () => {
--data-table-library_grid-template-columns: repeat(1, minmax(0, 1fr)) 130px; --data-table-library_grid-template-columns: repeat(1, minmax(0, 1fr)) 130px;
`, `,
BaseRow: ` BaseRow: `
.td { // .td {
height: 42px; // height: 42px;
} // }
`, `,
HeaderRow: ` HeaderRow: `
.th { .th {
padding: 8px; padding: 8px;
height: 36px; height: 36px;
`,
Row: `
&:hover .td {
background-color: #177ac9;
` `
} }
]); ]);
@@ -222,7 +227,12 @@ const Devices = () => {
Row: ` Row: `
&:nth-of-type(odd) .td { &:nth-of-type(odd) .td {
background-color: #303030; background-color: #303030;
} },
&:hover .td {
background-color: #177ac9;
// border-top: 1px solid #177ac9;
// border-bottom: 1px solid #177ac9;
}
` `
} }
]); ]);