diff --git a/virtweb_frontend/src/widgets/tokens/APITokenDetails.tsx b/virtweb_frontend/src/widgets/tokens/APITokenDetails.tsx index 5a0fdd4..86f3c73 100644 --- a/virtweb_frontend/src/widgets/tokens/APITokenDetails.tsx +++ b/virtweb_frontend/src/widgets/tokens/APITokenDetails.tsx @@ -2,6 +2,7 @@ import { Button } from "@mui/material"; import Grid from "@mui/material/Grid2"; import React from "react"; import { useNavigate } from "react-router-dom"; +import { GroupApi } from "../../api/GroupApi"; import { NWFilter, NWFilterApi } from "../../api/NWFilterApi"; import { NetworkApi, NetworkInfo } from "../../api/NetworksApi"; import { ServerApi } from "../../api/ServerApi"; @@ -35,12 +36,14 @@ interface DetailsProps { export function APITokenDetails(p: DetailsProps): React.ReactElement { const [vms, setVMs] = React.useState(); + const [groups, setGroups] = React.useState(); const [networks, setNetworks] = React.useState(); const [nwFilters, setNetworkFilters] = React.useState(); const [tokens, setTokens] = React.useState(); const load = async () => { setVMs(await VMApi.GetList()); + setGroups(await GroupApi.GetList()); setNetworks(await NetworkApi.GetList()); setNetworkFilters(await NWFilterApi.GetList()); setTokens(await TokensApi.GetList()); @@ -54,6 +57,7 @@ export function APITokenDetails(p: DetailsProps): React.ReactElement { build={() => ( void; vms: VMInfo[]; + groups: string[]; networks: NetworkInfo[]; nwFilters: NWFilter[]; tokens: APIToken[]; @@ -238,6 +239,139 @@ export function TokenRightsEditor(p: { + + + + + + + Group name + Get VM info + Start VM + Shutdown VM + Suspend VM + Resume VM + Kill VM + Reset VM + Screenshot VM + Get VM State + + + + {/* All Group operations */} + + + All + + + + + + + + + + + + + {/* Per VM operations */} + {p.groups.map((v, n) => ( + + {v} + + + + + + + + + + + ))} + +
+
+ {/* Networks */}