diff --git a/src/components/storage/InstallationDestination.jsx b/src/components/storage/InstallationDestination.jsx index 54f23a020e..4924e93cfa 100644 --- a/src/components/storage/InstallationDestination.jsx +++ b/src/components/storage/InstallationDestination.jsx @@ -433,7 +433,7 @@ export const InstallationDestination = ({ : _("No usable disks detected") )} {rescanDisksButton} - {!isBootIso && } + > diff --git a/src/components/storage/ModifyStorage.jsx b/src/components/storage/ModifyStorage.jsx index a731685f9f..edb0a214b8 100644 --- a/src/components/storage/ModifyStorage.jsx +++ b/src/components/storage/ModifyStorage.jsx @@ -29,19 +29,24 @@ import { WrenchIcon, ExternalLinkAltIcon } from "@patternfly/react-icons"; const _ = cockpit.gettext; const N_ = cockpit.noop; -const startBlivetGUI = (onStart, onStarted, errorHandler) => { - console.log("Spawning blivet-gui."); - // We don't have an event informing that blivet-gui started so just wait a bit. - const timeoutId = window.setTimeout(onStarted, 3000); - cockpit.spawn(["blivet-gui", "--keep-above", "--auto-dev-updates"], { err: "message" }) - .then(() => { - console.log("blivet-gui exited."); - // If the blivet-gui exits earlier cancel the delay - window.clearTimeout(timeoutId); - return onStarted(); - }) - .catch((error) => { window.clearTimeout(timeoutId); errorHandler(error) }); +let cockpit_window = null; + +const startCockpitStorage = (onStart, onStarted, errorHandler) => { + window.localStorage.setItem("cockpit_anaconda", + JSON.stringify({ + mount_point_prefix: "/mnt/sysimage", + ignore_devices: ["/dev/sr0", "/dev/loop0"] + })); + cockpit_window = window.open("/cockpit/@localhost/storage/index.html", "storage-tab"); onStart(); + onStarted(); +}; + +const stopCockpitStorage = () => { + if (cockpit_window) { + cockpit_window.close(); + cockpit_window = null; + } }; const StorageModifiedModal = ({ onClose, onRescan }) => { @@ -55,7 +60,7 @@ const StorageModifiedModal = ({ onClose, onRescan }) => { footer={ <> { onClose(); onRescan() }} + onClick={() => { stopCockpitStorage(); onClose(); onRescan() }} variant="primary" id="storage-modified-modal-rescan-btn" key="rescan" @@ -64,7 +69,7 @@ const StorageModifiedModal = ({ onClose, onRescan }) => { onClose()} + onClick={() => { stopCockpitStorage(); onClose() }} id="storage-modified-modal-ignore-btn" key="ignore" > @@ -92,7 +97,7 @@ const ModifyStorageModal = ({ onClose, onToolStarted, errorHandler }) => { footer={ <> startBlivetGUI( + onClick={() => startCockpitStorage( onStart, onStarted, errorHandler @@ -103,7 +108,7 @@ const ModifyStorageModal = ({ onClose, onToolStarted, errorHandler }) => { isDisabled={toolIsStarting} variant="primary" > - {_("Launch Blivet-gui storage editor")} + {_("Launch storage editor")} { }> - {_("Blivet-gui is an advanced storage editor that lets you resize, delete, and create partitions. It can set up LVM and much more.")} + {_("The storage editor lets you resize, delete, and create partitions. It can set up LVM and much more.")} - {_("Changes made in Blivet-gui will directly affect your storage.")} + {_("Changes made in the storage editor will directly affect your storage.")} diff --git a/src/components/storage/MountPointMapping.jsx b/src/components/storage/MountPointMapping.jsx index 0c4c057048..52f89a06f0 100644 --- a/src/components/storage/MountPointMapping.jsx +++ b/src/components/storage/MountPointMapping.jsx @@ -58,6 +58,7 @@ import { import "./MountPointMapping.scss"; const _ = cockpit.gettext; +const cmpm = JSON.parse(window.localStorage.getItem("cockpit_mount_points")); /* Filter out the partitioning requests array to contain only: * - rows with required mount points @@ -637,6 +638,7 @@ export const MountPointMapping = ({ return ( <> + Cockpit says: {window.localStorage.getItem("cockpit_mount_points")} {showLuksUnlock && (
Cockpit says: {window.localStorage.getItem("cockpit_mount_points")}