Latest changes from Harvester master - a537c1ae38eb7030542ac371f24ae3336cd9d422

Signed-off-by: Francesco Torchia <francesco.torchia@suse.com>
This commit is contained in:
Francesco Torchia
2024-10-23 17:01:40 +02:00
parent 2ca86930ad
commit 118aaf16b7
35 changed files with 1484 additions and 93 deletions
@@ -225,13 +225,15 @@ export default {
}
},
headerFor(type) {
return {
headerFor(type, hasVolBackups = false) {
const mainHeader = {
[SOURCE_TYPE.NEW]: this.$store.getters['i18n/t']('harvester.virtualMachine.volume.title.volume'),
[SOURCE_TYPE.IMAGE]: this.$store.getters['i18n/t']('harvester.virtualMachine.volume.title.vmImage'),
[SOURCE_TYPE.ATTACH_VOLUME]: this.$store.getters['i18n/t']('harvester.virtualMachine.volume.title.existingVolume'),
[SOURCE_TYPE.CONTAINER]: this.$store.getters['i18n/t']('harvester.virtualMachine.volume.title.container'),
}[type];
return hasVolBackups ? `${ mainHeader } and Backups` : mainHeader;
},
update() {
@@ -322,7 +324,7 @@ export default {
</span>
<span v-else>
{{ headerFor(volume.source) }}
{{ headerFor(volume.source, !!volume?.volumeBackups) }}
</span>
</h3>
<div>
@@ -3,6 +3,7 @@ import { LabeledInput } from '@components/Form/LabeledInput';
import LabeledSelect from '@shell/components/form/LabeledSelect';
import InputOrDisplay from '@shell/components/InputOrDisplay';
import { VOLUME_TYPE, InterfaceOption } from '../../../../config/harvester-map';
import { Banner } from '@components/Banner';
export default {
name: 'HarvesterEditContainer',
@@ -10,7 +11,7 @@ export default {
emits: ['update'],
components: {
LabeledInput, LabeledSelect, InputOrDisplay
LabeledInput, LabeledSelect, InputOrDisplay, Banner
},
props: {
@@ -70,7 +71,6 @@ export default {
/>
</InputOrDisplay>
</div>
<div
data-testid="input-hec-type"
class="col span-6"
@@ -111,7 +111,6 @@ export default {
/>
</InputOrDisplay>
</div>
<div
data-testid="input-hec-bus"
class="col span-6"
@@ -131,5 +130,28 @@ export default {
</InputOrDisplay>
</div>
</div>
<div class="row mb-20">
<div
v-if="value.volumeBackups"
class="col span-6"
>
<InputOrDisplay
:name="t('harvester.virtualMachine.volume.readyToUse')"
:value="value.volumeBackups.readyToUse"
:mode="mode"
>
<LabelValue
:name="t('harvester.virtualMachine.volume.readyToUse')"
:value="value.volumeBackups.readyToUse"
/>
</InputOrDisplay>
</div>
</div>
<Banner
v-if="value.volumeBackups && value.volumeBackups.error && value.volumeBackups.error.message"
color="error"
class="mb-20"
:label="value.volumeBackups.error.message"
/>
</div>
</template>
@@ -1,9 +1,10 @@
<script>
import UnitInput from '@shell/components/form/UnitInput';
import { LabeledInput } from '@components/Form/LabeledInput';
import LabelValue from '@shell/components/LabelValue';
import LabeledSelect from '@shell/components/form/LabeledSelect';
import InputOrDisplay from '@shell/components/InputOrDisplay';
import { Banner } from '@components/Banner';
import { sortBy } from '@shell/utils/sort';
import { PVC } from '@shell/config/types';
import { _CREATE } from '@shell/config/query-params';
@@ -17,7 +18,7 @@ export default {
emits: ['update'],
components: {
UnitInput, LabeledInput, LabeledSelect, InputOrDisplay
UnitInput, LabeledInput, LabeledSelect, InputOrDisplay, LabelValue, Banner
},
props: {
@@ -275,7 +276,6 @@ export default {
/>
</InputOrDisplay>
</div>
<div
data-testid="input-hee-bus"
class="col span-6"
@@ -296,6 +296,27 @@ export default {
/>
</InputOrDisplay>
</div>
<div
v-if="value.volumeBackups"
class="col span-6"
>
<InputOrDisplay
:name="t('harvester.virtualMachine.volume.readyToUse')"
:value="value.volumeBackups.readyToUse"
:mode="mode"
>
<LabelValue
:name="t('harvester.virtualMachine.volume.readyToUse')"
:value="value.volumeBackups.readyToUse"
/>
</InputOrDisplay>
</div>
</div>
<Banner
v-if="value.volumeBackups && value.volumeBackups.error && value.volumeBackups.error.message"
color="error"
class="mb-20"
:label="value.volumeBackups.error.message"
/>
</div>
</template>
@@ -4,6 +4,7 @@ import UnitInput from '@shell/components/form/UnitInput';
import { LabeledInput } from '@components/Form/LabeledInput';
import LabeledSelect from '@shell/components/form/LabeledSelect';
import InputOrDisplay from '@shell/components/InputOrDisplay';
import { Banner } from '@components/Banner';
import { PVC } from '@shell/config/types';
import { formatSi, parseSi } from '@shell/utils/units';
import { HCI } from '../../../../types';
@@ -18,7 +19,7 @@ export default {
emits: ['update'],
components: {
UnitInput, LabeledInput, LabeledSelect, InputOrDisplay, LabelValue
UnitInput, LabeledInput, LabeledSelect, InputOrDisplay, LabelValue, Banner
},
props: {
@@ -101,6 +102,12 @@ export default {
return image ? image.label : '-';
},
readyToUse() {
const val = String(this.value.volumeBackups?.readyToUse || false);
return ucFirst(val);
},
pvcsResource() {
const allPVCs = this.$store.getters['harvester/all'](PVC) || [];
@@ -301,7 +308,7 @@ export default {
</div>
<div
v-if="isView"
class="col span-6"
class="col span-3"
>
<LabelValue
:name="t('harvester.virtualMachine.volume.encryption')"
@@ -309,5 +316,19 @@ export default {
/>
</div>
</div>
<div class="row mb-20">
<div v-if="value.volumeBackups && isView" class="col span-3">
<LabelValue
:name="t('harvester.virtualMachine.volume.readyToUse')"
:value="readyToUse"
/>
</div>
</div>
<Banner
v-if="value.volumeBackups && value.volumeBackups.error && value.volumeBackups.error.message"
color="error"
class="mb-20"
:label="value.volumeBackups.error.message"
/>
</div>
</template>
@@ -4,7 +4,7 @@ import UnitInput from '@shell/components/form/UnitInput';
import InputOrDisplay from '@shell/components/InputOrDisplay';
import { LabeledInput } from '@components/Form/LabeledInput';
import LabeledSelect from '@shell/components/form/LabeledSelect';
import { Banner } from '@components/Banner';
import { PVC, STORAGE_CLASS } from '@shell/config/types';
import { formatSi, parseSi } from '@shell/utils/units';
import { VOLUME_TYPE, InterfaceOption } from '../../../../config/harvester-map';
@@ -18,7 +18,7 @@ export default {
emits: ['update'],
components: {
InputOrDisplay, Loading, LabeledInput, LabeledSelect, UnitInput, LabelValue
InputOrDisplay, Loading, LabeledInput, LabeledSelect, UnitInput, LabelValue, Banner
},
props: {
@@ -68,9 +68,16 @@ export default {
return ucFirst(String(this.value.isEncrypted));
},
readyToUse() {
const val = String(this.value.volumeBackups?.readyToUse || false);
return ucFirst(val);
},
isView() {
return this.mode === _VIEW;
},
pvcsResource() {
const allPVCs = this.$store.getters['harvester/all'](PVC) || [];
@@ -221,7 +228,6 @@ export default {
</InputOrDisplay>
</div>
</div>
<div class="row mb-20">
<div
data-testid="input-hev-bus"
@@ -248,5 +254,19 @@ export default {
/>
</div>
</div>
<div class="row mb-20">
<div v-if="value.volumeBackups && isView" class="col span-3">
<LabelValue
:name="t('harvester.virtualMachine.volume.readyToUse')"
:value="readyToUse"
/>
</div>
</div>
<Banner
v-if="value.volumeBackups && value.volumeBackups.error && value.volumeBackups.error.message"
color="error"
class="mb-20"
:label="value.volumeBackups.error.message"
/>
</div>
</template>
@@ -1,7 +1,6 @@
<script>
import { isEqual } from 'lodash';
import { mapGetters } from 'vuex';
import Tabbed from '@shell/components/Tabbed';
import Tab from '@shell/components/Tabbed/Tab';
import { Checkbox } from '@components/Form/Checkbox';