Skip to content

Commit e778f0b

Browse files
committed
Adds start and stop app tasks
Adds task types and app states for starting and stopping applications. Also adds new app status enums introduced following eel for Stopping and Crashed
1 parent a92d510 commit e778f0b

2 files changed

Lines changed: 14 additions & 1 deletion

File tree

eshtek/tasks.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@ export enum HexTaskType {
4848
APP_UNINSTALL = 'APP_UNINSTALL',
4949
APP_UPGRADE = 'APP_UPGRADE',
5050
APP_UPDATE = 'APP_UPDATE',
51+
APP_START = 'APP_START',
52+
APP_STOP = 'APP_STOP',
5153
PREFERENCE_LOCATION_PATH_MIGRATION = 'PREFERENCE_LOCATION_PATH_MIGRATION',
5254
POOLS_DELETE_ALL = 'POOLS_DELETE_ALL',
5355
DRIVE_REPLACE = 'DRIVE_REPLACE',
@@ -160,6 +162,8 @@ export type HexTaskDataMap = {
160162
[HexTaskType.APP_UNINSTALL]: HexTaskMeta<HexTaskDataBase & { appId: string }, string>;
161163
[HexTaskType.APP_UPGRADE]: HexTaskMeta<HexTaskDataBase & { appId: string; fromVersion?: string; toVersion?: string }, string>;
162164
[HexTaskType.APP_UPDATE]: HexTaskMeta<HexTaskDataBase & HexTaskAppUpdateData, string>;
165+
[HexTaskType.APP_START]: HexTaskMeta<HexTaskDataBase & { appId: string }, string>;
166+
[HexTaskType.APP_STOP]: HexTaskMeta<HexTaskDataBase & { appId: string }, string>;
163167
[HexTaskType.PREFERENCE_LOCATION_PATH_MIGRATION]: HexTaskMeta<HexTaskDataBase & { locationPreferenceId: string; oldPath: string; newPath: string }, never>;
164168
[HexTaskType.DRIVE_REPLACE]: HexTaskMeta<HexTaskDataBase & { poolId: number; devname: string; newDevname: string; label: string; disk: string }, string>;
165169
[HexTaskType.DOCKER_UPDATE]: HexTaskMeta<HexTaskDataBase & { poolName?: string; }, string>;
@@ -191,6 +195,8 @@ export const HexTaskSettings: {
191195
[HexTaskType.APP_UNINSTALL]: { canHaveMultiple: true, predictedSecondsToComplete: 500 },
192196
[HexTaskType.APP_UPGRADE]: { canHaveMultiple: true, predictedSecondsToComplete: 500 },
193197
[HexTaskType.APP_UPDATE]: { canHaveMultiple: true, predictedSecondsToComplete: 500 },
198+
[HexTaskType.APP_START]: { canHaveMultiple: true, predictedSecondsToComplete: 120 },
199+
[HexTaskType.APP_STOP]: { canHaveMultiple: true, predictedSecondsToComplete: 120 },
194200
[HexTaskType.PREFERENCE_LOCATION_PATH_MIGRATION]: { canHaveMultiple: false, predictedSecondsToComplete: 1200 },
195201
[HexTaskType.DRIVE_REPLACE]: { canHaveMultiple: true, predictedSecondsToComplete: 120 },
196202
[HexTaskType.DOCKER_UPDATE]: { canHaveMultiple: false, predictedSecondsToComplete: 120 },
Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,26 @@
11
const T = (str: string) => str;
22

3+
34
export enum AppState {
45
Running = 'RUNNING',
56
Deploying = 'DEPLOYING',
67
Stopped = 'STOPPED',
8+
Stopping = 'STOPPING',
9+
Crashed = 'CRASHED',
710
}
811

912
export const appStateIcons = new Map<AppState, string>([
1013
[AppState.Running, 'mdi-check-circle'],
1114
[AppState.Deploying, 'mdi-progress-wrench'],
1215
[AppState.Stopped, 'mdi-stop-circle'],
16+
[AppState.Stopping, 'mdi-check-circle'],
17+
[AppState.Crashed, 'mdi-alert-circle'],
1318
]);
1419

1520
export const appStateLabels = new Map<AppState, string>([
1621
[AppState.Running, T('Running')],
1722
[AppState.Deploying, T('Deploying')],
1823
[AppState.Stopped, T('Stopped')],
19-
]);
24+
[AppState.Stopping, T('Stopping')],
25+
[AppState.Crashed, T('Crashed')],
26+
]);

0 commit comments

Comments
 (0)