Permalink
Browse files

Include the device name in the graph_json request from JS.

  • Loading branch information...
trekawek committed Jan 20, 2019
1 parent 4d6fe3f commit d942fbef18830b3ed34e4b6b8746229815fb77b6
Showing with 3 additions and 3 deletions.
  1. +1 −1 src/htdocs/partials/head.php
  2. +1 −1 src/htdocs/partials/tail.php
  3. +1 −1 src/htdocs/public/js/main.js
@@ -37,7 +37,7 @@ function gtag(){dataLayer.push(arguments);}
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body data-pm10-limit1h="<?php echo PM10_LIMIT_1H ?>" data-pm25-limit1h="<?php echo PM25_LIMIT_1H ?>" data-pm10-limit24h="<?php echo PM10_LIMIT_24H ?>" data-pm25-limit24h="<?php echo PM25_LIMIT_24H ?>" data-current-lang='<?php echo $current_lang ?>' data-locale='<?php echo json_encode($locale) ?>'>
<body data-device-name="<?php echo $device['name'] ?>" data-pm10-limit1h="<?php echo PM10_LIMIT_1H ?>" data-pm25-limit1h="<?php echo PM25_LIMIT_1H ?>" data-pm10-limit24h="<?php echo PM10_LIMIT_24H ?>" data-pm25-limit24h="<?php echo PM25_LIMIT_24H ?>" data-current-lang='<?php echo $current_lang ?>' data-locale='<?php echo json_encode($locale) ?>'>
<div class="container">
<div class="row">
<div class="col-md-8 offset-md-2">
@@ -8,6 +8,6 @@
<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.7.3/Chart.min.js" integrity="sha256-oSgtFCCmHWRPQ/JmR4OoZ3Xke1Pw4v50uh6pLcu+fIc=" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/chartjs-plugin-annotation/0.5.7/chartjs-plugin-annotation.min.js" integrity="sha256-Olnajf3o9kfkFGloISwP1TslJiWUDd7IYmfC+GdCKd4=" crossorigin="anonymous"></script>

<script src="/public/js/main.js?v=1.10"></script>
<script src="/public/js/main.js?v=1.11"></script>
</body>
</html>
@@ -246,7 +246,7 @@ function updateGraph(graphContainer) {
var ctx = graphContainer.querySelector('canvas.graph');

var request = new XMLHttpRequest();
var url = '/graph_data.json?type=' + type + '&range=' + range;
var url = '/' + CONFIG.deviceName + '/graph_data.json?type=' + type + '&range=' + range;
if (typeof dataset.avgType !== 'undefined' && dataset.avgType != 0) {
url += '&ma_h=' + dataset.avgType;
}

0 comments on commit d942fbe

Please sign in to comment.