beremiz

SVGHMI: add static file serving feature.
py2compat
17 months ago, Edouard Tisserant
18071ab59cb3
SVGHMI: add static file serving feature.

Added two buttons to add and remove files.
Files are stored in project inside a directory named "static",
itself located in svghmi CTN instance files. Exemple :
exemples/svghmi_csv_json_img_table/svghmi_0@svghmi/static/
Files are transfered as "extra_files", but with a prefix
added to their name to avoid conflics.
// widget_image.ysl2
widget_desc("Image") {
longdesc
||
If Image widget is a svg:image element, then href content is replaced by
value of given variable.
||
shortdesc > Image display
}
widget_class("Image")
||
frequency = 5;
dispatch(value, oldval, index) {
if (index == 0) {
this.given_url = value;
this.ready = true;
this.request_animate();
}
}
||
widget_defs("Image") {
| given_url: "",
| ready: false,
| animate: function(){
| this.element.setAttribute('href', this.given_url);
| },
|
| init: function() {
| this.animate();
| },
}