Start work on saving graph controls
This commit is contained in:
parent
37fdf25eae
commit
c4177abaaf
@ -460,9 +460,13 @@ $(document).ready(function() {
|
|||||||
delete hiddenGraphData[serverIp];
|
delete hiddenGraphData[serverIp];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Redraw the graph
|
||||||
historyPlot.setData(convertGraphData(displayedGraphData));
|
historyPlot.setData(convertGraphData(displayedGraphData));
|
||||||
historyPlot.setupGrid();
|
historyPlot.setupGrid();
|
||||||
|
|
||||||
historyPlot.draw();
|
historyPlot.draw();
|
||||||
|
|
||||||
|
// Update our localStorage
|
||||||
|
saveGraphControls();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -2,6 +2,24 @@ var MISSING_FAVICON_BASE64 = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAA
|
|||||||
|
|
||||||
var tooltip = $('#tooltip');
|
var tooltip = $('#tooltip');
|
||||||
|
|
||||||
|
function saveGraphControls(displayedServers) {
|
||||||
|
if (typeof(localStorage) !== undefined) {
|
||||||
|
var json = JSON.stringify(displayedServers);
|
||||||
|
|
||||||
|
localStorage.setItem('displayedServers', json);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function loadGraphControls() {
|
||||||
|
if (typeof(localStorage) !== undefined) {
|
||||||
|
var item = localStorage.getItem('displayedServers');
|
||||||
|
|
||||||
|
if (item) {
|
||||||
|
return JSON.parse(item);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function getTimestamp(ms, timeOnly) {
|
function getTimestamp(ms, timeOnly) {
|
||||||
var date = new Date(0);
|
var date = new Date(0);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user