mirror of
https://github.com/harvester/harvester-ui-extension.git
synced 2026-11-21 16:22:08 +08:00
Vue migration - remove Vuew.set & this.$set; add vue-migrate script
Signed-off-by: Francesco Torchia <francesco.torchia@suse.com>
This commit is contained in:
85 files changed
+938
-256
No files matched your search
@@ -3,7 +3,7 @@ import { _VIEW, _EDIT, _CREATE } from '@shell/config/query-params';
|
||||
import Tag from '@shell/components/Tag';
|
||||
|
||||
export default {
|
||||
name: 'Tags',
|
||||
name: 'DiskTags',
|
||||
|
||||
components: { Tag },
|
||||
|
||||
|
||||
@@ -58,7 +58,7 @@ export default {
|
||||
},
|
||||
|
||||
removeAll() {
|
||||
this.$set(this, 'searchLabels', []);
|
||||
this['searchLabels'] = [];
|
||||
this.filterRows();
|
||||
},
|
||||
|
||||
|
||||
@@ -73,7 +73,7 @@ export default {
|
||||
|
||||
upgradeMessage = currentResource ? currentResource.upgradeMessage : [];
|
||||
|
||||
this.$set(this, 'upgradeMessage', upgradeMessage);
|
||||
this['upgradeMessage'] = upgradeMessage;
|
||||
},
|
||||
deep: true
|
||||
},
|
||||
|
||||
@@ -157,7 +157,7 @@ export default {
|
||||
const preference = this.$store.getters['management/all'](STEVE.PREFERENCE)?.[0];
|
||||
|
||||
try {
|
||||
this.$set(preference.data, PREFERED_SHORTCUT_KEYS, JSON.stringify(out));
|
||||
preference.data[PREFERED_SHORTCUT_KEYS] = JSON.stringify(out);
|
||||
await preference.save();
|
||||
this.closeRecordingModal();
|
||||
buttonCb(true);
|
||||
|
||||
@@ -143,6 +143,7 @@ export default {
|
||||
let out = [];
|
||||
|
||||
if (!preference?.[0]?.data) {
|
||||
// eslint-disable-next-line vue/no-side-effects-in-computed-properties
|
||||
this.hideCustomKeysBar = true;
|
||||
|
||||
return out;
|
||||
|
||||
@@ -30,7 +30,7 @@ export default {
|
||||
update() {
|
||||
const value = JSON.stringify(this.parseDefaultValue);
|
||||
|
||||
this.$set(this.value, 'value', value);
|
||||
this.value['value'] = value;
|
||||
}
|
||||
},
|
||||
|
||||
@@ -39,7 +39,7 @@ export default {
|
||||
handler(neu) {
|
||||
const parseDefaultValue = JSON.parse(neu.value);
|
||||
|
||||
this.$set(this, 'parseDefaultValue', parseDefaultValue);
|
||||
this['parseDefaultValue'] = parseDefaultValue;
|
||||
},
|
||||
deep: true
|
||||
}
|
||||
|
||||
@@ -80,7 +80,7 @@ export default {
|
||||
parseDefaultValue = { type: '', endpoint: '' };
|
||||
}
|
||||
|
||||
this.$set(this, 'parseDefaultValue', parseDefaultValue);
|
||||
this['parseDefaultValue'] = parseDefaultValue;
|
||||
this.update();
|
||||
},
|
||||
deep: true
|
||||
@@ -105,16 +105,16 @@ export default {
|
||||
const value = JSON.stringify(this.parseDefaultValue);
|
||||
|
||||
if (!this.parseDefaultValue.type) {
|
||||
this.$delete(this.value, 'value');
|
||||
delete this.value['value'];
|
||||
} else {
|
||||
this.$set(this.value, 'value', value);
|
||||
this.value['value'] = value;
|
||||
}
|
||||
},
|
||||
|
||||
useDefault() {
|
||||
const parseDefaultValue = { type: '', endpoint: '' };
|
||||
|
||||
this.$set(this, 'parseDefaultValue', parseDefaultValue);
|
||||
this['parseDefaultValue'] = parseDefaultValue;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -183,7 +183,7 @@ export default {
|
||||
|
||||
const value = Object.keys(out).length ? JSON.stringify(out) : '';
|
||||
|
||||
this.$set(this.value, 'value', value);
|
||||
this.value['value'] = value;
|
||||
},
|
||||
|
||||
addMirror() {
|
||||
@@ -210,8 +210,8 @@ export default {
|
||||
value: {
|
||||
handler(value) {
|
||||
if (!value.value) { // useDefaultVale
|
||||
this.$set(this, 'mirrors', []);
|
||||
this.$set(this, 'configs', []);
|
||||
this['mirrors'] = [];
|
||||
this['configs'] = [];
|
||||
this.update();
|
||||
}
|
||||
},
|
||||
|
||||
@@ -122,7 +122,7 @@ export default {
|
||||
|
||||
const value = this.configArr.length ? JSON.stringify(out) : '';
|
||||
|
||||
this.$set(this.value, 'value', value);
|
||||
this.value['value'] = value;
|
||||
},
|
||||
|
||||
willSave() {
|
||||
@@ -172,7 +172,7 @@ export default {
|
||||
useDefault() {
|
||||
const configArr = this.parseValue(this.value.default);
|
||||
|
||||
this.$set(this, 'configArr', configArr);
|
||||
this['configArr'] = configArr;
|
||||
this.update();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,11 +15,11 @@ export default {
|
||||
|
||||
methods: {
|
||||
update() {
|
||||
this.$set(this.value, 'value', String(this.terminationGracePeriodSeconds));
|
||||
this.value['value'] = String(this.terminationGracePeriodSeconds);
|
||||
},
|
||||
|
||||
useDefault() {
|
||||
this.$set(this, 'terminationGracePeriodSeconds', Number(this.value.default));
|
||||
this['terminationGracePeriodSeconds'] = Number(this.value.default);
|
||||
this.update();
|
||||
},
|
||||
},
|
||||
|
||||
@@ -34,7 +34,7 @@ export default {
|
||||
update() {
|
||||
const value = JSON.stringify(this.parseDefaultValue);
|
||||
|
||||
this.$set(this.value, 'value', value);
|
||||
this.value['value'] = value;
|
||||
}
|
||||
},
|
||||
|
||||
@@ -43,7 +43,7 @@ export default {
|
||||
handler(neu) {
|
||||
const parseDefaultValue = JSON.parse(neu.value);
|
||||
|
||||
this.$set(this, 'parseDefaultValue', parseDefaultValue);
|
||||
this['parseDefaultValue'] = parseDefaultValue;
|
||||
},
|
||||
deep: true
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@ export default {
|
||||
parseDefaultValue = { ntpServers: [] };
|
||||
}
|
||||
|
||||
this.$set(this, 'parseDefaultValue', parseDefaultValue);
|
||||
this['parseDefaultValue'] = parseDefaultValue;
|
||||
this.update();
|
||||
},
|
||||
deep: true
|
||||
@@ -43,13 +43,13 @@ export default {
|
||||
useDefault() {
|
||||
const parseDefaultValue = { ntpServers: [] };
|
||||
|
||||
this.$set(this, 'parseDefaultValue', parseDefaultValue);
|
||||
this['parseDefaultValue'] = parseDefaultValue;
|
||||
},
|
||||
|
||||
update() {
|
||||
const value = JSON.stringify(this.parseDefaultValue);
|
||||
|
||||
this.$set(this.value, 'value', value);
|
||||
this.value['value'] = value;
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
@@ -32,7 +32,7 @@ export default {
|
||||
update() {
|
||||
const value = JSON.stringify(this.parseDefaultValue);
|
||||
|
||||
this.$set(this.value, 'value', value);
|
||||
this.value['value'] = value;
|
||||
}
|
||||
},
|
||||
|
||||
@@ -41,7 +41,7 @@ export default {
|
||||
handler(neu) {
|
||||
const parseDefaultValue = JSON.parse(neu.value);
|
||||
|
||||
this.$set(this, 'parseDefaultValue', parseDefaultValue);
|
||||
this['parseDefaultValue'] = parseDefaultValue;
|
||||
},
|
||||
deep: true
|
||||
}
|
||||
|
||||
@@ -30,11 +30,11 @@ export default {
|
||||
onKeySelectedCa(type, file) {
|
||||
const { name, value } = file;
|
||||
|
||||
this.$set(this.parseDefaultValue, type, value);
|
||||
this.$set(this, `${ type }FileName`, name);
|
||||
this.parseDefaultValue[type] = value;
|
||||
this[`${ type }FileName`] = name;
|
||||
const _value = JSON.stringify(this.parseDefaultValue);
|
||||
|
||||
this.$set(this.value, 'value', _value);
|
||||
this.value['value'] = _value;
|
||||
}
|
||||
},
|
||||
|
||||
@@ -43,7 +43,7 @@ export default {
|
||||
handler(neu) {
|
||||
const parseDefaultValue = JSON.parse(neu.value);
|
||||
|
||||
this.$set(this, 'parseDefaultValue', parseDefaultValue);
|
||||
this['parseDefaultValue'] = parseDefaultValue;
|
||||
},
|
||||
deep: true
|
||||
}
|
||||
|
||||
@@ -88,7 +88,7 @@ export default {
|
||||
|
||||
const value = JSON.stringify(out);
|
||||
|
||||
this.$set(this.value, 'value', value);
|
||||
this.value['value'] = value;
|
||||
},
|
||||
|
||||
willSave() {
|
||||
|
||||
@@ -114,9 +114,9 @@ export default {
|
||||
const valueString = JSON.stringify(this.parsedDefaultValue);
|
||||
|
||||
if (this.openVlan) {
|
||||
this.$set(this.value, 'value', valueString);
|
||||
this.value['value'] = valueString;
|
||||
} else {
|
||||
this.$set(this.value, 'value', '');
|
||||
this.value['value'] = '';
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
@@ -65,7 +65,7 @@ export default {
|
||||
update() {
|
||||
const value = JSON.stringify(this.parseDefaultValue);
|
||||
|
||||
this.$set(this.value, 'value', value);
|
||||
this.value['value'] = value;
|
||||
},
|
||||
|
||||
willSave() {
|
||||
@@ -92,7 +92,7 @@ export default {
|
||||
handler(neu) {
|
||||
const parseDefaultValue = JSON.parse(neu.value);
|
||||
|
||||
this.$set(this, 'parseDefaultValue', parseDefaultValue);
|
||||
this['parseDefaultValue'] = parseDefaultValue;
|
||||
},
|
||||
deep: true
|
||||
}
|
||||
|
||||
@@ -40,7 +40,7 @@ export default {
|
||||
update() {
|
||||
const namespaceStr = this.namespaces.join(',');
|
||||
|
||||
this.$set(this.value, 'value', namespaceStr);
|
||||
this.value['value'] = namespaceStr;
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@ export default {
|
||||
update() {
|
||||
const value = JSON.stringify(this.parseDefaultValue);
|
||||
|
||||
this.$set(this.value, 'value', value);
|
||||
this.value['value'] = value;
|
||||
}
|
||||
},
|
||||
|
||||
@@ -39,7 +39,7 @@ export default {
|
||||
handler(neu) {
|
||||
const parseDefaultValue = JSON.parse(neu.value);
|
||||
|
||||
this.$set(this, 'parseDefaultValue', parseDefaultValue);
|
||||
this['parseDefaultValue'] = parseDefaultValue;
|
||||
},
|
||||
deep: true
|
||||
}
|
||||
|
||||
@@ -104,7 +104,7 @@ export default {
|
||||
key-field="_key"
|
||||
v-on="$listeners"
|
||||
>
|
||||
<template slot="cell:state" slot-scope="scope" class="state-col">
|
||||
<template slot="cell:state" slot-scope="scope">
|
||||
<div class="state">
|
||||
<HarvesterVmState class="vmstate" :row="scope.row" :all-cluster-network="allClusterNetwork" />
|
||||
</div>
|
||||
|
||||
@@ -87,7 +87,7 @@ export default {
|
||||
}
|
||||
|
||||
if (!this.value._type) {
|
||||
this.$set(this.value, '_type', TYPES.OPAQUE);
|
||||
this.value['_type'] = TYPES.OPAQUE;
|
||||
}
|
||||
|
||||
return {
|
||||
|
||||
+1
-1
@@ -58,7 +58,7 @@ export default {
|
||||
};
|
||||
});
|
||||
|
||||
this.$set(this, 'sshKeys', out);
|
||||
this['sshKeys'] = out;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -146,7 +146,7 @@ export default {
|
||||
handler(neu) {
|
||||
const diskRows = this.getDiskRows(neu);
|
||||
|
||||
this.$set(this, 'diskRows', diskRows);
|
||||
this['diskRows'] = diskRows;
|
||||
},
|
||||
deep: true
|
||||
}
|
||||
|
||||
@@ -69,14 +69,14 @@ export default {
|
||||
} else {
|
||||
const error = [res?.data] || exceptionToErrorsArray(res);
|
||||
|
||||
this.$set(this, 'errors', error);
|
||||
this['errors'] = error;
|
||||
buttonCb(false);
|
||||
}
|
||||
} catch (err) {
|
||||
const error = err?.data || err;
|
||||
const message = exceptionToErrorsArray(error);
|
||||
|
||||
this.$set(this, 'errors', message);
|
||||
this['errors'] = message;
|
||||
buttonCb(false);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -69,14 +69,14 @@ export default {
|
||||
} else {
|
||||
const error = [res?.data] || exceptionToErrorsArray(res);
|
||||
|
||||
this.$set(this, 'errors', error);
|
||||
this['errors'] = error;
|
||||
buttonCb(false);
|
||||
}
|
||||
} catch (err) {
|
||||
const error = err?.data || err;
|
||||
const message = exceptionToErrorsArray(error);
|
||||
|
||||
this.$set(this, 'errors', message);
|
||||
this['errors'] = message;
|
||||
buttonCb(false);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -92,14 +92,14 @@ export default {
|
||||
} else {
|
||||
const error = [res?.data] || exceptionToErrorsArray(res);
|
||||
|
||||
this.$set(this, 'errors', error);
|
||||
this['errors'] = error;
|
||||
buttonCb(false);
|
||||
}
|
||||
} catch (err) {
|
||||
const error = err?.data || err;
|
||||
const message = exceptionToErrorsArray(error);
|
||||
|
||||
this.$set(this, 'errors', message);
|
||||
this['errors'] = message;
|
||||
buttonCb(false);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -70,14 +70,14 @@ export default {
|
||||
} else {
|
||||
const error = [res?.data] || exceptionToErrorsArray(res);
|
||||
|
||||
this.$set(this, 'errors', error);
|
||||
this['errors'] = error;
|
||||
buttonCb(false);
|
||||
}
|
||||
} catch (err) {
|
||||
const error = err?.data || err;
|
||||
const message = exceptionToErrorsArray(error);
|
||||
|
||||
this.$set(this, 'errors', message);
|
||||
this['errors'] = message;
|
||||
buttonCb(false);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -79,14 +79,14 @@ export default {
|
||||
} else {
|
||||
const error = [res?.data] || exceptionToErrorsArray(res);
|
||||
|
||||
this.$set(this, 'errors', error);
|
||||
this['errors'] = error;
|
||||
buttonCb(false);
|
||||
}
|
||||
} catch (err) {
|
||||
const error = err?.data || err;
|
||||
const message = exceptionToErrorsArray(error);
|
||||
|
||||
this.$set(this, 'errors', message);
|
||||
this['errors'] = message;
|
||||
buttonCb(false);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -72,7 +72,7 @@ export default {
|
||||
const error = err?.data || err;
|
||||
const message = exceptionToErrorsArray(error);
|
||||
|
||||
this.$set(this, 'errors', message);
|
||||
this['errors'] = message;
|
||||
buttonDone(false);
|
||||
}
|
||||
},
|
||||
@@ -95,7 +95,7 @@ export default {
|
||||
}
|
||||
});
|
||||
|
||||
this.$set(this, 'diskNames', diskNames);
|
||||
this['diskNames'] = diskNames;
|
||||
},
|
||||
deep: true
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@ export default {
|
||||
|
||||
const defaultStorage = this.$store.getters[`${ inStore }/all`](STORAGE_CLASS).find(s => s.isDefault);
|
||||
|
||||
this.$set(this, 'storageClassName', defaultStorage?.metadata?.name || 'longhorn');
|
||||
this['storageClassName'] = defaultStorage?.metadata?.name || 'longhorn';
|
||||
},
|
||||
|
||||
data() {
|
||||
@@ -119,14 +119,14 @@ export default {
|
||||
} else {
|
||||
const error = [res?.data] || exceptionToErrorsArray(res);
|
||||
|
||||
this.$set(this, 'errors', error);
|
||||
this['errors'] = error;
|
||||
buttonCb(false);
|
||||
}
|
||||
} catch (err) {
|
||||
const error = err?.data || err;
|
||||
const message = exceptionToErrorsArray(error);
|
||||
|
||||
this.$set(this, 'errors', message);
|
||||
this['errors'] = message;
|
||||
buttonCb(false);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -109,7 +109,7 @@ export default {
|
||||
const name = this.$store.getters['i18n/t']('harvester.modal.migration.fields.nodeName.label');
|
||||
const message = this.$store.getters['i18n/t']('validation.required', { key: name });
|
||||
|
||||
this.$set(this, 'errors', [message]);
|
||||
this['errors'] = [message];
|
||||
buttonDone(false);
|
||||
|
||||
return;
|
||||
@@ -124,7 +124,7 @@ export default {
|
||||
const error = err?.data || err;
|
||||
const message = exceptionToErrorsArray(error);
|
||||
|
||||
this.$set(this, 'errors', message);
|
||||
this['errors'] = message;
|
||||
buttonDone(false);
|
||||
}
|
||||
},
|
||||
|
||||
@@ -105,14 +105,14 @@ export default {
|
||||
} else {
|
||||
const error = [res?.data] || exceptionToErrorsArray(res);
|
||||
|
||||
this.$set(this, 'errors', error);
|
||||
this['errors'] = error;
|
||||
buttonCb(false);
|
||||
}
|
||||
} catch (err) {
|
||||
const error = err?.data || err;
|
||||
const message = exceptionToErrorsArray(error);
|
||||
|
||||
this.$set(this, 'errors', message);
|
||||
this['errors'] = message;
|
||||
buttonCb(false);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -62,14 +62,14 @@ export default {
|
||||
} else {
|
||||
const error = [res?.data] || exceptionToErrorsArray(res);
|
||||
|
||||
this.$set(this, 'errors', error);
|
||||
this['errors'] = error;
|
||||
buttonCb(false);
|
||||
}
|
||||
} catch (err) {
|
||||
const error = err?.data || err;
|
||||
const message = exceptionToErrorsArray(error);
|
||||
|
||||
this.$set(this, 'errors', message);
|
||||
this['errors'] = message;
|
||||
buttonCb(false);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -86,7 +86,7 @@ export default {
|
||||
const error = err?.data || err;
|
||||
const message = exceptionToErrorsArray(error);
|
||||
|
||||
this.$set(this, 'errors', message);
|
||||
this['errors'] = message;
|
||||
buttonCb(false);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -83,7 +83,7 @@ export default {
|
||||
const error = err?.data || err;
|
||||
const message = exceptionToErrorsArray(error);
|
||||
|
||||
this.$set(this, 'errors', message);
|
||||
this['errors'] = message;
|
||||
buttonDone(false);
|
||||
}
|
||||
},
|
||||
|
||||
@@ -46,7 +46,7 @@ export default {
|
||||
|
||||
const currentStorageName = this.resources[0].metadata?.annotations[HCI_ANNOTATIONS.STORAGE_CLASS];
|
||||
|
||||
this.$set(this, 'storageClassName', currentStorageName || defaultStorage?.metadata?.name || 'longhorn');
|
||||
this['storageClassName'] = currentStorageName || defaultStorage?.metadata?.name || 'longhorn';
|
||||
}
|
||||
},
|
||||
|
||||
@@ -108,14 +108,14 @@ export default {
|
||||
} else {
|
||||
const error = [res?.data] || exceptionToErrorsArray(res);
|
||||
|
||||
this.$set(this, 'errors', error);
|
||||
this['errors'] = error;
|
||||
buttonCb(false);
|
||||
}
|
||||
} catch (err) {
|
||||
const error = err?.data || err;
|
||||
const message = exceptionToErrorsArray(error);
|
||||
|
||||
this.$set(this, 'errors', message);
|
||||
this['errors'] = message;
|
||||
buttonCb(false);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -50,14 +50,14 @@ export default {
|
||||
} else {
|
||||
const error = [res?.data] || exceptionToErrorsArray(res);
|
||||
|
||||
this.$set(this, 'errors', error);
|
||||
this['errors'] = error;
|
||||
buttonCb(false);
|
||||
}
|
||||
} catch (err) {
|
||||
const error = err?.data || err;
|
||||
const message = exceptionToErrorsArray(error);
|
||||
|
||||
this.$set(this, 'errors', message);
|
||||
this['errors'] = message;
|
||||
buttonCb(false);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -61,14 +61,14 @@ export default {
|
||||
} else {
|
||||
const error = [res?.data] || exceptionToErrorsArray(res);
|
||||
|
||||
this.$set(this, 'errors', error);
|
||||
this['errors'] = error;
|
||||
buttonCb(false);
|
||||
}
|
||||
} catch (err) {
|
||||
const error = err?.data || err;
|
||||
const message = exceptionToErrorsArray(error);
|
||||
|
||||
this.$set(this, 'errors', message);
|
||||
this['errors'] = message;
|
||||
buttonCb(false);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -77,7 +77,7 @@ export default {
|
||||
watch: {
|
||||
valuesContentJson: {
|
||||
handler(neu) {
|
||||
this.$set(this.value.spec, 'valuesContent', jsyaml.dump(neu));
|
||||
this.value.spec['valuesContent'] = jsyaml.dump(neu);
|
||||
},
|
||||
deep: true,
|
||||
immediate: true
|
||||
|
||||
@@ -191,7 +191,7 @@ export default {
|
||||
watch: {
|
||||
valuesContentJson: {
|
||||
handler(neu) {
|
||||
this.$set(this.value.spec, 'valuesContent', jsyaml.dump(neu));
|
||||
this.value.spec['valuesContent'] = jsyaml.dump(neu);
|
||||
},
|
||||
deep: true,
|
||||
immediate: true
|
||||
|
||||
@@ -80,7 +80,7 @@ export default {
|
||||
watch: {
|
||||
valuesContentJson: {
|
||||
handler(neu) {
|
||||
this.$set(this.value.spec, 'valuesContent', jsyaml.dump(neu));
|
||||
this.value.spec['valuesContent'] = jsyaml.dump(neu);
|
||||
},
|
||||
deep: true,
|
||||
immediate: true
|
||||
|
||||
@@ -108,7 +108,7 @@ export default {
|
||||
const inStore = this.$store.getters['currentProduct'].inStore;
|
||||
const defaultStorage = this.$store.getters[`${ inStore }/all`](STORAGE_CLASS).find( s => s.isDefault);
|
||||
|
||||
this.$set(this.valuesContent.pvcClaim, 'storageClassName', this.valuesContent?.pvcClaim?.storageClassName || defaultStorage?.metadata?.name || 'longhorn');
|
||||
this.valuesContent.pvcClaim['storageClassName'] = this.valuesContent?.pvcClaim?.storageClassName || defaultStorage?.metadata?.name || 'longhorn';
|
||||
|
||||
this.update();
|
||||
},
|
||||
|
||||
@@ -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 Tags from '../../components/DiskTags';
|
||||
import DiskTags from '../../components/DiskTags';
|
||||
import { HCI } from '../../types';
|
||||
import { LONGHORN_SYSTEM } from './index';
|
||||
|
||||
@@ -17,7 +17,7 @@ export default {
|
||||
Banner,
|
||||
RadioGroup,
|
||||
RadioButton,
|
||||
Tags,
|
||||
DiskTags,
|
||||
},
|
||||
|
||||
mixins: [
|
||||
@@ -171,7 +171,7 @@ export default {
|
||||
<div v-if="!value.isNew">
|
||||
<div class="row">
|
||||
<div class="col span-12">
|
||||
<Tags
|
||||
<DiskTags
|
||||
v-model="value.tags"
|
||||
:label="t('harvester.host.disk.tags.label')"
|
||||
:add-label="t('harvester.host.disk.tags.addLabel')"
|
||||
|
||||
@@ -92,7 +92,7 @@ export default {
|
||||
methods: {
|
||||
async saveKsmtuned() {
|
||||
this.spec.mergeAcrossNodes = this.enableMergeAcrossNodes ? 1 : 0;
|
||||
this.$set(this.ksmtuned, 'spec', this.spec);
|
||||
this.ksmtuned['spec'] = this.spec;
|
||||
|
||||
await this.ksmtuned.save().catch((reason) => {
|
||||
if (reason?.type === 'error') {
|
||||
|
||||
@@ -123,8 +123,8 @@ export default {
|
||||
} else {
|
||||
const [namespace, name] = value.split('/');
|
||||
|
||||
this.$set(this.value.spec.baseboardSpec.connection.authSecretRef, 'namespace', namespace);
|
||||
this.$set(this.value.spec.baseboardSpec.connection.authSecretRef, 'name', name);
|
||||
this.value.spec.baseboardSpec.connection.authSecretRef['namespace'] = namespace;
|
||||
this.value.spec.baseboardSpec.connection.authSecretRef['name'] = name;
|
||||
}
|
||||
},
|
||||
},
|
||||
@@ -135,7 +135,7 @@ export default {
|
||||
},
|
||||
|
||||
set(value) {
|
||||
this.$set(this.secret.data, 'username', base64Encode(value));
|
||||
this.secret.data['username'] = base64Encode(value);
|
||||
}
|
||||
},
|
||||
|
||||
@@ -145,7 +145,7 @@ export default {
|
||||
},
|
||||
|
||||
set(value) {
|
||||
this.$set(this.secret.data, 'password', base64Encode(value));
|
||||
this.secret.data['password'] = base64Encode(value);
|
||||
}
|
||||
},
|
||||
},
|
||||
|
||||
@@ -25,7 +25,7 @@ import { _EDIT } from '@shell/config/query-params';
|
||||
import { sortBy } from '@shell/utils/sort';
|
||||
import { Banner } from '@components/Banner';
|
||||
import { HCI } from '../../types';
|
||||
import Tags from '../../components/DiskTags';
|
||||
import DiskTags from '../../components/DiskTags';
|
||||
import HarvesterDisk from './HarvesterDisk';
|
||||
import HarvesterSeeder from './HarvesterSeeder';
|
||||
import HarvesterKsmtuned from './HarvesterKsmtuned';
|
||||
@@ -46,7 +46,7 @@ export default {
|
||||
ButtonDropdown,
|
||||
KeyValue,
|
||||
Banner,
|
||||
Tags,
|
||||
DiskTags,
|
||||
Loading,
|
||||
HarvesterSeeder,
|
||||
MessageLink,
|
||||
@@ -546,7 +546,7 @@ export default {
|
||||
class="row mb-20"
|
||||
>
|
||||
<div class="col span-12">
|
||||
<Tags
|
||||
<DiskTags
|
||||
v-model="longhornNode.spec.tags"
|
||||
:label="t('harvester.host.tags.label')"
|
||||
:add-label="t('harvester.host.tags.addLabel')"
|
||||
|
||||
@@ -49,10 +49,10 @@ export default {
|
||||
}));
|
||||
|
||||
if (this.mode !== _VIEW) {
|
||||
this.$set(this.value, 'spec', this.value.spec || {});
|
||||
this.value['spec'] = this.value.spec || {};
|
||||
|
||||
providers.forEach((provider) => {
|
||||
this.$set(this.value.spec, provider.name, this.value.spec[provider.name] || clone(provider.default));
|
||||
this.value.spec[provider.name] = this.value.spec[provider.name] || clone(provider.default);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -127,11 +127,11 @@ export default {
|
||||
if (!isEmpty(bufferJson)) {
|
||||
this.value.spec[this.selectedProvider].buffer = bufferJson;
|
||||
} else {
|
||||
this.$delete(this.value.spec[this.selectedProvider], 'buffer');
|
||||
delete this.value.spec[this.selectedProvider]['buffer'];
|
||||
}
|
||||
|
||||
if (this.loggingType === AUDIT_ONLY) {
|
||||
this.$set(this.value.spec, 'loggingRef', 'harvester-kube-audit-log-ref');
|
||||
this.value.spec['loggingRef'] = 'harvester-kube-audit-log-ref';
|
||||
}
|
||||
},
|
||||
tabChanged({ tab }) {
|
||||
|
||||
@@ -52,9 +52,9 @@ export default {
|
||||
if ( newCloudCred ) {
|
||||
this.value.metadata.namespace = DEFAULT_WORKSPACE;
|
||||
|
||||
this.$set(this.value.metadata, 'name', '');
|
||||
this.value.metadata['name'] = '';
|
||||
|
||||
this.$set(this.value, 'data', {});
|
||||
this.value['data'] = {};
|
||||
}
|
||||
|
||||
const secretTypes = [
|
||||
@@ -77,7 +77,7 @@ export default {
|
||||
});
|
||||
|
||||
if ( this.mode === _CREATE ) {
|
||||
this.$set(this.value, '_type', TYPES.OPAQUE);
|
||||
this.value['_type'] = TYPES.OPAQUE;
|
||||
}
|
||||
|
||||
return {
|
||||
@@ -212,7 +212,7 @@ export default {
|
||||
|
||||
selectCustomType(type) {
|
||||
if (type !== 'custom') {
|
||||
this.$set(this.value, '_type', type);
|
||||
this.value['_type'] = type;
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
@@ -39,7 +39,7 @@ export default {
|
||||
setting.canReset || !!this.value.default || this.value.canReset;
|
||||
|
||||
if (this.value.value === undefined) {
|
||||
this.$set(this.value, 'value', null);
|
||||
this.value['value'] = null;
|
||||
}
|
||||
|
||||
this.value.value = this.value.value || this.value.default || '';
|
||||
|
||||
@@ -17,7 +17,7 @@ import { STORAGE_CLASS, LONGHORN } from '@shell/config/types';
|
||||
import { allHash } from '@shell/utils/promise';
|
||||
import { clone } from '@shell/utils/object';
|
||||
import { CSI_DRIVER } from '../../types';
|
||||
import Tags from '../../components/DiskTags';
|
||||
import DiskTags from '../../components/DiskTags';
|
||||
|
||||
const LONGHORN_DRIVER = 'driver.longhorn.io';
|
||||
|
||||
@@ -34,7 +34,7 @@ export default {
|
||||
Tab,
|
||||
Tabbed,
|
||||
Loading,
|
||||
Tags,
|
||||
DiskTags,
|
||||
},
|
||||
|
||||
mixins: [CreateEditView],
|
||||
@@ -72,11 +72,11 @@ export default {
|
||||
|
||||
const allowedTopologies = clone(this.value.allowedTopologies?.[0]?.matchLabelExpressions || []);
|
||||
|
||||
this.$set(this.value, 'parameters', this.value.parameters || {});
|
||||
this.$set(this.value, 'provisioner', this.value.provisioner || LONGHORN_DRIVER);
|
||||
this.$set(this.value, 'allowVolumeExpansion', this.value.allowVolumeExpansion || allowVolumeExpansionOptions[0].value);
|
||||
this.$set(this.value, 'reclaimPolicy', this.value.reclaimPolicy || reclaimPolicyOptions[0].value);
|
||||
this.$set(this.value, 'volumeBindingMode', this.value.volumeBindingMode || volumeBindingModeOptions[0].value);
|
||||
this.value['parameters'] = this.value.parameters || {};
|
||||
this.value['provisioner'] = this.value.provisioner || LONGHORN_DRIVER;
|
||||
this.value['allowVolumeExpansion'] = this.value.allowVolumeExpansion || allowVolumeExpansionOptions[0].value;
|
||||
this.value['reclaimPolicy'] = this.value.reclaimPolicy || reclaimPolicyOptions[0].value;
|
||||
this.value['volumeBindingMode'] = this.value.volumeBindingMode || volumeBindingModeOptions[0].value;
|
||||
|
||||
return {
|
||||
reclaimPolicyOptions,
|
||||
@@ -141,7 +141,7 @@ export default {
|
||||
|
||||
watch: {
|
||||
provisionerWatch() {
|
||||
this.$set(this.value, 'parameters', {});
|
||||
this.value['parameters'] = {};
|
||||
}
|
||||
},
|
||||
|
||||
@@ -159,8 +159,8 @@ export default {
|
||||
},
|
||||
|
||||
updateProvisioner(provisioner) {
|
||||
this.$set(this.value, 'provisioner', provisioner);
|
||||
this.$set(this.value, 'allowVolumeExpansion', provisioner === LONGHORN_DRIVER);
|
||||
this.value['provisioner'] = provisioner;
|
||||
this.value['allowVolumeExpansion'] = provisioner === LONGHORN_DRIVER;
|
||||
},
|
||||
|
||||
willSave() {
|
||||
@@ -303,7 +303,7 @@ export default {
|
||||
/>
|
||||
</div>
|
||||
<div class="col span-8 value">
|
||||
<Tags
|
||||
<DiskTags
|
||||
v-model="scope.row.value.values"
|
||||
:add-label="t('generic.add')"
|
||||
:mode="modeOverride"
|
||||
|
||||
@@ -42,13 +42,13 @@ export default {
|
||||
|
||||
data() {
|
||||
if (this.realMode === _CREATE) {
|
||||
this.$set(this.value, 'parameters', {
|
||||
this.value['parameters'] = {
|
||||
numberOfReplicas: '3',
|
||||
staleReplicaTimeout: '30',
|
||||
diskSelector: null,
|
||||
nodeSelector: null,
|
||||
migratable: 'true',
|
||||
});
|
||||
migratable: 'true'
|
||||
};
|
||||
}
|
||||
|
||||
return {};
|
||||
|
||||
@@ -56,12 +56,12 @@ export default {
|
||||
|
||||
const defaultStorage = this.$store.getters[`${ inStore }/all`](STORAGE_CLASS).find(s => s.isDefault);
|
||||
|
||||
this.$set(this, 'storageClassName', this.storageClassName || defaultStorage?.metadata?.name || 'longhorn');
|
||||
this['storageClassName'] = this.storageClassName || defaultStorage?.metadata?.name || 'longhorn';
|
||||
},
|
||||
|
||||
data() {
|
||||
if ( !this.value.spec ) {
|
||||
this.$set(this.value, 'spec', { sourceType: DOWNLOAD });
|
||||
this.value['spec'] = { sourceType: DOWNLOAD };
|
||||
}
|
||||
|
||||
if (!this.value.metadata.name) {
|
||||
@@ -130,7 +130,7 @@ export default {
|
||||
},
|
||||
|
||||
'value.spec.sourceType'() {
|
||||
this.$set(this, 'file', null);
|
||||
this['file'] = null;
|
||||
this.url = '';
|
||||
|
||||
if (this.$refs?.file?.value) {
|
||||
|
||||
@@ -175,10 +175,10 @@ export default {
|
||||
|
||||
this.value.cleanForNew();
|
||||
this.customName = randomStr(10);
|
||||
this.$set(this.value.metadata, 'annotations', {
|
||||
this.value.metadata['annotations'] = {
|
||||
...this.value.metadata.annotations,
|
||||
[HCI_ANNOTATIONS.TEMPLATE_VERSION_CUSTOM_NAME]: this.customName
|
||||
});
|
||||
};
|
||||
|
||||
const name = this.templateValue.metadata.name || template.metadata.name;
|
||||
const namespace = this.templateValue.metadata.namespace || template.metadata.namespace;
|
||||
@@ -187,7 +187,7 @@ export default {
|
||||
this.value.metadata.namespace = namespace;
|
||||
}
|
||||
|
||||
this.$set(this.value.spec, 'templateId', `${ namespace }/${ name }`);
|
||||
this.value.spec['templateId'] = `${ namespace }/${ name }`;
|
||||
const res = await this.value.save();
|
||||
|
||||
await this.saveSecret(res);
|
||||
|
||||
@@ -59,7 +59,7 @@ export default {
|
||||
|
||||
const defaultStorage = this.$store.getters[`harvester/all`](STORAGE_CLASS).find( O => O.isDefault);
|
||||
|
||||
this.$set(this.value.spec, 'storageClassName', this.value?.spec?.storageClassName || defaultStorage?.metadata?.name || 'longhorn');
|
||||
this.value.spec['storageClassName'] = this.value?.spec?.storageClassName || defaultStorage?.metadata?.name || 'longhorn';
|
||||
},
|
||||
|
||||
data() {
|
||||
@@ -247,7 +247,7 @@ export default {
|
||||
|
||||
this.value.setAnnotations(imageAnnotations);
|
||||
|
||||
this.$set(this.value, 'spec', spec);
|
||||
this.value['spec'] = spec;
|
||||
},
|
||||
|
||||
generateYaml() {
|
||||
|
||||
+1
-1
@@ -73,7 +73,7 @@ export default {
|
||||
|
||||
selectedUser(val, old) {
|
||||
if ( val.includes(_NEW)) {
|
||||
this.$set(this, 'selectedUser', old);
|
||||
this['selectedUser'] = old;
|
||||
this.update();
|
||||
this.show();
|
||||
}
|
||||
|
||||
+1
-1
@@ -49,7 +49,7 @@ export default {
|
||||
},
|
||||
|
||||
updateUser(neu) {
|
||||
this.$set(this.value, 'username', neu);
|
||||
this.value['username'] = neu;
|
||||
this.update();
|
||||
},
|
||||
|
||||
|
||||
+2
-2
@@ -40,12 +40,12 @@ export default {
|
||||
},
|
||||
|
||||
updateUser(neu) {
|
||||
this.$set(this.value, 'users', neu);
|
||||
this.value['users'] = neu;
|
||||
this.update();
|
||||
},
|
||||
|
||||
updateSSH(neu) {
|
||||
this.$set(this.value, 'sshkeys', neu);
|
||||
this.value['sshkeys'] = neu;
|
||||
this.update();
|
||||
},
|
||||
|
||||
|
||||
@@ -179,7 +179,7 @@ export default {
|
||||
cancel() {
|
||||
this.cloudTemplate = '';
|
||||
this.cloudTemplateName = '';
|
||||
this.$set(this, 'errors', []);
|
||||
this['errors'] = [];
|
||||
this.isOpen = false;
|
||||
},
|
||||
|
||||
|
||||
@@ -138,7 +138,7 @@ export default {
|
||||
handler(neu) {
|
||||
const hasManagementNetwork = !!neu.some(N => N.isPod);
|
||||
|
||||
this.$set(this, 'hasManagementNetwork', hasManagementNetwork);
|
||||
this['hasManagementNetwork'] = hasManagementNetwork;
|
||||
},
|
||||
immediate: true,
|
||||
deep: true
|
||||
@@ -146,7 +146,7 @@ export default {
|
||||
|
||||
isSingle(neu) {
|
||||
if (!neu) {
|
||||
this.$set(this.value, 'macAddress', '');
|
||||
this.value['macAddress'] = '';
|
||||
this.update();
|
||||
}
|
||||
}
|
||||
@@ -164,7 +164,7 @@ export default {
|
||||
this.value.isPod = false;
|
||||
}
|
||||
|
||||
this.$set(this, 'isMasquerade', this.value.isPod);
|
||||
this['isMasquerade'] = this.value.isPod;
|
||||
|
||||
if (this.value.isPod) {
|
||||
this.value.type = 'masquerade';
|
||||
|
||||
+2
-2
@@ -134,8 +134,8 @@ export default {
|
||||
},
|
||||
|
||||
changeRows(filterRows, parentSriov) {
|
||||
this.$set(this, 'filterRows', filterRows);
|
||||
this.$set(this, 'parentSriov', parentSriov);
|
||||
this['filterRows'] = filterRows;
|
||||
this['parentSriov'] = parentSriov;
|
||||
},
|
||||
|
||||
sortGenerationFn() {
|
||||
|
||||
@@ -126,7 +126,7 @@ export default {
|
||||
|
||||
checkedSsh(val, old) {
|
||||
if ( val.includes(_NEW)) {
|
||||
this.$set(this, 'checkedSsh', old);
|
||||
this['checkedSsh'] = old;
|
||||
this.update();
|
||||
this.show();
|
||||
}
|
||||
|
||||
+2
-2
@@ -89,8 +89,8 @@ export default {
|
||||
|
||||
methods: {
|
||||
changeRows(filterRows, parentSriov) {
|
||||
this.$set(this, 'filterRows', filterRows);
|
||||
this.$set(this, 'parentSriov', parentSriov);
|
||||
this['filterRows'] = filterRows;
|
||||
this['parentSriov'] = parentSriov;
|
||||
},
|
||||
|
||||
sortGenerationFn() {
|
||||
|
||||
@@ -149,7 +149,7 @@ export default {
|
||||
return V;
|
||||
});
|
||||
|
||||
this.$set(this, 'rows', rows);
|
||||
this['rows'] = rows;
|
||||
},
|
||||
deep: true,
|
||||
immediate: true,
|
||||
|
||||
+1
-1
@@ -32,7 +32,7 @@ export default {
|
||||
watch: {
|
||||
'value.type'(neu) {
|
||||
if (neu === 'cd-rom') {
|
||||
this.$set(this.value, 'bus', 'sata');
|
||||
this.value['bus'] = 'sata';
|
||||
this.update();
|
||||
}
|
||||
},
|
||||
|
||||
+1
-1
@@ -140,7 +140,7 @@ export default {
|
||||
|
||||
'value.type'(neu) {
|
||||
if (neu === 'cd-rom') {
|
||||
this.$set(this.value, 'bus', 'sata');
|
||||
this.value['bus'] = 'sata';
|
||||
this.update();
|
||||
}
|
||||
},
|
||||
|
||||
@@ -100,7 +100,7 @@ export default {
|
||||
watch: {
|
||||
'value.type'(neu) {
|
||||
if (neu === 'cd-rom') {
|
||||
this.$set(this.value, 'bus', 'sata');
|
||||
this.value['bus'] = 'sata';
|
||||
this.update();
|
||||
}
|
||||
},
|
||||
@@ -143,11 +143,11 @@ export default {
|
||||
|
||||
if (this.idx === 0) {
|
||||
if (/iso$/i.test(imageResource?.imageSuffix)) {
|
||||
this.$set(this.value, 'type', 'cd-rom');
|
||||
this.$set(this.value, 'bus', 'sata');
|
||||
this.value['type'] = 'cd-rom';
|
||||
this.value['bus'] = 'sata';
|
||||
} else {
|
||||
this.$set(this.value, 'type', 'disk');
|
||||
this.$set(this.value, 'bus', 'virtio');
|
||||
this.value['type'] = 'disk';
|
||||
this.value['bus'] = 'virtio';
|
||||
}
|
||||
}
|
||||
|
||||
@@ -165,7 +165,7 @@ export default {
|
||||
message: this.$store.getters['i18n/t']('harvester.vmTemplate.tips.notExistImage.message')
|
||||
}, { root: true });
|
||||
|
||||
this.$set(this.value, 'image', '');
|
||||
this.value['image'] = '';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -87,7 +87,7 @@ export default {
|
||||
watch: {
|
||||
'value.type'(neu) {
|
||||
if (neu === 'cd-rom') {
|
||||
this.$set(this.value, 'bus', 'sata');
|
||||
this.value['bus'] = 'sata';
|
||||
this.update();
|
||||
}
|
||||
},
|
||||
|
||||
@@ -19,17 +19,17 @@ import KeyValue from '@shell/components/form/KeyValue';
|
||||
|
||||
import { clear } from '@shell/utils/array';
|
||||
import { clone } from '@shell/utils/object';
|
||||
import { HCI } from '../../types';
|
||||
import { RunStrategys } from '../../config/harvester-map';
|
||||
import { saferDump } from '@shell/utils/create-yaml';
|
||||
import { exceptionToErrorsArray } from '@shell/utils/error';
|
||||
import { HCI as HCI_ANNOTATIONS } from '@pkg/harvester/config/labels-annotations';
|
||||
import { BEFORE_SAVE_HOOKS, AFTER_SAVE_HOOKS } from '@shell/mixins/child-hook';
|
||||
|
||||
import VM_MIXIN from '../../mixins/harvester-vm';
|
||||
import CreateEditView from '@shell/mixins/create-edit-view';
|
||||
|
||||
import { parseVolumeClaimTemplates } from '@pkg/utils/vm';
|
||||
import VM_MIXIN from '../../mixins/harvester-vm';
|
||||
import { RunStrategys } from '../../config/harvester-map';
|
||||
import { HCI } from '../../types';
|
||||
import RestartVMDialog from '../../dialog/RestartVMDialog';
|
||||
import VirtualMachineVGpuDevices from './VirtualMachineVGpuDevices/index';
|
||||
import PciDevices from './VirtualMachinePciDevices/index';
|
||||
@@ -218,7 +218,7 @@ export default {
|
||||
this.getInitConfig({
|
||||
value: cloneVersionVM, existUserData: true, fromTemplate: true
|
||||
});
|
||||
this.$set(this, 'hasCreateVolumes', []); // When using the template, all volume names need to be newly created
|
||||
this['hasCreateVolumes'] = []; // When using the template, all volume names need to be newly created
|
||||
}
|
||||
},
|
||||
|
||||
@@ -261,7 +261,7 @@ export default {
|
||||
|
||||
const diskRows = this.getDiskRows(this.value);
|
||||
|
||||
this.$set(this, 'diskRows', diskRows);
|
||||
this['diskRows'] = diskRows;
|
||||
const templateId = this.$route.query.templateId;
|
||||
const templateVersionId = this.$route.query.versionId;
|
||||
|
||||
@@ -317,13 +317,13 @@ export default {
|
||||
const cloneSpec = clone(this.spec);
|
||||
|
||||
for (let i = 1; i <= this.count; i++) {
|
||||
this.$set(this.value, 'spec', cloneValue.spec);
|
||||
this.$set(this, 'spec', cloneSpec);
|
||||
this.value['spec'] = cloneValue.spec;
|
||||
this['spec'] = cloneSpec;
|
||||
const suffix = i < 10 ? `0${ i }` : i;
|
||||
|
||||
this.value.cleanForNew();
|
||||
this.value.metadata.name = `${ this.namePrefix }${ join }${ suffix }`;
|
||||
this.$set(this.value.spec.template.spec, 'hostname', `${ baseHostname }${ join }${ suffix }`);
|
||||
this.value.spec.template.spec['hostname'] = `${ baseHostname }${ join }${ suffix }`;
|
||||
this.secretName = '';
|
||||
await this.parseVM();
|
||||
const basicValue = await this.$store.dispatch('harvester/clone', { resource: this.value });
|
||||
@@ -380,7 +380,7 @@ export default {
|
||||
updateBeforeSave() {
|
||||
if (this.isSingle) {
|
||||
if (!this.value.spec.template.spec.hostname) {
|
||||
this.$set(this.value.spec.template.spec, 'hostname', this.value.metadata.name);
|
||||
this.value.spec.template.spec['hostname'] = this.value.metadata.name;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -395,7 +395,7 @@ export default {
|
||||
|
||||
validateCount(count) {
|
||||
if (count > 10) {
|
||||
this.$set(this, 'count', 10);
|
||||
this['count'] = 10;
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
@@ -139,7 +139,7 @@ export default {
|
||||
backendServerSelector[key] = (value[key] || '').split(',');
|
||||
});
|
||||
|
||||
this.$set(this.value.spec, 'backendServerSelector', backendServerSelector);
|
||||
this.value.spec['backendServerSelector'] = backendServerSelector;
|
||||
},
|
||||
},
|
||||
|
||||
|
||||
@@ -36,8 +36,8 @@ export default {
|
||||
this.canEditPSPBindings = !!pspBindingSchema;
|
||||
},
|
||||
data() {
|
||||
this.$set(this.value, 'spec', this.value.spec || {});
|
||||
this.$set(this.value.spec, 'podSecurityPolicyTemplateId', this.value.status?.podSecurityPolicyTemplateId || '');
|
||||
this.value['spec'] = this.value.spec || {};
|
||||
this.value.spec['podSecurityPolicyTemplateId'] = this.value.status?.podSecurityPolicyTemplateId || '';
|
||||
|
||||
return {
|
||||
allPSPs: [],
|
||||
@@ -134,9 +134,9 @@ export default {
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.$set(this.value.metadata, 'namespace', this.$store.getters['currentCluster'].id);
|
||||
this.$set(this.value, 'spec', this.value.spec || {});
|
||||
this.$set(this.value.spec, 'containerDefaultResourceLimit', this.value.spec.containerDefaultResourceLimit || {});
|
||||
this.value.metadata['namespace'] = this.$store.getters['currentCluster'].id;
|
||||
this.value['spec'] = this.value.spec || {};
|
||||
this.value.spec['containerDefaultResourceLimit'] = this.value.spec.containerDefaultResourceLimit || {};
|
||||
},
|
||||
methods: {
|
||||
async save(saveCb) {
|
||||
@@ -178,11 +178,11 @@ export default {
|
||||
},
|
||||
|
||||
onHasOwnerChanged(hasOwner) {
|
||||
this.$set(this, 'membershipHasOwner', hasOwner);
|
||||
this['membershipHasOwner'] = hasOwner;
|
||||
},
|
||||
|
||||
onMembershipUpdate(update) {
|
||||
this.$set(this, 'membershipUpdate', update);
|
||||
this['membershipUpdate'] = update;
|
||||
},
|
||||
|
||||
removeQuota(key) {
|
||||
|
||||
@@ -39,8 +39,8 @@ export default {
|
||||
|
||||
methods: {
|
||||
changeRows(filterRows, searchLabels) {
|
||||
this.$set(this, 'filterRows', filterRows);
|
||||
this.$set(this, 'searchLabels', searchLabels);
|
||||
this['filterRows'] = filterRows;
|
||||
this['searchLabels'] = searchLabels;
|
||||
},
|
||||
|
||||
sortGenerationFn() {
|
||||
|
||||
@@ -161,7 +161,7 @@ export default {
|
||||
|
||||
await this.$store.dispatch(`${ inStore }/findAll`, { type: HCI.VMIM });
|
||||
|
||||
this.$set(this, 'allVMIs', vmis);
|
||||
this['allVMIs'] = vmis;
|
||||
}
|
||||
};
|
||||
</script>
|
||||
@@ -179,7 +179,7 @@ export default {
|
||||
key-field="_key"
|
||||
v-on="$listeners"
|
||||
>
|
||||
<template slot="cell:state" slot-scope="scope" class="state-col">
|
||||
<template slot="cell:state" slot-scope="scope">
|
||||
<div class="state">
|
||||
<HarvesterVmState class="vmstate" :row="scope.row" :all-node-network="allNodeNetworks" :all-cluster-network="allClusterNetworks" />
|
||||
</div>
|
||||
|
||||
@@ -361,33 +361,33 @@ export default {
|
||||
spec.runStrategy = 'RerunOnFailure';
|
||||
}
|
||||
|
||||
this.$set(this, 'spec', spec);
|
||||
this.$set(this, 'runStrategy', runStrategy);
|
||||
this.$set(this, 'secretRef', secretRef);
|
||||
this.$set(this, 'accessCredentials', accessCredentials);
|
||||
this.$set(this, 'userScript', userData);
|
||||
this.$set(this, 'networkScript', networkData);
|
||||
this['spec'] = spec;
|
||||
this['runStrategy'] = runStrategy;
|
||||
this['secretRef'] = secretRef;
|
||||
this['accessCredentials'] = accessCredentials;
|
||||
this['userScript'] = userData;
|
||||
this['networkScript'] = networkData;
|
||||
|
||||
this.$set(this, 'sshKey', sshKey);
|
||||
this.$set(this, 'osType', osType);
|
||||
this.$set(this, 'installAgent', installAgent);
|
||||
this['sshKey'] = sshKey;
|
||||
this['osType'] = osType;
|
||||
this['installAgent'] = installAgent;
|
||||
|
||||
this.$set(this, 'cpu', cpu);
|
||||
this.$set(this, 'memory', memory);
|
||||
this.$set(this, 'reservedMemory', reservedMemory);
|
||||
this.$set(this, 'machineType', machineType);
|
||||
this.$set(this, 'terminationGracePeriodSeconds', terminationGracePeriodSeconds);
|
||||
this['cpu'] = cpu;
|
||||
this['memory'] = memory;
|
||||
this['reservedMemory'] = reservedMemory;
|
||||
this['machineType'] = machineType;
|
||||
this['terminationGracePeriodSeconds'] = terminationGracePeriodSeconds;
|
||||
|
||||
this.$set(this, 'installUSBTablet', installUSBTablet);
|
||||
this.$set(this, 'efiEnabled', efiEnabled);
|
||||
this.$set(this, 'tpmEnabled', tpmEnabled);
|
||||
this.$set(this, 'secureBoot', secureBoot);
|
||||
this['installUSBTablet'] = installUSBTablet;
|
||||
this['efiEnabled'] = efiEnabled;
|
||||
this['tpmEnabled'] = tpmEnabled;
|
||||
this['secureBoot'] = secureBoot;
|
||||
|
||||
this.$set(this, 'hasCreateVolumes', hasCreateVolumes);
|
||||
this.$set(this, 'networkRows', networkRows);
|
||||
this.$set(this, 'imageId', imageId);
|
||||
this['hasCreateVolumes'] = hasCreateVolumes;
|
||||
this['networkRows'] = networkRows;
|
||||
this['imageId'] = imageId;
|
||||
|
||||
this.$set(this, 'diskRows', diskRows);
|
||||
this['diskRows'] = diskRows;
|
||||
|
||||
this.refreshYamlEditor();
|
||||
},
|
||||
@@ -556,9 +556,9 @@ export default {
|
||||
|
||||
parseOther() {
|
||||
if (!this.spec.template.spec.domain.machine) {
|
||||
this.$set(this.spec.template.spec.domain, 'machine', { type: this.machineType });
|
||||
this.spec.template.spec.domain['machine'] = { type: this.machineType };
|
||||
} else {
|
||||
this.$set(this.spec.template.spec.domain.machine, 'type', this.machineType);
|
||||
this.spec.template.spec.domain.machine['type'] = this.machineType;
|
||||
}
|
||||
|
||||
this.spec.template.spec.domain.cpu.cores = this.cpu;
|
||||
@@ -681,28 +681,28 @@ export default {
|
||||
spec = this.multiVMScheduler(spec);
|
||||
}
|
||||
|
||||
this.$set(this.value.metadata, 'annotations', {
|
||||
this.value.metadata['annotations'] = {
|
||||
...this.value.metadata.annotations,
|
||||
[HCI_ANNOTATIONS.VOLUME_CLAIM_TEMPLATE]: JSON.stringify(volumeClaimTemplates),
|
||||
[HCI_ANNOTATIONS.NETWORK_IPS]: JSON.stringify(this.value.networkIps)
|
||||
});
|
||||
};
|
||||
|
||||
this.$set(this.value.metadata, 'labels', {
|
||||
this.value.metadata['labels'] = {
|
||||
...this.value.metadata.labels,
|
||||
[HCI_ANNOTATIONS.CREATOR]: 'harvester',
|
||||
[HCI_ANNOTATIONS.OS]: this.osType
|
||||
});
|
||||
};
|
||||
|
||||
this.$set(this.value, 'spec', spec);
|
||||
this.$set(this, 'spec', spec);
|
||||
this.value['spec'] = spec;
|
||||
this['spec'] = spec;
|
||||
} else if (this.resource === HCI.VM_VERSION) {
|
||||
this.$set(this.value.spec.vm, 'spec', spec);
|
||||
this.$set(this.value.spec.vm.metadata, 'annotations', { ...this.value.spec.vm.metadata.annotations, [HCI_ANNOTATIONS.VOLUME_CLAIM_TEMPLATE]: JSON.stringify(volumeClaimTemplates) });
|
||||
this.$set(this.value.spec.vm.metadata, 'labels', {
|
||||
this.value.spec.vm['spec'] = spec;
|
||||
this.value.spec.vm.metadata['annotations'] = { ...this.value.spec.vm.metadata.annotations, [HCI_ANNOTATIONS.VOLUME_CLAIM_TEMPLATE]: JSON.stringify(volumeClaimTemplates) };
|
||||
this.value.spec.vm.metadata['labels'] = {
|
||||
...this.value.spec.vm.metadata.labels,
|
||||
[HCI_ANNOTATIONS.OS]: this.osType,
|
||||
});
|
||||
this.$set(this, 'spec', spec);
|
||||
[HCI_ANNOTATIONS.OS]: this.osType
|
||||
};
|
||||
this['spec'] = spec;
|
||||
}
|
||||
},
|
||||
|
||||
@@ -772,7 +772,7 @@ export default {
|
||||
networks
|
||||
};
|
||||
|
||||
this.$set(this.spec.template, 'spec', spec);
|
||||
this.spec.template['spec'] = spec;
|
||||
},
|
||||
|
||||
parseAccessCredentials() {
|
||||
@@ -862,12 +862,12 @@ export default {
|
||||
},
|
||||
|
||||
updateSSHKey(neu) {
|
||||
this.$set(this, 'sshKey', neu);
|
||||
this['sshKey'] = neu;
|
||||
},
|
||||
|
||||
updateCpuMemory(cpu, memory) {
|
||||
this.$set(this, 'cpu', cpu);
|
||||
this.$set(this, 'memory', memory);
|
||||
this['cpu'] = cpu;
|
||||
this['memory'] = memory;
|
||||
},
|
||||
|
||||
parseDisk(R, index) {
|
||||
@@ -1309,10 +1309,10 @@ export default {
|
||||
const index = inputs.findIndex(O => isEqual(O, USB_TABLET[0]));
|
||||
|
||||
if (hasExist && inputs.length === 1) {
|
||||
this.$delete(this.spec.template.spec.domain.devices, 'inputs');
|
||||
delete this.spec.template.spec.domain.devices['inputs'];
|
||||
} else if (hasExist) {
|
||||
inputs.splice(index, 1);
|
||||
this.$set(this.spec.template.spec.domain.devices, 'inputs', inputs);
|
||||
this.spec.template.spec.domain.devices['inputs'] = inputs;
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -1325,17 +1325,17 @@ export default {
|
||||
// set(this.spec.template.spec.domain, 'features.smm.enabled', false);
|
||||
|
||||
try {
|
||||
this.$delete(this.spec.template.spec.domain.features.smm, 'enabled');
|
||||
delete this.spec.template.spec.domain.features.smm['enabled'];
|
||||
const noKeys = Object.keys(this.spec.template.spec.domain.features.smm).length === 0;
|
||||
|
||||
if (noKeys) {
|
||||
this.$delete(this.spec.template.spec.domain.features, 'smm');
|
||||
delete this.spec.template.spec.domain.features['smm'];
|
||||
}
|
||||
} catch (e) {}
|
||||
set(this.spec.template.spec.domain, 'firmware.bootloader.efi.secureBoot', false);
|
||||
} else {
|
||||
this.$delete(this.spec.template.spec.domain, 'firmware');
|
||||
this.$delete(this.spec.template.spec.domain.features, 'smm');
|
||||
delete this.spec.template.spec.domain['firmware'];
|
||||
delete this.spec.template.spec.domain.features['smm'];
|
||||
}
|
||||
},
|
||||
|
||||
@@ -1343,7 +1343,7 @@ export default {
|
||||
if (tpmEnabled) {
|
||||
set(this.spec.template.spec.domain.devices, 'tpm', {});
|
||||
} else {
|
||||
this.$delete(this.spec.template.spec.domain.devices, 'tpm');
|
||||
delete this.spec.template.spec.domain.devices['tpm'];
|
||||
}
|
||||
},
|
||||
|
||||
@@ -1367,9 +1367,9 @@ export default {
|
||||
}
|
||||
|
||||
if (isEmpty(userDataJson)) {
|
||||
this.$set(this, 'userScript', undefined);
|
||||
this['userScript'] = undefined;
|
||||
} else {
|
||||
this.$set(this, 'userScript', jsyaml.dump(userDataJson));
|
||||
this['userScript'] = jsyaml.dump(userDataJson);
|
||||
}
|
||||
|
||||
this.refreshYamlEditor();
|
||||
@@ -1407,11 +1407,11 @@ export default {
|
||||
updateReserved(value = {}) {
|
||||
const { memory } = value;
|
||||
|
||||
this.$set(this, 'reservedMemory', memory);
|
||||
this['reservedMemory'] = memory;
|
||||
},
|
||||
|
||||
updateTerminationGracePeriodSeconds(value) {
|
||||
this.$set(this, 'terminationGracePeriodSeconds', value);
|
||||
this['terminationGracePeriodSeconds'] = value;
|
||||
},
|
||||
},
|
||||
|
||||
@@ -1444,9 +1444,9 @@ export default {
|
||||
|
||||
isWindows(val) {
|
||||
if (val) {
|
||||
this.$set(this, 'sshKey', []);
|
||||
this.$set(this, 'userScript', undefined);
|
||||
this.$set(this, 'installAgent', false);
|
||||
this['sshKey'] = [];
|
||||
this['userScript'] = undefined;
|
||||
this['installAgent'] = false;
|
||||
}
|
||||
},
|
||||
|
||||
@@ -1487,7 +1487,7 @@ export default {
|
||||
}
|
||||
}
|
||||
|
||||
this.$set(this, 'userScript', out);
|
||||
this['userScript'] = out;
|
||||
this.refreshYamlEditor();
|
||||
}
|
||||
this.deleteAgent = true;
|
||||
@@ -1498,7 +1498,7 @@ export default {
|
||||
osType(neu) {
|
||||
const out = this.getUserData({ installAgent: this.installAgent, osType: neu });
|
||||
|
||||
this.$set(this, 'userScript', out);
|
||||
this['userScript'] = out;
|
||||
this.refreshYamlEditor();
|
||||
},
|
||||
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import Vue from 'vue';
|
||||
import { _CLONE } from '@shell/config/query-params';
|
||||
import pick from 'lodash/pick';
|
||||
import { PV, LONGHORN } from '@shell/config/types';
|
||||
@@ -21,12 +20,12 @@ export default class HciPv extends HarvesterResource {
|
||||
const storageClassName =
|
||||
realMode === _CLONE ? this.spec.storageClassName : '';
|
||||
|
||||
Vue.set(this, 'spec', {
|
||||
this['spec'] = {
|
||||
accessModes,
|
||||
storageClassName,
|
||||
volumeName: '',
|
||||
resources: { requests: { storage } }
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
get availableActions() {
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import Vue from 'vue';
|
||||
import {
|
||||
DESCRIPTION,
|
||||
ANNOTATIONS_TO_IGNORE_REGEX,
|
||||
@@ -64,8 +63,8 @@ export default class HciVmImage extends HarvesterResource {
|
||||
|
||||
applyDefaults(resources = this, realMode) {
|
||||
if (realMode !== _CLONE) {
|
||||
Vue.set(this.metadata, 'labels', { [HCI_ANNOTATIONS.OS_TYPE]: '', [HCI_ANNOTATIONS.IMAGE_SUFFIX]: '' });
|
||||
Vue.set(this.metadata, 'annotations', { [HCI_ANNOTATIONS.STORAGE_CLASS]: '' });
|
||||
this.metadata['labels'] = { [HCI_ANNOTATIONS.OS_TYPE]: '', [HCI_ANNOTATIONS.IMAGE_SUFFIX]: '' };
|
||||
this.metadata['annotations'] = { [HCI_ANNOTATIONS.STORAGE_CLASS]: '' };
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import Vue from 'vue';
|
||||
import { find, pickBy, omitBy } from 'lodash';
|
||||
import {
|
||||
AS, MODE, _VIEW, _CONFIG, _UNFLAG, _EDIT
|
||||
@@ -110,7 +109,7 @@ export default class HciVmTemplateVersion extends HarvesterResource {
|
||||
}
|
||||
};
|
||||
|
||||
Vue.set(this, 'spec', spec);
|
||||
this['spec'] = spec;
|
||||
}
|
||||
|
||||
get canDelete() {
|
||||
@@ -272,6 +271,6 @@ export default class HciVmTemplateVersion extends HarvesterResource {
|
||||
return matchesSomeRegex(key, LABELS_TO_IGNORE_REGEX);
|
||||
});
|
||||
|
||||
Vue.set(this.spec.vm.spec.template.metadata, 'labels', { ...wasIgnored, ...val });
|
||||
this.spec.vm.spec.template.metadata['labels'] = { ...wasIgnored, ...val };
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,3 @@
|
||||
import Vue from 'vue';
|
||||
import SteveModel from '@shell/plugins/steve/steve-class';
|
||||
import { HCI } from '@shell/config/labels-annotations';
|
||||
|
||||
@@ -16,7 +15,7 @@ export default class NetworkAttachmentDef extends SteveModel {
|
||||
})
|
||||
};
|
||||
|
||||
Vue.set(this, 'spec', spec);
|
||||
this.spec = spec;
|
||||
}
|
||||
|
||||
get parseConfig() {
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import Vue from 'vue';
|
||||
import { load } from 'js-yaml';
|
||||
import { omitBy, pickBy } from 'lodash';
|
||||
|
||||
@@ -264,8 +263,8 @@ export default class VirtVm extends HarvesterResource {
|
||||
};
|
||||
|
||||
if (realMode !== _CLONE) {
|
||||
Vue.set(this.metadata, 'annotations', { [HCI_ANNOTATIONS.VOLUME_CLAIM_TEMPLATE]: '[]' });
|
||||
Vue.set(this, 'spec', spec);
|
||||
this.metadata['annotations'] = { [HCI_ANNOTATIONS.VOLUME_CLAIM_TEMPLATE]: '[]' };
|
||||
this['spec'] = spec;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1057,6 +1056,6 @@ export default class VirtVm extends HarvesterResource {
|
||||
return matchesSomeRegex(key, LABELS_TO_IGNORE_REGEX);
|
||||
});
|
||||
|
||||
Vue.set(this.spec.template.metadata, 'labels', { ...wasIgnored, ...val });
|
||||
this.spec.template.metadata['labels'] = { ...wasIgnored, ...val };
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,3 @@
|
||||
import Vue from 'vue';
|
||||
import { clone } from '@shell/utils/object';
|
||||
import HarvesterResource from '@pkg/harvester/models/harvester';
|
||||
import { HCI } from '@pkg/harvester/types';
|
||||
@@ -14,8 +13,8 @@ export default class HciLB extends HarvesterResource {
|
||||
spec.selector = spec.selector || {};
|
||||
spec.selector.network = spec.selector.network || '';
|
||||
|
||||
Vue.set(this, 'spec', spec);
|
||||
Vue.set(this, 'metadata', meta);
|
||||
this['spec'] = spec;
|
||||
this['metadata'] = meta;
|
||||
}
|
||||
|
||||
get customValidationRules() {
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
<script lang="ts">
|
||||
import Vue from 'vue';
|
||||
// eslint-disable-next-line import/named
|
||||
import { Location } from 'vue-router';
|
||||
import ExplorerProjectsNamespaces from '@shell/components/ExplorerProjectsNamespaces.vue';
|
||||
import { MANAGEMENT, NAMESPACE } from '@shell/config/types';
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import Vue from 'vue';
|
||||
import Parse from 'url-parse';
|
||||
import { HCI } from '../types';
|
||||
import { PRODUCT_NAME } from '../config/harvester';
|
||||
@@ -42,7 +41,7 @@ const mutations = {
|
||||
uploadEnd(state, value) {
|
||||
const filtered = state.uploadingImages.filter(l => l !== value);
|
||||
|
||||
Vue.set(state, 'uploadingImages', filtered);
|
||||
state['uploadingImages'] = filtered;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in new issue
Block a user