This commit is contained in:
@@ -32,7 +32,7 @@ export function ConvertDiskImageDialog(p: {
|
|||||||
|
|
||||||
const [filename, setFilename] = React.useState(p.image.file_name + ".qcow2");
|
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) });
|
setFormat({ format: value ?? ("QCow2" as any) });
|
||||||
|
|
||||||
if (value === "QCow2") setFilename(`${p.image.file_name}.qcow2`);
|
if (value === "QCow2") setFilename(`${p.image.file_name}.qcow2`);
|
||||||
@@ -93,7 +93,7 @@ export function ConvertDiskImageDialog(p: {
|
|||||||
<CheckboxInput
|
<CheckboxInput
|
||||||
editable
|
editable
|
||||||
label="Sparse file"
|
label="Sparse file"
|
||||||
checked={format.is_sparse === true}
|
checked={format.is_sparse}
|
||||||
onValueChange={(c) => {
|
onValueChange={(c) => {
|
||||||
setFormat({ format: "Raw", is_sparse: c });
|
setFormat({ format: "Raw", is_sparse: c });
|
||||||
}}
|
}}
|
||||||
@@ -105,7 +105,9 @@ export function ConvertDiskImageDialog(p: {
|
|||||||
editable
|
editable
|
||||||
label="New image name"
|
label="New image name"
|
||||||
value={filename}
|
value={filename}
|
||||||
onValueChange={(s) => setFilename(s ?? "")}
|
onValueChange={(s) => {
|
||||||
|
setFilename(s ?? "");
|
||||||
|
}}
|
||||||
size={ServerApi.Config.constraints.disk_image_name_size}
|
size={ServerApi.Config.constraints.disk_image_name_size}
|
||||||
helperText="The image name shall contain the proper file extension"
|
helperText="The image name shall contain the proper file extension"
|
||||||
/>
|
/>
|
||||||
|
@@ -170,7 +170,7 @@ function DiskImageList(p: {
|
|||||||
const [dlProgress, setDlProgress] = React.useState<undefined | number>();
|
const [dlProgress, setDlProgress] = React.useState<undefined | number>();
|
||||||
|
|
||||||
// Convert disk image file
|
// Convert disk image file
|
||||||
const convertDiskImage = async (entry: DiskImage) => {
|
const convertDiskImage = (entry: DiskImage) => {
|
||||||
setCurrConversion(entry);
|
setCurrConversion(entry);
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -266,7 +266,7 @@ function DiskImageList(p: {
|
|||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Tooltip title="Convert disk image">
|
<Tooltip title="Convert disk image">
|
||||||
<IconButton onClick={() => convertDiskImage(params.row)}>
|
<IconButton onClick={() => { convertDiskImage(params.row); }}>
|
||||||
<LoopIcon />
|
<LoopIcon />
|
||||||
</IconButton>
|
</IconButton>
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
@@ -316,7 +316,9 @@ function DiskImageList(p: {
|
|||||||
{currConversion && (
|
{currConversion && (
|
||||||
<ConvertDiskImageDialog
|
<ConvertDiskImageDialog
|
||||||
image={currConversion}
|
image={currConversion}
|
||||||
onCancel={() => setCurrConversion(undefined)}
|
onCancel={() => {
|
||||||
|
setCurrConversion(undefined);
|
||||||
|
}}
|
||||||
onFinished={() => {
|
onFinished={() => {
|
||||||
setCurrConversion(undefined);
|
setCurrConversion(undefined);
|
||||||
p.onReload();
|
p.onReload();
|
||||||
|
Reference in New Issue
Block a user