mirror of
https://github.com/louislam/uptime-kuma.git
synced 2024-10-01 01:25:45 -04:00
fix(edit-monitor): add translations to en.js
This commit is contained in:
parent
6b44116245
commit
afeb424dc0
@ -195,4 +195,12 @@ export default {
|
|||||||
"pushbullet": "Pushbullet",
|
"pushbullet": "Pushbullet",
|
||||||
"line": "Line Messenger",
|
"line": "Line Messenger",
|
||||||
"mattermost": "Mattermost",
|
"mattermost": "Mattermost",
|
||||||
|
Method: "Method",
|
||||||
|
Body: "Body",
|
||||||
|
Headers: "Headers",
|
||||||
|
PushUrl: "Push URL",
|
||||||
|
HeadersInvalidFormat: "Headers do not have a valid format: \"key: value <new line> key: value <new line>...\"",
|
||||||
|
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",
|
||||||
};
|
};
|
||||||
|
@ -86,7 +86,7 @@
|
|||||||
|
|
||||||
<!-- Push URL -->
|
<!-- Push URL -->
|
||||||
<div v-if="monitor.type === 'push' " class="my-3">
|
<div v-if="monitor.type === 'push' " class="my-3">
|
||||||
<label for="push-url" class="form-label">{{ $t("Push URL") }}</label>
|
<label for="push-url" class="form-label">{{ $t("PushUrl") }}</label>
|
||||||
<CopyableInput id="push-url" v-model="pushURL" type="url" disabled="disabled" />
|
<CopyableInput id="push-url" v-model="pushURL" type="url" disabled="disabled" />
|
||||||
<div class="form-text">
|
<div class="form-text">
|
||||||
You should call this url every {{ monitor.interval }} seconds.<br />
|
You should call this url every {{ monitor.interval }} seconds.<br />
|
||||||
@ -328,15 +328,11 @@ export default {
|
|||||||
},
|
},
|
||||||
|
|
||||||
bodyPlaceholder() {
|
bodyPlaceholder() {
|
||||||
return `{
|
return this.$t("BodyPlaceholder");
|
||||||
"id": 124357,
|
|
||||||
"username": "admin",
|
|
||||||
"password": "myAdminPassword"
|
|
||||||
}`;
|
|
||||||
},
|
},
|
||||||
|
|
||||||
headersPlaceholder() {
|
headersPlaceholder() {
|
||||||
return "Authorization: Bearer abc123\nContent-Type: application/json";
|
return this.$t("HeadersPlaceholder");
|
||||||
}
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
@ -441,13 +437,13 @@ export default {
|
|||||||
try {
|
try {
|
||||||
JSON.parse(this.monitor.body);
|
JSON.parse(this.monitor.body);
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
toast.error(this.$t("The request body is not valid JSON: ") + err.message);
|
toast.error(this.$t("BodyInvalidFormat") + err.message);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (this.monitor.headers) {
|
if (this.monitor.headers) {
|
||||||
if (!/^([^:]+:.*)([\s]+[^:]+:.*)+$/g.test(this.monitor.headers)) {
|
if (!/^([^:]+:.*)([\s]+[^:]+:.*)+$/g.test(this.monitor.headers)) {
|
||||||
toast.error(this.$t("Headers do not have a valid format: \"key: value<new line>key: value<new line>...\""));
|
toast.error(this.$t("HeadersInvalidFormat"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user