This commit is contained in:
		@@ -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"
 | 
			
		||||
        />
 | 
			
		||||
 
 | 
			
		||||
@@ -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();
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user