update
This commit is contained in:
@@ -8,6 +8,7 @@ import type {
|
||||
InstallProgress,
|
||||
LogEvent,
|
||||
LogLevel,
|
||||
Market,
|
||||
Phase,
|
||||
Settings,
|
||||
StackComponent,
|
||||
@@ -112,6 +113,9 @@ class Launcher {
|
||||
stopping = $state(false);
|
||||
/** The sync review panel. */
|
||||
syncOpen = $state(false);
|
||||
/** The marketplace panel, and the drive it describes (null: this PC and its DHP). */
|
||||
marketOpen = $state(false);
|
||||
marketDrive = $state<string | null>(null);
|
||||
/** Decisions waiting in this PC's database; null until the panel loads them. */
|
||||
conflicts = $state<SyncConflict[] | null>(null);
|
||||
notes = $state<NotesState>({
|
||||
@@ -289,6 +293,38 @@ class Launcher {
|
||||
}
|
||||
}
|
||||
|
||||
/** The marketplace listing, of this PC's DHP or of a drive. Throws, so the drawer says why. */
|
||||
loadMarket(drive?: string): Promise<Market> {
|
||||
return backend.getMarket(drive);
|
||||
}
|
||||
|
||||
openMarket() {
|
||||
this.marketDrive = null;
|
||||
this.marketOpen = true;
|
||||
}
|
||||
|
||||
/** Installing from a drive starts by looking at what the drive carries. */
|
||||
async chooseDrive() {
|
||||
const path = await this.pickFolder();
|
||||
if (!path) return;
|
||||
this.marketDrive = path;
|
||||
this.marketOpen = true;
|
||||
}
|
||||
|
||||
/** Choose what an install about to run will bring; nothing installed is touched. */
|
||||
setMarket(selected: string[], drive?: string) {
|
||||
return this.run("market", () => backend.setMarket(selected, drive));
|
||||
}
|
||||
|
||||
/** Save the choice of optional items and apply it (downloads show as an install). */
|
||||
applyMarket(selected: string[]) {
|
||||
return this.run("market", async () => {
|
||||
this.lastOp = null;
|
||||
await backend.applyMarket(selected);
|
||||
this.applyStatus(await backend.getStatus());
|
||||
});
|
||||
}
|
||||
|
||||
install() {
|
||||
return this.run("install", async () => {
|
||||
this.lastOp = { kind: "install" };
|
||||
@@ -296,9 +332,11 @@ class Launcher {
|
||||
});
|
||||
}
|
||||
|
||||
async installFromDrive() {
|
||||
const path = await this.pickFolder();
|
||||
if (!path) return false;
|
||||
/**
|
||||
* Installing from a drive is a copy the operator chooses first: the marketplace opens on what
|
||||
* the drive carries, and starts this once they have picked.
|
||||
*/
|
||||
async installFromDrive(path: string) {
|
||||
return this.run("install", async () => {
|
||||
this.lastOp = { kind: "drive", path };
|
||||
await backend.startInstallFromDrive(path);
|
||||
|
||||
Reference in New Issue
Block a user