Skip to content

Commit

Permalink
add node disk scheduling radio buttons
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 Jul 30, 2024
1 parent d1254dc commit 8d5426e
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 3 deletions.
14 changes: 13 additions & 1 deletion pkg/harvester/detail/harvesterhci.io.host/HarvesterHostDisk.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,15 @@ import LabelValue from '@shell/components/LabelValue';
import { BadgeState } from '@components/BadgeState';
import { Banner } from '@components/Banner';
import HarvesterDisk from '../../mixins/harvester-disk';
import { RadioGroup } from '@components/Form/Radio';
export default {
components: {
LabelValue,
BadgeState,
Banner,
Tag
Tag,
RadioGroup
},
mixins: [
Expand Down Expand Up @@ -117,6 +119,16 @@ export default {
</div>
<div class="row mt-10">
<div class="col span-12">
<div class="pull-left">
<RadioGroup
v-model="value.allowScheduling"
name="diskScheduling"
:label="t('harvester.host.disk.allowScheduling.label')"
:mode="mode"
:options="allowSchedulingOptions"
:row="true"
/>
</div>
<div class="pull-right">
{{ t('harvester.host.disk.conditions') }}:
<BadgeState
Expand Down
1 change: 1 addition & 0 deletions pkg/harvester/detail/harvesterhci.io.host/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ export default {
}
const blockDevices = this.$store.getters[`${ inStore }/all`](HCI.BLOCK_DEVICE);
const provisionedBlockDevices = blockDevices.filter((d) => {
const provisioned = d?.spec?.fileSystem?.provisioned;
const isCurrentNode = d?.spec?.nodeName === this.value.id;
Expand Down
10 changes: 10 additions & 0 deletions pkg/harvester/edit/harvesterhci.io.host/HarvesterDisk.vue
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,16 @@ export default {
</div>
<div class="row mt-10">
<div class="col span-12">
<div class="pull-left">
<RadioGroup
v-model="value.allowScheduling"
name="diskScheduling"
:label="t('harvester.host.disk.allowScheduling.label')"
:mode="mode"
:options="allowSchedulingOptions"
:row="true"
/>
</div>
<div class="pull-right">
{{ t('harvester.host.disk.conditions') }}:
<BadgeState
Expand Down
4 changes: 2 additions & 2 deletions pkg/harvester/edit/harvesterhci.io.host/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,6 @@ export default {
return blockDevice.save();
}));
this.$store.dispatch('growl/success', {
title: this.t('generic.notification.title.succeed'),
message: this.t('harvester.host.disk.notification.success', { name: this.value.metadata?.name || '' }),
Expand Down Expand Up @@ -478,10 +477,11 @@ export default {
const disks = this.longhornNode?.spec?.disks || {};
// update each disk tags and scheduling
this.newDisks.map((disk) => {
(disks[disk.name] || {}).tags = disk.tags;
(disks[disk.name] || {}).allowScheduling = disk.allowScheduling;
});
let count = 0;
const retrySave = async() => {
Expand Down

0 comments on commit 8d5426e

Please sign in to comment.