diff options
author | Vasilii Chernov <vchernov@inr.ru> | 2016-03-01 16:42:48 +0100 |
---|---|---|
committer | Vasilii Chernov <vchernov@inr.ru> | 2016-03-01 16:42:48 +0100 |
commit | 9b947f32c3db96c3022afad401b1349205d22259 (patch) | |
tree | 1bc5fbc5c82752d1808a240964317c6813ad19c3 /html_server/templates | |
parent | 5d775d64bdec554b9842823bd1c46263210425fd (diff) | |
download | pcitool-9b947f32c3db96c3022afad401b1349205d22259.tar.gz pcitool-9b947f32c3db96c3022afad401b1349205d22259.tar.bz2 pcitool-9b947f32c3db96c3022afad401b1349205d22259.tar.xz pcitool-9b947f32c3db96c3022afad401b1349205d22259.zip |
1. api-serer:
- change multiprosessing work mechanism
- add new pywrap functions handling
2. html-server:
- now works through api-server
Diffstat (limited to 'html_server/templates')
-rw-r--r-- | html_server/templates/base.html | 63 | ||||
-rw-r--r-- | html_server/templates/property_info.html | 6 | ||||
-rw-r--r-- | html_server/templates/registers/table_scripts.html | 8 |
3 files changed, 19 insertions, 58 deletions
diff --git a/html_server/templates/base.html b/html_server/templates/base.html index 0e3aea8..a2df1e9 100644 --- a/html_server/templates/base.html +++ b/html_server/templates/base.html @@ -5,6 +5,7 @@ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> <meta http-equiv="X-UA-Compatible" content="IE=edge"/> <link rel="stylesheet" type="text/css" href="{{ url_for('static', filename='codebase/dhtmlx.css') }}"/> + <link rel="stylesheet" type="text/css" href="{{ url_for('static', filename='base.css') }}"/> <script type=text/javascript src="{{ url_for('static', filename='jquery-2.2.1.js') }}"></script> <script src="{{ url_for('static', filename='codebase/dhtmlx.js') }}"></script> <script src="{{ url_for('static', filename='check_err.js') }}"></script> @@ -13,8 +14,8 @@ function createPropertyTree(branch, id) { function getPropertyItemsOnLevel(branch, id) { - pathToProperties = "{{ url_for('get_property_list_json') }}" - completePath = pathToProperties + '?branch=' + branch + var pathToProperties = "{{ url_for('process_json_command', command = 'get_property_list') }}" + var completePath = pathToProperties + '?branch=' + branch $.getJSON(completePath, function(json) { @@ -25,6 +26,9 @@ function parsePropertyItems(json, branch, id) { + checkError(json) + json = json.properties + function loadPropertyInfo(branch) { var pathToProperties = "{{ url_for('get_property_list') }}" @@ -57,6 +61,8 @@ var regTree function createRegistersList() { function parseJsonRegisterList(json) { + checkError(json) + json = json.registers function loadRegistersList(bank) { var pathToGetRegisterList = "{{ url_for('get_registers_list') }}" @@ -129,7 +135,7 @@ } //get registers json list - getRegistersListPath = "{{ url_for('get_registers_list_json') }}" + var getRegistersListPath = "{{ url_for('process_json_command', command = 'get_registers_list') }}" $.getJSON(getRegistersListPath, parseJsonRegisterList); } @@ -152,54 +158,6 @@ <h2>Device {{ device }} model={{ model }} control page </h2> </div> {% endblock %} - <style> - .tabs > div, .tabs > input { display: none; } - - .tabs label { - padding: 5px; - border: 1px solid #aaa; - line-height: 28px; - cursor: pointer; - position: relative; - bottom: 1px; - background: #fff; - } - - .tabs input[type="radio"]:checked + label { border-bottom: 2px solid #fff; } - - .tabs > input:nth-of-type(1):checked ~ div:nth-of-type(1), - .tabs > input:nth-of-type(2):checked ~ div:nth-of-type(2) { - display: block; - padding: 5px; - border: - 1px solid #aaa; - } - .tree { - height: 85vh; - padding: 5px; - border: 1px solid #aaa; - line-height: 28px; - cursor: pointer; - position: relative; - bottom: 1px; - background: #fff; - overflow:auto; - } - - .infoTable { - padding: 2px; - - border: 1px solid #aaa; - line-height: 28px; - cursor: pointer; - position: relative; - background: #fff; - overflow:auto; - bottom: 1px; - - text-align: left; - } - </style> <div class="tabs"> <input type="radio" name="current" checked="checked" id="props_id"/> @@ -229,5 +187,8 @@ </div> {% block content %} {% endblock %} + <div class="block1" > + <a href="{{ url_for('process_json_command', command='help') }}">Json API usage</a> + </div> </body> </html> diff --git a/html_server/templates/property_info.html b/html_server/templates/property_info.html index 4e7c92f..62ea1ba 100644 --- a/html_server/templates/property_info.html +++ b/html_server/templates/property_info.html @@ -7,7 +7,7 @@ <script> function updateProperty(prop) { - var pathToGetProperty = "{{ url_for('get_property_json') }}" + var pathToGetProperty = "{{ url_for('process_json_command', command = 'get_property') }}" var completePath = pathToGetProperty + '?prop=' + prop $.getJSON(completePath, function(json){ @@ -23,9 +23,9 @@ if(value == "") return - var pathToGetProperty = "{{ url_for('set_property_json') }}" + var pathToGetProperty = "{{ url_for('process_json_command', command = 'set_property') }}" var completePath = pathToGetProperty + '?prop=' + prop + - '&val=' + value; + '&value=' + value; $.getJSON(completePath, function(json) { diff --git a/html_server/templates/registers/table_scripts.html b/html_server/templates/registers/table_scripts.html index 017c910..a772b9f 100644 --- a/html_server/templates/registers/table_scripts.html +++ b/html_server/templates/registers/table_scripts.html @@ -13,9 +13,9 @@ */ function updateRegister(bank, name) { - var pathToReadRegister = "{{ url_for('read_register_json') }}" + var pathToReadRegister = "{{ url_for('process_json_command', command = 'read_register') }}" var completePath = pathToReadRegister + '?bank=' + bank + - '&name=' + name + '®=' + name $.getJSON(completePath, function(json){ checkError(json) @@ -29,9 +29,9 @@ if(value == "") return - var pathToReadRegister = "{{ url_for('write_register_json') }}" + var pathToReadRegister = "{{ url_for('process_json_command', command = 'write_register') }}" var completePath = pathToReadRegister + '?bank=' + bank + - '&name=' + name + '&val=' + value; + '®=' + name + '&value=' + value; $.getJSON(completePath, function(json) { |