mirror of
https://github.com/harvester/harvester-ui-extension.git
synced 2026-08-16 04:39:15 +00:00
feat(forklift): Applied fix to select the proper data on network. Added condition to show critical
Signed-off-by: Marcelo Fukumoto <marcelo.fukumoto@suse.com>
This commit is contained in:
parent
d4f59a04be
commit
740ca94841
@ -8,6 +8,36 @@ export default class ForkliftPlan extends HarvesterResource {
|
||||
return conditions.some((c) => c.type === 'Failed' && c.status === 'True');
|
||||
}
|
||||
|
||||
get planCritical() {
|
||||
const conditions = this.status?.conditions || [];
|
||||
|
||||
return conditions.some((c) => c.category === 'Critical' && c.status === 'True');
|
||||
}
|
||||
|
||||
get criticalMessages() {
|
||||
const conditions = this.status?.conditions || [];
|
||||
|
||||
return conditions
|
||||
.filter((c) => c.category === 'Critical' && c.status === 'True')
|
||||
.map((c) => c.message);
|
||||
}
|
||||
|
||||
get stateDescription() {
|
||||
if (this.planCritical) {
|
||||
return this.criticalMessages.join('; ');
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
get stateObj() {
|
||||
return {
|
||||
error: this.planFailed || this.planCritical,
|
||||
transitioning: this.isMigrating,
|
||||
message: this.stateDescription,
|
||||
};
|
||||
}
|
||||
|
||||
get isMigrating() {
|
||||
const migration = this.status?.migration;
|
||||
|
||||
@ -38,6 +68,10 @@ export default class ForkliftPlan extends HarvesterResource {
|
||||
return 'Error';
|
||||
}
|
||||
|
||||
if (this.planCritical) {
|
||||
return 'Error';
|
||||
}
|
||||
|
||||
if (this.planCanceled) {
|
||||
return 'Canceled';
|
||||
}
|
||||
@ -54,6 +88,10 @@ export default class ForkliftPlan extends HarvesterResource {
|
||||
return 'bg-error';
|
||||
}
|
||||
|
||||
if (this.planCritical) {
|
||||
return 'bg-error';
|
||||
}
|
||||
|
||||
if (this.planCanceled) {
|
||||
return 'bg-warning';
|
||||
}
|
||||
@ -67,7 +105,7 @@ export default class ForkliftPlan extends HarvesterResource {
|
||||
|
||||
get _availableActions() {
|
||||
const canStop = this.isMigrating && !this.planCanceled;
|
||||
const canStart = !this.planSucceeded && (!this.isMigrating || this.planFailed || this.planCanceled);
|
||||
const canStart = !this.planSucceeded && (!this.isMigrating || this.planFailed || this.planCanceled || this.planCritical);
|
||||
|
||||
const out = super._availableActions;
|
||||
|
||||
|
||||
@ -215,12 +215,16 @@ const saveMappings = async(buttonCb) => {
|
||||
};
|
||||
}
|
||||
|
||||
const parts = entry.target.split('/');
|
||||
const netName = parts.length > 1 ? parts[1] : parts[0];
|
||||
const netNamespace = parts.length > 1 ? parts[0] : NAMESPACE;
|
||||
|
||||
return {
|
||||
source: { name: entry.name, id: entry.id },
|
||||
destination: {
|
||||
type: 'multus',
|
||||
name: entry.target,
|
||||
namespace: NAMESPACE,
|
||||
name: netName,
|
||||
namespace: netNamespace,
|
||||
},
|
||||
};
|
||||
}),
|
||||
|
||||
@ -262,7 +262,7 @@ init();
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<span v-else>-</span>
|
||||
<span v-if="!row.vmProgress.length">-</span>
|
||||
</template>
|
||||
<template #cell:mappings="{ row }">
|
||||
<MappingsCell
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user