fix: 看板按钮改真实链接(避免弹窗拦截) + 全局UI美化与布局优化

This commit is contained in:
2026-09-08 19:14:21 +08:00
parent e111151504
commit 6d14860b9c
3 changed files with 41 additions and 18 deletions
-1
View File
@@ -700,7 +700,6 @@
$('#lgLogin').addEventListener('click', loginEnter); $('#lgLogin').addEventListener('click', loginEnter);
$('#lgPwd').addEventListener('keydown', e => { if (e.key === 'Enter') loginTest(); }); $('#lgPwd').addEventListener('keydown', e => { if (e.key === 'Enter') loginTest(); });
$('#btnLogout').addEventListener('click', logout); $('#btnLogout').addEventListener('click', logout);
$('#btnDashboard').addEventListener('click', () => window.open('dashboard.php', '_blank'));
// 启动:本会话已认证(未重启电脑)则直接进入主界面,跳过登录门;否则显示登录门 // 启动:本会话已认证(未重启电脑)则直接进入主界面,跳过登录门;否则显示登录门
let authed = false; let authed = false;
+40 -16
View File
@@ -31,6 +31,13 @@ html, body {
-webkit-font-smoothing: antialiased; -webkit-font-smoothing: antialiased;
} }
/* 顶部柔和渐变,增强页面层次 */
body {
background-image: linear-gradient(180deg, rgba(47, 107, 255, .06), rgba(47, 107, 255, 0) 300px);
background-repeat: no-repeat;
background-attachment: fixed;
}
/* ---------- 顶栏 ---------- */ /* ---------- 顶栏 ---------- */
.topbar { .topbar {
position: sticky; position: sticky;
@@ -115,20 +122,27 @@ html, body {
background: var(--primary-weak); color: var(--primary); background: var(--primary-weak); color: var(--primary);
border-radius: 999px; font-size: 11px; border-radius: 999px; font-size: 11px;
} }
/* 链接当按钮用(如「数据看板」):继承按钮外观,避免被浏览器弹窗拦截 */
a.btn {
display: inline-flex; align-items: center; justify-content: center;
text-decoration: none; white-space: nowrap;
}
a.btn:hover { text-decoration: none; }
/* ---------- 布局 ---------- */ /* ---------- 布局 ---------- */
.wrap { max-width: 1440px; margin: 0 auto; padding: 20px 24px 48px; } .wrap { max-width: 1460px; margin: 0 auto; padding: 22px 26px 52px; }
.toolbar { .toolbar {
display: flex; flex-wrap: wrap; align-items: flex-end; gap: 14px; display: flex; flex-wrap: wrap; align-items: flex-end; gap: 16px 18px;
background: var(--panel); border: 1px solid var(--border); background: linear-gradient(180deg, #ffffff, #fbfcff);
border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); border: 1px solid var(--border);
border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow);
} }
.field { display: flex; flex-direction: column; gap: 6px; } .field { display: flex; flex-direction: column; gap: 7px; min-width: 150px; }
.field.grow { flex: 1 1 260px; min-width: 220px; } .field.grow { flex: 1 1 280px; min-width: 220px; }
.field.grow-2 { flex: 1 1 200px; min-width: 180px; } .field.grow-2 { flex: 1 1 210px; min-width: 180px; }
.field.btns { flex-direction: row; gap: 8px; align-items: center; } .field.btns { flex-direction: row; gap: 8px; align-items: center; }
.field label { font-size: 12px; color: var(--text-2); font-weight: 600; } .field label { font-size: 12px; color: var(--text-2); font-weight: 600; letter-spacing: .3px; }
.inline { display: flex; align-items: center; gap: 10px; } .inline { display: flex; align-items: center; gap: 10px; }
select, input[type=text], input[type=number], input[type=password] { select, input[type=text], input[type=number], input[type=password] {
@@ -194,16 +208,24 @@ select:focus, input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px
/* ---------- 面板 ---------- */ /* ---------- 面板 ---------- */
.panel { .panel {
margin-top: 16px; background: var(--panel); margin-top: 18px; background: var(--panel);
border: 1px solid var(--border); border-radius: var(--radius); border: 1px solid var(--border); border-radius: var(--radius);
box-shadow: var(--shadow); overflow: hidden; box-shadow: var(--shadow); overflow: hidden;
} }
.panel-head { .panel-head {
display: flex; align-items: center; justify-content: space-between; display: flex; align-items: center; justify-content: space-between;
padding: 12px 16px; border-bottom: 1px solid var(--border-2); padding: 13px 18px; border-bottom: 1px solid var(--border-2);
background: linear-gradient(180deg, #ffffff, #fbfcfe);
} }
.panel-head h2 { margin: 0; font-size: 15px; font-weight: 700; } .panel-head h2 {
.panel-head h2 small { font-weight: 500; color: var(--text-3); font-size: 12px; margin-left: 8px; } margin: 0; font-size: 15px; font-weight: 700;
display: flex; align-items: center; gap: 9px;
}
.panel-head h2::before {
content: ''; flex: none; width: 4px; height: 16px; border-radius: 3px;
background: linear-gradient(180deg, var(--primary), #6a4bff);
}
.panel-head h2 small { font-weight: 500; color: var(--text-3); font-size: 12px; margin-left: 0; }
.updated { font-size: 12px; color: var(--text-3); display: flex; align-items: center; gap: 6px; } .updated { font-size: 12px; color: var(--text-3); display: flex; align-items: center; gap: 6px; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: #cbd3e2; display: inline-block; } .dot { width: 7px; height: 7px; border-radius: 50%; background: #cbd3e2; display: inline-block; }
.dot.on { background: var(--ok); animation: pulse 1.6s infinite; } .dot.on { background: var(--ok); animation: pulse 1.6s infinite; }
@@ -220,16 +242,18 @@ select:focus, input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px
table.grid { width: 100%; border-collapse: collapse; font-size: 13px; } table.grid { width: 100%; border-collapse: collapse; font-size: 13px; }
table.grid th { table.grid th {
position: sticky; top: 0; z-index: 2; position: sticky; top: 0; z-index: 2;
background: #fafbfe; color: var(--text-2); background: linear-gradient(180deg, #fbfcfe, #f4f7fc); color: var(--text-2);
text-align: left; font-weight: 600; font-size: 12px; text-align: left; font-weight: 600; font-size: 12px;
padding: 10px 14px; border-bottom: 1px solid var(--border); padding: 11px 14px; border-bottom: 1px solid var(--border);
white-space: nowrap; white-space: nowrap;
box-shadow: inset 0 -1px 0 var(--border);
} }
table.grid th.sortable { cursor: pointer; user-select: none; } table.grid th.sortable { cursor: pointer; user-select: none; }
table.grid th.sortable:hover { color: var(--primary); } table.grid th.sortable:hover { color: var(--primary); }
table.grid th .arrow { color: var(--primary); margin-left: 3px; } table.grid th .arrow { color: var(--primary); margin-left: 3px; }
table.grid td { padding: 9px 14px; border-bottom: 1px solid var(--border-2); } table.grid td { padding: 10px 14px; border-bottom: 1px solid var(--border-2); }
table.grid tbody tr:hover td { background: #fafbfe; } table.grid tbody tr:nth-child(even) td { background: #fbfcff; }
table.grid tbody tr:hover td { background: var(--primary-weak); }
table.grid.compact td, table.grid.compact th { padding: 7px 12px; } table.grid.compact td, table.grid.compact th { padding: 7px 12px; }
td.empty { text-align: center; color: var(--text-3); padding: 32px 0; } td.empty { text-align: center; color: var(--text-3); padding: 32px 0; }
td.num { font-variant-numeric: tabular-nums; white-space: nowrap; } td.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
+1 -1
View File
@@ -25,7 +25,7 @@ $rosterCount = Roster::count();
</div> </div>
<div class="top-right"> <div class="top-right">
<div id="conn" class="conn conn-off"><i></i><span>未连接</span></div> <div id="conn" class="conn conn-off"><i></i><span>未连接</span></div>
<button class="btn" id="btnDashboard" title="打开数据看板">📊 数据看板</button> <a class="btn" id="btnDashboard" href="dashboard.php" target="_blank" rel="noopener" title="在新标签页打开数据看板">📊 数据看板</a>
<button class="btn" id="btnFullscreen" title="切换全屏">⛶ 全屏</button> <button class="btn" id="btnFullscreen" title="切换全屏">⛶ 全屏</button>
<button class="btn" id="btnRoster">名单管理 <b id="rosterBadge"><?= (int)$rosterCount ?></b></button> <button class="btn" id="btnRoster">名单管理 <b id="rosterBadge"><?= (int)$rosterCount ?></b></button>
<button class="btn btn-primary" id="btnSettings">设置</button> <button class="btn btn-primary" id="btnSettings">设置</button>