WIP ESLint fixes
This commit is contained in:
@ -116,7 +116,7 @@ function EditApiTokenRouteInner(p: {
|
||||
const [changed, setChanged] = React.useState(false);
|
||||
|
||||
const [, updateState] = React.useState<any>();
|
||||
const forceUpdate = React.useCallback(() => updateState({}), []);
|
||||
const forceUpdate = React.useCallback(() => { updateState({}); }, []);
|
||||
|
||||
const valueChanged = () => {
|
||||
setChanged(true);
|
||||
|
@ -99,7 +99,7 @@ function EditNetworkFilterRouteInner(p: {
|
||||
const [changed, setChanged] = React.useState(false);
|
||||
|
||||
const [, updateState] = React.useState<any>();
|
||||
const forceUpdate = React.useCallback(() => updateState({}), []);
|
||||
const forceUpdate = React.useCallback(() => { updateState({}); }, []);
|
||||
|
||||
const valueChanged = () => {
|
||||
setChanged(true);
|
||||
|
@ -97,7 +97,7 @@ function EditNetworkRouteInner(p: {
|
||||
const [changed, setChanged] = React.useState(false);
|
||||
|
||||
const [, updateState] = React.useState<any>();
|
||||
const forceUpdate = React.useCallback(() => updateState({}), []);
|
||||
const forceUpdate = React.useCallback(() => { updateState({}); }, []);
|
||||
|
||||
const valueChanged = () => {
|
||||
setChanged(true);
|
||||
|
@ -103,7 +103,7 @@ function EditVMInner(p: {
|
||||
const [changed, setChanged] = React.useState(false);
|
||||
|
||||
const [, updateState] = React.useState<any>();
|
||||
const forceUpdate = React.useCallback(() => updateState({}), []);
|
||||
const forceUpdate = React.useCallback(() => { updateState({}); }, []);
|
||||
|
||||
const valueChanged = () => {
|
||||
setChanged(true);
|
||||
|
@ -166,14 +166,14 @@ function UploadIsoFileFromUrlCard(p: {
|
||||
label="URL"
|
||||
value={url}
|
||||
style={{ flex: 3 }}
|
||||
onChange={(e) => setURL(e.target.value)}
|
||||
onChange={(e) => { setURL(e.target.value); }}
|
||||
/>
|
||||
<span style={{ width: "10px" }}></span>
|
||||
<TextField
|
||||
label="Filename"
|
||||
value={actualFileName}
|
||||
style={{ flex: 2 }}
|
||||
onChange={(e) => setFilename(e.target.value)}
|
||||
onChange={(e) => { setFilename(e.target.value); }}
|
||||
/>
|
||||
{url !== "" && actualFileName !== "" && (
|
||||
<Button onClick={upload}>Upload file</Button>
|
||||
|
@ -78,7 +78,7 @@ function NetworkFiltersListRouteInner(p: {
|
||||
size="small"
|
||||
value={visibleFilters}
|
||||
exclusive
|
||||
onChange={(_ev, v) => setVisibleFilters(v)}
|
||||
onChange={(_ev, v) => { setVisibleFilters(v); }}
|
||||
aria-label="visible filters"
|
||||
>
|
||||
<ToggleButton value={VisibleFilters.All}>All</ToggleButton>
|
||||
|
@ -236,7 +236,7 @@ export function SysInfoRouteInner(p: {
|
||||
function SysInfoDetailsTable(p: {
|
||||
label: string;
|
||||
icon: React.ReactElement;
|
||||
entries: Array<{ label: string; value: string | number }>;
|
||||
entries: { label: string; value: string | number }[];
|
||||
}): React.ReactElement {
|
||||
return (
|
||||
<VirtWebPaper
|
||||
|
@ -25,13 +25,13 @@ import { VirtWebRouteContainer } from "../widgets/VirtWebRouteContainer";
|
||||
import { VMStatusWidget } from "../widgets/vms/VMStatusWidget";
|
||||
|
||||
export function VMListRoute(): React.ReactElement {
|
||||
const [groups, setGroups] = React.useState<Array<string | undefined>>();
|
||||
const [groups, setGroups] = React.useState<(string | undefined)[]>();
|
||||
const [list, setList] = React.useState<VMInfo[] | undefined>();
|
||||
|
||||
const loadKey = React.useRef(1);
|
||||
|
||||
const load = async () => {
|
||||
const groups: Array<string | undefined> = await GroupApi.GetList();
|
||||
const groups: (string | undefined)[] = await GroupApi.GetList();
|
||||
const list = await VMApi.GetList();
|
||||
|
||||
if (list.find((v) => !v.group) !== undefined) groups.push(undefined);
|
||||
@ -70,7 +70,7 @@ export function VMListRoute(): React.ReactElement {
|
||||
}
|
||||
|
||||
function VMListWidget(p: {
|
||||
groups: Array<string | undefined>;
|
||||
groups: (string | undefined)[];
|
||||
list: VMInfo[];
|
||||
onReload: () => void;
|
||||
}): React.ReactElement {
|
||||
@ -125,9 +125,9 @@ function VMListWidget(p: {
|
||||
>
|
||||
<IconButton
|
||||
size="small"
|
||||
onClick={() => toggleHiddenGroup(g)}
|
||||
onClick={() => { toggleHiddenGroup(g); }}
|
||||
>
|
||||
{!hiddenGroups?.has(g) ? (
|
||||
{!hiddenGroups.has(g) ? (
|
||||
<KeyboardArrowUpIcon />
|
||||
) : (
|
||||
<KeyboardArrowDownIcon />
|
||||
@ -157,7 +157,7 @@ function VMListWidget(p: {
|
||||
<TableCell>
|
||||
<VMStatusWidget
|
||||
vm={row}
|
||||
onChange={(s) => updateVMState(row, s)}
|
||||
onChange={(s) => { updateVMState(row, s); }}
|
||||
/>
|
||||
</TableCell>
|
||||
<TableCell>
|
||||
|
@ -91,7 +91,7 @@ function VNCInner(p: { vm: VMInfo }): React.ReactElement {
|
||||
connect(false);
|
||||
|
||||
if (vncRef.current) {
|
||||
vncRef.current.onfullscreenchange = () => setCounter(counter + 1);
|
||||
vncRef.current.onfullscreenchange = () => { setCounter(counter + 1); };
|
||||
}
|
||||
});
|
||||
|
||||
@ -140,10 +140,10 @@ function VNCInner(p: { vm: VMInfo }): React.ReactElement {
|
||||
ref={vncScreenRef}
|
||||
url={token.url}
|
||||
onDisconnect={() => {
|
||||
console.info("VNC disconnected " + token?.url);
|
||||
console.info("VNC disconnected " + token.url);
|
||||
disconnected();
|
||||
}}
|
||||
onConnect={() => setConnected(true)}
|
||||
onConnect={() => { setConnected(true); }}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -36,7 +36,7 @@ export function LoginRoute(): React.ReactElement {
|
||||
const canSubmit = username.length > 0 && password.length > 0;
|
||||
|
||||
const [showPassword, setShowPassword] = React.useState(false);
|
||||
const handleClickShowPassword = () => setShowPassword((show) => !show);
|
||||
const handleClickShowPassword = () => { setShowPassword((show) => !show); };
|
||||
|
||||
const handleMouseDownPassword = (
|
||||
event: React.MouseEvent<HTMLButtonElement>
|
||||
@ -105,7 +105,7 @@ export function LoginRoute(): React.ReactElement {
|
||||
label="Username"
|
||||
name="username"
|
||||
value={username}
|
||||
onChange={(e) => setUsername(e.target.value)}
|
||||
onChange={(e) => { setUsername(e.target.value); }}
|
||||
autoComplete="username"
|
||||
autoFocus
|
||||
/>
|
||||
@ -120,7 +120,7 @@ export function LoginRoute(): React.ReactElement {
|
||||
type={showPassword ? "text" : "password"}
|
||||
id="password"
|
||||
value={password}
|
||||
onChange={(e) => setPassword(e.target.value)}
|
||||
onChange={(e) => { setPassword(e.target.value); }}
|
||||
autoComplete="current-password"
|
||||
endAdornment={
|
||||
<InputAdornment position="end">
|
||||
|
Reference in New Issue
Block a user