chore: no unused mainteance details and other v-if="false" (#6590)
This commit is contained in:
commit
b6ec3b2e96
@ -15,10 +15,6 @@
|
|||||||
<span v-else-if="!running" class="text-danger">{{ $t("Not running") }}</span>
|
<span v-else-if="!running" class="text-danger">{{ $t("Not running") }}</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div v-if="false">
|
|
||||||
{{ message }}
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div v-if="errorMessage" class="mt-3">
|
<div v-if="errorMessage" class="mt-3">
|
||||||
{{ $t("Message:") }}
|
{{ $t("Message:") }}
|
||||||
<textarea v-model="errorMessage" class="form-control" readonly></textarea>
|
<textarea v-model="errorMessage" class="form-control" readonly></textarea>
|
||||||
|
|||||||
@ -1277,14 +1277,6 @@
|
|||||||
<label for="body" class="form-label">{{ $t("Body") }}</label>
|
<label for="body" class="form-label">{{ $t("Body") }}</label>
|
||||||
<textarea id="body" v-model="monitor.grpcBody" class="form-control" :placeholder="bodyPlaceholder"></textarea>
|
<textarea id="body" v-model="monitor.grpcBody" class="form-control" :placeholder="bodyPlaceholder"></textarea>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Metadata: temporary disable waiting for next PR allow to send gRPC with metadata -->
|
|
||||||
<template v-if="false">
|
|
||||||
<div class="my-3">
|
|
||||||
<label for="metadata" class="form-label">{{ $t("Metadata") }}</label>
|
|
||||||
<textarea id="metadata" v-model="monitor.grpcMetadata" class="form-control" :placeholder="headersPlaceholder"></textarea>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
</template>
|
</template>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -1,169 +0,0 @@
|
|||||||
<template>
|
|
||||||
<transition name="slide-fade" appear>
|
|
||||||
<div v-if="maintenance">
|
|
||||||
<h1>{{ maintenance.title }}</h1>
|
|
||||||
<p class="url">
|
|
||||||
<span>{{ $t("Start") }}: {{ $root.datetimeMaintenance(maintenance.start_date) }}</span>
|
|
||||||
<br>
|
|
||||||
<span>{{ $t("End") }}: {{ $root.datetimeMaintenance(maintenance.end_date) }}</span>
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<div class="functions" style="margin-top: 10px;">
|
|
||||||
<router-link :to=" '/maintenance/edit/' + maintenance.id " class="btn btn-secondary">
|
|
||||||
<font-awesome-icon icon="edit" /> {{ $t("Edit") }}
|
|
||||||
</router-link>
|
|
||||||
<button class="btn btn-danger" @click="deleteDialog">
|
|
||||||
<font-awesome-icon icon="trash" /> {{ $t("Delete") }}
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<label for="description" class="form-label" style="margin-top: 20px;">{{ $t("Description") }}</label>
|
|
||||||
<textarea id="description" v-model="maintenance.description" class="form-control" disabled></textarea>
|
|
||||||
|
|
||||||
<label for="affected_monitors" class="form-label" style="margin-top: 20px;">{{ $t("Affected Monitors") }}</label>
|
|
||||||
<br>
|
|
||||||
<button v-for="monitor in affectedMonitors" :key="monitor.id" class="btn btn-monitor" style="margin: 5px; cursor: auto; color: white; font-weight: 500;">
|
|
||||||
{{ monitor }}
|
|
||||||
</button>
|
|
||||||
<br />
|
|
||||||
|
|
||||||
<label for="selected_status_pages" class="form-label" style="margin-top: 20px;">{{ $t("Show this Maintenance Message on which Status Pages") }}</label>
|
|
||||||
<br>
|
|
||||||
<button v-for="statusPage in selectedStatusPages" :key="statusPage.id" class="btn btn-monitor" style="margin: 5px; cursor: auto; color: white; font-weight: 500;">
|
|
||||||
{{ statusPage }}
|
|
||||||
</button>
|
|
||||||
|
|
||||||
<Confirm ref="confirmDelete" btn-style="btn-danger" :yes-text="$t('Yes')" :no-text="$t('No')" @yes="deleteMaintenance">
|
|
||||||
{{ $t("deleteMaintenanceMsg") }}
|
|
||||||
</Confirm>
|
|
||||||
</div>
|
|
||||||
</transition>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
import { useToast } from "vue-toastification";
|
|
||||||
const toast = useToast();
|
|
||||||
import Confirm from "../components/Confirm.vue";
|
|
||||||
|
|
||||||
export default {
|
|
||||||
components: {
|
|
||||||
Confirm,
|
|
||||||
},
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
affectedMonitors: [],
|
|
||||||
selectedStatusPages: [],
|
|
||||||
};
|
|
||||||
},
|
|
||||||
computed: {
|
|
||||||
maintenance() {
|
|
||||||
let id = this.$route.params.id;
|
|
||||||
return this.$root.maintenanceList[id];
|
|
||||||
},
|
|
||||||
},
|
|
||||||
mounted() {
|
|
||||||
this.init();
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
/**
|
|
||||||
* Initialise page
|
|
||||||
* @returns {void}
|
|
||||||
*/
|
|
||||||
init() {
|
|
||||||
this.$root.getSocket().emit("getMonitorMaintenance", this.$route.params.id, (res) => {
|
|
||||||
if (res.ok) {
|
|
||||||
this.affectedMonitors = Object.values(res.monitors).map(monitor => monitor.name);
|
|
||||||
} else {
|
|
||||||
toast.error(res.msg);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
this.$root.getSocket().emit("getMaintenanceStatusPage", this.$route.params.id, (res) => {
|
|
||||||
if (res.ok) {
|
|
||||||
this.selectedStatusPages = Object.values(res.statusPages).map(statusPage => statusPage.title);
|
|
||||||
} else {
|
|
||||||
toast.error(res.msg);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Confirm deletion
|
|
||||||
* @returns {void}
|
|
||||||
*/
|
|
||||||
deleteDialog() {
|
|
||||||
this.$refs.confirmDelete.show();
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Delete maintenance after showing confirmation
|
|
||||||
* @returns {void}
|
|
||||||
*/
|
|
||||||
deleteMaintenance() {
|
|
||||||
this.$root.deleteMaintenance(this.maintenance.id, (res) => {
|
|
||||||
this.$root.toastRes(res);
|
|
||||||
this.$router.push("/maintenance");
|
|
||||||
});
|
|
||||||
},
|
|
||||||
},
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
|
||||||
@import "../assets/vars.scss";
|
|
||||||
|
|
||||||
@media (max-width: 550px) {
|
|
||||||
.functions {
|
|
||||||
text-align: center;
|
|
||||||
|
|
||||||
button, a {
|
|
||||||
margin-left: 10px !important;
|
|
||||||
margin-right: 10px !important;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@media (max-width: 400px) {
|
|
||||||
.btn {
|
|
||||||
display: inline-flex;
|
|
||||||
flex-direction: column;
|
|
||||||
align-items: center;
|
|
||||||
padding-top: 10px;
|
|
||||||
}
|
|
||||||
|
|
||||||
a.btn {
|
|
||||||
padding-left: 25px;
|
|
||||||
padding-right: 25px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.url {
|
|
||||||
color: $primary;
|
|
||||||
margin-bottom: 20px;
|
|
||||||
font-weight: bold;
|
|
||||||
|
|
||||||
a {
|
|
||||||
color: $primary;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.functions {
|
|
||||||
button, a {
|
|
||||||
margin-right: 20px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
textarea {
|
|
||||||
min-height: 100px;
|
|
||||||
resize: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
.btn-monitor {
|
|
||||||
background-color: #5cdd8b;
|
|
||||||
}
|
|
||||||
|
|
||||||
.dark .btn-monitor {
|
|
||||||
color: #020b05 !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
</style>
|
|
||||||
@ -28,7 +28,6 @@
|
|||||||
></div>
|
></div>
|
||||||
<div class="info">
|
<div class="info">
|
||||||
<div class="title">{{ item.title }}</div>
|
<div class="title">{{ item.title }}</div>
|
||||||
<div v-if="false">{{ item.description }}</div>
|
|
||||||
<div class="status">
|
<div class="status">
|
||||||
{{ $t("maintenanceStatus-" + item.status) }}
|
{{ $t("maintenanceStatus-" + item.status) }}
|
||||||
</div>
|
</div>
|
||||||
@ -38,8 +37,6 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="buttons">
|
<div class="buttons">
|
||||||
<router-link v-if="false" :to="maintenanceURL(item.id)" class="btn btn-light">{{ $t("Details") }}</router-link>
|
|
||||||
|
|
||||||
<div class="btn-group" role="group">
|
<div class="btn-group" role="group">
|
||||||
<button v-if="item.active" class="btn btn-normal" :aria-label="$t('ariaPauseMaintenance')" @click="pauseDialog(item.id)">
|
<button v-if="item.active" class="btn btn-normal" :aria-label="$t('ariaPauseMaintenance')" @click="pauseDialog(item.id)">
|
||||||
<font-awesome-icon icon="pause" /> {{ $t("Pause") }}
|
<font-awesome-icon icon="pause" /> {{ $t("Pause") }}
|
||||||
@ -82,7 +79,6 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { getResBaseURL } from "../util-frontend";
|
import { getResBaseURL } from "../util-frontend";
|
||||||
import { getMaintenanceRelativeURL } from "../util.ts";
|
|
||||||
import Confirm from "../components/Confirm.vue";
|
import Confirm from "../components/Confirm.vue";
|
||||||
import MaintenanceTime from "../components/MaintenanceTime.vue";
|
import MaintenanceTime from "../components/MaintenanceTime.vue";
|
||||||
|
|
||||||
@ -135,15 +131,6 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
|
||||||
* Get maintenance URL
|
|
||||||
* @param {number} id ID of maintenance to read
|
|
||||||
* @returns {string} Relative URL
|
|
||||||
*/
|
|
||||||
maintenanceURL(id) {
|
|
||||||
return getMaintenanceRelativeURL(id);
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Show delete confirmation
|
* Show delete confirmation
|
||||||
* @param {number} maintenanceID ID of maintenance to show delete
|
* @param {number} maintenanceID ID of maintenance to show delete
|
||||||
|
|||||||
@ -74,11 +74,6 @@
|
|||||||
<label class="form-check-label" for="show-only-last-heartbeat">{{ $t("showOnlyLastHeartbeat") }}</label>
|
<label class="form-check-label" for="show-only-last-heartbeat">{{ $t("showOnlyLastHeartbeat") }}</label>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div v-if="false" class="my-3">
|
|
||||||
<label for="password" class="form-label">{{ $t("Password") }} <sup>{{ $t("Coming Soon") }}</sup></label>
|
|
||||||
<input id="password" v-model="config.password" disabled type="password" autocomplete="new-password" class="form-control">
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- Domain Name List -->
|
<!-- Domain Name List -->
|
||||||
<div class="my-3">
|
<div class="my-3">
|
||||||
<label class="form-label">
|
<label class="form-label">
|
||||||
|
|||||||
@ -16,7 +16,6 @@ import ManageStatusPage from "./pages/ManageStatusPage.vue";
|
|||||||
import AddStatusPage from "./pages/AddStatusPage.vue";
|
import AddStatusPage from "./pages/AddStatusPage.vue";
|
||||||
import NotFound from "./pages/NotFound.vue";
|
import NotFound from "./pages/NotFound.vue";
|
||||||
import DockerHosts from "./components/settings/Docker.vue";
|
import DockerHosts from "./components/settings/Docker.vue";
|
||||||
import MaintenanceDetails from "./pages/MaintenanceDetails.vue";
|
|
||||||
import ManageMaintenance from "./pages/ManageMaintenance.vue";
|
import ManageMaintenance from "./pages/ManageMaintenance.vue";
|
||||||
import APIKeys from "./components/settings/APIKeys.vue";
|
import APIKeys from "./components/settings/APIKeys.vue";
|
||||||
import SetupDatabase from "./pages/SetupDatabase.vue";
|
import SetupDatabase from "./pages/SetupDatabase.vue";
|
||||||
@ -150,10 +149,6 @@ const routes = [
|
|||||||
path: "/maintenance",
|
path: "/maintenance",
|
||||||
component: ManageMaintenance,
|
component: ManageMaintenance,
|
||||||
},
|
},
|
||||||
{
|
|
||||||
path: "/maintenance/:id",
|
|
||||||
component: MaintenanceDetails,
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
path: "/add-maintenance",
|
path: "/add-maintenance",
|
||||||
component: EditMaintenance,
|
component: EditMaintenance,
|
||||||
|
|||||||
@ -11,7 +11,7 @@
|
|||||||
var _a;
|
var _a;
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
exports.CONSOLE_STYLE_FgPink = exports.CONSOLE_STYLE_FgBrown = exports.CONSOLE_STYLE_FgViolet = exports.CONSOLE_STYLE_FgLightBlue = exports.CONSOLE_STYLE_FgLightGreen = exports.CONSOLE_STYLE_FgOrange = exports.CONSOLE_STYLE_FgGray = exports.CONSOLE_STYLE_FgWhite = exports.CONSOLE_STYLE_FgCyan = exports.CONSOLE_STYLE_FgMagenta = exports.CONSOLE_STYLE_FgBlue = exports.CONSOLE_STYLE_FgYellow = exports.CONSOLE_STYLE_FgGreen = exports.CONSOLE_STYLE_FgRed = exports.CONSOLE_STYLE_FgBlack = exports.CONSOLE_STYLE_Hidden = exports.CONSOLE_STYLE_Reverse = exports.CONSOLE_STYLE_Blink = exports.CONSOLE_STYLE_Underscore = exports.CONSOLE_STYLE_Dim = exports.CONSOLE_STYLE_Bright = exports.CONSOLE_STYLE_Reset = exports.PING_PER_REQUEST_TIMEOUT_DEFAULT = exports.PING_PER_REQUEST_TIMEOUT_MAX = exports.PING_PER_REQUEST_TIMEOUT_MIN = exports.PING_COUNT_DEFAULT = exports.PING_COUNT_MAX = exports.PING_COUNT_MIN = exports.PING_GLOBAL_TIMEOUT_DEFAULT = exports.PING_GLOBAL_TIMEOUT_MAX = exports.PING_GLOBAL_TIMEOUT_MIN = exports.PING_PACKET_SIZE_DEFAULT = exports.PING_PACKET_SIZE_MAX = exports.PING_PACKET_SIZE_MIN = exports.MIN_INTERVAL_SECOND = exports.MAX_INTERVAL_SECOND = exports.SQL_DATETIME_FORMAT_WITHOUT_SECOND = exports.SQL_DATETIME_FORMAT = exports.SQL_DATE_FORMAT = exports.STATUS_PAGE_MAINTENANCE = exports.STATUS_PAGE_PARTIAL_DOWN = exports.STATUS_PAGE_ALL_UP = exports.STATUS_PAGE_ALL_DOWN = exports.MAINTENANCE = exports.PENDING = exports.UP = exports.DOWN = exports.appName = exports.isNode = exports.isDev = void 0;
|
exports.CONSOLE_STYLE_FgPink = exports.CONSOLE_STYLE_FgBrown = exports.CONSOLE_STYLE_FgViolet = exports.CONSOLE_STYLE_FgLightBlue = exports.CONSOLE_STYLE_FgLightGreen = exports.CONSOLE_STYLE_FgOrange = exports.CONSOLE_STYLE_FgGray = exports.CONSOLE_STYLE_FgWhite = exports.CONSOLE_STYLE_FgCyan = exports.CONSOLE_STYLE_FgMagenta = exports.CONSOLE_STYLE_FgBlue = exports.CONSOLE_STYLE_FgYellow = exports.CONSOLE_STYLE_FgGreen = exports.CONSOLE_STYLE_FgRed = exports.CONSOLE_STYLE_FgBlack = exports.CONSOLE_STYLE_Hidden = exports.CONSOLE_STYLE_Reverse = exports.CONSOLE_STYLE_Blink = exports.CONSOLE_STYLE_Underscore = exports.CONSOLE_STYLE_Dim = exports.CONSOLE_STYLE_Bright = exports.CONSOLE_STYLE_Reset = exports.PING_PER_REQUEST_TIMEOUT_DEFAULT = exports.PING_PER_REQUEST_TIMEOUT_MAX = exports.PING_PER_REQUEST_TIMEOUT_MIN = exports.PING_COUNT_DEFAULT = exports.PING_COUNT_MAX = exports.PING_COUNT_MIN = exports.PING_GLOBAL_TIMEOUT_DEFAULT = exports.PING_GLOBAL_TIMEOUT_MAX = exports.PING_GLOBAL_TIMEOUT_MIN = exports.PING_PACKET_SIZE_DEFAULT = exports.PING_PACKET_SIZE_MAX = exports.PING_PACKET_SIZE_MIN = exports.MIN_INTERVAL_SECOND = exports.MAX_INTERVAL_SECOND = exports.SQL_DATETIME_FORMAT_WITHOUT_SECOND = exports.SQL_DATETIME_FORMAT = exports.SQL_DATE_FORMAT = exports.STATUS_PAGE_MAINTENANCE = exports.STATUS_PAGE_PARTIAL_DOWN = exports.STATUS_PAGE_ALL_UP = exports.STATUS_PAGE_ALL_DOWN = exports.MAINTENANCE = exports.PENDING = exports.UP = exports.DOWN = exports.appName = exports.isNode = exports.isDev = void 0;
|
||||||
exports.evaluateJsonQuery = exports.intHash = exports.localToUTC = exports.utcToLocal = exports.utcToISODateTime = exports.isoToUTCDateTime = exports.parseTimeFromTimeObject = exports.parseTimeObject = exports.getMaintenanceRelativeURL = exports.getMonitorRelativeURL = exports.genSecret = exports.getCryptoRandomInt = exports.getRandomInt = exports.getRandomArbitrary = exports.TimeLogger = exports.polyfill = exports.log = exports.debug = exports.ucfirst = exports.sleep = exports.flipStatus = exports.badgeConstants = exports.CONSOLE_STYLE_BgGray = exports.CONSOLE_STYLE_BgWhite = exports.CONSOLE_STYLE_BgCyan = exports.CONSOLE_STYLE_BgMagenta = exports.CONSOLE_STYLE_BgBlue = exports.CONSOLE_STYLE_BgYellow = exports.CONSOLE_STYLE_BgGreen = exports.CONSOLE_STYLE_BgRed = exports.CONSOLE_STYLE_BgBlack = void 0;
|
exports.evaluateJsonQuery = exports.intHash = exports.localToUTC = exports.utcToLocal = exports.utcToISODateTime = exports.isoToUTCDateTime = exports.parseTimeFromTimeObject = exports.parseTimeObject = exports.getMonitorRelativeURL = exports.genSecret = exports.getCryptoRandomInt = exports.getRandomInt = exports.getRandomArbitrary = exports.TimeLogger = exports.polyfill = exports.log = exports.debug = exports.ucfirst = exports.sleep = exports.flipStatus = exports.badgeConstants = exports.CONSOLE_STYLE_BgGray = exports.CONSOLE_STYLE_BgWhite = exports.CONSOLE_STYLE_BgCyan = exports.CONSOLE_STYLE_BgMagenta = exports.CONSOLE_STYLE_BgBlue = exports.CONSOLE_STYLE_BgYellow = exports.CONSOLE_STYLE_BgGreen = exports.CONSOLE_STYLE_BgRed = exports.CONSOLE_STYLE_BgBlack = void 0;
|
||||||
const dayjs_1 = require("dayjs");
|
const dayjs_1 = require("dayjs");
|
||||||
const jsonata = require("jsonata");
|
const jsonata = require("jsonata");
|
||||||
exports.isDev = process.env.NODE_ENV === "development";
|
exports.isDev = process.env.NODE_ENV === "development";
|
||||||
@ -321,10 +321,6 @@ function getMonitorRelativeURL(id) {
|
|||||||
return "/dashboard/" + id;
|
return "/dashboard/" + id;
|
||||||
}
|
}
|
||||||
exports.getMonitorRelativeURL = getMonitorRelativeURL;
|
exports.getMonitorRelativeURL = getMonitorRelativeURL;
|
||||||
function getMaintenanceRelativeURL(id) {
|
|
||||||
return "/maintenance/" + id;
|
|
||||||
}
|
|
||||||
exports.getMaintenanceRelativeURL = getMaintenanceRelativeURL;
|
|
||||||
function parseTimeObject(time) {
|
function parseTimeObject(time) {
|
||||||
if (!time) {
|
if (!time) {
|
||||||
return {
|
return {
|
||||||
|
|||||||
@ -534,15 +534,6 @@ export function getMonitorRelativeURL(id: string) {
|
|||||||
return "/dashboard/" + id;
|
return "/dashboard/" + id;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Get relative path for maintenance
|
|
||||||
* @param id ID of maintenance
|
|
||||||
* @returns Formatted relative path
|
|
||||||
*/
|
|
||||||
export function getMaintenanceRelativeURL(id: string) {
|
|
||||||
return "/maintenance/" + id;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Parse to Time Object that used in VueDatePicker
|
* Parse to Time Object that used in VueDatePicker
|
||||||
* @param {string} time E.g. 12:00
|
* @param {string} time E.g. 12:00
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user