luci-app-statistics: use stable random seed for dynamic graph colors

Fixes: #3666
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
This commit is contained in:
Jo-Philipp Wich 2020-02-21 23:01:22 +01:00
parent 4322cae66a
commit 96dcae3a34

View file

@ -335,6 +335,10 @@ return L.Class.extend({
_longest_name = 0,
_has_totals = false;
/* use the plugin+instance+type as seed for the prng to ensure the
same pseudo-random color sequence for each render */
random.seed(sfh([plugin, plugin_instance || '', dtype || ''].join('.')));
function __def(source) {
var inst = source.sname,
rrd = source.rrd.replace(/[\\:]/g, '\\$&'),