Latest changes from harvester/master

Signed-off-by: Francesco Torchia <francesco.torchia@suse.com>
This commit is contained in:
Francesco Torchia
2024-10-23 17:01:03 +02:00
parent deeccf3db6
commit ec3d88aeb7
56 changed files with 1498 additions and 2197 deletions
@@ -5,7 +5,7 @@ import { BadgeState } from '@components/BadgeState';
import { Banner } from '@components/Banner';
import { RadioGroup, RadioButton } from '@components/Form/Radio';
import HarvesterDisk from '../../mixins/harvester-disk';
import DiskTags from '../../components/DiskTags';
import Tags from '../../components/DiskTags';
import { HCI } from '../../types';
import { LONGHORN_SYSTEM } from './index';
@@ -17,7 +17,7 @@ export default {
Banner,
RadioGroup,
RadioButton,
DiskTags,
Tags,
},
mixins: [
@@ -44,6 +44,18 @@ export default {
return {};
},
computed: {
targetDisk() {
return this.disks.find(disk => disk.name === this.value.name);
},
schedulableTooltipMessage() {
const { name, path } = this.value;
if (this.targetDisk && !this.targetDisk.allowScheduling && name && path) {
return this.t('harvester.host.disk.allowScheduling.tooltip', { name, path });
} else {
return this.schedulableCondition.message;
}
},
allowSchedulingOptions() {
return [{
label: this.t('generic.enabled'),
@@ -171,7 +183,7 @@ export default {
<div v-if="!value.isNew">
<div class="row">
<div class="col span-12">
<DiskTags
<Tags
v-model:value="value.tags"
:label="t('harvester.host.disk.tags.label')"
:add-label="t('harvester.host.disk.tags.addLabel')"
@@ -181,6 +193,16 @@ export default {
</div>
<div class="row mt-10">
<div class="col span-12">
<div class="pull-left">
<RadioGroup
v-model:value="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
@@ -191,9 +213,9 @@ export default {
class="mr-10 ml-10 state"
/>
<BadgeState
v-clean-tooltip="schedulableCondition.message"
:color="schedulableCondition.status === 'True' ? 'bg-success' : 'bg-error' "
:icon="schedulableCondition.status === 'True' ? 'icon-checkmark' : 'icon-warning' "
v-clean-tooltip="schedulableTooltipMessage"
:color="schedulableCondition.status === 'True' && targetDisk?.allowScheduling ? 'bg-success' : 'bg-error' "
:icon="schedulableCondition.status === 'True' && targetDisk?.allowScheduling ? 'icon-checkmark' : 'icon-warning' "
label="Schedulable"
class="mr-10 state"
/>
@@ -5,6 +5,7 @@ import UnitInput from '@shell/components/form/UnitInput';
import { RadioGroup } from '@components/Form/Radio';
import { Checkbox } from '@components/Form/Checkbox';
import { HCI } from '../../types';
import { DOC_LINKS } from '../../config/doc-links';
export const ksmtunedMode = [{
value: 'standard',
@@ -86,6 +87,10 @@ export default {
showKsmt() {
return this.spec.run === 'run';
},
ksmtunedLink() {
return DOC_LINKS.KSMTUNED_MODE;
}
},
@@ -135,7 +140,7 @@ export default {
<Checkbox v-model:value="enableMergeAcrossNodes" :mode="mode" class="check mb-20" type="checkbox" :label="t('harvester.host.ksmtuned.enableMergeNodes')" />
<h3>
<t k="harvester.host.ksmtuned.modeLink" :raw="true" />
<t k="harvester.host.ksmtuned.modeLink" :raw="true" :url="ksmtunedLink" />
</h3>
<RadioGroup
v-model:value="spec.mode"
@@ -25,10 +25,10 @@ import { _EDIT } from '@shell/config/query-params';
import { sortBy } from '@shell/utils/sort';
import { Banner } from '@components/Banner';
import { HCI } from '../../types';
import DiskTags from '../../components/DiskTags';
import HarvesterDisk from './HarvesterDisk';
import HarvesterSeeder from './HarvesterSeeder';
import HarvesterKsmtuned from './HarvesterKsmtuned';
import Tags from '../../components/DiskTags';
export const LONGHORN_SYSTEM = 'longhorn-system';
@@ -46,7 +46,7 @@ export default {
ButtonDropdown,
KeyValue,
Banner,
DiskTags,
Tags,
Loading,
HarvesterSeeder,
MessageLink,
@@ -478,10 +478,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() => {
@@ -505,7 +506,9 @@ export default {
}
};
await retrySave();
if (this.longhornNode) {
await retrySave();
}
},
},
};
@@ -547,7 +550,7 @@ export default {
class="row mb-20"
>
<div class="col span-12">
<DiskTags
<Tags
v-model:value="longhornNode.spec.tags"
:label="t('harvester.host.tags.label')"
:add-label="t('harvester.host.tags.addLabel')"
@@ -650,7 +653,6 @@ export default {
:value="filteredLabels"
:add-label="t('labels.addLabel')"
:mode="mode"
:title="t('labels.labels.title')"
:read-allowed="false"
:value-can-be-empty="true"
@update:value="updateHostLabels"