diff --git a/src/languages/en.js b/src/languages/en.js index 46298b01..db3928da 100644 --- a/src/languages/en.js +++ b/src/languages/en.js @@ -195,4 +195,12 @@ export default { "pushbullet": "Pushbullet", "line": "Line Messenger", "mattermost": "Mattermost", + Method: "Method", + Body: "Body", + Headers: "Headers", + PushUrl: "Push URL", + HeadersInvalidFormat: "Headers do not have a valid format: \"key: value key: value ...\"", + BodyInvalidFormat: "The request body is not valid JSON: ", + BodyPlaceholder: "{\n\t\"id\": 124357,\n\t\"username\": \"admin\",\n\t\"password\": \"myAdminPassword\"\n}", + HeadersPlaceholder: "Authorization: Bearer abc123\nContent-Type: application/json", }; diff --git a/src/pages/EditMonitor.vue b/src/pages/EditMonitor.vue index 30cf1da0..df3b211f 100644 --- a/src/pages/EditMonitor.vue +++ b/src/pages/EditMonitor.vue @@ -86,7 +86,7 @@
- +
You should call this url every {{ monitor.interval }} seconds.
@@ -328,15 +328,11 @@ export default { }, bodyPlaceholder() { - return `{ - "id": 124357, - "username": "admin", - "password": "myAdminPassword" -}`; + return this.$t("BodyPlaceholder"); }, headersPlaceholder() { - return "Authorization: Bearer abc123\nContent-Type: application/json"; + return this.$t("HeadersPlaceholder"); } }, @@ -441,13 +437,13 @@ export default { try { JSON.parse(this.monitor.body); } catch (err) { - toast.error(this.$t("The request body is not valid JSON: ") + err.message); + toast.error(this.$t("BodyInvalidFormat") + err.message); return false; } } if (this.monitor.headers) { if (!/^([^:]+:.*)([\s]+[^:]+:.*)+$/g.test(this.monitor.headers)) { - toast.error(this.$t("Headers do not have a valid format: \"key: valuekey: value...\"")); + toast.error(this.$t("HeadersInvalidFormat")); return false; } }