From 59ad5fd72215be5698942f6db91dd842fdbadccd Mon Sep 17 00:00:00 2001 From: Pierre HUBERT Date: Thu, 5 Dec 2024 19:32:12 +0100 Subject: [PATCH] Display VMs in group --- remote_frontend/src/widgets/GroupsWidget.tsx | 64 +++++++++++++++++++- 1 file changed, 62 insertions(+), 2 deletions(-) diff --git a/remote_frontend/src/widgets/GroupsWidget.tsx b/remote_frontend/src/widgets/GroupsWidget.tsx index 4f553e7..053d894 100644 --- a/remote_frontend/src/widgets/GroupsWidget.tsx +++ b/remote_frontend/src/widgets/GroupsWidget.tsx @@ -1,5 +1,65 @@ -import { Rights } from "../api/ServerApi"; +import { + Card, + Table, + TableBody, + TableCell, + TableCellLayout, + TableHeader, + TableHeaderCell, + TableRow, + Title3, +} from "@fluentui/react-components"; +import { Desktop24Regular } from "@fluentui/react-icons"; +import { filesize } from "filesize"; +import { Rights, VMGroup } from "../api/ServerApi"; export function GroupsWidget(p: { rights: Rights }): React.ReactElement { - return

TODO

; + return ( + <> + {p.rights.groups.map((g) => ( + + ))} + + ); +} + +function GroupInfo(p: { group: VMGroup }): React.ReactElement { + return ( + + {p.group.id} + + + + Name + Description + Resources + Actions + + + + {p.group.vms.map((item) => ( + + + }> + {item.name} + + + {item.description} + + {item.architecture} • RAM :{" "} + {filesize(item.memory * 1000 * 1000)} • {item.number_vcpu}{" "} + vCPU + + + ))} + +
+
+ ); }