mirror of
https://github.com/louislam/uptime-kuma.git
synced 2025-04-20 23:46:39 -04:00
Compare commits
4 Commits
18a2c8168b
...
7a94fc86cd
Author | SHA1 | Date | |
---|---|---|---|
![]() |
7a94fc86cd | ||
![]() |
b8f3541a30 | ||
![]() |
4042085fbb | ||
![]() |
10a518e72e |
13
db/knex_migrations/2025-03-25-0127-fix-5721.js
Normal file
13
db/knex_migrations/2025-03-25-0127-fix-5721.js
Normal file
@ -0,0 +1,13 @@
|
||||
// Fix #5721: Change proxy port column type to integer to support larger port numbers
|
||||
exports.up = function (knex) {
|
||||
return knex.schema
|
||||
.alterTable("proxy", function (table) {
|
||||
table.integer("port").alter();
|
||||
});
|
||||
};
|
||||
|
||||
exports.down = function (knex) {
|
||||
return knex.schema.alterTable("proxy", function (table) {
|
||||
table.smallint("port").alter();
|
||||
});
|
||||
};
|
@ -1777,11 +1777,11 @@ class Monitor extends BeanModel {
|
||||
]);
|
||||
|
||||
if (healthCheckMonitor) {
|
||||
return healthCheckMonitor.id === UP;
|
||||
return healthCheckMonitor.status === UP;
|
||||
}
|
||||
|
||||
// Default to indicative of being healthy, this shouldn't happen
|
||||
// Better to be safe if we can't find the selector monitor, it may have been deleted
|
||||
// Better to be safe if we can't find the selected monitor, it may have been deleted
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
80
src/components/HealthCheckAlert.vue
Normal file
80
src/components/HealthCheckAlert.vue
Normal file
@ -0,0 +1,80 @@
|
||||
<template>
|
||||
<div v-if="! healthCheckStatus" id="health-check" class="d-flex flex-wrap py-3 mx-4">
|
||||
<div class="alert alert-danger w-100 d-inline-flex align-items-center justify-content-between">
|
||||
<div class="px-3">Monitoring is paused, the health check monitor is down!</div>
|
||||
<div>
|
||||
<router-link :to="monitorURL(healthCheckMonitor.id)" class="btn btn-danger text-nowrap">
|
||||
View {{ healthCheckMonitor.name }}
|
||||
</router-link>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { UP } from "../util.ts";
|
||||
import { getMonitorRelativeURL } from "../util.ts";
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
settings: {},
|
||||
};
|
||||
},
|
||||
|
||||
computed: {
|
||||
/**
|
||||
* Find the designated health check monitor from the monitor list
|
||||
* @returns {*|null} A monitor object if the health check monitor id is set
|
||||
*/
|
||||
healthCheckMonitor() {
|
||||
const healthCheckMonitorId = this.settings?.healthCheckMonitorId;
|
||||
|
||||
if (this.$root.monitorList[healthCheckMonitorId]) {
|
||||
return this.$root.monitorList[healthCheckMonitorId];
|
||||
}
|
||||
|
||||
return null;
|
||||
},
|
||||
|
||||
/**
|
||||
* Determines if the designated health check monitor is down
|
||||
* @returns {boolean} The health check monitor status
|
||||
*/
|
||||
healthCheckStatus() {
|
||||
const healthCheckMonitorId = this.healthCheckMonitor?.id;
|
||||
|
||||
if (healthCheckMonitorId in this.$root.lastHeartbeatList && this.$root.lastHeartbeatList[healthCheckMonitorId]) {
|
||||
return this.$root.lastHeartbeatList[healthCheckMonitorId].status === UP;
|
||||
}
|
||||
|
||||
return true;
|
||||
},
|
||||
},
|
||||
|
||||
mounted() {
|
||||
this.loadSettings();
|
||||
},
|
||||
|
||||
methods: {
|
||||
/**
|
||||
* Load settings from server
|
||||
* @returns {void}
|
||||
*/
|
||||
loadSettings() {
|
||||
this.$root.getSocket().emit("getSettings", (res) => {
|
||||
this.settings = res.data;
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* Get URL of monitor
|
||||
* @param {number} id ID of monitor
|
||||
* @returns {string} Relative URL of monitor
|
||||
*/
|
||||
monitorURL(id) {
|
||||
return getMonitorRelativeURL(id);
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
@ -90,6 +90,7 @@
|
||||
</header>
|
||||
|
||||
<main>
|
||||
<health-check-alert v-if="$root.loggedIn" />
|
||||
<router-view v-if="$root.loggedIn" />
|
||||
<Login v-if="! $root.loggedIn && $root.allowLoginDialog" />
|
||||
</main>
|
||||
@ -133,11 +134,13 @@
|
||||
import Login from "../components/Login.vue";
|
||||
import compareVersions from "compare-versions";
|
||||
import { useToast } from "vue-toastification";
|
||||
import HealthCheckAlert from "../components/HealthCheckAlert.vue";
|
||||
const toast = useToast();
|
||||
|
||||
export default {
|
||||
|
||||
components: {
|
||||
HealthCheckAlert,
|
||||
Login,
|
||||
},
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user