HomeGenie Forum

Automation Program Plugins and Wizard Scripting => Help => Topic started by: wolfgang928 on September 10, 2016, 09:41:52 AM

Title: Widget v2 save data to locale file
Post by: wolfgang928 on September 10, 2016, 09:41:52 AM
Hello all,

i'm just playing with download a widget side filtered list content  to a locale log file from inside widget.

Due to missing js libraries like FileSaver.js or others i found the adaption of the maintenance log download function

 $('#btn_configuresystem_downloadtday').bind('click', function () {
                window.open('/api/HomeAutomation.HomeGenie/Config/System.Configure/SystemLogging.DownloadCsv/0');
            });

which is using a
(request.Context.Data as HttpListenerContext).Response.AddHeader("Content-Disposition", "attachment;filename=homegenie_log_" + migCommand.GetOption(1) + ".csv");
request.ResponseData = csvlog;

Is there any other way to make this locale inside widget, because all my data are inside widget yet and not on the server side due to the filtering feature.
Thanks for a hint!

Wolfgang
Title: Re: Widget v2 save data to locale file
Post by: HGexperimenter on November 13, 2016, 11:31:48 PM
Just read - helped me with some /API calls I was working on (Program.Stores).
Thanks!
Title: Re: Widget v2 save data to locale file
Post by: raptorjr on November 14, 2016, 06:23:52 PM
Hello all,

i'm just playing with download a widget side filtered list content  to a locale log file from inside widget.

Due to missing js libraries like FileSaver.js or others i found the adaption of the maintenance log download function

 $('#btn_configuresystem_downloadtday').bind('click', function () {
                window.open('/api/HomeAutomation.HomeGenie/Config/System.Configure/SystemLogging.DownloadCsv/0');
            });

which is using a
(request.Context.Data as HttpListenerContext).Response.AddHeader("Content-Disposition", "attachment;filename=homegenie_log_" + migCommand.GetOption(1) + ".csv");
request.ResponseData = csvlog;

Is there any other way to make this locale inside widget, because all my data are inside widget yet and not on the server side due to the filtering feature.
Thanks for a hint!

Wolfgang

This sounds cool. Is the code available?