Commit 89b7cf0e authored by Roque Porchetto's avatar Roque Porchetto

erp5_wendelin_telecom_UI: download button for windows batch script tool

parent f7e1c15c
......@@ -15,8 +15,12 @@
</head>
<body>
<form name='download'>
<input style="margin-top:10px" type="submit" value="Download" />
<span style="margin-left:10px" > and run command: <b style="margin-left:10px" > source dataset-tool <span id="dataset_reference"/>push <i>my-data-set</i></b> </span>
<input style="margin-top:10px" type="submit" value="Download for Linux/OSX" />
<span style="margin-left:10px" > and run command: <b style="margin-left:10px" > source ebulk <span id="dataset_reference"/>push <i>my-data-set</i></b> </span>
</form>
<form name='download-win'>
<input style="margin-top:10px" type="submit" value="Download for Windows" />
<span style="margin-left:10px" > and run command: <b style="margin-left:10px" > ebulk.bat <span id="dataset_reference_win"/>push <i>my-data-set</i></b> </span>
</form>
</body>
</html>
\ No newline at end of file
......@@ -234,7 +234,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>968.21275.8106.34884</string> </value>
<value> <string>968.31425.29475.18500</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -252,7 +252,7 @@
</tuple>
<state>
<tuple>
<float>1529412536.85</float>
<float>1530025820.7</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -5,10 +5,16 @@
"use strict";
function download(context, evt) {
var link = document.createElement('a');
link.download = "download_tool.zip";
link.download = "ebulk_tool_unix.zip";
link.href = window.location.origin + "/erp5/data_stream_module/embulk_download_script/getData";
link.click();
}
function download_win(context, evt) {
var link = document.createElement('a');
link.download = "ebulk_tool_win.zip";
link.href = window.location.origin + "/erp5/data_stream_module/embulk_download_script_win/getData";
link.click();
}
rJS(window)
.allowPublicAcquisition('setFillStyle', function () {
......@@ -20,6 +26,9 @@
.declareJob('download', function (evt) {
return download(this, evt);
})
.declareJob('download_win', function (evt) {
return download_win(this, evt);
})
.declareMethod("render", function (reference) {
var html = "pull <i>" + reference + "</i>";
if (reference === undefined)
......@@ -28,10 +37,13 @@
})
.declareService(function () {
document.getElementById("dataset_reference").innerHTML = this.state.dataset_reference;
document.getElementById("dataset_reference_win").innerHTML = this.state.dataset_reference;
})
.onEvent('submit', function (evt) {
if (evt.target.name === 'download') {
return this.download(evt);
} else if (evt.target.name === 'download-win') {
return this.download_win(evt);
} else {
throw new Error('Unknown form');
}
......
......@@ -234,7 +234,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>960.23998.30923.34781</string> </value>
<value> <string>968.31506.21659.1382</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -252,7 +252,7 @@
</tuple>
<state>
<tuple>
<float>1508757685.25</float>
<float>1530026061.85</float>
<string>UTC</string>
</tuple>
</state>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment