Fix ESLint issues
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Pierre HUBERT 2025-05-29 15:52:23 +02:00
parent d765f9c2c3
commit d5fbc24c96
2 changed files with 10 additions and 6 deletions

View File

@ -32,7 +32,7 @@ export function ConvertDiskImageDialog(p: {
const [filename, setFilename] = React.useState(p.image.file_name + ".qcow2");
const handleFormatChange = async (value?: string) => {
const handleFormatChange = (value?: string) => {
setFormat({ format: value ?? ("QCow2" as any) });
if (value === "QCow2") setFilename(`${p.image.file_name}.qcow2`);
@ -93,7 +93,7 @@ export function ConvertDiskImageDialog(p: {
<CheckboxInput
editable
label="Sparse file"
checked={format.is_sparse === true}
checked={format.is_sparse}
onValueChange={(c) => {
setFormat({ format: "Raw", is_sparse: c });
}}
@ -105,7 +105,9 @@ export function ConvertDiskImageDialog(p: {
editable
label="New image name"
value={filename}
onValueChange={(s) => setFilename(s ?? "")}
onValueChange={(s) => {
setFilename(s ?? "");
}}
size={ServerApi.Config.constraints.disk_image_name_size}
helperText="The image name shall contain the proper file extension"
/>

View File

@ -170,7 +170,7 @@ function DiskImageList(p: {
const [dlProgress, setDlProgress] = React.useState<undefined | number>();
// Convert disk image file
const convertDiskImage = async (entry: DiskImage) => {
const convertDiskImage = (entry: DiskImage) => {
setCurrConversion(entry);
};
@ -266,7 +266,7 @@ function DiskImageList(p: {
return (
<>
<Tooltip title="Convert disk image">
<IconButton onClick={() => convertDiskImage(params.row)}>
<IconButton onClick={() => { convertDiskImage(params.row); }}>
<LoopIcon />
</IconButton>
</Tooltip>
@ -316,7 +316,9 @@ function DiskImageList(p: {
{currConversion && (
<ConvertDiskImageDialog
image={currConversion}
onCancel={() => setCurrConversion(undefined)}
onCancel={() => {
setCurrConversion(undefined);
}}
onFinished={() => {
setCurrConversion(undefined);
p.onReload();