grafana-dashboards/Seeding Board.json
2023-05-02 12:17:43 -04:00

278 lines
6.3 KiB
JSON

{
"__inputs": [
{
"name": "DS_MYSQL",
"label": "MySQL",
"description": "",
"type": "datasource",
"pluginId": "mysql",
"pluginName": "MySQL"
}
],
"__elements": {},
"__requires": [
{
"type": "grafana",
"id": "grafana",
"name": "Grafana",
"version": "9.4.7"
},
{
"type": "datasource",
"id": "mysql",
"name": "MySQL",
"version": "1.0.0"
},
{
"type": "panel",
"id": "table",
"name": "Table",
"version": ""
}
],
"annotations": {
"list": [
{
"builtIn": 1,
"datasource": {
"type": "grafana",
"uid": "-- Grafana --"
},
"enable": true,
"hide": true,
"iconColor": "rgba(0, 211, 255, 1)",
"name": "Annotations & Alerts",
"target": {
"limit": 100,
"matchAny": false,
"tags": [],
"type": "dashboard"
},
"type": "dashboard"
}
]
},
"description": "",
"editable": true,
"fiscalYearStartMonth": 0,
"graphTooltip": 0,
"id": null,
"links": [],
"liveNow": false,
"panels": [
{
"datasource": {
"type": "mysql",
"uid": "${DS_MYSQL}"
},
"fieldConfig": {
"defaults": {
"color": {
"mode": "thresholds"
},
"custom": {
"align": "auto",
"cellOptions": {
"type": "auto"
},
"filterable": false,
"inspect": false
},
"decimals": 2,
"mappings": [],
"thresholds": {
"mode": "percentage",
"steps": [
{
"color": "text",
"value": null
},
{
"color": "red",
"value": 10
},
{
"color": "orange",
"value": 30
},
{
"color": "#EAB839",
"value": 50
},
{
"color": "blue",
"value": 60
},
{
"color": "green",
"value": 70
},
{
"color": "dark-green",
"value": 80
},
{
"color": "dark-purple",
"value": 90
}
]
}
},
"overrides": [
{
"matcher": {
"id": "byName",
"options": "Player"
},
"properties": [
{
"id": "custom.filterable",
"value": true
}
]
},
{
"matcher": {
"id": "byType",
"options": "number"
},
"properties": [
{
"id": "custom.cellOptions",
"value": {
"type": "color-text"
}
}
]
}
]
},
"gridPos": {
"h": 22,
"w": 24,
"x": 0,
"y": 0
},
"id": 2,
"options": {
"footer": {
"countRows": false,
"enablePagination": false,
"fields": "",
"reducer": [
"sum"
],
"show": false
},
"showHeader": true,
"sortBy": [
{
"desc": true,
"displayName": "Seed Hours"
}
]
},
"pluginVersion": "9.4.7",
"targets": [
{
"datasource": {
"type": "mysql",
"uid": "${DS_MYSQL}"
},
"editorMode": "code",
"format": "table",
"rawQuery": true,
"rawSql": "select lastName as 'Player', player as 'Steam ID',\r\n sum(case when serverState=1 then time_to_sec(timediff(ifnull(endTime,now()), startTime))/3600 end) as 'Seed Hours',\r\n sum(time_to_sec(timediff(ifnull(endTime,now()),startTime))/3600) as 'Total Hours'\r\nfrom DBLog_PlayerTimes join DBLog_SteamUsers DLSU on DLSU.steamID = DBLog_PlayerTimes.player\r\nwhere $__timeFilter(startTime) and server != 3 and lastName ${admins:value}\r\ngroup by player\r\norder by `Seed Hours` desc\r\n",
"refId": "A",
"sql": {
"columns": [
{
"parameters": [],
"type": "function"
}
],
"groupBy": [
{
"property": {
"type": "string"
},
"type": "groupBy"
}
],
"limit": 50
}
}
],
"title": "Seeding Board",
"transformations": [
{
"id": "configFromData",
"options": {
"applyTo": {
"id": "byName",
"options": "Seed Hours"
},
"configRefId": "A",
"mappings": [
{
"fieldName": "Seed Hours",
"handlerKey": "max",
"reducerId": "max"
}
]
}
}
],
"type": "table"
}
],
"refresh": "",
"revision": 1,
"schemaVersion": 38,
"style": "dark",
"tags": [],
"templating": {
"list": [
{
"current": {
"selected": true,
"text": "yes",
"value": "is not null"
},
"hide": 0,
"includeAll": false,
"label": "Include Admins",
"multi": false,
"name": "admins",
"options": [
{
"selected": true,
"text": "yes",
"value": "is not null"
},
{
"selected": false,
"text": "no",
"value": "not regexp \"\\\\{ASG[oOaAbB]\\\\}\""
}
],
"query": "yes : is not null ,no : not regexp \"\\\\{ASG[oOaAbB]\\\\}\"",
"queryValue": "",
"skipUrlSync": false,
"type": "custom"
}
]
},
"time": {
"from": "now/M",
"to": "now/M"
},
"timepicker": {
"hidden": false
},
"timezone": "",
"title": "Seeding Board",
"uid": "1TJJ4HJ4k",
"version": 31,
"weekStart": ""
}