Skip to content

Commit

Permalink
Added links Statistics again (#973)
Browse files Browse the repository at this point in the history
* Added links again

I moved the should be invisible fields to the far right and minimised them... As soon as that is fixed in Grafana, we can just make them invisible.

The only thing, which is not optimal, is, that the fields with mi and F show up at the far right. No idea, how to address that...

* And changed timezone back to current_setting

Given, that it can be set via PGTZ.

* Added panel title

Otherwise you cannot sort by clicking the column header...

* Make time zone configurable again; preselect current TZ

Co-authored-by: Adrian Kumpf <[email protected]>
  • Loading branch information
DrMichael and adriankumpf committed Oct 14, 2020
1 parent 592526f commit b44231a
Showing 1 changed file with 77 additions and 27 deletions.
104 changes: 77 additions & 27 deletions grafana/dashboards/statistics.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"editable": true,
"gnetId": null,
"graphTooltip": 0,
"iteration": 1601808426715,
"iteration": 1601887874542,
"links": [
{
"icon": "dashboard",
Expand Down Expand Up @@ -114,6 +114,16 @@
{
"id": "custom.width",
"value": 195
},
{
"id": "links",
"value": [
{
"targetBlank": true,
"title": "Trip",
"url": "d/FkUpJpQZk/trip?orgId=1&from=${__data.fields.date_from}&to=${__data.fields.date_to}"
}
]
}
]
},
Expand Down Expand Up @@ -165,7 +175,13 @@
},
{
"id": "links",
"value": []
"value": [
{
"targetBlank": true,
"title": "Charging stats",
"url": "d/-pkIkhmRz/charging-stats?orgId=1&from=${__data.fields.date_from}&to=${__data.fields.date_to}"
}
]
},
{
"id": "unit",
Expand Down Expand Up @@ -209,7 +225,13 @@
"properties": [
{
"id": "links",
"value": []
"value": [
{
"targetBlank": true,
"title": "Charges",
"url": "d/TSmNYvRRk/charges?orgId=1&from=${__data.fields.date_from}&to=${__data.fields.date_to}"
}
]
}
]
},
Expand All @@ -221,7 +243,13 @@
"properties": [
{
"id": "links",
"value": []
"value": [
{
"targetBlank": true,
"title": "Drives",
"url": "d/Y8upc6ZRk/drives?orgId=1&from=${__data.fields.date_from}&to=${__data.fields.date_to}"
}
]
}
]
},
Expand Down Expand Up @@ -362,6 +390,30 @@
"value": "fahrenheit"
}
]
},
{
"matcher": {
"id": "byName",
"options": "date_from"
},
"properties": [
{
"id": "custom.width",
"value": 25
}
]
},
{
"matcher": {
"id": "byName",
"options": "date_to"
},
"properties": [
{
"id": "custom.width",
"value": 26
}
]
}
]
},
Expand Down Expand Up @@ -478,7 +530,7 @@
],
"timeFrom": null,
"timeShift": null,
"title": "",
"title": "per ${period}",
"transformations": [
{
"id": "merge",
Expand All @@ -500,30 +552,30 @@
"timezone": true
},
"indexByName": {
"avg_consumption_kwh": 10,
"avg_outside_temp_c": 6,
"cnt": 7,
"cnt_charges": 12,
"cost_charges": 11,
"date": 3,
"date_from": 1,
"date_to": 2,
"avg_consumption_kwh": 8,
"avg_outside_temp_c": 4,
"cnt": 5,
"cnt_charges": 10,
"cost_charges": 9,
"date": 1,
"date_from": 12,
"date_to": 13,
"display": 0,
"efficiency": 8,
"efficiency_net_km": 13,
"sum_consumption_kwh": 9,
"sum_distance_km": 5,
"sum_duration_h": 4
"efficiency": 6,
"efficiency_net_km": 11,
"sum_consumption_kwh": 7,
"sum_distance_km": 3,
"sum_duration_h": 2
},
"renameByName": {
"avg_consumption_kwh": "Avg charged",
"avg_outside_temp_c": "",
"cnt": "# drives",
"cnt_charges": "# charges",
"cost_charges": "Costs",
"date": "",
"date_from": "Starting at",
"date_to": "Ending at",
"date": "Starting at",
"date_from": "",
"date_to": "",
"display": "Period",
"efficiency": "Efficiency",
"efficiency_net_km": "",
Expand Down Expand Up @@ -691,21 +743,19 @@
{
"allValue": null,
"current": {
"selected": true,
"text": "GMT",
"value": "GMT"
"selected": false
},
"datasource": "TeslaMate",
"definition": "select name from pg_timezone_names where name like 'posix/%';",
"definition": "select current_setting('TIMEZONE'), replace(name, 'posix/', '') from pg_timezone_names where name like 'posix/%';",
"hide": 0,
"includeAll": false,
"label": "Time zone",
"multi": false,
"name": "timezone",
"options": [],
"query": "select name from pg_timezone_names where name like 'posix/%';",
"query": "select current_setting('TIMEZONE'), replace(name, 'posix/', '') from pg_timezone_names where name like 'posix/%';",
"refresh": 1,
"regex": "/posix\\/(.*)/",
"regex": "",
"skipUrlSync": false,
"sort": 0,
"tagValuesQuery": "",
Expand Down

0 comments on commit b44231a

Please sign in to comment.