Changes in / [7b68139:e9ed726]


Ignore:
Files:
6 deleted
10 edited

Legend:

Unmodified
Added
Removed
  • debian/changelog

    r7b68139 re9ed726  
    22
    33  * Added php5-mysql dependency for gnuboat-server
    4   * Merged improvements to gnuboat-server and gnuboat-webclient
    5     from master
    64
    75 -- EngSaS - Joachim Langenbach <info@engsas.de>  Sun, 23 Apr 2017 12:54:00 +0200
  • src/puppetcode/environments/test/hieradata/common.yaml

    r7b68139 re9ed726  
    66  - gnuboat_gnuboat
    77  - gnuboat_hostapd
    8   - gnuboat_canboat
    9   - apt
    108
    11 apt::sources:
    12   'gnuboat':
    13     comment: 'GNUBoat repository'
    14     location: 'http://ftp.engsas.de/unstable/gnuboat/'
    15     release: 'jessie'
    16     repos: 'main'
    17     pin: '100'
    18     key:
    19       id: 'A365301E098FC834A7DA74C5210358AB8EC7F5EB'
    20       server: 'pgp.mit.edu'
    21     include:
    22       src: true
    23       deb: true
    24 gnuboat_lighttpd::service::status: 'running'
     9gnuboat_lighttpd::servuce::status: 'running'
    2510gnuboat_lighttpd::service::enabled: true
    26 gnuboat_epd::service::status: 'stopped'
     11gnuboat_epd::service::status: 'running'
    2712gnuboat_epd::service::enabled: true
    2813gnuboat_epd::service::display_size: '2.7'
    … …  
    3924gnuboat_hostapd::config::interface: 'wlan0'
    4025gnuboat_hostapd::config::country_code: 'de'
    41 gnuboat_canboat::service::actisense_primary: '/dev/ttyUSB0'
    42 gnuboat_canboat::service::monitor: true
    43 gnuboat_canboat::service::actisense_serial: 'Actisense_NGT-1_2C88A'
  • src/puppetcode/environments/test/modules/gnuboat_epd/manifests/install.pp

    r7b68139 re9ed726  
    55inherits gnuboat_epd
    66{
     7        include apt
     8
     9        apt::source{'gnuboatapt':
     10                comment => 'This is the raspbian repository for GNUBoat',
     11                location => 'http://ftp.engsas.de/unstable/gnuboat/',
     12                release => 'jessie',
     13                repos => 'main',
     14                pin => '-10',
     15                include => {
     16                        'src' => true,
     17                        'deb' => true,
     18                },
     19        }
     20
    721        package{'epd-fuse':
    822                name => "epd-fuse-${panel}",
    923                ensure => $version,
    1024                notify => Service['epd-fuse'],
     25                require => Apt::Source['gnuboatapt'],
    1126        }
    1227
  • src/puppetcode/environments/test/modules/gnuboat_gnuboat/manifests/config.pp

    r7b68139 re9ed726  
    55inherits gnuboat_gnuboat
    66{
    7         file{'/etc/lighttpd/lighttpd.conf':
     7        file{'/etc/lighttpd':
    88                ensure => 'present',
    99                owner => 'root',
    … …  
    1515                        }
    1616                ),
    17                 notify => Service['lighttpd'],
    1817        }
    1918}
  • src/puppetcode/environments/test/modules/gnuboat_gnuboat/manifests/install.pp

    r7b68139 re9ed726  
    11class gnuboat_gnuboat::install() inherits gnuboat_gnuboat
    22{
     3        include apt
     4
     5#        apt::source{'gnuboatapt':
     6#                comment => 'This is the raspbian repository for GNUBoat',
     7#                location => 'http://ftp.engsas.de/unstable/gnuboat/',
     8#                release => 'jessie',
     9#                repos => 'main',
     10#                pin => '-10',
     11#                include => {
     12#                        'src' => true,
     13#                        'deb' => true,
     14#                },
     15#        }
     16
    317        if $server {
    418                package{'gnuboat-server':
    519                        ensure => $version,
    620                        notify => Service['gnuboat'],
     21                        require => Apt::Source['gnuboatapt'],
    722                }
    823        }
    … …  
    1126                package{'gnuboat-webclient':
    1227                        ensure => $version,
     28                        require => Apt::Source['gnuboatapt'],
    1329                }
    1430        }
  • src/puppetcode/environments/test/modules/gnuboat_gnuboat/templates/lighttpd.conf.epp

    r7b68139 re9ed726  
    77)
    88
    9 server.document-root        = "<%= $document_root %>"
     9server.document-root        = "<%= document_root %>"
    1010server.upload-dirs          = ( "/var/cache/lighttpd/uploads" )
    1111server.errorlog             = "/var/log/lighttpd/error.log"
    … …  
    2727include_shell "/usr/share/lighttpd/create-mime.assign.pl"
    2828include_shell "/usr/share/lighttpd/include-conf-enabled.pl"
    29 
    30 url.redirect = ( "^/$" => "/webclient/" )
  • src/webapp/webclient/javascript/main.js

    r7b68139 re9ed726  
    2828
    2929function displayDataSet(data){
    30         if(!Array.isArray(data)){
    31                 console.log("No data array returned!");
    32                 return;
    33         }
    3430        if(!("lastvalid" in data)){
    3531                        console.log("No last valid values given!");
    … …  
    122118$(document).ready(function() {
    123119        displayDataGet();
    124         setInterval(displayDataGet, 15000);
     120        setInterval(displayDataGet, 5000);
    125121       
    126122        $.getJSON("../webservice/tileserver.php?/map.json", mapSetup);
  • src/webapp/webservice/inc/Config.php

    r7b68139 re9ed726  
    3535
    3636        public function databaseFile(){
    37                 return $this->dataDirectory() ."gnuboat.rrd";
     37                return $this->dataDirectory() ."log-webservice.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 __DIR__ ."/../data/";
    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

    r7b68139 re9ed726  
    1616    along with this program.  If not, see <http://www.gnu.org/licenses/>.
    1717*/
    18 
    19 xdebug_start_trace();
    2018
    2119require_once(__DIR__ ."/inc/Config.php");
    … …  
    6563        $lastTime = -1;
    6664        $keys = array_keys($data);
    67         $keyTimeframes = $keys[0];
    68         $itemCount = count($keys);
    69         if($itemCount < 0 ){
     65        if(count($keys) < 0 ){
    7066                error_log("No keys in fetched rrd data from ". $dbFile);
    7167                echo json_encode("");
    7268                exit;
    7369        }
    74         $timeframesCount = count($data[$keyTimeframes]);
    7570        if($debug > 0){
    76                 echo "<p>Variables: ". $itemCount ."; Timeframes: ". $timeframesCount ."</p>\n";
     71                echo "<p>Variables: ". count($keys) ."; Timeframes: ". count($data[$keys[0]]) ."</p>\n";
    7772        }
    78         $keysTimeframes = array_keys($data[$keyTimeframes]);
    79         for($i = 0; $i < $timeframesCount; $i++){
    80                 $time = $keysTimeframes[$i];
     73        for($i = 0; $i < count($data[$keys[0]]); $i++){
     74                $time = array_keys($data[$keys[0]])[$i];
    8175                $allValid = true;
    8276                $tmp = array();
    … …  
    181175}
    182176
    183 xdebug_stop_trace();
    184 
    185177?>
  • src/webapp/webservice/tileserver.php

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