diff --git a/static/public/css/theme.css b/static/public/css/theme.css index 092dab6..be578fa 100644 --- a/static/public/css/theme.css +++ b/static/public/css/theme.css @@ -420,6 +420,15 @@ input[type="button"]:disabled { } } .minimap:empty, .userpanel:empty { display: none; } +/* userpanel 纯展示项(用户名/角色):不可点击,无手型光标与 hover 变色 */ +.userpanel .tag.no-hover { + cursor: default; +} +.userpanel .tag.no-hover:hover { + color: var(--fg-secondary); + background: rgba(232, 133, 58, 0.08); + border-color: transparent; +} .minimap .tag, .userpanel .tag { display: inline-block; max-width: 140px; diff --git a/static/public/js/dnfs.js b/static/public/js/dnfs.js index d52f8ef..50a2285 100644 --- a/static/public/js/dnfs.js +++ b/static/public/js/dnfs.js @@ -693,12 +693,12 @@ function renderUserPanel() { if (!userpanel_expand || !current_user.login) return; let name_tag = document.createElement("div"); - name_tag.className = "tag"; + name_tag.className = "tag no-hover"; name_tag.textContent = current_user.user; userpanel.appendChild(name_tag); let role_tag = document.createElement("div"); - role_tag.className = "tag"; + role_tag.className = "tag no-hover"; role_tag.textContent = current_user.is_admin ? "管理员" : "普通用户"; userpanel.appendChild(role_tag);