Commit 9f683a8e authored by Tobias Winchen's avatar Tobias Winchen
Browse files

Updated colors and overflow

parent d3e65ff5
......@@ -96,7 +96,7 @@
{
"aliasColors": {},
"cacheTimeout": null,
"css_data": "",
"css_data": ".graph{\ntext-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;\">\nNo graph provided\n</div>",
"html_data": "<div class=\"graph\" timestamp=0>\nNo graph provided\n</div>",
"id": 2093487693488,
"interval": null,
"js_code": "var svg = ctrl.data[0].rows[0].value;\nvar old_timestamp = ctrl.data[0].rows[0].timestamp;\nvar summary = JSON.parse(ctrl.data[1].rows[0].value);\nconsole.log(summary);\nconsole.log(\"FOO\");\n\nvar graph = htmlnode.lastChild;\n\ntimestamp = 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\nvar svg_graph = graph.children[0].children[0];\nfor (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;\nvar old_timestamp = ctrl.data[0].rows[0].timestamp;\nvar summary = JSON.parse(ctrl.data[1].rows[0].value);\n\nvar graph = htmlnode.lastChild;\n\ntimestamp = graph.getAttribute(\"timestamp\");\nif (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\ngraph.children[0].setAttribute(\"width\", \"100%\");\nvar svg_graph = graph.children[0].children[0];\nfor (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": [],
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment