new influxdb auth
This commit is contained in:
parent
2ef9508fee
commit
e58f180463
|
|
@ -108,7 +108,7 @@ func metricsHandler(response http.ResponseWriter, request *http.Request) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set headers
|
// Set headers
|
||||||
req.Header.Set("Authorization", "Token xXnq8ADcDygAyM_L0B_10c9yuoOv-cYcUfIXkJunRrIDMhB5ZNmza-Whr1ELcbKNzW8GzUMMYD85QohUHQdAmg==")
|
req.Header.Set("Authorization", "Token OzSltiHLmm3WCaFPI0DrK0VFAVCiqcORNrGsgHO43jb0qodyVGAumJQ3HRtkaze53BVR3AmHqfkmrwrjq-xTyA==")
|
||||||
req.Header.Set("accept", "application/csv")
|
req.Header.Set("accept", "application/csv")
|
||||||
req.Header.Set("content-type", "application/vnd.flux")
|
req.Header.Set("content-type", "application/vnd.flux")
|
||||||
|
|
||||||
|
|
@ -194,7 +194,7 @@ func lastmetricsHandler(response http.ResponseWriter, request *http.Request) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set headers
|
// Set headers
|
||||||
req.Header.Set("Authorization", "Token xXnq8ADcDygAyM_L0B_10c9yuoOv-cYcUfIXkJunRrIDMhB5ZNmza-Whr1ELcbKNzW8GzUMMYD85QohUHQdAmg==")
|
req.Header.Set("Authorization", "Token OzSltiHLmm3WCaFPI0DrK0VFAVCiqcORNrGsgHO43jb0qodyVGAumJQ3HRtkaze53BVR3AmHqfkmrwrjq-xTyA==")
|
||||||
req.Header.Set("accept", "application/csv")
|
req.Header.Set("accept", "application/csv")
|
||||||
req.Header.Set("content-type", "application/vnd.flux")
|
req.Header.Set("content-type", "application/vnd.flux")
|
||||||
|
|
||||||
|
|
@ -291,7 +291,7 @@ func getLastMetrics(deveui string) OneMetric {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set headers
|
// Set headers
|
||||||
req.Header.Set("Authorization", "Token xXnq8ADcDygAyM_L0B_10c9yuoOv-cYcUfIXkJunRrIDMhB5ZNmza-Whr1ELcbKNzW8GzUMMYD85QohUHQdAmg==")
|
req.Header.Set("Authorization", "Token OzSltiHLmm3WCaFPI0DrK0VFAVCiqcORNrGsgHO43jb0qodyVGAumJQ3HRtkaze53BVR3AmHqfkmrwrjq-xTyA==")
|
||||||
req.Header.Set("accept", "application/csv")
|
req.Header.Set("accept", "application/csv")
|
||||||
req.Header.Set("content-type", "application/vnd.flux")
|
req.Header.Set("content-type", "application/vnd.flux")
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -207,11 +207,15 @@ function drawGraph(deveui, alias, property, start, stop, create_graph) {
|
||||||
|
|
||||||
$.getJSON('https://mini-beieli.ch/metrics?deveui=' + deveui + '&alias=' + alias + '&property=' + property + range, function(mydata) {
|
$.getJSON('https://mini-beieli.ch/metrics?deveui=' + deveui + '&alias=' + alias + '&property=' + property + range, function(mydata) {
|
||||||
if ("msg" in mydata) {
|
if ("msg" in mydata) {
|
||||||
$('#chart').html(`<article class="message is-danger">
|
if (mydata.msg.includes("expired")) {
|
||||||
|
$('#chart').html(`<article class="message is-danger">
|
||||||
<div class="message-body">
|
<div class="message-body">
|
||||||
Abo ist abgelaufen!
|
Abo ist abgelaufen
|
||||||
</div>
|
</div>
|
||||||
</article>`);
|
</article>`);
|
||||||
|
} else {
|
||||||
|
location.reload(true);
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
var options = {
|
var options = {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue