diff --git a/src/components/backend-ai-edu-applauncher.ts b/src/components/backend-ai-edu-applauncher.ts index 6b94d767d..9f10f8864 100644 --- a/src/components/backend-ai-edu-applauncher.ts +++ b/src/components/backend-ai-edu-applauncher.ts @@ -258,20 +258,28 @@ export default class BackendAiEduApplauncher extends BackendAIPage { 'TERMINATING', 'PENDING', 'SCHEDULED', - 'PREPARED', + globalThis.backendaiclient.supports('prepared-session-status') + ? 'PREPARED' + : undefined, 'PREPARING', 'PULLING', - ].join(','); + ] + .filter((v) => !!v) + .join(','); } else { statuses = [ 'RUNNING', 'RESTARTING', 'TERMINATING', 'PENDING', - 'PREPARED', + globalThis.backendaiclient.supports('prepared-session-status') + ? 'PREPARED' + : undefined, 'PREPARING', 'PULLING', - ].join(','); + ] + .filter((v) => !!v) + .join(','); } const accessKey = globalThis.backendaiclient._config.accessKey; diff --git a/src/components/backend-ai-session-list.ts b/src/components/backend-ai-session-list.ts index 23b511feb..359a8fa65 100644 --- a/src/components/backend-ai-session-list.ts +++ b/src/components/backend-ai-session-list.ts @@ -765,11 +765,13 @@ export default class BackendAISessionList extends BackendAIPage { 'TERMINATING', 'PENDING', 'SCHEDULED', - 'PREPARED', 'PREPARING', 'PULLING', 'ERROR', ]; + if (globalThis.backendaiclient.supports('prepared-session-status')) { + status.push('PREPARED'); + } break; case 'finished': status = ['TERMINATED', 'CANCELLED']; // TERMINATED, CANCELLED @@ -781,10 +783,12 @@ export default class BackendAISessionList extends BackendAIPage { 'TERMINATING', 'PENDING', 'SCHEDULED', - 'PREPARED', 'PREPARING', 'PULLING', ]; + if (globalThis.backendaiclient.supports('prepared-session-status')) { + status.push('PREPARED'); + } } if ( !globalThis.backendaiclient.supports('avoid-hol-blocking') && diff --git a/src/components/backend-ai-session-view.ts b/src/components/backend-ai-session-view.ts index 09531dac9..1d949c2e8 100644 --- a/src/components/backend-ai-session-view.ts +++ b/src/components/backend-ai-session-view.ts @@ -334,7 +334,6 @@ export default class BackendAISessionView extends BackendAIPage { 'TERMINATING', 'PENDING', 'SCHEDULED', - 'PREPARED', 'PREPARING', 'PULLING', 'TERMINATED', @@ -347,7 +346,6 @@ export default class BackendAISessionView extends BackendAIPage { 'RESTARTING', 'TERMINATING', 'PENDING', - 'PREPARED', 'PREPARING', 'PULLING', 'TERMINATED', @@ -355,6 +353,9 @@ export default class BackendAISessionView extends BackendAIPage { 'ERROR', ]; } + if (globalThis.backendaiclient.supports('prepared-session-status')) { + status.push('PREPARED'); + } if (globalThis.backendaiclient.supports('detailed-session-states')) { status = status.join(','); } diff --git a/src/lib/backend.ai-client-esm.ts b/src/lib/backend.ai-client-esm.ts index 7d395439a..fe9dfc1fb 100644 --- a/src/lib/backend.ai-client-esm.ts +++ b/src/lib/backend.ai-client-esm.ts @@ -724,6 +724,7 @@ class Client { if (this.isManagerVersionCompatibleWith('24.12.0')) { this._features['extended-image-info'] = true; this._features['batch-timeout'] = true; + this._features['prepared-session-status'] = true; } }