Skip to content

Commit 1d2b68b

Browse files
committed
chore: 更新面板菜单栏
1 parent 0b2ea5b commit 1d2b68b

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

assets/js/index.js

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,17 @@ class Menu extends Element {
9292
this.$menus = {}
9393
this._render_task = null
9494
this.route_handler_lock = null;
95+
96+
const [
97+
x, y
98+
] = [
99+
document.body.getBoundingClientRect().width,
100+
document.body.getBoundingClientRect().height
101+
]
102+
// if is phone, hide menu
103+
if (x < 1280 || y > x) {
104+
this.toggle()
105+
}
95106
}
96107
toggle() {
97108
super.toggle("hidden")
@@ -984,7 +995,6 @@ async function load() {
984995
const $menu = new Menu()
985996
const $menu_variables = {};
986997
$menu.add("dashboard", "a", (...args) => {
987-
console.log("triggered")
988998
if (!$menu_variables.dashboard) {
989999
$menu_variables.dashboard = {};
9901000
}
@@ -1272,11 +1282,9 @@ async function load() {
12721282
)
12731283
} else {
12741284
var server_time = $dashboard_locals.info_runtime
1275-
console.log(server_time)
12761285
// return int((t - ((t + UTC) % 86400) - 86400 * day) / 3600)
12771286
var datetime = server_time.current_time - server_time.diff / 1000.0 + (+new Date() - server_time.resp_timestamp) / 1000.0;
1278-
const previous = (datetime + ((datetime) % 86400) - 86400 * 30);
1279-
console.log(resp)
1287+
const previous = (datetime + (datetime % 86400) - 86400 * 29);
12801288
const res = {}
12811289
for (let i = 0; i < 30; i++) {
12821290
var d = Tools.formatDate(new Date((previous + i * 86400) * 1000.0))
@@ -1285,7 +1293,6 @@ async function load() {
12851293
}
12861294
resp = res
12871295
}
1288-
console.log(resp)
12891296
var option = {
12901297
color: [
12911298
$style.getThemeValue("echarts-color-0"),

0 commit comments

Comments
 (0)