mirror of
https://github.com/harvester/harvester-ui-extension.git
synced 2026-08-16 12:49:14 +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');
|
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() {
|
get isMigrating() {
|
||||||
const migration = this.status?.migration;
|
const migration = this.status?.migration;
|
||||||
|
|
||||||
@ -38,6 +68,10 @@ export default class ForkliftPlan extends HarvesterResource {
|
|||||||
return 'Error';
|
return 'Error';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (this.planCritical) {
|
||||||
|
return 'Error';
|
||||||
|
}
|
||||||
|
|
||||||
if (this.planCanceled) {
|
if (this.planCanceled) {
|
||||||
return 'Canceled';
|
return 'Canceled';
|
||||||
}
|
}
|
||||||
@ -54,6 +88,10 @@ export default class ForkliftPlan extends HarvesterResource {
|
|||||||
return 'bg-error';
|
return 'bg-error';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (this.planCritical) {
|
||||||
|
return 'bg-error';
|
||||||
|
}
|
||||||
|
|
||||||
if (this.planCanceled) {
|
if (this.planCanceled) {
|
||||||
return 'bg-warning';
|
return 'bg-warning';
|
||||||
}
|
}
|
||||||
@ -67,7 +105,7 @@ export default class ForkliftPlan extends HarvesterResource {
|
|||||||
|
|
||||||
get _availableActions() {
|
get _availableActions() {
|
||||||
const canStop = this.isMigrating && !this.planCanceled;
|
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;
|
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 {
|
return {
|
||||||
source: { name: entry.name, id: entry.id },
|
source: { name: entry.name, id: entry.id },
|
||||||
destination: {
|
destination: {
|
||||||
type: 'multus',
|
type: 'multus',
|
||||||
name: entry.target,
|
name: netName,
|
||||||
namespace: NAMESPACE,
|
namespace: netNamespace,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
}),
|
}),
|
||||||
|
|||||||
@ -262,7 +262,7 @@ init();
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<span v-else>-</span>
|
<span v-if="!row.vmProgress.length">-</span>
|
||||||
</template>
|
</template>
|
||||||
<template #cell:mappings="{ row }">
|
<template #cell:mappings="{ row }">
|
||||||
<MappingsCell
|
<MappingsCell
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user