diff --git a/README.md b/README.md index acbd42b9..4632d760 100644 --- a/README.md +++ b/README.md @@ -94,6 +94,8 @@ _Customized themes are synced with local session storage_ 🌩 **Socket.IO**: Send and Receive data with socketio server. SocketIO is popular websocket solution. +🦟 **MQTT**: Subscribe and Publish to topics of a MQTT Broker. + 🔮 **GraphQL**: GraphQL is a query language for APIs and a runtime for fulfilling those queries with your existing data. - Set endpoint and get schemas diff --git a/components/realtime/mqtt.vue b/components/realtime/mqtt.vue new file mode 100644 index 00000000..36beb5d0 --- /dev/null +++ b/components/realtime/mqtt.vue @@ -0,0 +1,260 @@ + + diff --git a/lang/en-US.js b/lang/en-US.js index dbbfd434..c5d6b93e 100644 --- a/lang/en-US.js +++ b/lang/en-US.js @@ -276,4 +276,10 @@ export default { notes: "Notes", socketio: "Socket.IO", event_name: "Event Name", + mqtt: "MQTT", + mqtt_topic: "Topic", + mqtt_topic_title: "Publish / Subscribe topic", + mqtt_publish: "Publish", + mqtt_subscribe: "Subscribe", + mqtt_unsubscribe: "Unsubscribe", } diff --git a/package-lock.json b/package-lock.json index 02bdfb1a..4c8515bb 100644 --- a/package-lock.json +++ b/package-lock.json @@ -8983,6 +8983,11 @@ "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==" }, + "paho-mqtt": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/paho-mqtt/-/paho-mqtt-1.1.0.tgz", + "integrity": "sha512-KPbL9KAB0ASvhSDbOrZBaccXS+/s7/LIofbPyERww8hM5Ko71GUJQ6Nmg0BWqj8phAIT8zdf/Sd/RftHU9i2HA==" + }, "pako": { "version": "1.0.10", "resolved": "https://registry.npmjs.org/pako/-/pako-1.0.10.tgz", diff --git a/package.json b/package.json index 5e1065a0..991ecfed 100644 --- a/package.json +++ b/package.json @@ -43,6 +43,7 @@ "graphql-language-service-interface": "^2.3.3", "nuxt": "^2.11.0", "nuxt-i18n": "^6.6.0", + "paho-mqtt": "^1.1.0", "socket.io-client": "^2.3.0", "v-tooltip": "^2.0.3", "vue-virtual-scroll-list": "^1.4.6", diff --git a/pages/realtime.vue b/pages/realtime.vue index fa56ee5c..0185976e 100644 --- a/pages/realtime.vue +++ b/pages/realtime.vue @@ -27,9 +27,9 @@ > {{ !connectionState ? $t("connect") : $t("disconnect") }} - - {{ !connectionState ? "sync" : "sync_disabled" }} - + {{ + !connectionState ? "sync" : "sync_disabled" + }} @@ -94,9 +94,9 @@ > {{ !connectionSSEState ? $t("start") : $t("stop") }} - - {{ !connectionSSEState ? "sync" : "sync_disabled" }} - + {{ + !connectionSSEState ? "sync" : "sync_disabled" + }} @@ -117,6 +117,9 @@ + + + @@ -132,6 +135,7 @@ export default { socketio: () => import("../components/realtime/socketio"), tabs: () => import("../components/ui/tabs"), tab: () => import("../components/ui/tab"), + mqtt: () => import("../components/realtime/mqtt"), realtimeLog, }, data() {