mirror of
https://github.com/louislam/uptime-kuma.git
synced 2024-12-16 11:14:38 -05:00
Feat: Allow MQTT successMessage to be optional
This commit is contained in:
parent
c28b90feb4
commit
cd38dd3f68
@ -135,10 +135,10 @@ exports.mqttAsync = function (hostname, topic, okMessage, options = {}) {
|
||||
if (messageTopic == topic) {
|
||||
client.end();
|
||||
clearTimeout(timeoutID);
|
||||
if (message.toString() === okMessage) {
|
||||
resolve(`Topic: ${messageTopic}; Message: ${message.toString()}`);
|
||||
if (okMessage != null && okMessage !== "" && message.toString() !== okMessage) {
|
||||
reject(new Error(`Message Mismatch - Topic: ${messageTopic}; Message: ${message.toString()}`));
|
||||
} else {
|
||||
reject(new Error(`Error; Topic: ${messageTopic}; Message: ${message.toString()}`));
|
||||
resolve(`Topic: ${messageTopic}; Message: ${message.toString()}`);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
@ -141,7 +141,7 @@
|
||||
|
||||
<div class="my-3">
|
||||
<label for="mqttSuccessMessage" class="form-label">MQTT {{ $t("successMessage") }}</label>
|
||||
<input id="mqttSuccessMessage" v-model="monitor.mqttSuccessMessage" type="text" class="form-control" required>
|
||||
<input id="mqttSuccessMessage" v-model="monitor.mqttSuccessMessage" type="text" class="form-control">
|
||||
<div class="form-text">
|
||||
{{ $t("successMessageExplanation") }}
|
||||
</div>
|
||||
|
Loading…
Reference in New Issue
Block a user