mirror of
https://github.com/harvester/harvester-ui-extension.git
synced 2025-12-13 21:21:44 +00:00
fix: resume/active scheduling job failed
Signed-off-by: andy.lee <andy.lee@suse.com> (cherry picked from commit 814d296d75e972c44c1721d202f84d068b97f175)
This commit is contained in:
parent
0f03fc0805
commit
7d97e6821c
@ -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() {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user