Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
MPIfR-BDG
edd_provisioning
Commits
9f683a8e
Commit
9f683a8e
authored
Sep 09, 2021
by
Tobias Winchen
Browse files
Updated colors and overflow
parent
d3e65ff5
Changes
1
Hide whitespace changes
Inline
Side-by-side
roles/grafana_monitoring/templates/home_dashboard.json
View file @
9f683a8e
...
...
@@ -96,7 +96,7 @@
{
"aliasColors"
:
{},
"cacheTimeout"
:
null
,
"css_data"
:
""
,
"css_data"
:
"
.graph{
\n
text-align: center;
\n
}
"
,
"datasource"
:
"Redis_Plots"
,
"doInit"
:
{},
"format"
:
"short"
,
...
...
@@ -107,10 +107,10 @@
"y"
:
3
},
"handleMetric"
:
{},
"html_data"
:
"<div class=
\"
graph
\"
timestamp=0
style=
\"
text-align:center;
\"
>
\n
No graph provided
\n
</div>"
,
"html_data"
:
"<div class=
\"
graph
\"
timestamp=0>
\n
No graph provided
\n
</div>"
,
"id"
:
2093487693488
,
"interval"
:
null
,
"js_code"
:
"var svg = ctrl.data[0].rows[0].value;
\n
var old_timestamp = ctrl.data[0].rows[0].timestamp;
\n
var summary = JSON.parse(ctrl.data[1].rows[0].value);
\
n
console.log(summary);
\n
console.log(
\"
FOO
\"
);
\
n\n
var graph = htmlnode.lastChild;
\n\n
timestamp = graph.getAttribute(
\"
timestamp
\"
);
\n
//
if (timestamp < old_timestamp)
\n
{
\n
console.log(
\"
Updating timestamp
\"
);
\n
graph.setAttribute(
\"
timestamp
\"
, old_timestamp);
\n\n
graph.innerHTML = svg;
\n
\n
//var parser = new DOMParser();
\n
//var doc = parser.parseFromString(svg,
\"
image/svg+xml
\"
);
\n
//console.log(doc);
\n
//graph.appendChild(doc);
\n
\n
\n
}
\n\n
\n
var svg_graph = graph.children[0].children[0];
\n
for (var el of svg_graph.children)
\n
{
\n
if (el.hasAttribute(
\"
class
\"
) && el.getAttribute(
\"
class
\"
) ==
\"
node
\"
)
\n
{
\n
var product_name = el.children[0].innerHTML;
\n
if (summary[product_name] ==
\"
error
\"
)
\n
{
\n
el.children[1].setAttribute(
\"
fill
\"
,
\"
#aa0000
\"
);
\n
el.children[2].setAttribute(
\"
fill
\"
,
\"
#ffffff
\"
);
\n
}
\n
else
\n
{
\n
el.children[1].setAttribute(
\"
fill
\"
,
\"
#00aa00
\"
);
\n
el.children[2].setAttribute(
\"
fill
\"
,
\"
#000000
\"
);
\n\n
}
\n
}
\n
}
\n\n\n
"
,
"js_code"
:
"var svg = ctrl.data[0].rows[0].value;
\n
var old_timestamp = ctrl.data[0].rows[0].timestamp;
\n
var summary = JSON.parse(ctrl.data[1].rows[0].value);
\n\n
var graph = htmlnode.lastChild;
\n\n
timestamp = graph.getAttribute(
\"
timestamp
\"
);
\n
if (timestamp < old_timestamp)
\n
{
\n
graph.setAttribute(
\"
timestamp
\"
, old_timestamp);
\n\n
graph.innerHTML = svg;
\n
\n
//var parser = new DOMParser();
\n
//var doc = parser.parseFromString(svg,
\"
image/svg+xml
\"
);
\n
//console.log(doc);
\n
//graph.appendChild(doc);
\n
}
\n\n
graph.children[0].setAttribute(
\"
width
\"
,
\"
100%
\"
);
\n
var svg_graph = graph.children[0].children[0];
\n
for (var el of svg_graph.children)
\n
{
\n
if (el.hasAttribute(
\"
class
\"
) && el.getAttribute(
\"
class
\"
) ==
\"
node
\"
)
\n
{
\n
var product_name = el.children[0].innerHTML;
\n
if (summary[product_name] ==
\"
error
\"
)
\n
{
\n
el.children[1].setAttribute(
\"
fill
\"
,
\"
#aa0000
\"
);
\n
el.children[2].setAttribute(
\"
fill
\"
,
\"
#ffffff
\"
);
\n
}
\n
else if (summary[product_name] ==
\"
idle
\"
)
\n
{
\n
el.children[1].setAttribute(
\"
fill
\"
,
\"
#6ed0e0
\"
);
\n
el.children[2].setAttribute(
\"
fill
\"
,
\"
#000000
\"
);
\n
}
\n
else if (summary[product_name] ==
\"
configured
\"
)
\n
{
\n
el.children[1].setAttribute(
\"
fill
\"
,
\"
#5794f2
\"
);
\n
el.children[2].setAttribute(
\"
fill
\"
,
\"
#000000
\"
);
\n
}
\n
else
\n
{
\n
el.children[1].setAttribute(
\"
fill
\"
,
\"
#00aa00
\"
);
\n
el.children[2].setAttribute(
\"
fill
\"
,
\"
#000000
\"
);
\n\n
}
\n
}
\n
}
\n\n\n
"
,
"js_init_code"
:
""
,
"links"
:
[],
"maxDataPoints"
:
3
,
...
...
@@ -425,7 +425,7 @@
"type"
:
"dashlist"
}
],
"refresh"
:
""
,
"refresh"
:
"
5s
"
,
"schemaVersion"
:
30
,
"style"
:
"dark"
,
"tags"
:
[],
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment