4
function runScript(name){
5
var pathToGetProperty = "{{ url_for('process_json_command', command = 'run_script') }}"
6
var completePath = pathToGetProperty + '?script_name=' + name +
7
'&value=' + $("#input_" + name).val()
9
$.get(completePath, function(data, status){
11
if(typeof(data) === "object") {
12
stringData = JSON.stringify(data)
15
stringData = String(data)
17
var blob = new Blob([stringData], {type: "text/plain;charset=utf-8"});
18
saveAs(blob, "output_" + name);
23
<input type="file" id="file-input" />
25
<table class="infoTable">
26
<tr class="infoTable">
27
<td class="infoTable">Name</td>
28
<td class="infoTable">Description</td>
30
{% for script in scripts %}
31
<tr class="infoTable">
32
<td class="infoTable">{{ script.name }}</td>
33
<td class="infoTable">
34
{% if 'description' in script %}
35
{{ script.description }}
38
<td class="infoTable" style="overflow: visible">
39
{% if 'valid' in script and script['valid'] %}
40
<input type='text' id="input_{{ script.name }}"/>
41
<input type="button" value="run"
42
onclick="runScript('{{ script.name }}')">