|
56 | 56 | ServiceKafka serviceType = "kafka" |
57 | 57 | ServiceMail serviceType = "mail" |
58 | 58 | ServiceLdap serviceType = "ldap" |
| 59 | + ServiceMqtt serviceType = "mqtt" |
59 | 60 | ) |
60 | 61 |
|
61 | 62 | type service struct { |
@@ -138,6 +139,8 @@ func (h *handler) ServeHTTP(w http.ResponseWriter, r *http.Request) { |
138 | 139 | h.getHttpService(w, r, h.app.Monitor) |
139 | 140 | case strings.HasPrefix(p, "/api/services/kafka"): |
140 | 141 | h.handleKafka(w, r) |
| 142 | + case strings.HasPrefix(p, "/api/services/mqtt"): |
| 143 | + h.handleMqtt(w, r) |
141 | 144 | case strings.HasPrefix(p, "/api/services/mail/"): |
142 | 145 | h.handleMailService(w, r) |
143 | 146 | case strings.HasPrefix(p, "/api/services/ldap/"): |
@@ -204,6 +207,7 @@ func (h *handler) getServices(w http.ResponseWriter, _ *http.Request) { |
204 | 207 | services = append(services, getKafkaServices(h.app.Kafka, h.app.Monitor)...) |
205 | 208 | services = append(services, getMailServices(h.app.Mail, h.app.Monitor)...) |
206 | 209 | services = append(services, getLdapServices(h.app.Ldap, h.app.Monitor)...) |
| 210 | + services = append(services, getMqttServices(h.app.Mqtt, h.app.Monitor)...) |
207 | 211 | slices.SortFunc(services, func(a interface{}, b interface{}) int { |
208 | 212 | return compareService(a, b) |
209 | 213 | }) |
@@ -242,6 +246,9 @@ func (h *handler) getInfo(w http.ResponseWriter, _ *http.Request) { |
242 | 246 | if len(h.app.Ldap.List()) > 0 { |
243 | 247 | i.ActiveServices = append(i.ActiveServices, "ldap") |
244 | 248 | } |
| 249 | + if len(h.app.Mqtt.List()) > 0 { |
| 250 | + i.ActiveServices = append(i.ActiveServices, "mqtt") |
| 251 | + } |
245 | 252 |
|
246 | 253 | writeJsonBody(w, i) |
247 | 254 | } |
|
0 commit comments