Skip to content

Commit 76d7ed7

Browse files
committed
fix panel list ui layout
1 parent ef58975 commit 76d7ed7

5 files changed

Lines changed: 57 additions & 19 deletions

File tree

‎src/client/src/components/panels/PanelEditTable.jsx‎

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -131,26 +131,37 @@ export default function PanelTable({ showGroups = true }) {
131131
}}
132132
>
133133
<TableRow>
134-
<TableCell sx={{ width: "48px" }}></TableCell>
135-
<TableCell sx={{ width: "48px" }}></TableCell>
134+
<TableCell width="10"></TableCell>
135+
<TableCell width="10"></TableCell>
136+
<TableCell>Title</TableCell>
136137
<TableCell
137138
sx={{
138-
width: "50%",
139+
"@media (max-width:1024px)": {
140+
display: "none",
141+
},
139142
}}
140143
>
141-
Title
144+
Description
142145
</TableCell>
143146
<TableCell
144147
sx={{
145-
width: "50%",
146148
"@media (max-width:512px)": {
147149
display: "none",
148150
},
149151
}}
150152
>
151153
Module
152154
</TableCell>
153-
<TableCell sx={{ width: "48px" }}></TableCell>
155+
<TableCell
156+
sx={{
157+
"@media (max-width:250px)": {
158+
display: "none",
159+
},
160+
}}
161+
>
162+
Version
163+
</TableCell>
164+
<TableCell></TableCell>
154165
</TableRow>
155166
</TableHead>
156167
<TableBody>

‎src/client/src/components/panels/PanelEditTableGroupLabel.jsx‎

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,13 @@ import { TableCell, TableRow } from "@mui/material";
44
export default function PanelEditTableGroupLabel({ group, onChange, placeholder, id, passedKey }) {
55
return (
66
<TableRow
7-
hover
87
key={passedKey}
98
sx={{
10-
height: "48px",
11-
cursor: "move",
9+
height: "62px",
1210
backgroundColor: "background.default",
1311
}}
1412
>
15-
<TableCell colSpan={6}>
13+
<TableCell colSpan={7}>
1614
<BugTextField
1715
sx={{
1816
fontSize: "0.875rem",

‎src/client/src/components/panels/PanelEditTableRow.jsx‎

Lines changed: 36 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,29 +2,57 @@ import PanelPowerIcon from "@components/panels/PanelPowerIcon";
22
import PanelRowState from "@components/panels/PanelRowState";
33
import BugApiSwitch from "@core/BugApiSwitch";
44
import MoreVertIcon from "@mui/icons-material/MoreVert";
5-
import { TableCell, TableRow } from "@mui/material";
5+
import { Box, TableCell, TableRow } from "@mui/material";
66

77
export default function PanelEditTableRow({ id, panel }) {
88
return (
9-
<TableRow hover key={id} sx={{ height: "65px", cursor: "move", backgroundColor: "background.paper" }}>
9+
<TableRow hover key={id} sx={{ height: "65px", backgroundColor: "background.paper" }}>
1010
<TableCell
1111
sx={{
12-
width: "48px",
12+
width: "54px",
1313
textAlign: "center",
1414
}}
1515
>
1616
<PanelPowerIcon panel={panel} />
1717
</TableCell>
18-
<TableCell sx={{ textAlign: "center" }}>
18+
<TableCell sx={{ width: "4rem" }} style={{ textAlign: "center" }}>
1919
<BugApiSwitch checked={panel.enabled} disabled />
2020
</TableCell>
21-
<TableCell sx={{ width: "50%" }}>
21+
<TableCell>
2222
<div>{panel.title}</div>
2323
<PanelRowState panel={panel} />
2424
</TableCell>
25-
<TableCell sx={{ width: "50%" }}>{panel._module.longname}</TableCell>
26-
<TableCell sx={{ width: "48px" }}>
27-
<MoreVertIcon />
25+
<TableCell
26+
sx={{
27+
"@media (max-width:1024px)": {
28+
display: "none",
29+
},
30+
}}
31+
>
32+
{panel.description}
33+
</TableCell>
34+
<TableCell
35+
sx={{
36+
"@media (max-width:512px)": {
37+
display: "none",
38+
},
39+
}}
40+
>
41+
{panel._module.longname}
42+
</TableCell>
43+
<TableCell
44+
sx={{
45+
"@media (max-width:250px)": {
46+
display: "none",
47+
},
48+
}}
49+
>
50+
<Box sx={{ padding: "0.5rem" }}>{panel._module.version}</Box>
51+
</TableCell>
52+
<TableCell sx={{ width: "2rem" }}>
53+
<Box sx={{ width: 40, height: 40, display: "flex", alignItems: "center", justifyContent: "center" }}>
54+
<MoreVertIcon sx={{ opacity: 0.5 }} />
55+
</Box>
2856
</TableCell>
2957
</TableRow>
3058
);

‎src/client/src/components/panels/PanelTableGroupRow.jsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ export default function PanelTableGroupRow({ title }) {
44
return (
55
<TableRow
66
sx={{
7-
height: 48,
7+
height: "62px",
88
}}
99
>
1010
<TableCell

‎src/client/src/components/panels/PanelTableRow.jsx‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ export default function PanelTableRow({ panel, showGroups }) {
4747
key={panel.id}
4848
hover={panel._active}
4949
sx={{
50+
height: "65px",
5051
cursor: panel._active ? "pointer" : "auto",
5152
}}
5253
onClick={(e) => handleRowClicked(e, panel.id)}

0 commit comments

Comments
 (0)