Merge pull request #69 from a110605/issue_7174

fix: failed to resume /active vm schedule job
This commit is contained in:
Andy Lee 2025-01-10 14:22:45 +08:00 committed by GitHub
commit 4ca6caefb9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1,6 +1,4 @@
import HarvesterResource from './harvester'; import HarvesterResource from './harvester';
import { get } from '@shell/utils/object';
import { findBy } from '@shell/utils/array';
import { colorForState, stateDisplay, STATES } from '@shell/plugins/dashboard-store/resource-class'; import { colorForState, stateDisplay, STATES } from '@shell/plugins/dashboard-store/resource-class';
import { _CREATE } from '@shell/config/query-params'; import { _CREATE } from '@shell/config/query-params';
import { ucFirst, escapeHtml } from '@shell/utils/string'; import { ucFirst, escapeHtml } from '@shell/utils/string';
@ -67,14 +65,7 @@ export default class ScheduleVmBackup extends HarvesterResource {
} }
get state() { get state() {
const conditions = get(this, 'status.conditions'); return this.status?.suspended === true ? STATES.suspended.label : STATES.active.label;
const isSuspended = findBy(conditions, 'type', 'BackupSuspend')?.status === 'True';
if (isSuspended) {
return STATES.suspended.label;
}
return this.metadata.state.name;
} }
get stateDescription() { get stateDescription() {