123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869 |
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="UTF-8">
- <title>Status display</title>
- <meta name="description"
- content="Status display generated by BORA.">
- <link rel="stylesheet" href="{{ static_url("style.css") }}">
- <link rel="stylesheet" href="{{ static_url("jquery-ui.min.css") }}">
- <!--[if IE]>
- <script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
- <![endif]-->
- </head>
- <body>
-
- {% if data['style'] %}
- {% for key in data['style'] %}
- <div style='position: absolute; top: {{ data['style'][key]['top'] }}; left:{{ data['style'][key]['left'] }}; width:{{ data['style'][key]['width'] }}px; height:{{ data['style'][key]['height'] }}px;' min="{{ data['style'][key]['min'] }}" max="{{ data['style'][key]['max'] }}" lesser="{{ data['style'][key]['lesser'] }}" larger="{{ data['style'][key]['larger'] }}" id="{{ key }}">
- <p><span style="color: #000; font-size: {{ data['style'][key]['header']['size'] }}; font-weight: {{ data['style'][key]['header']['weight'] }};" class="title">{{ data['style'][key]['header']['title'] }}</span>
- <span style="color: #000; font-size: {{ data['style'][key]['unit']['size'] }}; font-weight: {{ data['style'][key]['unit']['weight'] }};" class="varval"> XXX.XX </span><span class='unit_title'> {{ data['style'][key]['unit']['title'] }}</span></p>
- </div>
- {% end %}
- {% else %}
- {% end %}
-
- <img src="{{ static_url('background.png') }}"></img>
-
- <!-- java script -->
- <script src="{{ static_url("jquery-1.12.3.min.js") }}"></script>
- <script src="{{ static_url("jquery-ui.min.js") }}"></script>
- <script>
- jQuery(window).load(function () {
- myTimer();
- var myVar = setInterval(myTimer, 10000);
- function myTimer() {
- var dataToSend = {};
- $.ajax({
- url: '/getdata/',
- type: 'GET',
- data: dataToSend,
- success: function (response) {
- //var objresponse = JSON.parse(response);
- console.log(response);
- for (var key in response) {
- console.log(key, response[key]);
- if($("#" + key).length > 0) {
- $(".varval", "#" + key).text(parseFloat(response[key]).toFixed(2));
- }
- }
- },
- error: function () {
- console.log("Error.")
- }
- });
- }
- });
- </script>
- </body>
- </html>
|