Lint fixes

Signed-off-by: Francesco Torchia <francesco.torchia@suse.com>
This commit is contained in:
Francesco Torchia
2024-11-12 11:50:20 +01:00
parent 19b11aac2c
commit 4626d56acd
214 changed files with 3162 additions and 1298 deletions
@@ -23,7 +23,7 @@ export default {
computed: {
vm() {
const vm = this.vmList.find( V => V.id === `${ this.row.metadata.namespace }/${ this.value }`);
const vm = this.vmList.find( (V) => V.id === `${ this.row.metadata.namespace }/${ this.value }`);
return vm;
},
@@ -18,7 +18,7 @@ export default {
if (!this.value) {
return '';
} else {
return this.scheduleList.find(s => s.id === this.value);
return this.scheduleList.find((s) => s.id === this.value);
}
},
to() {
@@ -29,13 +29,19 @@ export default {
</script>
<template>
<router-link v-if="to" :to="to">
<router-link
v-if="to"
:to="to"
>
{{ value }}
</router-link>
<span v-else-if="value">
{{ value }}
</span>
<span v-else class="text-muted">
<span
v-else
class="text-muted"
>
&mdash;
</span>
</template>
@@ -51,7 +51,7 @@ export default {
return null;
}
const title = this.t(`harvester.${ this.value.type }.progress.details`);
const rows = this.value.details.volumes.map(v => `<br><b>${ v.volumeName }</b>: ${ v.progress || 0 }%`);
const rows = this.value.details.volumes.map((v) => `<br><b>${ v.volumeName }</b>: ${ v.progress || 0 }%`);
return rows.reduce((acc, r) => acc + r, `${ title }<br>`);
},
@@ -60,7 +60,10 @@ export default {
</script>
<template>
<div v-if="isEmpty" class="empty">
<div
v-if="isEmpty"
class="empty"
>
<span class="text-muted">
&mdash;
</span>
@@ -22,7 +22,7 @@ export default {
computed: {
isMatch() {
const harvesterSettings = this.$store.getters['harvester/all'](HCI.SETTING) || [];
const resource = harvesterSettings.find( V => V.id === 'backup-target');
const resource = harvesterSettings.find( (V) => V.id === 'backup-target');
let isMatch = false;
@@ -42,7 +42,10 @@ export default {
</div>
<div v-else>
{{ value }}
<p v-if="value" class="text-error">
<p
v-if="value"
class="text-error"
>
{{ t('harvester.backup.matchTarget') }}
</p>
</div>
@@ -14,7 +14,7 @@ export default {
},
computed: {
row() {
return this.rows.find(r => r.id === this.value);
return this.rows.find((r) => r.id === this.value);
},
cpuManagerStatus() {
if (this.row?.isCPUManagerEnableInProgress) {
@@ -28,10 +28,16 @@ export default {
</script>
<template>
<span v-if="row?.isCPUManagerEnableInProgress" v-clean-tooltip="cpuManagerStatus">
<span
v-if="row?.isCPUManagerEnableInProgress"
v-clean-tooltip="cpuManagerStatus"
>
<i class="icon icon-spinner icon-spin" />
</span>
<span v-else-if="row?.isCPUManagerEnabled" v-clean-tooltip="cpuManagerStatus">
<span
v-else-if="row?.isCPUManagerEnabled"
v-clean-tooltip="cpuManagerStatus"
>
<i class="icon icon-checkmark" />
</span>
<span
@@ -87,7 +87,9 @@ export default {
<template #popper>
<p
v-for="(message, index) in warningMessage" :key="index">
v-for="(message, index) in warningMessage"
:key="index"
>
{{ index + 1 }}. {{ message }}
</p>
</template>
+4 -1
View File
@@ -31,6 +31,9 @@ export default {
<template>
<div>
<CopyToClipboardText v-clean-tooltip="ip" :text="nameDisplay" />
<CopyToClipboardText
v-clean-tooltip="ip"
:text="nameDisplay"
/>
</div>
</template>
@@ -53,7 +53,7 @@ export default {
try {
const out = JSON.parse(annotationIp);
return out.map( ip => ({
return out.map( (ip) => ({
ip: ip.replace(/\/[\d\D]*/, ''),
name: ''
}));
@@ -64,7 +64,7 @@ export default {
vmiIp() {
const vmiResources = this.$store.getters[`${ this.inStore }/all`](HCI.VMI);
const resource = vmiResources.find(VMI => VMI.id === this.value) || null;
const resource = vmiResources.find((VMI) => VMI.id === this.value) || null;
const networksName = this.row.networksName || [];
const vmiNetworks = resource?.spec?.networks || [];
@@ -72,7 +72,7 @@ export default {
return isIpv4(intf.ipAddress) && networksName.includes(intf.name);
}).map((intf) => {
let name;
const network = vmiNetworks.find(network => network.name === intf.name);
const network = vmiNetworks.find((network) => network.name === intf.name);
if (network && network.multus) {
name = network.multus.networkName;
@@ -96,8 +96,14 @@ export default {
<template>
<div v-if="showIP">
<span v-for="{ip, name} in ips" :key="ip">
<CopyToClipboardText v-clean-tooltip="name" :text="ip" />
<span
v-for="{ip, name} in ips"
:key="ip"
>
<CopyToClipboardText
v-clean-tooltip="name"
:text="ip"
/>
</span>
</div>
</template>
@@ -66,7 +66,9 @@ export default {
<template>
<div>
<div
v-for="(port, index) in parsed" :key="index">
v-for="(port, index) in parsed"
:key="index"
>
<CopyToClipboardText :text="port.label" />
</div>
</div>
@@ -4,7 +4,7 @@ import { HCI } from '../types';
export default {
emits: ['state-changed'],
components: { BadgeState },
props: {
@@ -46,7 +46,10 @@ export default {
<template>
<div v-if="migrationState">
<span v-if="!showSuccess">/</span>
<BadgeState :label="migrationState" :color="migrationBackground" />
<BadgeState
:label="migrationState"
:color="migrationBackground"
/>
</div>
</template>
@@ -53,7 +53,7 @@ export default {
};
const inStore = this.$store.getters['currentProduct'].inStore;
const node = this.$store.getters[`${ inStore }/byId`](LONGHORN.NODES, `longhorn-system/${ this.row.id }`) || {};
const storageOverProvisioningPercentageSetting = this.longhornSettings.find(s => s.id === 'longhorn-system/storage-over-provisioning-percentage');
const storageOverProvisioningPercentageSetting = this.longhornSettings.find((s) => s.id === 'longhorn-system/storage-over-provisioning-percentage');
const disks = node?.spec?.disks || {};
const diskStatus = node?.status?.diskStatus || {};
@@ -48,7 +48,9 @@ export default {
<template>
<div class="vfs">
<span
v-for="(vf, index) in rows.visible" :key="index">
v-for="(vf, index) in rows.visible"
:key="index"
>
<router-link
:to="vf.to"
>
@@ -76,7 +78,9 @@ export default {
<div class="vfs-popup">
<div>
<span
v-for="(vf, index) in rows.invisible" :key="index">
v-for="(vf, index) in rows.invisible"
:key="index"
>
<router-link
:to="vf.to"
>
@@ -46,7 +46,9 @@ export default {
<template>
<div class="vgpudevices">
<span
v-for="(vgpu, index) in rows.visible" :key="index">
v-for="(vgpu, index) in rows.visible"
:key="index"
>
<router-link
:to="vgpu.to"
>
@@ -74,7 +76,9 @@ export default {
<div class="vgpu-popup">
<div>
<span
v-for="(vgpu, index) in rows.invisible" :key="index">
v-for="(vgpu, index) in rows.invisible"
:key="index"
>
<router-link
:to="vgpu.to"
>
+14 -4
View File
@@ -37,7 +37,7 @@ export default {
};
},
beforeDestroy() {
beforeUnmount() {
if (this.timer) {
clearTimeout(this.timer);
}
@@ -122,8 +122,15 @@ export default {
<template>
<span>
<HarvesterMigrationState v-show="isMigrating" :vm-resource="row" @state-changed="migrationStateChanged" />
<div v-show="!isMigrating" class="state">
<HarvesterMigrationState
v-show="isMigrating"
:vm-resource="row"
@state-changed="migrationStateChanged"
/>
<div
v-show="!isMigrating"
class="state"
>
<VMState :row="row" />
<v-dropdown
v-if="warningMessage.length"
@@ -144,7 +151,10 @@ export default {
@mouseenter="showMessage(true)"
@mouseleave="showMessage(false)"
>
<p v-for="(message, index) in warningMessage" :key="index">
<p
v-for="(message, index) in warningMessage"
:key="index"
>
{{ index + 1 }}.
<a
v-if="canMiss(row, message)"
@@ -31,10 +31,21 @@ export default {
<template>
<div>
<div v-if="value !== 'N/A'" class="text">
<BadgeStateFormatter class="ml-10" :arbitrary="arbitrary" :row="row" :value="value" />
<div
v-if="value !== 'N/A'"
class="text"
>
<BadgeStateFormatter
class="ml-10"
:arbitrary="arbitrary"
:row="row"
:value="value"
/>
</div>
<div v-else class="text">
<div
v-else
class="text"
>
{{ value }}
</div>
</div>
@@ -22,7 +22,7 @@ export default {
computed: {
volume() {
const namespace = this.row?.metadata?.namespace;
const volume = this.volumeList.find( V => V.id === `${ namespace }/${ this.value }`) || {};
const volume = this.volumeList.find( (V) => V.id === `${ namespace }/${ this.value }`) || {};
return volume;
},
@@ -36,7 +36,9 @@ export default {
<template #popper>
<p
v-for="(message, index) in warningMessages" :key="index">
v-for="(message, index) in warningMessages"
:key="index"
>
{{ index + 1 }}.
{{ message.text }}
</p>