Feature #1060
open
Need store manager web UI
Added by Hammel about 1 year ago.
Updated 19 days ago.
Description
Although the touchscreen is useful for general drive data, it's not user-friendly for managing the stores.
Each store needs to be configurable with
- Directories (add, remove, rename, write-enable, read-enable)
- ACLs
- Enable as PiSentry store
It should also display (but not configure)
Don't make it complex. Use simple CSS layout with few UI components.
Web server directly accesses mount points and makes changes, so it must run as root. Touchscreen UI should NOT access this metadata - only low level drive data should be displayed.
- Severity changed from 03 - Medium to 01 - Critical
- Status changed from New to In Progress
- % Done changed from 0 to 20
The pistoreweb application is now stubbed out fully given the API definition (see pistoreweb.c) and expected UI.
The first API implemented is the monitor request for status - get.c:pistoreStatus(). This now needs a unit test. To do this, the jarvis.c/h code needs to be updated to make monitor requests to pistoreweb, but it needs to act like a monitor now and not like Jarvis.
pistoreweb needs to register with the monitor. This must happen before we allow processing by mongoose. Or the mongoose handlers should ignore all requests if registration isn't complete.
Registration is sending the multicast request and getting back the UUID generated by the monitor. Once the UUID is received, it must be stored and used for API transactions.
See piboxd registerDevice() for how registration works. pistoreweb will need to support "/register?uuid=<>". This function also shows possible responses.
Next up:
Save registration UUID.
Disable further registrations.
Test front end UI
Need to handle if more than one ironman responds. For now, just accept a single ironman, re: the first to respond.
Registration and default index.html are now working.
Next:
Retrieve storage stats.
Ready to test but must be tested on PiStore system.
Generate png graph of stats.
This is basically a version of gtk_graph_paint() in pistore:graphwidget.c that just writes the graph to a file.
Create index.tmpl template.
Build image map from png graph.
Generate index.html from index.tmpl and just add links to each drive. An image map can't (easily, keeping it KISS) be sync'd with png write, index gets and graph image gets.
Add code to replace template tags with generated code.
- Add CSS to template (embed it to reduce secondary calls).
This essentially works. There is some cleanup I could do to make it pretty.
- Make the side links for mount points top or bottom justified.
- Add css like I have on my source directories to make the directory listings more interesting looking.
- % Done changed from 20 to 90
This is actually really clumsy. It would be better (sadly) to use client side javascript. It can do automated callbacks to update the graph. And the layout can be much nicer. So this needs to be updated with a MINIMAL javascript client side. Mongoose will have no problems sending that.
Reviewing JS charting libraries, specifically those that have no dependencies.
In most cases a call to the server to get JSON data representing storage data will need to be converted to a Javascript array.
Also available in: Atom
PDF