Merge branch 'main' into issue-7081

This commit is contained in:
Yi-Ya Chen
2025-01-20 10:44:58 +08:00
14 changed files with 264 additions and 372 deletions
@@ -1,6 +1,4 @@
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 { _CREATE } from '@shell/config/query-params';
import { ucFirst, escapeHtml } from '@shell/utils/string';
@@ -66,15 +64,12 @@ export default class ScheduleVmBackup extends HarvesterResource {
}
}
get stateObj() {
return this?.metadata?.state || {};
}
get state() {
const conditions = get(this, 'status.conditions');
const isSuspended = findBy(conditions, 'type', 'BackupSuspend')?.status === 'True';
if (isSuspended) {
return STATES.suspended.label;
}
return this.metadata.state.name;
return this.status?.suspended === true ? STATES.suspended.label : STATES.active.label;
}
get stateDescription() {
@@ -1120,10 +1120,6 @@ export default class VirtVm extends HarvesterResource {
return qemu?.status === 'True';
}
get warnDeletionMessage() {
return this.t('harvester.virtualMachine.promptRemove.tips');
}
get instanceLabels() {
const all = this.spec?.template?.metadata?.labels || {};