Compare commits

...

4 Commits

4 changed files with 98 additions and 2 deletions

View 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();
});
};

View File

@ -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;
}
}

View 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>

View File

@ -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,
},