Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
1 change: 1 addition & 0 deletions eshtek/errors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ export enum GlobalErrorCode {
UPDATE_APP_ANALYSIS_FAILED = 'UPDATE_APP_ANALYSIS_FAILED',
UPDATE_APP_FAILED = 'UPDATE_APP_FAILED',
UPDATE_APP_NO_CURRENT_CONFIG = 'UPDATE_APP_NO_CURRENT_CONFIG',
UPGRADE_APP_INVALID_STATE = 'UPGRADE_APP_INVALID_STATE',
DOMAIN_NOT_FOUND = 'DOMAIN_NOT_FOUND',
ACME_ACCOUNT_EMAIL_REQUIRED = 'ACME_ACCOUNT_EMAIL_REQUIRED',
ACME_CHALLENGE_FAILED = 'ACME_CHALLENGE_FAILED',
Expand Down
6 changes: 6 additions & 0 deletions eshtek/tasks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ export enum HexTaskType {
APP_UNINSTALL = 'APP_UNINSTALL',
APP_UPGRADE = 'APP_UPGRADE',
APP_UPDATE = 'APP_UPDATE',
APP_START = 'APP_START',
APP_STOP = 'APP_STOP',
PREFERENCE_LOCATION_PATH_MIGRATION = 'PREFERENCE_LOCATION_PATH_MIGRATION',
POOLS_DELETE_ALL = 'POOLS_DELETE_ALL',
DRIVE_REPLACE = 'DRIVE_REPLACE',
Expand Down Expand Up @@ -160,6 +162,8 @@ export type HexTaskDataMap = {
[HexTaskType.APP_UNINSTALL]: HexTaskMeta<HexTaskDataBase & { appId: string }, string>;
[HexTaskType.APP_UPGRADE]: HexTaskMeta<HexTaskDataBase & { appId: string; fromVersion?: string; toVersion?: string }, string>;
[HexTaskType.APP_UPDATE]: HexTaskMeta<HexTaskDataBase & HexTaskAppUpdateData, string>;
[HexTaskType.APP_START]: HexTaskMeta<HexTaskDataBase & { appId: string }, string>;
[HexTaskType.APP_STOP]: HexTaskMeta<HexTaskDataBase & { appId: string }, string>;
[HexTaskType.PREFERENCE_LOCATION_PATH_MIGRATION]: HexTaskMeta<HexTaskDataBase & { locationPreferenceId: string; oldPath: string; newPath: string }, never>;
[HexTaskType.DRIVE_REPLACE]: HexTaskMeta<HexTaskDataBase & { poolId: number; devname: string; newDevname: string; label: string; disk: string }, string>;
[HexTaskType.DOCKER_UPDATE]: HexTaskMeta<HexTaskDataBase & { poolName?: string; }, string>;
Expand Down Expand Up @@ -191,6 +195,8 @@ export const HexTaskSettings: {
[HexTaskType.APP_UNINSTALL]: { canHaveMultiple: true, predictedSecondsToComplete: 500 },
[HexTaskType.APP_UPGRADE]: { canHaveMultiple: true, predictedSecondsToComplete: 500 },
[HexTaskType.APP_UPDATE]: { canHaveMultiple: true, predictedSecondsToComplete: 500 },
[HexTaskType.APP_START]: { canHaveMultiple: true, predictedSecondsToComplete: 120 },
[HexTaskType.APP_STOP]: { canHaveMultiple: true, predictedSecondsToComplete: 120 },
[HexTaskType.PREFERENCE_LOCATION_PATH_MIGRATION]: { canHaveMultiple: false, predictedSecondsToComplete: 1200 },
[HexTaskType.DRIVE_REPLACE]: { canHaveMultiple: true, predictedSecondsToComplete: 120 },
[HexTaskType.DOCKER_UPDATE]: { canHaveMultiple: false, predictedSecondsToComplete: 120 },
Expand Down
9 changes: 8 additions & 1 deletion truenas/webui/enums/app-state.enum.ts
Original file line number Diff line number Diff line change
@@ -1,19 +1,26 @@
const T = (str: string) => str;


export enum AppState {
Running = 'RUNNING',
Deploying = 'DEPLOYING',
Stopped = 'STOPPED',
Stopping = 'STOPPING',
Crashed = 'CRASHED',
}

export const appStateIcons = new Map<AppState, string>([
[AppState.Running, 'mdi-check-circle'],
[AppState.Deploying, 'mdi-progress-wrench'],
[AppState.Stopped, 'mdi-stop-circle'],
[AppState.Stopping, 'mdi-check-circle'],
[AppState.Crashed, 'mdi-alert-circle'],
]);

export const appStateLabels = new Map<AppState, string>([
[AppState.Running, T('Running')],
[AppState.Deploying, T('Deploying')],
[AppState.Stopped, T('Stopped')],
]);
[AppState.Stopping, T('Stopping')],
[AppState.Crashed, T('Crashed')],
]);