Changes in / [c84f87e:00a8800]
- Location:
- src
- Files:
-
- 1 added
- 8 edited
-
puppetcode/environments/test/hieradata/common.yaml (modified) (1 diff)
-
puppetcode/environments/test/modules/gnuboat_canboat/files/n2kd_monitor.service (added)
-
puppetcode/environments/test/modules/gnuboat_canboat/manifests/service.pp (modified) (1 diff)
-
puppetcode/environments/test/modules/gnuboat_gnuboat/manifests/config.pp (modified) (1 diff)
-
puppetcode/environments/test/modules/gnuboat_gnuboat/templates/lighttpd.conf.epp (modified) (1 diff)
-
webapp/webclient/javascript/main.js (modified) (2 diffs)
-
webapp/webservice/inc/Config.php (modified) (5 diffs)
-
webapp/webservice/index.php (modified) (3 diffs)
-
webapp/webservice/tileserver.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/puppetcode/environments/test/hieradata/common.yaml
rc84f87e r00a8800 39 39 gnuboat_hostapd::config::interface: 'wlan0' 40 40 gnuboat_hostapd::config::country_code: 'de' 41 gnuboat_canboat:: service::actisense_primary: '/dev/ttyUSB0'42 gnuboat_canboat:: service::monitor: true43 gnuboat_canboat:: service::actisense_serial: 'Actisense_NGT-1_2C88A'41 gnuboat_canboat::actisense_primary: '/dev/ttyUSB0' 42 gnuboat_canboat::monitor: true 43 gnuboat_canboat::actisense_serial: 'Actisense_NGT-1_2C88A' -
src/puppetcode/environments/test/modules/gnuboat_canboat/manifests/service.pp
rc84f87e r00a8800 36 36 } 37 37 38 file{'/etc/systemd/system/n2kd_monitor.service': 39 ensure => present, 40 owner => 'root', 41 group => 'root', 42 mode => '0600', 43 notify => Service['n2kd_monitor'], 44 source => 'puppet:///modules/gnuboat_canboat/n2kd_monitor.service', 45 } 46 38 47 if $actisense_serial != '' { 39 48 file{'/etc/udev/rules.d/99-n2kd-actisense.rules': -
src/puppetcode/environments/test/modules/gnuboat_gnuboat/manifests/config.pp
rc84f87e r00a8800 15 15 } 16 16 ), 17 notify => Service['lighttpd'],18 17 } 19 18 } -
src/puppetcode/environments/test/modules/gnuboat_gnuboat/templates/lighttpd.conf.epp
rc84f87e r00a8800 27 27 include_shell "/usr/share/lighttpd/create-mime.assign.pl" 28 28 include_shell "/usr/share/lighttpd/include-conf-enabled.pl" 29 30 url.redirect = ( "^/$" => "/webclient/" ) -
src/webapp/webclient/javascript/main.js
rc84f87e r00a8800 28 28 29 29 function displayDataSet(data){ 30 if(!Array.isArray(data)){31 console.log("No data array returned!");32 return;33 }34 30 if(!("lastvalid" in data)){ 35 31 console.log("No last valid values given!"); … … 123 119 displayDataGet(); 124 120 setInterval(displayDataGet, 10000); 125 121 126 122 $.getJSON("../webservice/tileserver.php?/map.json", mapSetup); 127 123 -
src/webapp/webservice/inc/Config.php
rc84f87e r00a8800 1 1 <?php 2 2 /* 3 Copyright (C) 2016 - 2017EngSaS - Engineering Solutions and Services Langenbach. All rights reserved.3 Copyright (C) 2016 EngSaS - Engineering Solutions and Services Langenbach. All rights reserved. 4 4 5 5 This program is free software: you can redistribute it and/or modify … … 35 35 36 36 public function databaseFile(){ 37 return $this->dataDirectory() ." gnuboat.rrd";37 return $this->dataDirectory() ."log-webservice.rrd"; 38 38 } 39 39 40 40 public function shutdownRequestFile(){ 41 41 if(array_key_exists("shutdownfile", $this->_config)) … … 43 43 return "/var/spool/gnuboat/shutdown.request"; 44 44 } 45 45 46 46 public function dataDirectory(){ 47 47 if(array_key_exists("datadirectory", $this->_config)) … … 49 49 return "/var/lib/gnuboat/"; 50 50 } 51 51 52 52 private static function addTrailingSlash($path){ 53 53 $length = strlen($path); … … 57 57 return $path; 58 58 } 59 59 60 60 private $_config; 61 61 } -
src/webapp/webservice/index.php
rc84f87e r00a8800 16 16 along with this program. If not, see <http://www.gnu.org/licenses/>. 17 17 */ 18 19 xdebug_start_trace();20 18 21 19 require_once(__DIR__ ."/inc/Config.php"); … … 70 68 $lastTime = -1; 71 69 $keys = array_keys($data); 72 $keyTimeframes = $keys[0]; 73 $itemCount = count($keys); 74 if($itemCount < 0 ){ 70 if(count($keys) < 0 ){ 75 71 error_log("No keys in fetched rrd data from ". $dbFile); 76 72 echo json_encode(""); 77 73 exit; 78 74 } 79 $timeframesCount = count($data[$keyTimeframes]);80 75 if($debug > 0){ 81 echo "<p>Variables: ". $itemCount ."; Timeframes: ". $timeframesCount."</p>\n";76 echo "<p>Variables: ". count($keys) ."; Timeframes: ". count($data[$keys[0]]) ."</p>\n"; 82 77 } 83 78 foreach($data[$keys[0]] as $timeframe => $value){ … … 190 185 } 191 186 192 xdebug_stop_trace();193 194 187 ?> -
src/webapp/webservice/tileserver.php
rc84f87e r00a8800 294 294 $this->db = new PDO('sqlite:' . $tileset, '', '', array(PDO::ATTR_PERSISTENT => true)); 295 295 } catch (Exception $exc) { 296 e rror_log($exc->getTraceAsString());296 echo $exc->getTraceAsString(); 297 297 die; 298 298 } … … 300 300 if (!isset($this->db)) { 301 301 header('Content-type: text/plain'); 302 e rror_log('Incorrect tileset name: ' . $tileset);302 echo 'Incorrect tileset name: ' . $tileset; 303 303 die; 304 304 } … … 401 401 } else { 402 402 header('HTTP/1.1 404 Not Found'); 403 e rror_log('Server: Unknown or not specified dataset "' . $tileset . '"');403 echo 'Server: Unknown or not specified dataset "' . $tileset . '"'; 404 404 die; 405 405 }
Note:
See TracChangeset
for help on using the changeset viewer.
