mirror of
https://github.com/harvester/harvester-ui-extension.git
synced 2026-08-16 12:49:14 +00:00
feat: added comments from copilot review
Signed-off-by: Marcelo Fukumoto <marcelo.fukumoto@suse.com>
This commit is contained in:
parent
107e44bd4b
commit
a4299a9597
@ -1829,6 +1829,7 @@ harvester:
|
|||||||
hours: "{hours} {hours, plural, one {hour} other {hours}}"
|
hours: "{hours} {hours, plural, one {hour} other {hours}}"
|
||||||
minutes: "{minutes} {minutes, plural, one {minute} other {minutes}}"
|
minutes: "{minutes} {minutes, plural, one {minute} other {minutes}}"
|
||||||
errors:
|
errors:
|
||||||
|
failedLoadPlans: Failed to load migration plans
|
||||||
failedLoadVms: Failed to load virtual machines
|
failedLoadVms: Failed to load virtual machines
|
||||||
failedRefreshVms: Failed to refresh virtual machines
|
failedRefreshVms: Failed to refresh virtual machines
|
||||||
failedLoadProviders: Failed to load providers
|
failedLoadProviders: Failed to load providers
|
||||||
|
|||||||
@ -251,7 +251,7 @@ export default class ForkliftPlan extends HarvesterResource {
|
|||||||
* Use foreground propagation to ensure children are deleted before the parent.
|
* Use foreground propagation to ensure children are deleted before the parent.
|
||||||
*/
|
*/
|
||||||
remove(opt = {}) {
|
remove(opt = {}) {
|
||||||
opt.params = { propagationPolicy: 'Foreground' };
|
opt.params = { ...(opt.params || {}), propagationPolicy: 'Foreground' };
|
||||||
|
|
||||||
return this._remove(opt);
|
return this._remove(opt);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -29,7 +29,7 @@ export default class ForkliftProvider extends HarvesterResource {
|
|||||||
* Use foreground propagation to ensure children are deleted before the parent.
|
* Use foreground propagation to ensure children are deleted before the parent.
|
||||||
*/
|
*/
|
||||||
remove(opt = {}) {
|
remove(opt = {}) {
|
||||||
opt.params = { propagationPolicy: 'Foreground' };
|
opt.params = { ...(opt.params || {}), propagationPolicy: 'Foreground' };
|
||||||
|
|
||||||
return this._remove(opt);
|
return this._remove(opt);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -5,6 +5,7 @@ import Loading from '@shell/components/Loading';
|
|||||||
import Masthead from '@shell/components/ResourceList/Masthead';
|
import Masthead from '@shell/components/ResourceList/Masthead';
|
||||||
import ResourceTable from '@shell/components/ResourceTable';
|
import ResourceTable from '@shell/components/ResourceTable';
|
||||||
import PercentageBar from '@shell/components/PercentageBar';
|
import PercentageBar from '@shell/components/PercentageBar';
|
||||||
|
import { Banner } from '@components/Banner';
|
||||||
import MappingsCell from '../../../../components/MappingsCell';
|
import MappingsCell from '../../../../components/MappingsCell';
|
||||||
import { SCHEMA } from '@shell/config/types';
|
import { SCHEMA } from '@shell/config/types';
|
||||||
import { useI18n } from '@shell/composables/useI18n';
|
import { useI18n } from '@shell/composables/useI18n';
|
||||||
@ -27,6 +28,7 @@ const store = useStore();
|
|||||||
const { t } = useI18n(store);
|
const { t } = useI18n(store);
|
||||||
|
|
||||||
const loading = ref(true);
|
const loading = ref(true);
|
||||||
|
const errors = ref([]);
|
||||||
|
|
||||||
const inStore = computed(() => store.getters['currentProduct'].inStore);
|
const inStore = computed(() => store.getters['currentProduct'].inStore);
|
||||||
|
|
||||||
@ -155,13 +157,17 @@ const headers = [
|
|||||||
];
|
];
|
||||||
|
|
||||||
const init = async() => {
|
const init = async() => {
|
||||||
await Promise.all([
|
try {
|
||||||
store.dispatch(`${ inStore.value }/findAll`, { type: HCI.FORKLIFT_PLAN }),
|
await Promise.all([
|
||||||
store.dispatch(`${ inStore.value }/findAll`, { type: HCI.FORKLIFT_NETWORK_MAP }),
|
store.dispatch(`${ inStore.value }/findAll`, { type: HCI.FORKLIFT_PLAN }),
|
||||||
store.dispatch(`${ inStore.value }/findAll`, { type: HCI.FORKLIFT_STORAGE_MAP }),
|
store.dispatch(`${ inStore.value }/findAll`, { type: HCI.FORKLIFT_NETWORK_MAP }),
|
||||||
]);
|
store.dispatch(`${ inStore.value }/findAll`, { type: HCI.FORKLIFT_STORAGE_MAP }),
|
||||||
|
]);
|
||||||
loading.value = false;
|
} catch (e) {
|
||||||
|
errors.value = [e?.message || t('harvester.addons.vmMigration.errors.failedLoadPlans')];
|
||||||
|
} finally {
|
||||||
|
loading.value = false;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
init();
|
init();
|
||||||
@ -170,6 +176,12 @@ init();
|
|||||||
<template>
|
<template>
|
||||||
<Loading v-if="loading" />
|
<Loading v-if="loading" />
|
||||||
<div v-else>
|
<div v-else>
|
||||||
|
<Banner
|
||||||
|
v-for="(err, i) in errors"
|
||||||
|
:key="i"
|
||||||
|
color="error"
|
||||||
|
:label="err"
|
||||||
|
/>
|
||||||
<Masthead
|
<Masthead
|
||||||
:schema="schema"
|
:schema="schema"
|
||||||
:resource="schema.id"
|
:resource="schema.id"
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user