mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-23 00:13:13 +09:00
No longer displays all subpages by default, performance on tab inactive
This commit is contained in:
1 parent
85274220e7
commit
09d511d0c8
2 files changed
+8
-1
No files matched your search
+5
-1
@@ -51,6 +51,7 @@ function drawcontents(data) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// handle the navigation buttons
|
// handle the navigation buttons
|
||||||
|
currentPage = ""
|
||||||
function display(page) {
|
function display(page) {
|
||||||
var pages = document.querySelector("#body").childNodes;
|
var pages = document.querySelector("#body").childNodes;
|
||||||
for(i=0;i<pages.length;i++){
|
for(i=0;i<pages.length;i++){
|
||||||
@@ -60,6 +61,7 @@ function display(page) {
|
|||||||
}
|
}
|
||||||
if(typeof page == "string" && document.querySelector("#" + page)) {
|
if(typeof page == "string" && document.querySelector("#" + page)) {
|
||||||
document.querySelector("#" + page).style.display = "block";
|
document.querySelector("#" + page).style.display = "block";
|
||||||
|
currentPage = page;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -154,7 +156,9 @@ setInterval(function() {
|
|||||||
xmlhttp.onreadystatechange = function() {
|
xmlhttp.onreadystatechange = function() {
|
||||||
if(xmlhttp.readyState == 4 && xmlhttp.status == 200) {
|
if(xmlhttp.readyState == 4 && xmlhttp.status == 200) {
|
||||||
data = JSON.parse(xmlhttp.responseText);
|
data = JSON.parse(xmlhttp.responseText);
|
||||||
drawcontents(data);
|
if(currentPage = "storage"){
|
||||||
|
drawcontents(data);
|
||||||
|
}
|
||||||
// render our piechart with up to date information
|
// render our piechart with up to date information
|
||||||
// items-in-network-chart
|
// items-in-network-chart
|
||||||
if(piedata) {
|
if(piedata) {
|
||||||
|
|||||||
@@ -16,6 +16,9 @@
|
|||||||
#body {
|
#body {
|
||||||
margin-left:200px;
|
margin-left:200px;
|
||||||
}
|
}
|
||||||
|
#body > div {
|
||||||
|
display:none;
|
||||||
|
}
|
||||||
#contents {
|
#contents {
|
||||||
width:300px;
|
width:300px;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user