Merge pull request #1565 from Saibamen/eslint

Fix some of ESLint warnings
pull/1473/head^2
Louis Lam 3 years ago committed by GitHub
commit 1687de163c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -48,6 +48,7 @@ module.exports = {
"vue/html-self-closing": "off", "vue/html-self-closing": "off",
"vue/require-component-is": "off", // not allow is="style" https://github.com/vuejs/eslint-plugin-vue/issues/462#issuecomment-430234675 "vue/require-component-is": "off", // not allow is="style" https://github.com/vuejs/eslint-plugin-vue/issues/462#issuecomment-430234675
"vue/attribute-hyphenation": "off", // This change noNL to "no-n-l" unexpectedly "vue/attribute-hyphenation": "off", // This change noNL to "no-n-l" unexpectedly
"vue/multi-word-component-names": "off",
"no-multi-spaces": [ "error", { "no-multi-spaces": [ "error", {
ignoreEOLComments: true, ignoreEOLComments: true,
}], }],

@ -15,6 +15,7 @@
"lint:js": "eslint --ext \".js,.vue\" --ignore-path .gitignore .", "lint:js": "eslint --ext \".js,.vue\" --ignore-path .gitignore .",
"lint-fix:js": "eslint --ext \".js,.vue\" --fix --ignore-path .gitignore .", "lint-fix:js": "eslint --ext \".js,.vue\" --fix --ignore-path .gitignore .",
"lint:style": "stylelint \"**/*.{vue,css,scss}\" --ignore-path .gitignore", "lint:style": "stylelint \"**/*.{vue,css,scss}\" --ignore-path .gitignore",
"lint-fix:style": "stylelint \"**/*.{vue,css,scss}\" --fix --ignore-path .gitignore",
"lint": "npm run lint:js && npm run lint:style", "lint": "npm run lint:js && npm run lint:style",
"dev": "concurrently -k -r \"wait-on tcp:3000 && npm run start-server-dev \" \"npm run start-frontend-dev\"", "dev": "concurrently -k -r \"wait-on tcp:3000 && npm run start-server-dev \" \"npm run start-frontend-dev\"",
"start-frontend-dev": "cross-env NODE_ENV=development vite --host --config ./config/vite.config.js", "start-frontend-dev": "cross-env NODE_ENV=development vite --host --config ./config/vite.config.js",
@ -123,7 +124,7 @@
}, },
"devDependencies": { "devDependencies": {
"@actions/github": "~5.0.1", "@actions/github": "~5.0.1",
"@babel/eslint-parser": "~7.15.8", "@babel/eslint-parser": "~7.17.0",
"@babel/preset-env": "^7.15.8", "@babel/preset-env": "^7.15.8",
"@types/bootstrap": "~5.1.9", "@types/bootstrap": "~5.1.9",
"@vitejs/plugin-legacy": "~1.6.4", "@vitejs/plugin-legacy": "~1.6.4",
@ -135,16 +136,16 @@
"core-js": "~3.18.3", "core-js": "~3.18.3",
"cross-env": "~7.0.3", "cross-env": "~7.0.3",
"dns2": "~2.0.1", "dns2": "~2.0.1",
"eslint": "~7.32.0", "eslint": "~8.14.0",
"eslint-plugin-vue": "~7.18.0", "eslint-plugin-vue": "~8.7.1",
"jest": "~27.2.5", "jest": "~27.2.5",
"jest-puppeteer": "~6.0.3", "jest-puppeteer": "~6.0.3",
"npm-check-updates": "^12.5.5", "npm-check-updates": "^12.5.9",
"postcss-html": "^1.3.1", "postcss-html": "^1.3.1",
"puppeteer": "~13.1.3", "puppeteer": "~13.1.3",
"sass": "~1.42.1", "sass": "~1.42.1",
"stylelint": "~14.2.0", "stylelint": "~14.7.1",
"stylelint-config-standard": "~24.0.0", "stylelint-config-standard": "~25.0.0",
"typescript": "~4.4.4", "typescript": "~4.4.4",
"vite": "~2.6.14", "vite": "~2.6.14",
"wait-on": "^6.0.1" "wait-on": "^6.0.1"

@ -58,7 +58,7 @@ class Database {
"patch-monitor-expiry-notification.sql": true, "patch-monitor-expiry-notification.sql": true,
"patch-status-page-footer-css.sql": true, "patch-status-page-footer-css.sql": true,
"patch-added-mqtt-monitor.sql": true, "patch-added-mqtt-monitor.sql": true,
} };
/** /**
* The final version should be 10 after merged tag feature * The final version should be 10 after merged tag feature

@ -731,7 +731,7 @@ class Monitor extends BeanModel {
} else { } else {
// Handle new monitor with only one beat, because the beat's duration = 0 // Handle new monitor with only one beat, because the beat's duration = 0
let status = parseInt(await R.getCell("SELECT `status` FROM heartbeat WHERE monitor_id = ?", [monitorID])); let status = parseInt(await R.getCell("SELECT `status` FROM heartbeat WHERE monitor_id = ?", [ monitorID ]));
if (status === UP) { if (status === UP) {
uptime = 1; uptime = 1;

@ -33,7 +33,7 @@ const monitorStatus = new PrometheusClient.Gauge({
}); });
class Prometheus { class Prometheus {
monitorLabelValues = {} monitorLabelValues = {};
/** /**
* @param {Object} monitor Monitor object to monitor * @param {Object} monitor Monitor object to monitor

@ -7,7 +7,7 @@ const { UptimeKumaServer } = require("./uptime-kuma-server");
class Proxy { class Proxy {
static SUPPORTED_PROXY_PROTOCOLS = [ "http", "https", "socks", "socks5", "socks4" ] static SUPPORTED_PROXY_PROTOCOLS = [ "http", "https", "socks", "socks5", "socks4" ];
/** /**
* Saves and updates given proxy entity * Saves and updates given proxy entity

@ -136,13 +136,6 @@ app.use(function (req, res, next) {
next(); next();
}); });
/**
* Total WebSocket client connected to server currently, no actual use
*
* @type {number}
*/
let totalClient = 0;
/** /**
* Use for decode the auth object * Use for decode the auth object
* @type {null} * @type {null}
@ -248,17 +241,11 @@ try {
sendInfo(socket); sendInfo(socket);
totalClient++;
if (needSetup) { if (needSetup) {
log.info("server", "Redirect to setup page"); log.info("server", "Redirect to setup page");
socket.emit("setup"); socket.emit("setup");
} }
socket.on("disconnect", () => {
totalClient--;
});
// *************************** // ***************************
// Public Socket API // Public Socket API
// *************************** // ***************************
@ -327,7 +314,7 @@ try {
let user = await login(data.username, data.password); let user = await login(data.username, data.password);
if (user) { if (user) {
if (user.twofa_status == 0) { if (user.twofa_status === 0) {
afterLogin(socket, user); afterLogin(socket, user);
log.info("auth", `Successfully logged in user ${data.username}. IP=${getClientIp(socket)}`); log.info("auth", `Successfully logged in user ${data.username}. IP=${getClientIp(socket)}`);
@ -340,7 +327,7 @@ try {
}); });
} }
if (user.twofa_status == 1 && !data.token) { if (user.twofa_status === 1 && !data.token) {
log.info("auth", `2FA token required for user ${data.username}. IP=${getClientIp(socket)}`); log.info("auth", `2FA token required for user ${data.username}. IP=${getClientIp(socket)}`);
@ -417,7 +404,7 @@ try {
socket.userID, socket.userID,
]); ]);
if (user.twofa_status == 0) { if (user.twofa_status === 0) {
let newSecret = genSecret(); let newSecret = genSecret();
let encodedSecret = base32.encode(newSecret); let encodedSecret = base32.encode(newSecret);
@ -548,7 +535,7 @@ try {
socket.userID, socket.userID,
]); ]);
if (user.twofa_status == 1) { if (user.twofa_status === 1) {
callback({ callback({
ok: true, ok: true,
status: true, status: true,
@ -1169,7 +1156,7 @@ try {
let version17x = compareVersions.compare(backupData.version, "1.7.0", ">="); let version17x = compareVersions.compare(backupData.version, "1.7.0", ">=");
// If the import option is "overwrite" it'll clear most of the tables, except "settings" and "user" // If the import option is "overwrite" it'll clear most of the tables, except "settings" and "user"
if (importHandle == "overwrite") { if (importHandle === "overwrite") {
// Stops every monitor first, so it doesn't execute any heartbeat while importing // Stops every monitor first, so it doesn't execute any heartbeat while importing
for (let id in server.monitorList) { for (let id in server.monitorList) {
let monitor = server.monitorList[id]; let monitor = server.monitorList[id];
@ -1193,7 +1180,7 @@ try {
for (let i = 0; i < notificationListData.length; i++) { for (let i = 0; i < notificationListData.length; i++) {
// Only starts importing the notification if the import option is "overwrite", "keep" or "skip" but the notification doesn't exists // Only starts importing the notification if the import option is "overwrite", "keep" or "skip" but the notification doesn't exists
if ((importHandle == "skip" && notificationNameListString.includes(notificationListData[i].name) == false) || importHandle == "keep" || importHandle == "overwrite") { if ((importHandle === "skip" && notificationNameListString.includes(notificationListData[i].name) === false) || importHandle === "keep" || importHandle === "overwrite") {
let notification = JSON.parse(notificationListData[i].config); let notification = JSON.parse(notificationListData[i].config);
await Notification.save(notification, null, socket.userID); await Notification.save(notification, null, socket.userID);
@ -1228,7 +1215,7 @@ try {
for (let i = 0; i < monitorListData.length; i++) { for (let i = 0; i < monitorListData.length; i++) {
// Only starts importing the monitor if the import option is "overwrite", "keep" or "skip" but the notification doesn't exists // Only starts importing the monitor if the import option is "overwrite", "keep" or "skip" but the notification doesn't exists
if ((importHandle == "skip" && monitorNameListString.includes(monitorListData[i].name) == false) || importHandle == "keep" || importHandle == "overwrite") { if ((importHandle === "skip" && monitorNameListString.includes(monitorListData[i].name) === false) || importHandle === "keep" || importHandle === "overwrite") {
// Define in here every new variable for monitors which where implemented after the first version of the Import/Export function (1.6.0) // Define in here every new variable for monitors which where implemented after the first version of the Import/Export function (1.6.0)
// --- Start --- // --- Start ---
@ -1325,7 +1312,7 @@ try {
await updateMonitorNotification(bean.id, notificationIDList); await updateMonitorNotification(bean.id, notificationIDList);
// If monitor was active start it immediately, otherwise pause it // If monitor was active start it immediately, otherwise pause it
if (monitorListData[i].active == 1) { if (monitorListData[i].active === 1) {
await startMonitor(socket.userID, bean.id); await startMonitor(socket.userID, bean.id);
} else { } else {
await pauseMonitor(socket.userID, bean.id); await pauseMonitor(socket.userID, bean.id);

@ -158,7 +158,7 @@ exports.mqttAsync = function (hostname, topic, okMessage, options = {}) {
}); });
client.on("message", (messageTopic, message) => { client.on("message", (messageTopic, message) => {
if (messageTopic == topic) { if (messageTopic === topic) {
client.end(); client.end();
clearTimeout(timeoutID); clearTimeout(timeoutID);
if (okMessage != null && okMessage !== "" && message.toString() !== okMessage) { if (okMessage != null && okMessage !== "" && message.toString() !== okMessage) {

@ -5,8 +5,8 @@
<script> <script>
import dayjs from "dayjs"; import dayjs from "dayjs";
import relativeTime from "dayjs/plugin/relativeTime"; import relativeTime from "dayjs/plugin/relativeTime";
import utc from "dayjs/plugin/utc";
import timezone from "dayjs/plugin/timezone"; // dependent on utc plugin import timezone from "dayjs/plugin/timezone"; // dependent on utc plugin
import utc from "dayjs/plugin/utc";
dayjs.extend(utc); dayjs.extend(utc);
dayjs.extend(timezone); dayjs.extend(timezone);
dayjs.extend(relativeTime); dayjs.extend(relativeTime);

@ -47,8 +47,8 @@
<script> <script>
import HeartbeatBar from "../components/HeartbeatBar.vue"; import HeartbeatBar from "../components/HeartbeatBar.vue";
import Uptime from "../components/Uptime.vue";
import Tag from "../components/Tag.vue"; import Tag from "../components/Tag.vue";
import Uptime from "../components/Uptime.vue";
import { getMonitorRelativeURL } from "../util.ts"; import { getMonitorRelativeURL } from "../util.ts";
export default { export default {
@ -105,7 +105,7 @@ export default {
// Simple filter by search text // Simple filter by search text
// finds monitor name, tag name or tag value // finds monitor name, tag name or tag value
if (this.searchText != "") { if (this.searchText !== "") {
const loweredSearchText = this.searchText.toLowerCase(); const loweredSearchText = this.searchText.toLowerCase();
result = result.filter(monitor => { result = result.filter(monitor => {
return monitor.name.toLowerCase().includes(loweredSearchText) return monitor.name.toLowerCase().includes(loweredSearchText)
@ -170,12 +170,6 @@ export default {
} }
} }
.dark {
.footer {
// background-color: $dark-bg;
}
}
@media (max-width: 770px) { @media (max-width: 770px) {
.list-header { .list-header {
margin: -20px; margin: -20px;

@ -18,10 +18,10 @@
<script lang="ts"> <script lang="ts">
import { BarController, BarElement, Chart, Filler, LinearScale, LineController, LineElement, PointElement, TimeScale, Tooltip } from "chart.js"; import { BarController, BarElement, Chart, Filler, LinearScale, LineController, LineElement, PointElement, TimeScale, Tooltip } from "chart.js";
import "chartjs-adapter-dayjs";
import dayjs from "dayjs"; import dayjs from "dayjs";
import utc from "dayjs/plugin/utc";
import timezone from "dayjs/plugin/timezone"; import timezone from "dayjs/plugin/timezone";
import "chartjs-adapter-dayjs"; import utc from "dayjs/plugin/utc";
import { LineChart } from "vue-chart-3"; import { LineChart } from "vue-chart-3";
import { useToast } from "vue-toastification"; import { useToast } from "vue-toastification";
import { DOWN } from "../util.ts"; import { DOWN } from "../util.ts";
@ -217,7 +217,7 @@ export default {
watch: { watch: {
// Update chart data when the selected chart period changes // Update chart data when the selected chart period changes
chartPeriodHrs: function (newPeriod) { chartPeriodHrs: function (newPeriod) {
if (newPeriod == "0") { if (newPeriod === "0") {
newPeriod = null; newPeriod = null;
this.heartbeatList = null; this.heartbeatList = null;
this.$root.storage().removeItem(`chart-period-${this.monitorId}`); this.$root.storage().removeItem(`chart-period-${this.monitorId}`);
@ -241,7 +241,7 @@ export default {
// And mirror latest change to this.heartbeatList // And mirror latest change to this.heartbeatList
this.$watch(() => this.$root.heartbeatList[this.monitorId], this.$watch(() => this.$root.heartbeatList[this.monitorId],
(heartbeatList) => { (heartbeatList) => {
if (this.chartPeriodHrs != 0) { if (this.chartPeriodHrs !== 0) {
const newBeat = heartbeatList.at(-1); const newBeat = heartbeatList.at(-1);
if (newBeat && dayjs.utc(newBeat.time) > dayjs.utc(this.heartbeatList.at(-1)?.time)) { if (newBeat && dayjs.utc(newBeat.time) > dayjs.utc(this.heartbeatList.at(-1)?.time)) {
this.heartbeatList.push(heartbeatList.at(-1)); this.heartbeatList.push(heartbeatList.at(-1));

@ -1,13 +1,14 @@
<template> <template>
<div class="tag-wrapper rounded d-inline-flex" <div
:class="{ 'px-3': size == 'normal', class="tag-wrapper rounded d-inline-flex"
'py-1': size == 'normal', :class="{ 'px-3': size == 'normal',
'm-2': size == 'normal', 'py-1': size == 'normal',
'px-2': size == 'sm', 'm-2': size == 'normal',
'py-0': size == 'sm', 'px-2': size == 'sm',
'm-1': size == 'sm', 'py-0': size == 'sm',
}" 'm-1': size == 'sm',
:style="{ backgroundColor: item.color, fontSize: size == 'sm' ? '0.7em' : '1em' }" }"
:style="{ backgroundColor: item.color, fontSize: size == 'sm' ? '0.7em' : '1em' }"
> >
<span class="tag-text">{{ displayText }}</span> <span class="tag-text">{{ displayText }}</span>
<span v-if="remove != null" class="ps-1 btn-remove" @click="remove(item)"> <span v-if="remove != null" class="ps-1 btn-remove" @click="remove(item)">
@ -34,7 +35,7 @@ export default {
}, },
computed: { computed: {
displayText() { displayText() {
if (this.item.value == "") { if (this.item.value === "") {
return this.item.name; return this.item.name;
} else { } else {
return `${this.item.name}: ${this.item.value}`; return `${this.item.name}: ${this.item.value}`;

@ -34,18 +34,20 @@
label="name" label="name"
> >
<template #option="{ option }"> <template #option="{ option }">
<div class="mx-2 py-1 px-3 rounded d-inline-flex" <div
style="margin-top: -5px; margin-bottom: -5px; height: 24px;" class="mx-2 py-1 px-3 rounded d-inline-flex"
:style="{ color: textColor(option), backgroundColor: option.color + ' !important' }" style="margin-top: -5px; margin-bottom: -5px; height: 24px;"
:style="{ color: textColor(option), backgroundColor: option.color + ' !important' }"
> >
<span> <span>
{{ option.name }}</span> {{ option.name }}</span>
</div> </div>
</template> </template>
<template #singleLabel="{ option }"> <template #singleLabel="{ option }">
<div class="py-1 px-3 rounded d-inline-flex" <div
style="height: 24px;" class="py-1 px-3 rounded d-inline-flex"
:style="{ color: textColor(option), backgroundColor: option.color + ' !important' }" style="height: 24px;"
:style="{ color: textColor(option), backgroundColor: option.color + ' !important' }"
> >
<span>{{ option.name }}</span> <span>{{ option.name }}</span>
</div> </div>
@ -53,10 +55,11 @@
</vue-multiselect> </vue-multiselect>
<div v-if="newDraftTag.select?.name == null" class="d-flex mb-2"> <div v-if="newDraftTag.select?.name == null" class="d-flex mb-2">
<div class="w-50 pe-2"> <div class="w-50 pe-2">
<input v-model="newDraftTag.name" class="form-control" <input
:class="{'is-invalid': validateDraftTag.nameInvalid}" v-model="newDraftTag.name" class="form-control"
:placeholder="$t('Name')" :class="{'is-invalid': validateDraftTag.nameInvalid}"
@keydown.enter.prevent="onEnter" :placeholder="$t('Name')"
@keydown.enter.prevent="onEnter"
/> />
<div class="invalid-feedback"> <div class="invalid-feedback">
{{ $t("Tag with this name already exist.") }} {{ $t("Tag with this name already exist.") }}
@ -75,17 +78,19 @@
deselect-label="" deselect-label=""
> >
<template #option="{ option }"> <template #option="{ option }">
<div class="mx-2 py-1 px-3 rounded d-inline-flex" <div
style="height: 24px; color: white;" class="mx-2 py-1 px-3 rounded d-inline-flex"
:style="{ backgroundColor: option.color + ' !important' }" style="height: 24px; color: white;"
:style="{ backgroundColor: option.color + ' !important' }"
> >
<span>{{ option.name }}</span> <span>{{ option.name }}</span>
</div> </div>
</template> </template>
<template #singleLabel="{ option }"> <template #singleLabel="{ option }">
<div class="py-1 px-3 rounded d-inline-flex" <div
style="height: 24px; color: white;" class="py-1 px-3 rounded d-inline-flex"
:style="{ backgroundColor: option.color + ' !important' }" style="height: 24px; color: white;"
:style="{ backgroundColor: option.color + ' !important' }"
> >
<span>{{ option.name }}</span> <span>{{ option.name }}</span>
</div> </div>
@ -94,10 +99,11 @@
</div> </div>
</div> </div>
<div class="mb-2"> <div class="mb-2">
<input v-model="newDraftTag.value" class="form-control" <input
:class="{'is-invalid': validateDraftTag.valueInvalid}" v-model="newDraftTag.value" class="form-control"
:placeholder="$t('value (optional)')" :class="{'is-invalid': validateDraftTag.valueInvalid}"
@keydown.enter.prevent="onEnter" :placeholder="$t('value (optional)')"
@keydown.enter.prevent="onEnter"
/> />
<div class="invalid-feedback"> <div class="invalid-feedback">
{{ $t("Tag with this value already exist.") }} {{ $t("Tag with this value already exist.") }}
@ -123,8 +129,8 @@
<script> <script>
import { Modal } from "bootstrap"; import { Modal } from "bootstrap";
import VueMultiselect from "vue-multiselect"; import VueMultiselect from "vue-multiselect";
import Tag from "../components/Tag.vue";
import { useToast } from "vue-toastification"; import { useToast } from "vue-toastification";
import Tag from "../components/Tag.vue";
const toast = useToast(); const toast = useToast();
export default { export default {
@ -159,14 +165,14 @@ export default {
tagOptions() { tagOptions() {
const tagOptions = this.existingTags; const tagOptions = this.existingTags;
for (const tag of this.newTags) { for (const tag of this.newTags) {
if (!tagOptions.find(t => t.name == tag.name && t.color == tag.color)) { if (!tagOptions.find(t => t.name === tag.name && t.color === tag.color)) {
tagOptions.push(tag); tagOptions.push(tag);
} }
} }
return tagOptions; return tagOptions;
}, },
selectedTags() { selectedTags() {
return this.preSelectedTags.concat(this.newTags).filter(tag => !this.deleteTags.find(monitorTag => monitorTag.id == tag.id)); return this.preSelectedTags.concat(this.newTags).filter(tag => !this.deleteTags.find(monitorTag => monitorTag.id === tag.id));
}, },
colorOptions() { colorOptions() {
return [ return [
@ -192,7 +198,7 @@ export default {
let nameInvalid = false; let nameInvalid = false;
let valueInvalid = false; let valueInvalid = false;
let invalid = true; let invalid = true;
if (this.deleteTags.find(tag => tag.name == this.newDraftTag.select?.name && tag.value == this.newDraftTag.value)) { if (this.deleteTags.find(tag => tag.name === this.newDraftTag.select?.name && tag.value === this.newDraftTag.value)) {
// Undo removing a Tag // Undo removing a Tag
nameInvalid = false; nameInvalid = false;
valueInvalid = false; valueInvalid = false;
@ -202,9 +208,9 @@ export default {
nameInvalid = true; nameInvalid = true;
invalid = true; invalid = true;
} else if (this.newTags.concat(this.preSelectedTags).filter(tag => ( } else if (this.newTags.concat(this.preSelectedTags).filter(tag => (
tag.name == this.newDraftTag.select?.name && tag.value == this.newDraftTag.value tag.name === this.newDraftTag.select?.name && tag.value === this.newDraftTag.value
) || ( ) || (
tag.name == this.newDraftTag.name && tag.value == this.newDraftTag.value tag.name === this.newDraftTag.name && tag.value === this.newDraftTag.value
)).length > 0) { )).length > 0) {
// Try to add a tag with existing name and value // Try to add a tag with existing name and value
valueInvalid = true; valueInvalid = true;
@ -250,7 +256,7 @@ export default {
deleteTag(item) { deleteTag(item) {
if (item.new) { if (item.new) {
// Undo Adding a new Tag // Undo Adding a new Tag
this.newTags = this.newTags.filter(tag => !(tag.name == item.name && tag.value == item.value)); this.newTags = this.newTags.filter(tag => !(tag.name === item.name && tag.value === item.value));
} else { } else {
// Remove an Existing Tag // Remove an Existing Tag
this.deleteTags.push(item); this.deleteTags.push(item);
@ -266,9 +272,9 @@ export default {
addDraftTag() { addDraftTag() {
console.log("Adding Draft Tag: ", this.newDraftTag); console.log("Adding Draft Tag: ", this.newDraftTag);
if (this.newDraftTag.select != null) { if (this.newDraftTag.select != null) {
if (this.deleteTags.find(tag => tag.name == this.newDraftTag.select.name && tag.value == this.newDraftTag.value)) { if (this.deleteTags.find(tag => tag.name === this.newDraftTag.select.name && tag.value === this.newDraftTag.value)) {
// Undo removing a tag // Undo removing a tag
this.deleteTags = this.deleteTags.filter(tag => !(tag.name == this.newDraftTag.select.name && tag.value == this.newDraftTag.value)); this.deleteTags = this.deleteTags.filter(tag => !(tag.name === this.newDraftTag.select.name && tag.value === this.newDraftTag.value));
} else { } else {
// Add an existing Tag // Add an existing Tag
this.newTags.push({ this.newTags.push({
@ -345,7 +351,7 @@ export default {
tagId = newTagResult.id; tagId = newTagResult.id;
// Assign the new ID to the tags of the same name & color // Assign the new ID to the tags of the same name & color
this.newTags.map(tag => { this.newTags.map(tag => {
if (tag.name == newTag.name && tag.color == newTag.color) { if (tag.name === newTag.name && tag.color === newTag.color) {
tag.id = newTagResult.id; tag.id = newTagResult.id;
} }
}); });

@ -361,13 +361,12 @@
</template> </template>
<script> <script>
import VueMultiselect from "vue-multiselect";
import { useToast } from "vue-toastification";
import CopyableInput from "../components/CopyableInput.vue";
import NotificationDialog from "../components/NotificationDialog.vue"; import NotificationDialog from "../components/NotificationDialog.vue";
import ProxyDialog from "../components/ProxyDialog.vue"; import ProxyDialog from "../components/ProxyDialog.vue";
import TagsManager from "../components/TagsManager.vue"; import TagsManager from "../components/TagsManager.vue";
import CopyableInput from "../components/CopyableInput.vue";
import { useToast } from "vue-toastification";
import VueMultiselect from "vue-multiselect";
import { genSecret, isDev } from "../util.ts"; import { genSecret, isDev } from "../util.ts";
const toast = useToast(); const toast = useToast();
@ -540,7 +539,7 @@ export default {
} }
for (let i = 0; i < this.$root.notificationList.length; i++) { for (let i = 0; i < this.$root.notificationList.length; i++) {
if (this.$root.notificationList[i].isDefault == true) { if (this.$root.notificationList[i].isDefault === true) {
this.monitor.notificationIDList[this.$root.notificationList[i].id] = true; this.monitor.notificationIDList[this.$root.notificationList[i].id] = true;
} }
} }

Loading…
Cancel
Save