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:
parent
4322cae66a
commit
96dcae3a34
1 changed files with 4 additions and 0 deletions
|
@ -335,6 +335,10 @@ return L.Class.extend({
|
||||||
_longest_name = 0,
|
_longest_name = 0,
|
||||||
_has_totals = false;
|
_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) {
|
function __def(source) {
|
||||||
var inst = source.sname,
|
var inst = source.sname,
|
||||||
rrd = source.rrd.replace(/[\\:]/g, '\\$&'),
|
rrd = source.rrd.replace(/[\\:]/g, '\\$&'),
|
||||||
|
|
Loading…
Reference in a new issue