From 7345cc9943fa3812a963caeb61808823bed04b39 Mon Sep 17 00:00:00 2001 From: Rahul Date: Wed, 11 Mar 2020 17:50:04 +0530 Subject: [PATCH] Added MQTT support --- components/realtime/mqtt.vue | 260 +++++++++++++++++++++++++++++++++++ lang/en-US.js | 5 + package-lock.json | 5 + package.json | 1 + pages/realtime.vue | 19 ++- 5 files changed, 284 insertions(+), 6 deletions(-) create mode 100644 components/realtime/mqtt.vue diff --git a/components/realtime/mqtt.vue b/components/realtime/mqtt.vue new file mode 100644 index 000000000..36beb5d0e --- /dev/null +++ b/components/realtime/mqtt.vue @@ -0,0 +1,260 @@ + + diff --git a/lang/en-US.js b/lang/en-US.js index dbbfd4343..745b0c41f 100644 --- a/lang/en-US.js +++ b/lang/en-US.js @@ -276,4 +276,9 @@ export default { notes: "Notes", socketio: "Socket.IO", event_name: "Event Name", + 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 02bdfb1a1..4c8515bb0 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 5e1065a04..991ecfed2 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 fa56ee5c8..7fd9c3ac6 100644 --- a/pages/realtime.vue +++ b/pages/realtime.vue @@ -27,9 +27,7 @@ > {{ !connectionState ? $t("connect") : $t("disconnect") }} - - {{ !connectionState ? "sync" : "sync_disabled" }} - + {{ !connectionState ? "sync" : "sync_disabled" }} @@ -94,9 +92,7 @@ > {{ !connectionSSEState ? $t("start") : $t("stop") }} - - {{ !connectionSSEState ? "sync" : "sync_disabled" }} - + {{ !connectionSSEState ? "sync" : "sync_disabled" }} @@ -118,6 +114,16 @@ + + +
+ +
+ + +
+ +
@@ -132,6 +138,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() {