feat(web): drop per-binding list from customer credentials tab (item 15)

The tab now shows only the subscription token and the shared
credential set. The Reality public key moved to the node edit form
(item 17) and the socks username to the node itself (item 21), so
nothing the bindings list showed is lost. Display-only change: the
credentials endpoint payload is unchanged.
This commit is contained in:
aaaamoooo
2026-10-21 10:43:37 +00:00
parent 80140f391f
commit 8189a513e1
+6 -7
View File
@@ -627,11 +627,11 @@ function renderCredentialsPane(customer) {
const data = customerFormState.credentials; const data = customerFormState.credentials;
if (!data) { pane.innerHTML = '<div class="empty"><b>加载中…</b></div>'; return; } if (!data) { pane.innerHTML = '<div class="empty"><b>加载中…</b></div>'; return; }
const creds = data.credentials || {}; const creds = data.credentials || {};
const bindings = (data.bindings || []).map((entry) => `<div class="cred-group"> // Round-3 item 15: the per-binding list (node name / status / protocol
<div class="g-head">${esc(entry.nodeName)}<span class="badge ${entry.status === 'active' ? 'green' : 'gray'}">${esc(statusText[entry.status] || entry.status)}</span><span class="mut" style="font-weight:400;font-size:12px">${esc(entry.protocol)}</span></div> // / Reality public key) is gone — the tab shows only the subscription
${entry.username ? credRowHTML('用户名', entry.username) : ''} // token and the one shared credential set. Reality keys live on the
${entry.realityPublicKey ? credRowHTML('Reality 公钥', entry.realityPublicKey) : ''} // node edit form now (item 17); the socks username lives on the node
</div>`).join(''); // (item 21). Backend payload unchanged.
pane.innerHTML = `<div class="cred-group"><div class="g-head">订阅</div> pane.innerHTML = `<div class="cred-group"><div class="g-head">订阅</div>
<div class="cred-row"><span class="k">订阅令牌</span><span class="v">${esc(data.subscriptionToken || '—')}</span> <div class="cred-row"><span class="k">订阅令牌</span><span class="v">${esc(data.subscriptionToken || '—')}</span>
<button type="button" class="icon-btn" data-tip="复制" data-action="copy-text" data-value="${esc(data.subscriptionToken || '')}">${ICONS.copy}</button> <button type="button" class="icon-btn" data-tip="复制" data-action="copy-text" data-value="${esc(data.subscriptionToken || '')}">${ICONS.copy}</button>
@@ -640,8 +640,7 @@ function renderCredentialsPane(customer) {
${credRowHTML('UUID', creds.clientId)} ${credRowHTML('UUID', creds.clientId)}
${credRowHTML('密码', creds.password)} ${credRowHTML('密码', creds.password)}
${credRowHTML('Reality Short ID', creds.shortId)} ${credRowHTML('Reality Short ID', creds.shortId)}
</div> </div>`;
${bindings || '<div class="empty"><b>尚未关联节点</b></div>'}`;
} }
function linkStatusLine(customer, source) { function linkStatusLine(customer, source) {