A first usable web frontend version is now in the hub. There are two new mongoose config options to enable serving from file space and list directory contents. I recommend enabling them, if you want to exclude access to the filesystem, you can do so by configuration params "http.server": // "http.server"Instances: // Name Default Function // enable.files yes Enable file serving from docroot // enable.dirlist yes Enable directory listings // docroot /sd File server document root // auth.domain ovms Default auth domain (digest realm) // auth.file .htpasswd Per directory auth file (Note: no inheritance from parent dir!) // auth.global yes Use global auth for files (user "admin", module password) File access is not needed for the web frontend though, just an option to be able to access i.e. CAN logs. The docroot can be set to "/store", but I don't recommend that. The config path is protected, but this relies on mongoose delivering correct paths -- a bug would open access to the config. If you want to serve from /store, use a sub directory like "/store/www" as the docroot. Global and web session authentication is bound to the module password (config set password module "…"). The frontend is AJAX based using Bootstrap & jQuery, with currently a very basic (functional) design. I've implemented a first home & status screen (just command outputs), a simple shell and config pages for the password and the basic vehicle setup (just type & id for now). I'll add config pages for wifi, modem, server & ota during the next days. The frontend is usable on a small screen, just the shell could need full screen support -- I'll have a look at that later on. The framework provides a page registration and page context utilities to enable custom / vehicle specific extensions with few effort. I'll add an example / template for this. Feedback is welcome. Regards, Michael -- Michael Balzer * Helkenberger Weg 9 * D-58256 Ennepetal Fon 02333 / 833 5735 * Handy 0176 / 206 989 26
Nice! Look forward to test this, but I get this errors: /Users/goev/Prosjekter/ovms3/Open-Vehicle-Monitoring-System-3/vehicle/OVMS.V3/components/ovms_webserver/src/web_framework.cpp: In static member function 'static void OvmsWebServer::HandleAsset(PageEntry_t&, PageContext_t&)': /Users/goev/Prosjekter/ovms3/Open-Vehicle-Monitoring-System-3/vehicle/OVMS.V3/components/ovms_webserver/src/web_framework.cpp:359:35: error: expected primary-expression before ';' token mtime = MTIME_ASSETS_STYLE_CSS; ^ /Users/goev/Prosjekter/ovms3/Open-Vehicle-Monitoring-System-3/vehicle/OVMS.V3/components/ovms_webserver/src/web_framework.cpp:365:35: error: expected primary-expression before ';' token mtime = MTIME_ASSETS_SCRIPT_JS; Are they missing? Best regards, Geir
28. jan. 2018 kl. 20:10 skrev Michael Balzer <dexter@expeedo.de>:
A first usable web frontend version is now in the hub.
There are two new mongoose config options to enable serving from file space and list directory contents. I recommend enabling them, if you want to exclude access to the filesystem, you can do so by configuration params "http.server":
// "http.server"Instances: // Name Default Function // enable.files yes Enable file serving from docroot // enable.dirlist yes Enable directory listings // docroot /sd File server document root // auth.domain ovms Default auth domain (digest realm) // auth.file .htpasswd Per directory auth file (Note: no inheritance from parent dir!) // auth.global yes Use global auth for files (user "admin", module password)
File access is not needed for the web frontend though, just an option to be able to access i.e. CAN logs. The docroot can be set to "/store", but I don't recommend that. The config path is protected, but this relies on mongoose delivering correct paths -- a bug would open access to the config. If you want to serve from /store, use a sub directory like "/store/www" as the docroot.
Global and web session authentication is bound to the module password (config set password module "…").
The frontend is AJAX based using Bootstrap & jQuery, with currently a very basic (functional) design. I've implemented a first home & status screen (just command outputs), a simple shell and config pages for the password and the basic vehicle setup (just type & id for now). I'll add config pages for wifi, modem, server & ota during the next days.
The frontend is usable on a small screen, just the shell could need full screen support -- I'll have a look at that later on.
The framework provides a page registration and page context utilities to enable custom / vehicle specific extensions with few effort. I'll add an example / template for this.
Feedback is welcome.
Regards, Michael
-- Michael Balzer * Helkenberger Weg 9 * D-58256 Ennepetal Fon 02333 / 833 5735 * Handy 0176 / 206 989 26
_______________________________________________ OvmsDev mailing list OvmsDev@lists.teslaclub.hk http://lists.teslaclub.hk/mailman/listinfo/ovmsdev
I get the modification times of the files by the date command: CPPFLAGS += -DMTIME_ASSETS_SCRIPT_JS=$(shell date +%s -r $(COMPONENT_PATH)/assets/script.js.gz 2>/dev/null) Can you please check what date +%s -r somefile outputs on your machine? To build, replace the lines in component.mk by fixed numbers, i.e. CPPFLAGS += -DMTIME_ASSETS_SCRIPT_JS=1517144892 CPPFLAGS += -DMTIME_ASSETS_STYLE_CSS=1517162015 I'll look for another method to get the file dates during build. Regards, Michael Am 28.01.2018 um 20:37 schrieb Geir Øyvind Vælidalo:
Nice! Look forward to test this, but I get this errors:
*/Users/goev/Prosjekter/ovms3/Open-Vehicle-Monitoring-System-3/vehicle/OVMS.V3/components/ovms_webserver/src/web_framework.cpp:* In static member function '*static void OvmsWebServer::HandleAsset(PageEntry_t&, PageContext_t&)*': */Users/goev/Prosjekter/ovms3/Open-Vehicle-Monitoring-System-3/vehicle/OVMS.V3/components/ovms_webserver/src/web_framework.cpp:359:35:* *error: *expected primary-expression before '*;*' token mtime = MTIME_ASSETS_STYLE_CSS; * ^* */Users/goev/Prosjekter/ovms3/Open-Vehicle-Monitoring-System-3/vehicle/OVMS.V3/components/ovms_webserver/src/web_framework.cpp:365:35:* *error: *expected primary-expression before '*;*' token mtime = MTIME_ASSETS_SCRIPT_JS;
Are they missing?
Best regards, Geir
28. jan. 2018 kl. 20:10 skrev Michael Balzer <dexter@expeedo.de <mailto:dexter@expeedo.de>>:
A first usable web frontend version is now in the hub.
There are two new mongoose config options to enable serving from file space and list directory contents. I recommend enabling them, if you want to exclude access to the filesystem, you can do so by configuration params "http.server":
// "http.server"Instances: // Name Default Function // enable.files yes Enable file serving from docroot // enable.dirlist yes Enable directory listings // docroot /sd File server document root // auth.domain ovms Default auth domain (digest realm) // auth.file .htpasswd Per directory auth file (Note: no inheritance from parent dir!) // auth.global yes Use global auth for files (user "admin", module password)
File access is not needed for the web frontend though, just an option to be able to access i.e. CAN logs. The docroot can be set to "/store", but I don't recommend that. The config path is protected, but this relies on mongoose delivering correct paths -- a bug would open access to the config. If you want to serve from /store, use a sub directory like "/store/www" as the docroot.
Global and web session authentication is bound to the module password (config set password module "…").
The frontend is AJAX based using Bootstrap & jQuery, with currently a very basic (functional) design. I've implemented a first home & status screen (just command outputs), a simple shell and config pages for the password and the basic vehicle setup (just type & id for now). I'll add config pages for wifi, modem, server & ota during the next days.
The frontend is usable on a small screen, just the shell could need full screen support -- I'll have a look at that later on.
The framework provides a page registration and page context utilities to enable custom / vehicle specific extensions with few effort. I'll add an example / template for this.
Feedback is welcome.
Regards, Michael
-- Michael Balzer * Helkenberger Weg 9 * D-58256 Ennepetal Fon 02333 / 833 5735 * Handy 0176 / 206 989 26
_______________________________________________ OvmsDev mailing list OvmsDev@lists.teslaclub.hk <mailto:OvmsDev@lists.teslaclub.hk> http://lists.teslaclub.hk/mailman/listinfo/ovmsdev
_______________________________________________ OvmsDev mailing list OvmsDev@lists.teslaclub.hk http://lists.teslaclub.hk/mailman/listinfo/ovmsdev
-- Michael Balzer * Helkenberger Weg 9 * D-58256 Ennepetal Fon 02333 / 833 5735 * Handy 0176 / 206 989 26
I get an error: date +%s -r ./suc.zip date: illegal time format usage: date [-jnRu] [-d dst] [-r seconds] [-t west] [-v[+|-]val[ymwdHMS]] ... [-f fmt date | [[[mm]dd]HH]MM[[cc]yy][.ss]] [+format] Strange, but it does not seem to work. I try with hardcoded times. Geir
28. jan. 2018 kl. 21:00 skrev Michael Balzer <dexter@expeedo.de>:
date +%s -r somefile
I should've checked for POSIX compatibility… %s is indeed non standard. Can you please try… stat -c %Y somefile Am 28.01.2018 um 21:05 schrieb Geir Øyvind Vælidalo:
I get an error:
date +%s -r ./suc.zip date: illegal time format usage: date [-jnRu] [-d dst] [-r seconds] [-t west] [-v[+|-]val[ymwdHMS]] ... [-f fmt date | [[[mm]dd]HH]MM[[cc]yy][.ss]] [+format]
Strange, but it does not seem to work. I try with hardcoded times.
Geir
28. jan. 2018 kl. 21:00 skrev Michael Balzer <dexter@expeedo.de <mailto:dexter@expeedo.de>>:
date +%s -r somefile
_______________________________________________ OvmsDev mailing list OvmsDev@lists.teslaclub.hk http://lists.teslaclub.hk/mailman/listinfo/ovmsdev
-- Michael Balzer * Helkenberger Weg 9 * D-58256 Ennepetal Fon 02333 / 833 5735 * Handy 0176 / 206 989 26
This wasn’t straight forward… My mac didn’t like the -c. Geir
28. jan. 2018 kl. 21:10 skrev Michael Balzer <dexter@expeedo.de>:
I should've checked for POSIX compatibility… %s is indeed non standard.
Can you please try…
stat -c %Y somefile
Am 28.01.2018 um 21:05 schrieb Geir Øyvind Vælidalo:
I get an error:
date +%s -r ./suc.zip date: illegal time format usage: date [-jnRu] [-d dst] [-r seconds] [-t west] [-v[+|-]val[ymwdHMS]] ... [-f fmt date | [[[mm]dd]HH]MM[[cc]yy][.ss]] [+format]
Strange, but it does not seem to work. I try with hardcoded times.
Geir
28. jan. 2018 kl. 21:00 skrev Michael Balzer <dexter@expeedo.de <mailto:dexter@expeedo.de>>:
date +%s -r somefile
_______________________________________________ OvmsDev mailing list OvmsDev@lists.teslaclub.hk <mailto:OvmsDev@lists.teslaclub.hk> http://lists.teslaclub.hk/mailman/listinfo/ovmsdev <http://lists.teslaclub.hk/mailman/listinfo/ovmsdev>
-- Michael Balzer * Helkenberger Weg 9 * D-58256 Ennepetal Fon 02333 / 833 5735 * Handy 0176 / 206 989 26 _______________________________________________ OvmsDev mailing list OvmsDev@lists.teslaclub.hk http://lists.teslaclub.hk/mailman/listinfo/ovmsdev
OK, one more: perl -e 'print +(stat $ARGV[0])[9], "\n"' somefile Am 28.01.2018 um 21:14 schrieb Geir Øyvind Vælidalo:
This wasn’t straight forward… My mac didn’t like the -c.
Geir
28. jan. 2018 kl. 21:10 skrev Michael Balzer <dexter@expeedo.de <mailto:dexter@expeedo.de>>:
I should've checked for POSIX compatibility… %s is indeed non standard.
Can you please try…
stat -c %Y somefile
Am 28.01.2018 um 21:05 schrieb Geir Øyvind Vælidalo:
I get an error:
date +%s -r ./suc.zip date: illegal time format usage: date [-jnRu] [-d dst] [-r seconds] [-t west] [-v[+|-]val[ymwdHMS]] ... [-f fmt date | [[[mm]dd]HH]MM[[cc]yy][.ss]] [+format]
Strange, but it does not seem to work. I try with hardcoded times.
Geir
28. jan. 2018 kl. 21:00 skrev Michael Balzer <dexter@expeedo.de <mailto:dexter@expeedo.de>>:
date +%s -r somefile
_______________________________________________ OvmsDev mailing list OvmsDev@lists.teslaclub.hk http://lists.teslaclub.hk/mailman/listinfo/ovmsdev
-- Michael Balzer * Helkenberger Weg 9 * D-58256 Ennepetal Fon 02333 / 833 5735 * Handy 0176 / 206 989 26 _______________________________________________ OvmsDev mailing list OvmsDev@lists.teslaclub.hk <mailto:OvmsDev@lists.teslaclub.hk> http://lists.teslaclub.hk/mailman/listinfo/ovmsdev
_______________________________________________ OvmsDev mailing list OvmsDev@lists.teslaclub.hk http://lists.teslaclub.hk/mailman/listinfo/ovmsdev
-- Michael Balzer * Helkenberger Weg 9 * D-58256 Ennepetal Fon 02333 / 833 5735 * Handy 0176 / 206 989 26
Am 28.01.2018 um 21:41 schrieb Geir Øyvind Vælidalo:
That worked! OK, solution pushed.
The web-server was great, btw! I see some great potential there. OVMS V3 is an amazing step up from V2 :-D Thanks, and yes, you bet! :)
Regards, Michael
Geir
28. jan. 2018 kl. 21:37 skrev Michael Balzer <dexter@expeedo.de <mailto:dexter@expeedo.de>>:
perl -e 'print +(stat $ARGV[0])[9], "\n"' somefile
-- Michael Balzer * Helkenberger Weg 9 * D-58256 Ennepetal Fon 02333 / 833 5735 * Handy 0176 / 206 989 26
Very very cool. Love the clean layout, and very usable as is. One comment: I don’t think the http.server config parameter is registered. I couldn’t set any configs on it. I was interested in trying out the vfs directory access functions - to download can bus dumps, etc. Wondering how mongoose handles that (and hoping it doesn’t consume all the ram for big files). Regards, Mark.
On 29 Jan 2018, at 3:10 AM, Michael Balzer <dexter@expeedo.de> wrote:
A first usable web frontend version is now in the hub.
There are two new mongoose config options to enable serving from file space and list directory contents. I recommend enabling them, if you want to exclude access to the filesystem, you can do so by configuration params "http.server":
// "http.server"Instances: // Name Default Function // enable.files yes Enable file serving from docroot // enable.dirlist yes Enable directory listings // docroot /sd File server document root // auth.domain ovms Default auth domain (digest realm) // auth.file .htpasswd Per directory auth file (Note: no inheritance from parent dir!) // auth.global yes Use global auth for files (user "admin", module password)
File access is not needed for the web frontend though, just an option to be able to access i.e. CAN logs. The docroot can be set to "/store", but I don't recommend that. The config path is protected, but this relies on mongoose delivering correct paths -- a bug would open access to the config. If you want to serve from /store, use a sub directory like "/store/www" as the docroot.
Global and web session authentication is bound to the module password (config set password module "…").
The frontend is AJAX based using Bootstrap & jQuery, with currently a very basic (functional) design. I've implemented a first home & status screen (just command outputs), a simple shell and config pages for the password and the basic vehicle setup (just type & id for now). I'll add config pages for wifi, modem, server & ota during the next days.
The frontend is usable on a small screen, just the shell could need full screen support -- I'll have a look at that later on.
The framework provides a page registration and page context utilities to enable custom / vehicle specific extensions with few effort. I'll add an example / template for this.
Feedback is welcome.
Regards, Michael
-- Michael Balzer * Helkenberger Weg 9 * D-58256 Ennepetal Fon 02333 / 833 5735 * Handy 0176 / 206 989 26
_______________________________________________ OvmsDev mailing list OvmsDev@lists.teslaclub.hk http://lists.teslaclub.hk/mailman/listinfo/ovmsdev
Oops, I moved the param registration to /dev/null -- I'll fix that this evening. File downloads are handled in chunks by the mongoose system. I've implemented chunked transfer for the embedded assets as well, so RAM usage should be acceptable even with the 3.0 module. Performance of file downloads is affected by the FAT buffer configuration, especially with a browser doing parallel fetches. But it's OK for single file downloads with a global buffer. Regards, Michael Am 29.01.2018 um 01:31 schrieb Mark Webb-Johnson:
Very very cool. Love the clean layout, and very usable as is.
One comment: I don’t think the http.server config parameter is registered. I couldn’t set any configs on it. I was interested in trying out the vfs directory access functions - to download can bus dumps, etc. Wondering how mongoose handles that (and hoping it doesn’t consume all the ram for big files).
Regards, Mark.
On 29 Jan 2018, at 3:10 AM, Michael Balzer <dexter@expeedo.de> wrote:
A first usable web frontend version is now in the hub.
There are two new mongoose config options to enable serving from file space and list directory contents. I recommend enabling them, if you want to exclude access to the filesystem, you can do so by configuration params "http.server":
// "http.server"Instances: // Name Default Function // enable.files yes Enable file serving from docroot // enable.dirlist yes Enable directory listings // docroot /sd File server document root // auth.domain ovms Default auth domain (digest realm) // auth.file .htpasswd Per directory auth file (Note: no inheritance from parent dir!) // auth.global yes Use global auth for files (user "admin", module password)
File access is not needed for the web frontend though, just an option to be able to access i.e. CAN logs. The docroot can be set to "/store", but I don't recommend that. The config path is protected, but this relies on mongoose delivering correct paths -- a bug would open access to the config. If you want to serve from /store, use a sub directory like "/store/www" as the docroot.
Global and web session authentication is bound to the module password (config set password module "…").
The frontend is AJAX based using Bootstrap & jQuery, with currently a very basic (functional) design. I've implemented a first home & status screen (just command outputs), a simple shell and config pages for the password and the basic vehicle setup (just type & id for now). I'll add config pages for wifi, modem, server & ota during the next days.
The frontend is usable on a small screen, just the shell could need full screen support -- I'll have a look at that later on.
The framework provides a page registration and page context utilities to enable custom / vehicle specific extensions with few effort. I'll add an example / template for this.
Feedback is welcome.
Regards, Michael
-- Michael Balzer * Helkenberger Weg 9 * D-58256 Ennepetal Fon 02333 / 833 5735 * Handy 0176 / 206 989 26
_______________________________________________ OvmsDev mailing list OvmsDev@lists.teslaclub.hk http://lists.teslaclub.hk/mailman/listinfo/ovmsdev
OvmsDev mailing list OvmsDev@lists.teslaclub.hk http://lists.teslaclub.hk/mailman/listinfo/ovmsdev
-- Michael Balzer * Helkenberger Weg 9 * D-58256 Ennepetal Fon 02333 / 833 5735 * Handy 0176 / 206 989 26
Param registration is fixed. Am 29.01.2018 um 10:48 schrieb Michael Balzer:
Oops, I moved the param registration to /dev/null -- I'll fix that this evening.
File downloads are handled in chunks by the mongoose system. I've implemented chunked transfer for the embedded assets as well, so RAM usage should be acceptable even with the 3.0 module.
Performance of file downloads is affected by the FAT buffer configuration, especially with a browser doing parallel fetches. But it's OK for single file downloads with a global buffer.
Regards, Michael
Am 29.01.2018 um 01:31 schrieb Mark Webb-Johnson:
Very very cool. Love the clean layout, and very usable as is.
One comment: I don’t think the http.server config parameter is registered. I couldn’t set any configs on it. I was interested in trying out the vfs directory access functions - to download can bus dumps, etc. Wondering how mongoose handles that (and hoping it doesn’t consume all the ram for big files).
Regards, Mark.
On 29 Jan 2018, at 3:10 AM, Michael Balzer <dexter@expeedo.de> wrote:
A first usable web frontend version is now in the hub.
There are two new mongoose config options to enable serving from file space and list directory contents. I recommend enabling them, if you want to exclude access to the filesystem, you can do so by configuration params "http.server":
// "http.server"Instances: // Name Default Function // enable.files yes Enable file serving from docroot // enable.dirlist yes Enable directory listings // docroot /sd File server document root // auth.domain ovms Default auth domain (digest realm) // auth.file .htpasswd Per directory auth file (Note: no inheritance from parent dir!) // auth.global yes Use global auth for files (user "admin", module password)
File access is not needed for the web frontend though, just an option to be able to access i.e. CAN logs. The docroot can be set to "/store", but I don't recommend that. The config path is protected, but this relies on mongoose delivering correct paths -- a bug would open access to the config. If you want to serve from /store, use a sub directory like "/store/www" as the docroot.
Global and web session authentication is bound to the module password (config set password module "…").
The frontend is AJAX based using Bootstrap & jQuery, with currently a very basic (functional) design. I've implemented a first home & status screen (just command outputs), a simple shell and config pages for the password and the basic vehicle setup (just type & id for now). I'll add config pages for wifi, modem, server & ota during the next days.
The frontend is usable on a small screen, just the shell could need full screen support -- I'll have a look at that later on.
The framework provides a page registration and page context utilities to enable custom / vehicle specific extensions with few effort. I'll add an example / template for this.
Feedback is welcome.
Regards, Michael
-- Michael Balzer * Helkenberger Weg 9 * D-58256 Ennepetal Fon 02333 / 833 5735 * Handy 0176 / 206 989 26
_______________________________________________ OvmsDev mailing list OvmsDev@lists.teslaclub.hk http://lists.teslaclub.hk/mailman/listinfo/ovmsdev
OvmsDev mailing list OvmsDev@lists.teslaclub.hk http://lists.teslaclub.hk/mailman/listinfo/ovmsdev
-- Michael Balzer * Helkenberger Weg 9 * D-58256 Ennepetal Fon 02333 / 833 5735 * Handy 0176 / 206 989 26
participants (3)
-
Geir Øyvind Vælidalo -
Mark Webb-Johnson -
Michael Balzer