Skip to content

Commit 937b1ea

Browse files
committed
fix some bug
1 parent b95d194 commit 937b1ea

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

web/js/serverstatus.js

+9-8
Original file line numberDiff line numberDiff line change
@@ -290,17 +290,18 @@ function updateTime() {
290290
uptime();
291291
updateTime();
292292
// 降低改值,可以减少cpu占用
293-
setInterval(uptime, 1000);
294-
setInterval(updateTime, 1000);
293+
setInterval(uptime, 2000);
294+
setInterval(updateTime, 2000);
295295

296296
// styleswitcher.js
297-
function setActiveStyleSheet(title, cookie = false) {
298-
Array.from(document.getElementsByTagName("link")).forEach(a => {
299-
if (a.getAttribute("rel").includes("style") && a.getAttribute("title")) {
300-
a.disabled = a.getAttribute("title") !== title;
297+
function setActiveStyleSheet(title) {
298+
var i, a, main;
299+
for (i = 0; (a = document.getElementsByTagName("link")[i]); i++) {
300+
if (a.getAttribute("rel").indexOf("stylesheet") != -1 && a.getAttribute("title")) {
301+
a.disabled = true;
302+
if (a.getAttribute("title") == title) a.disabled = false;
301303
}
302-
});
303-
if (cookie) createCookie("style", title, 365);
304+
}
304305
}
305306

306307
function getActiveStyleSheet() {

0 commit comments

Comments
 (0)