summaryrefslogtreecommitdiffstats
path: root/pyserver/templates/property_info.html
diff options
context:
space:
mode:
authorVasilii Chernov <vchernov@inr.ru>2016-03-02 08:48:24 +0100
committerVasilii Chernov <vchernov@inr.ru>2016-03-02 08:48:24 +0100
commit8eca0564a1dd6aac125086a244687b4813a1fd86 (patch)
tree462919b3c3a3ebe833b3b7215c5a9399e5da7f60 /pyserver/templates/property_info.html
parent269b0985bd5830e27f6dedb04a05d76f52acb68c (diff)
parentadc657ebcd01ecc2cc5f110453ef00dffde2d5c0 (diff)
downloadpcitool-8eca0564a1dd6aac125086a244687b4813a1fd86.tar.gz
pcitool-8eca0564a1dd6aac125086a244687b4813a1fd86.tar.bz2
pcitool-8eca0564a1dd6aac125086a244687b4813a1fd86.tar.xz
pcitool-8eca0564a1dd6aac125086a244687b4813a1fd86.zip
1. Merge with http://ufo.kit.edu/ufo/log/csa/pcitool 359 revision
2. Move api_server to html server
Diffstat (limited to 'pyserver/templates/property_info.html')
-rw-r--r--pyserver/templates/property_info.html91
1 files changed, 91 insertions, 0 deletions
diff --git a/pyserver/templates/property_info.html b/pyserver/templates/property_info.html
new file mode 100644
index 0000000..62ea1ba
--- /dev/null
+++ b/pyserver/templates/property_info.html
@@ -0,0 +1,91 @@
+{% block content %}
+
+{% if standalone %}
+<script src="{{ url_for('static', filename='codebase/dhtmlx.js') }}"></script>
+<script src="{{ url_for('static', filename='check_err.js') }}"></script>
+{% endif %}
+
+<script>
+ function updateProperty(prop) {
+ var pathToGetProperty = "{{ url_for('process_json_command', command = 'get_property') }}"
+ var completePath = pathToGetProperty + '?prop=' + prop
+
+ $.getJSON(completePath, function(json){
+ checkError(json)
+ var valFieldId = "#set_val_" + prop.split('/').join("_")
+ $(valFieldId).val(json.value)
+ })
+ }
+
+ function setProperty(prop)
+ {
+ var value = document.getElementById("set_val_" + prop.split('/').join("_")).value;
+ if(value == "")
+ return
+
+ var pathToGetProperty = "{{ url_for('process_json_command', command = 'set_property') }}"
+ var completePath = pathToGetProperty + '?prop=' + prop +
+ '&value=' + value;
+
+ $.getJSON(completePath,
+ function(json) {
+ checkError(json)
+ updateProperty(prop)
+ })
+ };
+</script>
+
+<table class="infoTable">
+ <tr class="infoTable">
+ <td class="infoTable">Name</td>
+ <td class="infoTable">Description</td>
+ <td class="infoTable">Value</td>
+ <td class="infoTable">Mode</td>
+ <td class="infoTable">Type</td>
+ <td class="infoTable">Unit</td>
+ <td class="infoTable">Path</td>
+ </tr>
+ {% for property in properties %}
+ <tr class="infoTable">
+ <td class="infoTable">{{ property.name }}</td>
+ <td class="infoTable">
+ {% if 'description' in property %}
+ {{ property.description }}
+ {% endif %}
+ </td>
+ <td class="infoTable">
+ <table>
+ {% if 'R' in property.mode %}
+ <tr>
+ <td>
+ <input type="text"
+ name="set_val_{{ property.path.replace('/', '_') }}"
+ id="set_val_{{ property.path.replace('/', '_') }}"
+ value="{{ value[property.path] }}" />
+ </td>
+ {% if 'W' in property.mode %}
+ <td>
+ <input type="button" value="set" style="width:100%;height:100%" onclick="setProperty('{{ property.path }}')">
+ </td>
+ {% endif %}
+ <td>
+ <input type="button" value="update" style="width:100%;height:100%" onclick="updateProperty('{{ property.path }}')">
+ </td>
+ </tr>
+ {% endif %}
+ </table>
+ </td>
+ <td class="infoTable">
+ <ul>
+ {% for m in property.mode %}
+ {{ m + '; '}}
+ {% endfor %}
+ </ul>
+ </td>
+ <td class="infoTable"> {{ property.type }} </td>
+ <td class="infoTable"> {{ property.unit }} </td>
+ <td class="infoTable"> {{ property.path }} </td>
+ </tr>
+ {% endfor %}
+</table>
+{% endblock %}