diff --git a/README.md b/README.md index acbd42b99..4632d760e 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 000000000..73edcad42 --- /dev/null +++ b/components/realtime/mqtt.vue @@ -0,0 +1,261 @@ + + + + + + {{ $t("url") }} + + + + + + + {{ this.connectionState ? $t("disconnect") : $t("connect") }} + + {{ !connectionState ? "sync" : "sync_disabled" }} + + + + + + + + + + + + + + + + {{ $t("mqtt_topic") }} + + + + {{ $t("message") }} + + + + + + + {{ $t("mqtt_publish") }} + + send + + + + + + + + {{ $t("mqtt_topic") }} + + + + + + + {{ subscriptionState ? $t("mqtt_unsubscribe") : $t("mqtt_subscribe") }} + + {{ subscriptionState ? "sync_disabled" : "sync" }} + + + + + + + + + + diff --git a/components/realtime/socketio.vue b/components/realtime/socketio.vue index 913429034..c25ae2296 100644 --- a/components/realtime/socketio.vue +++ b/components/realtime/socketio.vue @@ -32,7 +32,7 @@ - + @@ -76,12 +76,11 @@ diff --git a/components/realtime/websocket.vue b/components/realtime/websocket.vue new file mode 100644 index 000000000..a2d1b0415 --- /dev/null +++ b/components/realtime/websocket.vue @@ -0,0 +1,182 @@ + + + + + + {{ $t("url") }} + + + + + + + {{ !connectionState ? $t("connect") : $t("disconnect") }} + + + {{ !connectionState ? "sync" : "sync_disabled" }} + + + + + + + + + + + + + + + + + {{ $t("message") }} + + + + + + + {{ $t("send") }} + + send + + + + + + + + + + diff --git a/lang/en-US.js b/lang/en-US.js index dbbfd4343..c5d6b93e1 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 02bdfb1a1..4820350d4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2198,9 +2198,9 @@ "integrity": "sha512-8ZVAxwyCGAxQX8mOp9imSXH0hoSPkGfy8igJy+WO/7axL30saRhKgg1XPACSmxxPA7nfHVwM+ShWXT+vKsNuFg==" }, "acorn": { - "version": "6.4.0", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-6.4.0.tgz", - "integrity": "sha512-gac8OEcQ2Li1dxIEWGZzsp2BitJxwkwcOm0zHAJLcPJaVvm58FRnk6RkuLRpU1EujipU2ZFODv2P9DLMfnV8mw==" + "version": "6.4.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-6.4.1.tgz", + "integrity": "sha512-ZVA9k326Nwrj3Cj9jlh3wGFutC2ZornPNARZwsNYqQYgN0EsV2d53w5RN/co65Ohn4sUAUtb1rSUAOD6XN9idA==" }, "acorn-walk": { "version": "6.2.0", @@ -7322,9 +7322,9 @@ } }, "kind-of": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", - "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==" + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", + "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==" }, "last-call-webpack-plugin": { "version": "3.0.0", @@ -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..ac400985d 100644 --- a/pages/realtime.vue +++ b/pages/realtime.vue @@ -3,348 +3,35 @@ - - - - {{ $t("url") }} - - - - - - - {{ !connectionState ? $t("connect") : $t("disconnect") }} - - - {{ !connectionState ? "sync" : "sync_disabled" }} - - - - - - - - - - - - - - - - - {{ $t("message") }} - - - - - - - {{ $t("send") }} - - send - - - - - - + - - - - {{ $t("server") }} - - - - - - - {{ !connectionSSEState ? $t("start") : $t("stop") }} - - - {{ !connectionSSEState ? "sync" : "sync_disabled" }} - - - - - - - - - - - - - - - - + + + + +