优化中控科技风界面:登录居中、浮盈配色、默认打开首个客户端。
总览改名期权持仓总览,内容区 1800 居中,去掉左上角仓库名。 Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -91,13 +91,13 @@ def login():
|
||||
if u == hub_username() and p == hub_password():
|
||||
session["logged_in"] = True
|
||||
session.permanent = True
|
||||
nxt = (request.args.get("next") or request.form.get("next") or "/").strip() or "/"
|
||||
nxt = (request.args.get("next") or request.form.get("next") or "/desk").strip() or "/desk"
|
||||
if not nxt.startswith("/"):
|
||||
nxt = "/"
|
||||
nxt = "/desk"
|
||||
return redirect(nxt)
|
||||
flash("用户名或密码错误")
|
||||
if session.get("logged_in"):
|
||||
return redirect("/")
|
||||
return redirect("/desk")
|
||||
return render_template("login.html")
|
||||
|
||||
|
||||
@@ -195,7 +195,11 @@ def settings_page():
|
||||
@app.route("/desk")
|
||||
@login_required
|
||||
def desk():
|
||||
instances = list_instances(enabled_only=True)
|
||||
iid = request.args.get("id")
|
||||
# 未指定客户端时默认打开第一个
|
||||
if (not iid or not str(iid).isdigit()) and instances:
|
||||
return redirect(url_for("desk", id=instances[0]["id"]))
|
||||
inst = None
|
||||
open_url = ""
|
||||
if iid and str(iid).isdigit():
|
||||
@@ -209,7 +213,7 @@ def desk():
|
||||
)
|
||||
return render_template(
|
||||
"desk.html",
|
||||
instances=list_instances(enabled_only=True),
|
||||
instances=instances,
|
||||
current=inst,
|
||||
open_url=open_url,
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user