Skip to content

Commit 8e1bb06

Browse files
committed
fix: 修复获取不到代理端口
1 parent ff22e93 commit 8e1bb06

File tree

4 files changed

+19
-4
lines changed

4 files changed

+19
-4
lines changed

assets/js/common.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -511,14 +511,13 @@ class Router {
511511
this._route_prefix = route_prefix.replace(/\/+$/, "")
512512
this._before_handlers = []
513513
this._after_handlers = []
514-
this._current_path = this._get_current_path()
514+
this._current_path = null; //this._get_current_path()
515515
this._routes = []
516516
}
517517
init() {
518518
window.addEventListener("popstate", () => {
519519
this._popstate_handler()
520520
})
521-
this._popstate_handler()
522521
window.addEventListener("click", (e) => {
523522
if (e.target.tagName == "A") {
524523
const href = e.target.getAttribute("href")
@@ -530,6 +529,7 @@ class Router {
530529
}
531530
}
532531
})
532+
this._popstate_handler()
533533
}
534534
page(path) {
535535
this._popstate_handler(path)

assets/js/index.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,16 @@ class Menu extends Element {
122122
this.route_handler_lock = resolve
123123
})
124124
var page = event.current_route
125+
if (page.length == 1) {
126+
(() => {
127+
const first_menu = Object.values(this.$menus)[0]
128+
if (first_menu.children.length != 0) {
129+
first_menu.children[0].$dom.click();
130+
} else {
131+
first_menu.$dom.click();
132+
}
133+
})();
134+
}
125135
var [key, sub] = page.slice(1).split("/", 2)
126136
if (cur_key == key && cur_sub == sub) return;
127137
for (const [$key, $val] of Object.entries(this.$menus)) {
@@ -619,6 +629,8 @@ $i18n.addLanguageTable("zh_CN", {
619629
"dashboard.title.storage.30days.bytes": "30 天下载量",
620630
"dashboard.value.storage.hits": "下载数",
621631
"dashboard.value.storage.bytes": "下载量",
632+
"dashboard.title.qps": "5 分钟请求数",
633+
"switch.dashboard.cluster.:all:": "所有节点"
622634

623635
})
624636
$style.setTheme("light", {

core/config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ def rank_clusters_url(self):
170170

171171
const = Const()
172172

173-
VERSION = "3.3.5"
173+
VERSION = "3.3.6"
174174
API_VERSION = "1.13.1"
175175
USER_AGENT = f"openbmclapi/{API_VERSION} python-openbmclapi/{VERSION}"
176176
PYTHON_VERSION = ".".join(map(str, (sys.version_info.major, sys.version_info.minor, sys.version_info.micro)))

core/web.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -387,7 +387,10 @@ def get_server_port(server: Optional[asyncio.Server]):
387387
return None
388388
if not server.sockets:
389389
return None
390-
return server.sockets[0].getsockname()[1]
390+
try:
391+
return server.sockets[0].getsockname()[1]
392+
except:
393+
return None
391394

392395

393396
async def _check_server(

0 commit comments

Comments
 (0)