Skip to content

Commit

Permalink
Add ifHaveType for schedule page
Browse files Browse the repository at this point in the history
Signed-off-by: andy.lee <andy.lee@suse.com>
  • Loading branch information
a110605 committed Sep 24, 2024
1 parent 759fefb commit 6ab98fa
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 23 deletions.
3 changes: 2 additions & 1 deletion pkg/harvester/config/harvester.js
Original file line number Diff line number Diff line change
Expand Up @@ -478,7 +478,8 @@ export function init($plugin, store) {
name: `${ PRODUCT_NAME }-c-cluster-resource`,
params: { resource: HCI.SCHEDULE_VM_BACKUP }
},
exact: false
exact: false,
ifHaveType: HCI.SCHEDULE_VM_BACKUP,
});

configureType(HCI.BACKUP, { showListMasthead: false, showConfigView: false });
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import { HCI } from '../../../../types';
import { formatSi, parseSi } from '@shell/utils/units';
import { VOLUME_TYPE, InterfaceOption } from '../../../../config/harvester-map';
import { _VIEW } from '@shell/config/query-params';
import { ucFirst } from '@shell/utils/string';
export default {
Expand Down Expand Up @@ -101,6 +100,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) || [];
Expand Down Expand Up @@ -308,16 +313,13 @@ export default {
:value="encryptionValue"
/>
</div>
<div
v-if="value.volumeBackups"
class="col span-3"
>
<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 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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,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) || [];
Expand Down Expand Up @@ -243,16 +250,13 @@ export default {
:value="encryptionValue"
/>
</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 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
Expand Down
1 change: 0 additions & 1 deletion pkg/harvester/mixins/harvester-vm/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ import { HCI as HCI_ANNOTATIONS } from '@pkg/harvester/config/labels-annotations
import impl, { QGA_JSON, USB_TABLET } from './impl';
import { uniq } from '@shell/utils/array';
import { parseVolumeClaimTemplates } from '../../utils/vm';
import aardvark_blue from '../../../../../iTerm2-Color-Schemes/screenshots/aardvark_blue.png';

export const MANAGEMENT_NETWORK = 'management Network';

Expand Down

0 comments on commit 6ab98fa

Please sign in to comment.