Changeset c84f87e for src/webapp


Ignore:
Timestamp:
Apr 27, 2017, 11:48:42 AM (10 years ago)
Author:
Joachim Langenbach <joachim.langenbach@…>
Branches:
0.5, app-cordova, debian/bullseye, debian/jessie, master
Children:
06c0abb, 12afe34, 22f7269
Parents:
00a8800 (diff), 19ac332 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'master' of ​https://svn.falaba.de/gnuboat

Location:
src/webapp
Files:
4 edited

Legend:

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

    r00a8800 rc84f87e  
    2828
    2929function displayDataSet(data){
     30        if(!Array.isArray(data)){
     31                console.log("No data array returned!");
     32                return;
     33        }
    3034        if(!("lastvalid" in data)){
    3135                        console.log("No last valid values given!");
    … …  
    119123        displayDataGet();
    120124        setInterval(displayDataGet, 10000);
    121        
     125
    122126        $.getJSON("../webservice/tileserver.php?/map.json", mapSetup);
    123127       
  • src/webapp/webservice/inc/Config.php

    r00a8800 rc84f87e  
    11<?php
    22/*
    3     Copyright (C) 2016 EngSaS - Engineering Solutions and Services Langenbach. All rights reserved.
     3    Copyright (C) 2016 - 2017 EngSaS - Engineering Solutions and Services Langenbach. All rights reserved.
    44
    55    This program is free software: you can redistribute it and/or modify
    … …  
    3535
    3636        public function databaseFile(){
    37                 return $this->dataDirectory() ."log-webservice.rrd";
     37                return $this->dataDirectory() ."gnuboat.rrd";
    3838        }
    39        
     39
    4040        public function shutdownRequestFile(){
    4141                if(array_key_exists("shutdownfile", $this->_config))
    … …  
    4343                return "/var/spool/gnuboat/shutdown.request";
    4444        }
    45        
     45
    4646        public function dataDirectory(){
    4747                if(array_key_exists("datadirectory", $this->_config))
    … …  
    4949                return "/var/lib/gnuboat/";
    5050        }
    51        
     51
    5252        private static function addTrailingSlash($path){
    5353                $length = strlen($path);
    … …  
    5757                return $path;
    5858        }
    59        
     59
    6060        private $_config;
    6161}
  • src/webapp/webservice/index.php

    r00a8800 rc84f87e  
    1616    along with this program.  If not, see <http://www.gnu.org/licenses/>.
    1717*/
     18
     19xdebug_start_trace();
    1820
    1921require_once(__DIR__ ."/inc/Config.php");
    … …  
    6870        $lastTime = -1;
    6971        $keys = array_keys($data);
    70         if(count($keys) < 0 ){
     72        $keyTimeframes = $keys[0];
     73        $itemCount = count($keys);
     74        if($itemCount < 0 ){
    7175                error_log("No keys in fetched rrd data from ". $dbFile);
    7276                echo json_encode("");
    7377                exit;
    7478        }
     79        $timeframesCount = count($data[$keyTimeframes]);
    7580        if($debug > 0){
    76                 echo "<p>Variables: ". count($keys) ."; Timeframes: ". count($data[$keys[0]]) ."</p>\n";
     81                echo "<p>Variables: ". $itemCount ."; Timeframes: ". $timeframesCount ."</p>\n";
    7782        }
    7883        foreach($data[$keys[0]] as $timeframe => $value){
    … …  
    185190}
    186191
     192xdebug_stop_trace();
     193
    187194?>
  • src/webapp/webservice/tileserver.php

    r00a8800 rc84f87e  
    294294      $this->db = new PDO('sqlite:' . $tileset, '', '', array(PDO::ATTR_PERSISTENT => true));
    295295    } catch (Exception $exc) {
    296       echo $exc->getTraceAsString();
     296      error_log($exc->getTraceAsString());
    297297      die;
    298298    }
    … …  
    300300    if (!isset($this->db)) {
    301301      header('Content-type: text/plain');
    302       echo 'Incorrect tileset name: ' . $tileset;
     302      error_log('Incorrect tileset name: ' . $tileset);
    303303      die;
    304304    }
    … …  
    401401    } else {
    402402      header('HTTP/1.1 404 Not Found');
    403       echo 'Server: Unknown or not specified dataset "' . $tileset . '"';
     403      error_log('Server: Unknown or not specified dataset "' . $tileset . '"');
    404404      die;
    405405    }
Note: See TracChangeset for help on using the changeset viewer.