mirror of
https://github.com/louislam/uptime-kuma.git
synced 2025-05-22 14:52:35 +02:00
Fix the warning and error
This commit is contained in:
parent
5ace5c0024
commit
f18f0b1812
1 changed files with 14 additions and 12 deletions
|
@ -18,7 +18,7 @@
|
||||||
|
|
||||||
<div v-if="group.element && group.element.monitorList && group.element.monitorList.length > 1" class="sort-dropdown">
|
<div v-if="group.element && group.element.monitorList && group.element.monitorList.length > 1" class="sort-dropdown">
|
||||||
<div class="dropdown">
|
<div class="dropdown">
|
||||||
<button type="button" class="btn btn-sm btn-outline-secondary dropdown-toggle sort-button" :id="'sortDropdown' + group.index" data-bs-toggle="dropdown" aria-expanded="false">
|
<button :id="'sortDropdown' + group.index" type="button" class="btn btn-sm btn-outline-secondary dropdown-toggle sort-button" data-bs-toggle="dropdown" aria-expanded="false">
|
||||||
<div class="sort-arrows">
|
<div class="sort-arrows">
|
||||||
<font-awesome-icon
|
<font-awesome-icon
|
||||||
icon="arrow-down"
|
icon="arrow-down"
|
||||||
|
@ -212,10 +212,6 @@ export default {
|
||||||
// Listen for URL changes
|
// Listen for URL changes
|
||||||
window.addEventListener("popstate", this.handlePopState);
|
window.addEventListener("popstate", this.handlePopState);
|
||||||
},
|
},
|
||||||
beforeUnmount() {
|
|
||||||
// Remove URL change listener
|
|
||||||
window.removeEventListener("popstate", this.handlePopState);
|
|
||||||
},
|
|
||||||
watch: {
|
watch: {
|
||||||
// Watch for changes in heartbeat list, reapply sorting
|
// Watch for changes in heartbeat list, reapply sorting
|
||||||
"$root.heartbeatList": {
|
"$root.heartbeatList": {
|
||||||
|
@ -245,6 +241,10 @@ export default {
|
||||||
deep: true,
|
deep: true,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
beforeUnmount() {
|
||||||
|
// Remove URL change listener
|
||||||
|
window.removeEventListener("popstate", this.handlePopState);
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
/**
|
/**
|
||||||
* Initialize group sort settings
|
* Initialize group sort settings
|
||||||
|
@ -384,7 +384,9 @@ export default {
|
||||||
const sortDirection = group.sortDirection || "desc";
|
const sortDirection = group.sortDirection || "desc";
|
||||||
|
|
||||||
group.monitorList.sort((a, b) => {
|
group.monitorList.sort((a, b) => {
|
||||||
if (!a || !b) return 0;
|
if (!a || !b) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
let comparison = 0;
|
let comparison = 0;
|
||||||
let valueA;
|
let valueA;
|
||||||
|
@ -545,9 +547,9 @@ export default {
|
||||||
const sortParam = urlParams.get(`sort_${groupId}`);
|
const sortParam = urlParams.get(`sort_${groupId}`);
|
||||||
|
|
||||||
if (sortParam) {
|
if (sortParam) {
|
||||||
const [key, direction] = sortParam.split("_");
|
const [ key, direction ] = sortParam.split("_");
|
||||||
if (key && ["status", "name", "uptime", "cert"].includes(key) &&
|
if (key && [ "status", "name", "uptime", "cert" ].includes(key) &&
|
||||||
direction && ["asc", "desc"].includes(direction)) {
|
direction && [ "asc", "desc" ].includes(direction)) {
|
||||||
group.sortKey = key;
|
group.sortKey = key;
|
||||||
group.sortDirection = direction;
|
group.sortDirection = direction;
|
||||||
this.applySort(group);
|
this.applySort(group);
|
||||||
|
@ -569,7 +571,7 @@ export default {
|
||||||
|
|
||||||
// First clear all sort_ parameters
|
// First clear all sort_ parameters
|
||||||
const paramsToRemove = [];
|
const paramsToRemove = [];
|
||||||
for (const [key] of urlParams.entries()) {
|
for (const [ key ] of urlParams.entries()) {
|
||||||
if (key.startsWith("sort_")) {
|
if (key.startsWith("sort_")) {
|
||||||
paramsToRemove.push(key);
|
paramsToRemove.push(key);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue