Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/webapp/webclient/javascript/main.js

    r4ab1c0a rd7ee6ae  
    102102}
    103103
     104function shutdown(){
     105        $.getJSON("../webservice/?request=shutdown", function(data){
     106                var shutdownTime = data["shutdownstart"];
     107                var shutdownDate = Date.parse(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});
Note: See TracChangeset for help on using the changeset viewer.