Skip to content

Commit 4f38461

Browse files
authored
Merge pull request #87 from eshtek/feature/app-tasks-for-stop-and-start
Adds start and stop app tasks
2 parents a92d510 + fcd8e25 commit 4f38461

3 files changed

Lines changed: 15 additions & 1 deletion

File tree

eshtek/errors.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ export enum GlobalErrorCode {
4343
UPDATE_APP_ANALYSIS_FAILED = 'UPDATE_APP_ANALYSIS_FAILED',
4444
UPDATE_APP_FAILED = 'UPDATE_APP_FAILED',
4545
UPDATE_APP_NO_CURRENT_CONFIG = 'UPDATE_APP_NO_CURRENT_CONFIG',
46+
UPGRADE_APP_INVALID_STATE = 'UPGRADE_APP_INVALID_STATE',
4647
DOMAIN_NOT_FOUND = 'DOMAIN_NOT_FOUND',
4748
ACME_ACCOUNT_EMAIL_REQUIRED = 'ACME_ACCOUNT_EMAIL_REQUIRED',
4849
ACME_CHALLENGE_FAILED = 'ACME_CHALLENGE_FAILED',

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)