Implement pull request comments #200.
Co-authored-by: Sebastian Serth <mrserth@users.noreply.github.com>
This commit is contained in:
21
deploy/grafana-dashboard/utils/color_mapping.py
Normal file
21
deploy/grafana-dashboard/utils/color_mapping.py
Normal file
@ -0,0 +1,21 @@
|
||||
def color_mapping(name, color):
|
||||
return {
|
||||
"fieldConfig": {
|
||||
"overrides": [{
|
||||
"matcher": {
|
||||
"id": "byName",
|
||||
"options": name
|
||||
},
|
||||
"properties": [{
|
||||
"id": "color",
|
||||
"value": {
|
||||
"fixedColor": color,
|
||||
"mode": "fixed"
|
||||
}
|
||||
}]
|
||||
}]
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
grey_all_mapping = color_mapping("all", "#4c4b5a")
|
4
deploy/grafana-dashboard/utils/utils.py
Normal file
4
deploy/grafana-dashboard/utils/utils.py
Normal file
@ -0,0 +1,4 @@
|
||||
|
||||
def read_query(name):
|
||||
with open("queries/" + name + ".flux", 'r') as file:
|
||||
return file.read()
|
25
deploy/grafana-dashboard/utils/variables.py
Normal file
25
deploy/grafana-dashboard/utils/variables.py
Normal file
@ -0,0 +1,25 @@
|
||||
from grafanalib.core import Template
|
||||
|
||||
from utils.utils import read_query
|
||||
|
||||
stage_variable = Template(
|
||||
dataSource="Poseidon",
|
||||
label="Stage",
|
||||
name="stages",
|
||||
query=read_query("stages"),
|
||||
refresh=1,
|
||||
includeAll=True,
|
||||
multi=True,
|
||||
default="production"
|
||||
)
|
||||
|
||||
environment_variable = Template(
|
||||
dataSource="Poseidon",
|
||||
label="Environment IDs",
|
||||
name="environment_ids",
|
||||
query=read_query("environment-ids"),
|
||||
refresh=1,
|
||||
includeAll=True,
|
||||
multi=True,
|
||||
default="$__all"
|
||||
)
|
Reference in New Issue
Block a user