Ignore:
Timestamp:
Jul 20, 2016, 5:18:34 PM (10 years ago)
Author:
Joachim Langenbach <joachim.langenbach@…>
Branches:
0.5, app-cordova, debian/bullseye, debian/jessie, master
Children:
d7ee6ae
Parents:
a250eb4
Message:
  • Started to implement shutdown functionality
    • Tried to fix webservice rrd_fetch with to many values
Location:
src/webapp/webclient
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • src/webapp/webclient/css/main.css

    ra250eb4 r5519ced  
    1818body {
    1919        margin: 1em;
     20        width: 58.3mm;
    2021}
    2122
    … …  
    3536#display {
    3637        background-color: #E6E6E6;
    37         width: 58.3mm;
     38        width: 100%;
    3839        height: 38.2mm;
    3940        font-size: 12pt;
    … …  
    9495
    9596#map {
    96         width: 58.3mm;
     97        width: 100%;
    9798        height: 76mm;
    9899        border: 1px solid black;
    … …  
    133134
    134135}
     136
     137#shutdown {
     138        width: 100%;
     139        margin-top: 3em;
     140}
     141
     142#shutdown button {
     143        background-color: #8C1C00;
     144        color: white;
     145        font-weight: bold;
     146        font-size: 24pt;
     147        width: 100%;
     148}
  • src/webapp/webclient/javascript/main.js

    ra250eb4 r5519ced  
    102102}
    103103
     104function shutdown(){
     105        $.getJSON("../webservice/?request=shutdown", function(data){
     106                var shutdownTime = data["shutdownstart"];
     107                var shutdownDate = new Date(shutdownTime);
     108                var currentDate = new Date();
     109                var shutdownHint = "Shutting down in "+ Math.floor((shutdownDate - currentDate)/1000) +"s at "+ shutdownTime.toLocaleString();
     110                if(shutdownTime == -1){
     111                        shutdownHint = "Failed to initiate shutdown!";
     112                }
     113                $("#shutdownMessage").text(shutdownHint);
     114        });
     115}
     116
    104117$(document).ready(function() {
    105118        displayDataGet();
    … …  
    107120       
    108121        $.getJSON("../webservice/tileserver.php?/map.json", mapSetup);
     122       
     123        $("#shutdownButton").click(shutdown);
    109124});
  • src/webapp/webclient/root/index.php

    ra250eb4 r5519ced  
    100100                </div>
    101101        </form>
     102        <div id="shutdown">
     103                <p id="shutdownMessage"/>
     104                <form>
     105                        <button type="button" id="shutdownButton">SHUTDOWN</button>
     106                </form>
     107        </div>
    102108<?php
    103109require_once("inc/footer.php");
Note: See TracChangeset for help on using the changeset viewer.