Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions web/src/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,8 @@ const probeStorageAction = () => postAction({ probeStorage: null });

const discoverISCSIAction = (config: DiscoverISCSIConfig) => postAction({ discoverISCSI: config });

const startInstallation = () => postAction({ install: null });

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NP: It's weird to read "install: null" but I guess it has its explanation.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe "install" also works, but we are always sending a json object as payload of the action.


const finishInstallation = () => postAction({ finish: "reboot" });

export {
Expand All @@ -99,6 +101,7 @@ export {
activateStorageAction,
probeStorageAction,
discoverISCSIAction,
startInstallation,
finishInstallation,
};

Expand Down
2 changes: 1 addition & 1 deletion web/src/components/overview/OverviewPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ import InstallerOptionsMenu from "~/components/core/InstallerOptionsMenu";
import InstallationSettings from "~/components/overview/InstallationSettings";
import SystemInformationSection from "~/components/overview/SystemInformationSection";
import ProductLogo from "~/components/product/ProductLogo";
import { startInstallation } from "~/model/manager";
import { startInstallation } from "~/api";
import { useProductInfo } from "~/hooks/model/config/product";
import { useIssues } from "~/hooks/model/issue";
import { PRODUCT } from "~/routes/paths";
Expand Down
6 changes: 5 additions & 1 deletion web/src/model/action.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
* find current contact information at www.suse.com.
*/

type Action = ConfigureL10n | ActivateStorage | ProbeStorage | DiscoverISCSI | Finish;
type Action = ConfigureL10n | ActivateStorage | ProbeStorage | DiscoverISCSI | Install | Finish;

type ConfigureL10n = {
configureL10n: L10nSystemConfig;
Expand Down Expand Up @@ -52,6 +52,10 @@ type DiscoverISCSIConfig = {
initiatorPassword?: string;
};

type Install = {
install: null;
};

type Finish = {
finish: "halt" | "reboot" | "stop" | "poweroff";
};
Expand Down
12 changes: 1 addition & 11 deletions web/src/model/manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,16 +39,6 @@ const probe = () => post("/api/manager/probe_sync");
*/
const reprobe = () => post("/api/manager/reprobe_sync");

// we need wrapper here to pass it as plain string json
/* eslint-disable no-new-wrappers */
const install_action: object = new String("install");
/**
* Starts the installation process.
*
* The progress of the installation process can be tracked through installer signals.
*/
const startInstallation = () => post("/api/v2/action", install_action);

/**
* Clean-up when installation is done.
*/
Expand All @@ -59,4 +49,4 @@ const finishInstallation = () => post("/api/v2/action");
*/
const fetchLogs = () => get("/api/manager/logs/store");

export { startProbing, probe, reprobe, startInstallation, finishInstallation, fetchLogs };
export { startProbing, probe, reprobe, finishInstallation, fetchLogs };