diff --git a/server/model/maintenance.js b/server/model/maintenance.js index 4958a203..55308895 100644 --- a/server/model/maintenance.js +++ b/server/model/maintenance.js @@ -17,7 +17,7 @@ class Maintenance extends BeanModel { title: this.title, description: this.description, start_date: this.start_date, - end_date: this.end_date + end_date: this.end_date, }; } @@ -30,7 +30,7 @@ class Maintenance extends BeanModel { title: this.title, description: this.description, start_date: this.start_date, - end_date: this.end_date + end_date: this.end_date, }; } } diff --git a/server/model/monitor.js b/server/model/monitor.js index cd62ec6b..b6140c13 100644 --- a/server/model/monitor.js +++ b/server/model/monitor.js @@ -6,7 +6,7 @@ dayjs.extend(utc); dayjs.extend(timezone); const axios = require("axios"); const { Prometheus } = require("../prometheus"); -const { debug, UP, DOWN, PENDING, MAINTENANCE, flipStatus, TimeLogger} = require("../../src/util"); +const { debug, UP, DOWN, PENDING, MAINTENANCE, flipStatus, TimeLogger } = require("../../src/util"); const { tcping, ping, dnsResolve, checkCertificate, checkStatusCode, getTotalClientInRoom, setting, errorLog } = require("../util-server"); const { R } = require("redbean-node"); const { BeanModel } = require("redbean-node/dist/bean-model"); diff --git a/server/routers/api-router.js b/server/routers/api-router.js index 19e4fcad..472a837d 100644 --- a/server/routers/api-router.js +++ b/server/routers/api-router.js @@ -5,7 +5,7 @@ const server = require("../server"); const apicache = require("../modules/apicache"); const Monitor = require("../model/monitor"); const dayjs = require("dayjs"); -const { UP, MAINTENANCE, flipStatus, debug} = require("../../src/util"); +const { UP, MAINTENANCE, flipStatus, debug } = require("../../src/util"); let router = express.Router(); let cache = apicache.middleware; diff --git a/src/components/MonitorList.vue b/src/components/MonitorList.vue index d943efff..4e6610ad 100644 --- a/src/components/MonitorList.vue +++ b/src/components/MonitorList.vue @@ -66,7 +66,7 @@ import HeartbeatBar from "../components/HeartbeatBar.vue"; import Uptime from "../components/Uptime.vue"; import Tag from "../components/Tag.vue"; -import {getMaintenanceRelativeURL, getMonitorRelativeURL} from "../util.ts"; +import {getMaintenanceRelativeURL, getMonitorRelativeURL } from "../util.ts"; export default { components: { @@ -82,7 +82,7 @@ export default { data() { return { searchText: "", - selectedList: "monitor" + selectedList: "monitor", }; }, computed: { diff --git a/src/languages/en.js b/src/languages/en.js index 3edcc556..ce659466 100644 --- a/src/languages/en.js +++ b/src/languages/en.js @@ -7,7 +7,20 @@ export default { upsideDownModeDescription: "Flip the status upside down. If the service is reachable, it is DOWN.", maxRedirectDescription: "Maximum number of redirects to follow. Set to 0 to disable redirects.", acceptedStatusCodesDescription: "Select status codes which are considered as a successful response.", + Maintenance: "Maintenance", + "Monitor List": "Monitor List", + "Maintenance List": "Maintenance List", + "Schedule maintenance": "Schedule maintenance", + "Affected Monitors": "Affected Monitors", + "Pick Affected Monitors...": "Pick Affected Monitors...", + "Start of maintenance": "Start of maintenance", + "Expected end of maintenance": "Expected end of maintenance", + Start: "Start", + End: "End", affectedMonitorsDescription: "Select monitors that are affected by current maintenance", + atLeastOneMonitor: "Select at least one affected monitor", + maintenanceTitleExample: "Network infrastructure maintenance", + maintenanceDescriptionExample: "Example: Network infrastructure maintenance is underway which will affect some of our services.", passwordNotMatchMsg: "The repeat password does not match.", notificationDescription: "Notifications must be assigned to a monitor to function.", keywordDescription: "Search keyword in plain HTML or JSON response. The search is case-sensitive.", @@ -40,7 +53,10 @@ export default { "Check Update On GitHub": "Check Update On GitHub", List: "List", Add: "Add", + "Add Monitor": "Add Monitor", + "Add Maintenance": "Add Maintenance", "Add New Monitor": "Add New Monitor", + "Add New Maintenance": "Add New Maintenance", "Quick Stats": "Quick Stats", Up: "Up", Down: "Down", @@ -114,6 +130,7 @@ export default { "Remember me": "Remember me", Login: "Login", "No Monitors, please": "No Monitors, please", + "No Maintenance, please": "No Maintenance, please", "add one": "add one", "Notification Type": "Notification Type", Email: "Email", diff --git a/src/pages/EditMaintenance.vue b/src/pages/EditMaintenance.vue index 144b398a..6b6f8057 100644 --- a/src/pages/EditMaintenance.vue +++ b/src/pages/EditMaintenance.vue @@ -114,16 +114,15 @@ export default { }, titlePlaceholder() { - return this.$t("Network infrastructure maintenance"); + return this.$t("maintenanceTitleExample"); }, descriptionPlaceholder() { - return this.$t("Example: Network infrastructure maintenance is underway which will affect some of our services."); + return this.$t("maintenanceDescriptionExample"); } }, watch: { - "$route.fullPath"() { this.init(); } @@ -137,7 +136,7 @@ export default { Object.values(this.$root.monitorList).map(monitor => { this.affectedMonitorsOptions.push({ id: monitor.id, - name: monitor.name + name: monitor.name, }); }); } @@ -173,14 +172,13 @@ export default { } }); } - }, async submit() { this.processing = true; if (this.affectedMonitors.length === 0) { - toast.error(this.$t("Select at least one affected monitor")); + toast.error(this.$t("atLeastOneMonitor")); return this.processing = false; } diff --git a/src/pages/MaintenanceDetails.vue b/src/pages/MaintenanceDetails.vue index e3e4b59b..77d70078 100644 --- a/src/pages/MaintenanceDetails.vue +++ b/src/pages/MaintenanceDetails.vue @@ -3,9 +3,9 @@
- Start: {{ $root.datetimeMaintenance(maintenance.start_date) }}
+ {{$t("Start")}}: {{ $root.datetimeMaintenance(maintenance.start_date) }}
- End: {{ $root.datetimeMaintenance(maintenance.end_date) }}
+ {{$t("End")}}: {{ $root.datetimeMaintenance(maintenance.end_date) }}