summaryrefslogtreecommitdiffstats
path: root/pyserver/templates/scripts_info.html
diff options
context:
space:
mode:
authorVasilii Chernov <vchernov@inr.ru>2016-03-03 15:38:32 +0100
committerVasilii Chernov <vchernov@inr.ru>2016-03-03 15:38:32 +0100
commitc79d43273769d88f7129a3d53c80b85a6dc1946c (patch)
tree0b8071b6261d74ef8bdf50a029525546250369ed /pyserver/templates/scripts_info.html
parentee16e47966afe180d3c32e2b1d93301052894fac (diff)
downloadpcitool-c79d43273769d88f7129a3d53c80b85a6dc1946c.tar.gz
pcitool-c79d43273769d88f7129a3d53c80b85a6dc1946c.tar.bz2
pcitool-c79d43273769d88f7129a3d53c80b85a6dc1946c.tar.xz
pcitool-c79d43273769d88f7129a3d53c80b85a6dc1946c.zip
1. Pcipywrap: add persistent locking wrappings
2. html-server: - add scripts tab - change tab view to jQuery tabs
Diffstat (limited to 'pyserver/templates/scripts_info.html')
-rw-r--r--pyserver/templates/scripts_info.html49
1 files changed, 49 insertions, 0 deletions
diff --git a/pyserver/templates/scripts_info.html b/pyserver/templates/scripts_info.html
new file mode 100644
index 0000000..4708638
--- /dev/null
+++ b/pyserver/templates/scripts_info.html
@@ -0,0 +1,49 @@
+{% block content %}
+
+<script>
+ function runScript(name){
+ var pathToGetProperty = "{{ url_for('process_json_command', command = 'run_script') }}"
+ var completePath = pathToGetProperty + '?script_name=' + name +
+ '&value=' + $("#input_" + name).val()
+
+ $.get(completePath, function(data, status){
+ var stringData = ""
+ if(typeof(data) === "object") {
+ stringData = JSON.stringify(data)
+ }
+ else
+ stringData = String(data)
+
+ var blob = new Blob([stringData], {type: "text/plain;charset=utf-8"});
+ saveAs(blob, "output_" + name);
+ });
+ }
+</script>
+
+<input type="file" id="file-input" />
+
+<table class="infoTable">
+ <tr class="infoTable">
+ <td class="infoTable">Name</td>
+ <td class="infoTable">Description</td>
+ </tr>
+ {% for script in scripts %}
+ <tr class="infoTable">
+ <td class="infoTable">{{ script.name }}</td>
+ <td class="infoTable">
+ {% if 'description' in script %}
+ {{ script.description }}
+ {% endif %}
+ </td>
+ <td class="infoTable" style="overflow: visible">
+ {% if 'valid' in script and script['valid'] %}
+ <input type='text' id="input_{{ script.name }}"/>
+ <input type="button" value="run"
+ onclick="runScript('{{ script.name }}')">
+ {% endif %}
+ </td>
+ </tr>
+ {% endfor %}
+</table>
+{% endblock %}
+