diff --git a/remote_frontend/src/App.tsx b/remote_frontend/src/App.tsx index a8951d7..9d5ebd5 100644 --- a/remote_frontend/src/App.tsx +++ b/remote_frontend/src/App.tsx @@ -59,6 +59,10 @@ function AuthenticatedApp(): React.ReactElement { const load = async () => { setRights(await ServerApi.GetRights()); + + if (rights!.groups.length > 0) setTab("group"); + else if (rights!.vms.length > 0) setTab("vm"); + else setTab("info"); }; return ( @@ -87,27 +91,21 @@ function AuthenticatedApp(): React.ReactElement { selectedValue={tab} onTabSelect={(_, d) => setTab(d.value as any)} > - } - disabled={rights!.groups.length === 0} - > - Groups - - } - disabled={rights!.vms.length === 0} - > - Virtual machines - - } - disabled={!rights!.sys_info} - > - System info - + {rights!.groups.length > 0 && ( + }> + Groups + + )} + {rights!.vms.length > 0 && ( + }> + Virtual machines + + )} + {rights!.sys_info && ( + }> + System info + + )}