[MQTT] Use existing fields instead of creating new ones (Server)

This commit is contained in:
Louis Lam 2022-01-13 11:53:08 +08:00
parent 1c8407a433
commit 6272514820
3 changed files with 1 additions and 5 deletions

View file

@ -79,11 +79,9 @@ class Monitor extends BeanModel {
pushToken: this.pushToken,
notificationIDList,
tags: tags,
mqttPort: this.mqttPort,
mqttUsername: this.mqttUsername,
mqttTopic: this.mqttTopic,
mqttSuccessMessage: this.mqttSuccessMessage
};
}
@ -354,7 +352,7 @@ class Monitor extends BeanModel {
} else if (this.type === "mqtt") {
try {
bean.msg = await mqttAsync(this.url, this.mqttTopic, this.mqttSuccessMessage, {
mqttPort: this.mqttPort,
mqttPort: this.port,
mqttUsername: this.mqttUsername,
mqttPassword: this.mqttPassword,
interval: this.interval,

View file

@ -588,7 +588,6 @@ exports.entryPage = "dashboard";
bean.dns_resolve_type = monitor.dns_resolve_type;
bean.dns_resolve_server = monitor.dns_resolve_server;
bean.pushToken = monitor.pushToken;
bean.mqttPort = monitor.mqttPort;
bean.mqttUsername = monitor.mqttUsername;
bean.mqttTopic = monitor.mqttTopic;
bean.mqttSuccessMessage = monitor.mqttSuccessMessage;

View file

@ -472,7 +472,6 @@ export default {
accepted_statuscodes: ["200-299"],
dns_resolve_type: "A",
dns_resolve_server: "1.1.1.1",
mqttPort: "",
mqttUsername: "",
mqttPassword: "",
mqttTopic: "",