This commit is contained in:
Ben 2025-06-03 09:46:23 +02:00
parent 367b889055
commit cf66b4ec8e
No known key found for this signature in database
GPG Key ID: 0F16E812E736C24B

View File

@ -28,39 +28,18 @@ export class MainMenu {
};
promptMainMenu = async () => {
if ((await this.processControl.getNumberOfCodexProcesses()) > 0) {
await this.showRunningMenu();
} else {
if (await this.installer.isCodexInstalled()) {
await this.showNotRunningMenu();
} else {
await this.showNotInstalledMenu();
}
}
};
showNotInstalledMenu = async () => {
await this.ui.askMultipleChoice("Codex is not installed", [
await this.ui.askMultipleChoice("Select an option", [
{
label: "Install Codex",
label: "Download and install Codex",
action: this.installMenu.show,
},
{
label: "Exit",
action: this.loop.stopLoop,
},
]);
};
showRunningMenu = async () => {
await this.ui.askMultipleChoice("Codex is running", [
{
label: "Open Codex app",
action: this.codexApp.openCodexApp,
label: "Start Codex node",
action: this.startCodex,
},
{
label: "Stop Codex",
action: this.stopCodex,
label: "Check node status",
action: this.dataMenu.showNodeStatus,
},
{
label: "Upload a file",
@ -71,26 +50,21 @@ export class MainMenu {
action: this.dataMenu.performDownload,
},
{
label: "Exit (Codex keeps running)",
action: this.loop.stopLoop,
},
]);
};
showNotRunningMenu = async () => {
await this.ui.askMultipleChoice("Codex is installed but not running", [
{
label: "Start Codex",
action: this.startCodex,
label: "Show local data",
action: this.dataMenu.showLocalData,
},
{
label: "Edit Codex config",
action: this.configMenu.show,
label: "Stop Codex node",
action: this.stopCodex,
},
{
label: "Uninstall Codex",
label: "Uninstall Codex node",
action: this.installMenu.show,
},
{
label: "Submit feedback",
action: ,
},
{
label: "Exit",
action: this.loop.stopLoop,