1
0
mirror of https://github.com/mainflux/mainflux.git synced 2025-04-27 13:48:49 +08:00
Darko Draskovic 700cfdf6f3 Add UI websocket open/close and send/receive (#728)
* Add websocket open/close and send/receive

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Add websocket feedback/log to Elm

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Align WS open/close buttons

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Add websocket query for channel list

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Add websocket related encoders/decoders for port interops

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Fix .js indentation and simplify ws (dis)connect method

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Use single quotes consistently

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>

* Add HTTP Send and WS Listen

Signed-off-by: Darko Draskovic <darko.draskovic@gmail.com>
2019-04-26 19:17:04 +02:00
..
2019-04-18 13:29:38 +02:00
2019-03-06 16:21:09 +01:00

GUI for Mainflux in Elm

Dashboard made with elm-bootstrap.

Install

Docker container GUI build

Install Docker and Docker compose, cd to Mainflux root directory and then

docker-compose -f docker/docker-compose.yml up

if you want to launch a whole Mainflux docker composition, or just

docker-compose -f docker/docker-compose.yml up ui

if you want to launch just GUI.

Native GUI build

Install Elm and then run the following commands:

git clone https://github.com/mainflux/mainflux
cd mainflux/ui
make

This will produce index.html in the ui directory. Still in the mainflux/ui folder, enter

make run

and follow the instructions on screen.

NB: make does elm make src/Main.elm --output=main.js and make run executes elm reactor. Cf. Makefile for more options.

Configuration

Open the src/Env.elm file and edit the values of the env record.

Contribute to the GUI development

Follow the instructions above to install and run GUI as a native build. In src/Env.elm change a url field value of the elm record to http://localhost:80/ (trailing slash / is mandatory). Instead of make run you can install elm-live and execute elm-live src/Main.elm -- --output=main.js to get a live reload when your .Elm files change.

Launch Mainflux without ui service, either natively or as a Docker composition. If you have already launched Mainflux as a Docker composition, simply cd to Mainflux folder and run docker-compose -f docker/docker-compose.yml stop ui. Please follow the guidelines for Mainflux contributors.