This commit is contained in:
@ -35,14 +35,16 @@ interface DetailsProps {
|
||||
}
|
||||
|
||||
export function VMDetails(p: DetailsProps): React.ReactElement {
|
||||
const [groupsList, setGroupsList] = React.useState<string[] | any>();
|
||||
const [isoList, setIsoList] = React.useState<IsoFile[] | any>();
|
||||
const [groupsList, setGroupsList] = React.useState<string[] | undefined>();
|
||||
const [isoList, setIsoList] = React.useState<IsoFile[] | undefined>();
|
||||
const [vcpuCombinations, setVCPUCombinations] = React.useState<
|
||||
number[] | any
|
||||
number[] | undefined
|
||||
>();
|
||||
const [networksList, setNetworksList] = React.useState<
|
||||
NetworkInfo[] | undefined
|
||||
>();
|
||||
const [networksList, setNetworksList] = React.useState<NetworkInfo[] | any>();
|
||||
const [networkFiltersList, setNetworkFiltersList] = React.useState<
|
||||
NWFilter[] | any
|
||||
NWFilter[] | undefined
|
||||
>();
|
||||
|
||||
const load = async () => {
|
||||
@ -60,11 +62,11 @@ export function VMDetails(p: DetailsProps): React.ReactElement {
|
||||
errMsg="Failed to load the list of ISO files"
|
||||
build={() => (
|
||||
<VMDetailsInner
|
||||
groupsList={groupsList}
|
||||
isoList={isoList}
|
||||
vcpuCombinations={vcpuCombinations}
|
||||
networksList={networksList}
|
||||
networkFiltersList={networkFiltersList}
|
||||
groupsList={groupsList!}
|
||||
isoList={isoList!}
|
||||
vcpuCombinations={vcpuCombinations!}
|
||||
networksList={networksList!}
|
||||
networkFiltersList={networkFiltersList!}
|
||||
{...p}
|
||||
/>
|
||||
)}
|
||||
@ -202,7 +204,7 @@ function VMDetailsTabGeneral(p: DetailsInnerProps): React.ReactElement {
|
||||
editable={p.editable}
|
||||
label="Group"
|
||||
onValueChange={(v) => {
|
||||
p.vm.group = v! as any;
|
||||
p.vm.group = v!;
|
||||
p.onChange?.();
|
||||
}}
|
||||
value={p.vm.group}
|
||||
@ -222,7 +224,11 @@ function VMDetailsTabGeneral(p: DetailsInnerProps): React.ReactElement {
|
||||
: "Add a new group instead of using existing one"
|
||||
}
|
||||
>
|
||||
<IconButton onClick={() => { setAddGroup(!addGroup); }}>
|
||||
<IconButton
|
||||
onClick={() => {
|
||||
setAddGroup(!addGroup);
|
||||
}}
|
||||
>
|
||||
{addGroup ? <ListIcon /> : <AddIcon />}
|
||||
</IconButton>
|
||||
</Tooltip>
|
||||
|
@ -9,7 +9,7 @@ export function VMScreenshot(p: { vm: VMInfo }): React.ReactElement {
|
||||
string | undefined
|
||||
>();
|
||||
|
||||
const int = React.useRef<any | undefined>(undefined);
|
||||
const int = React.useRef<NodeJS.Timeout | undefined>(undefined);
|
||||
|
||||
React.useEffect(() => {
|
||||
const refresh = async () => {
|
||||
@ -25,7 +25,9 @@ export function VMScreenshot(p: { vm: VMInfo }): React.ReactElement {
|
||||
|
||||
if (int.current === undefined) {
|
||||
refresh();
|
||||
int.current = setInterval(() => refresh(), 5000);
|
||||
int.current = setInterval(() => {
|
||||
refresh();
|
||||
}, 5000);
|
||||
}
|
||||
|
||||
return () => {
|
||||
|
@ -31,13 +31,19 @@ export function VMStatusWidget(p: {
|
||||
}
|
||||
};
|
||||
|
||||
const changedAction = () => { setState(undefined); };
|
||||
const changedAction = () => {
|
||||
setState(undefined);
|
||||
};
|
||||
|
||||
React.useEffect(() => {
|
||||
refresh();
|
||||
const i = setInterval(() => refresh(), 3000);
|
||||
const i = setInterval(() => {
|
||||
refresh();
|
||||
}, 3000);
|
||||
|
||||
return () => { clearInterval(i); };
|
||||
return () => {
|
||||
clearInterval(i);
|
||||
};
|
||||
});
|
||||
|
||||
if (state === undefined)
|
||||
@ -59,6 +65,7 @@ export function VMStatusWidget(p: {
|
||||
icon={<PersonalVideoIcon />}
|
||||
tooltip="Graphical remote control over the VM"
|
||||
performAction={async () => navigate(p.vm.VNCURL)}
|
||||
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
||||
onExecuted={() => {}}
|
||||
/>
|
||||
)
|
||||
|
Reference in New Issue
Block a user