Hide default group if no VM is in this group
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
9755bacc55
commit
2b58ce4d5e
@ -31,8 +31,13 @@ export function VMListRoute(): React.ReactElement {
|
|||||||
const loadKey = React.useRef(1);
|
const loadKey = React.useRef(1);
|
||||||
|
|
||||||
const load = async () => {
|
const load = async () => {
|
||||||
setGroups([undefined, ...(await GroupApi.GetList())]);
|
const groups: Array<string | undefined> = await GroupApi.GetList();
|
||||||
setList(await VMApi.GetList());
|
const list = await VMApi.GetList();
|
||||||
|
|
||||||
|
if (list.find((v) => !v.group) !== undefined) groups.push(undefined);
|
||||||
|
|
||||||
|
setGroups(groups);
|
||||||
|
setList(list);
|
||||||
};
|
};
|
||||||
|
|
||||||
const reload = () => {
|
const reload = () => {
|
||||||
|
Loading…
Reference in New Issue
Block a user