实例表格展示 Token/路径,Token 默认打码编辑时明文,页宽上限 1800,统一右上按钮尺寸。
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
+32
-14
@@ -83,20 +83,13 @@ body.page-desk .main {
|
||||
margin: 0;
|
||||
padding: 10px 12px 14px;
|
||||
}
|
||||
/* 实例页:普通屏用满;带鱼屏锁 1800 */
|
||||
/* 实例页:最大 1800;小于 1800 时按可用宽度铺满 */
|
||||
body.page-instances .main {
|
||||
max-width: none;
|
||||
max-width: 1800px;
|
||||
width: 100%;
|
||||
margin: 0 auto;
|
||||
padding: 12px clamp(12px, 2vw, 28px) 20px;
|
||||
}
|
||||
@media (min-aspect-ratio: 21/9) {
|
||||
body.page-instances .main {
|
||||
max-width: 1800px;
|
||||
padding-left: clamp(16px, 3vw, 48px);
|
||||
padding-right: clamp(16px, 3vw, 48px);
|
||||
}
|
||||
}
|
||||
body.page-login {
|
||||
min-height: 100vh;
|
||||
}
|
||||
@@ -373,11 +366,23 @@ button, .btn {
|
||||
gap: 8px;
|
||||
align-items: center;
|
||||
}
|
||||
.inst-add-trigger {
|
||||
.inst-page-head-actions .inst-head-btn {
|
||||
box-sizing: border-box;
|
||||
min-width: 7.5rem;
|
||||
height: 40px;
|
||||
padding: 0 16px;
|
||||
margin: 0;
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
font-size: 0.88rem;
|
||||
font-weight: 600;
|
||||
letter-spacing: 0.02em;
|
||||
border-radius: 10px;
|
||||
line-height: 1;
|
||||
}
|
||||
.inst-add-trigger {
|
||||
cursor: pointer;
|
||||
margin: 0;
|
||||
}
|
||||
.inst-add-check {
|
||||
position: absolute;
|
||||
@@ -430,16 +435,29 @@ button, .btn {
|
||||
.inst-table tr.inst-row:hover td {
|
||||
background: rgba(34, 211, 238, 0.04);
|
||||
}
|
||||
.inst-td-name { min-width: 7rem; }
|
||||
.inst-td-name { min-width: 6rem; }
|
||||
.inst-td-url {
|
||||
max-width: 28rem;
|
||||
max-width: 18rem;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
font-size: 0.8rem;
|
||||
}
|
||||
.inst-td-token {
|
||||
white-space: nowrap;
|
||||
font-variant-numeric: tabular-nums;
|
||||
}
|
||||
.inst-token-mask {
|
||||
color: var(--muted);
|
||||
letter-spacing: 0.08em;
|
||||
font-size: 0.82rem;
|
||||
}
|
||||
.inst-td-path code {
|
||||
font-size: 0.8rem;
|
||||
color: #b6c7da;
|
||||
}
|
||||
.inst-td-tags {
|
||||
max-width: 10rem;
|
||||
max-width: 8rem;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
|
||||
@@ -32,6 +32,12 @@
|
||||
}
|
||||
}
|
||||
|
||||
function setTokenVisible(input, toggleBtn, visible) {
|
||||
if (!input) return;
|
||||
input.type = visible ? "text" : "password";
|
||||
if (toggleBtn) toggleBtn.textContent = visible ? "隐藏" : "显示";
|
||||
}
|
||||
|
||||
function bindTokenToggles(root) {
|
||||
(root || document).querySelectorAll(".inst-token-toggle").forEach(function (btn) {
|
||||
if (btn.dataset.bound) return;
|
||||
@@ -40,15 +46,31 @@
|
||||
const wrap = btn.closest(".inst-token-wrap");
|
||||
const input = wrap && wrap.querySelector(".inst-token-input");
|
||||
if (!input) return;
|
||||
const show = input.type === "password";
|
||||
input.type = show ? "text" : "password";
|
||||
btn.textContent = show ? "隐藏" : "显示";
|
||||
setTokenVisible(input, btn, input.type === "password");
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
function bindEditReveal() {
|
||||
document.querySelectorAll(".inst-edit-check[data-reveal-token]").forEach(function (cb) {
|
||||
if (cb.dataset.bound) return;
|
||||
cb.dataset.bound = "1";
|
||||
const sync = function () {
|
||||
const panel = cb.nextElementSibling;
|
||||
if (!panel) return;
|
||||
const input = panel.querySelector("[data-edit-token]");
|
||||
const toggle = panel.querySelector(".inst-token-toggle");
|
||||
// 展开编辑时明文显示 Token;收起后恢复打码
|
||||
setTokenVisible(input, toggle, !!cb.checked);
|
||||
};
|
||||
cb.addEventListener("change", sync);
|
||||
sync();
|
||||
});
|
||||
}
|
||||
|
||||
function boot() {
|
||||
bindTokenToggles(document);
|
||||
bindEditReveal();
|
||||
document.querySelectorAll("tr.inst-row[data-id]").forEach(function (row) {
|
||||
refreshVersion(row);
|
||||
const btn = row.querySelector("[data-inst-refresh-ver]");
|
||||
|
||||
Reference in New Issue
Block a user