mirror of
https://github.com/harvester/harvester-ui-extension.git
synced 2026-10-01 03:36:04 +08:00
Lint fixes
Signed-off-by: Francesco Torchia <francesco.torchia@suse.com>
This commit is contained in:
@@ -11,7 +11,7 @@ import { HCI } from '../../types';
|
||||
|
||||
export default {
|
||||
emits: ['updateMatchingNICs', 'updateMatchingNodes'],
|
||||
|
||||
|
||||
components: {
|
||||
RadioGroup,
|
||||
LabeledSelect,
|
||||
|
||||
@@ -26,7 +26,7 @@ import NodeSelector from './NodeSelector';
|
||||
|
||||
export default {
|
||||
emits: ['update:value'],
|
||||
|
||||
|
||||
components: {
|
||||
CruResource,
|
||||
NameNsDescription,
|
||||
@@ -96,7 +96,7 @@ export default {
|
||||
const inStore = this.$store.getters['currentProduct'].inStore;
|
||||
const nodes = this.$store.getters[`${ inStore }/all`](NODE);
|
||||
|
||||
return nodes.filter(n => n.isEtcd !== 'true').map((node) => {
|
||||
return nodes.filter((n) => n.isEtcd !== 'true').map((node) => {
|
||||
return {
|
||||
label: node.nameDisplay,
|
||||
value: node.id
|
||||
@@ -154,7 +154,7 @@ export default {
|
||||
const inStore = this.$store.getters['currentProduct'].inStore;
|
||||
const linkMonitor = this.$store.getters[`${ inStore }/byId`](HCI.LINK_MONITOR, 'nic') || {};
|
||||
const linkStatus = linkMonitor?.status?.linkStatus || {};
|
||||
const nodes = this.nodes.map(n => n.id);
|
||||
const nodes = this.nodes.map((n) => n.id);
|
||||
|
||||
const out = [];
|
||||
|
||||
@@ -194,7 +194,7 @@ export default {
|
||||
}
|
||||
});
|
||||
|
||||
return out.filter(o => !map[o.name].masterIndex).map((o) => {
|
||||
return out.filter((o) => !map[o.name].masterIndex).map((o) => {
|
||||
let label = '';
|
||||
|
||||
if (map[o.name].down === 0) {
|
||||
@@ -217,7 +217,7 @@ export default {
|
||||
const inStore = this.$store.getters['currentProduct'].inStore;
|
||||
const nodes = this.$store.getters[`${ inStore }/all`](NODE);
|
||||
|
||||
return nodes.filter(n => n.isEtcd !== 'true');
|
||||
return nodes.filter((n) => n.isEtcd !== 'true');
|
||||
},
|
||||
},
|
||||
|
||||
@@ -236,7 +236,7 @@ export default {
|
||||
errors.push(nicRequired);
|
||||
}
|
||||
|
||||
const option = this.nicOptions.find(option => option.value === n);
|
||||
const option = this.nicOptions.find((option) => option.value === n);
|
||||
|
||||
if (option && option?.disabled) {
|
||||
errors.push(this.t('harvester.vlanConfig.uplink.nics.validate.available', { nic: n }, true));
|
||||
@@ -280,15 +280,15 @@ export default {
|
||||
|
||||
if (isEmpty(nodeSelector)) {
|
||||
matchNICs = clone(allNICs);
|
||||
commonNodes = (this.nodes || []).map(n => n.id);
|
||||
commonNodes = (this.nodes || []).map((n) => n.id);
|
||||
} else if (nodeSelector[HOSTNAME] && Object.keys(nodeSelector).length === 1) {
|
||||
matchNICs = allNICs.filter(n => n.nodeName === nodeSelector[HOSTNAME]);
|
||||
matchNICs = allNICs.filter((n) => n.nodeName === nodeSelector[HOSTNAME]);
|
||||
commonNodes = [nodeSelector[HOSTNAME]];
|
||||
} else {
|
||||
const matchNodes = matching(this.nodes || [], nodeSelector).map(n => n.id);
|
||||
const matchNodes = matching(this.nodes || [], nodeSelector).map((n) => n.id);
|
||||
|
||||
matchNICs = allNICs.filter(n => matchNodes.includes(n.nodeName));
|
||||
commonNodes = matchNodes.map(n => n.id);
|
||||
matchNICs = allNICs.filter((n) => matchNodes.includes(n.nodeName));
|
||||
commonNodes = matchNodes.map((n) => n.id);
|
||||
}
|
||||
|
||||
this.matchNICs = this.intersection(matchNICs, commonNodes) || [];
|
||||
@@ -301,7 +301,7 @@ export default {
|
||||
map[n.name] = (map[n.name] || 0) + 1;
|
||||
});
|
||||
|
||||
return nics.filter(n => map[n.name] === commonNodes.length);
|
||||
return nics.filter((n) => map[n.name] === commonNodes.length);
|
||||
},
|
||||
|
||||
updateMatchingNodes: throttle(function() {
|
||||
@@ -316,7 +316,7 @@ export default {
|
||||
sample: allNodes[0] ? allNodes[0].nameDisplay : null,
|
||||
};
|
||||
} else if (selector[HOSTNAME] && Object.keys(selector).length === 1) {
|
||||
const matchNode = allNodes.find(n => n.id === selector[HOSTNAME]);
|
||||
const matchNode = allNodes.find((n) => n.id === selector[HOSTNAME]);
|
||||
|
||||
if (matchNode) {
|
||||
this.matchingNodes = {
|
||||
@@ -352,7 +352,7 @@ export default {
|
||||
const nicErrors = [];
|
||||
|
||||
nics.map((n) => {
|
||||
const option = options.find(option => option.value === n);
|
||||
const option = options.find((option) => option.value === n);
|
||||
|
||||
if ((option && option?.disabled) || !option) {
|
||||
nicErrors.push(this.t('harvester.vlanConfig.uplink.nics.validate.available', { nic: n }, true));
|
||||
@@ -376,9 +376,9 @@ export default {
|
||||
>
|
||||
<NameNsDescription
|
||||
:value="value"
|
||||
@update:value="$emit('update:value', $event)"
|
||||
:mode="mode"
|
||||
:namespaced="false"
|
||||
@update:value="$emit('update:value', $event)"
|
||||
/>
|
||||
|
||||
<Tabbed
|
||||
@@ -433,14 +433,16 @@ export default {
|
||||
<div class="row mt-20">
|
||||
<div class="col span-12">
|
||||
<Banner
|
||||
v-for="(err, i) in nicErrors" :key="i" color="warning"
|
||||
v-for="(err, i) in nicErrors"
|
||||
:key="i"
|
||||
color="warning"
|
||||
:label="err"
|
||||
/>
|
||||
<ArrayListSelect
|
||||
v-model:value="value.spec.uplink.nics"
|
||||
:mode="mode"
|
||||
:options="nicOptions"
|
||||
:enableDefaultAddValue="false"
|
||||
:enable-default-add-value="false"
|
||||
:array-list-props="{
|
||||
addLabel: t('harvester.vlanConfig.uplink.nics.addLabel'),
|
||||
initialEmptyRow: true,
|
||||
|
||||
Reference in New Issue
Block a user