新功能:允许查看服务器地址
This commit is contained in:
@@ -113,6 +113,7 @@
|
||||
globeCard: document.getElementById('globeCard'),
|
||||
btnExpandGlobe: document.getElementById('btnExpandGlobe'),
|
||||
btnRefreshNetwork: document.getElementById('btnRefreshNetwork'),
|
||||
showServerIpInput: document.getElementById('showServerIpInput'),
|
||||
// Footer & Filing
|
||||
icpFilingInput: document.getElementById('icpFilingInput'),
|
||||
psFilingInput: document.getElementById('psFilingInput'),
|
||||
@@ -539,6 +540,7 @@
|
||||
if (dom.psFilingInput) dom.psFilingInput.value = window.SITE_SETTINGS.ps_filing || '';
|
||||
if (dom.logoUrlDarkInput) dom.logoUrlDarkInput.value = window.SITE_SETTINGS.logo_url_dark || '';
|
||||
if (dom.faviconUrlInput) dom.faviconUrlInput.value = window.SITE_SETTINGS.favicon_url || '';
|
||||
if (dom.showServerIpInput) dom.showServerIpInput.value = window.SITE_SETTINGS.show_server_ip ? "1" : "0";
|
||||
// Latency routes loaded separately in openSettings or on startup
|
||||
}
|
||||
|
||||
@@ -1592,6 +1594,28 @@
|
||||
dom.detailDiskTotal.textContent = formatBytes(data.totalDiskSize || 0);
|
||||
}
|
||||
|
||||
// IP Addresses
|
||||
const infoGrid = document.getElementById('detailInfoGrid');
|
||||
if (infoGrid) {
|
||||
// Remove any previously added IP items
|
||||
infoGrid.querySelectorAll('.info-item-ip').forEach(el => el.remove());
|
||||
|
||||
if (window.SITE_SETTINGS && window.SITE_SETTINGS.show_server_ip) {
|
||||
if (data.ipv4 && data.ipv4.length > 0) {
|
||||
const ipv4Item = document.createElement('div');
|
||||
ipv4Item.className = 'info-item info-item-ip';
|
||||
ipv4Item.innerHTML = `<span class="info-label">IPv4 地址</span><span class="info-value">${escapeHtml(data.ipv4.join(', '))}</span>`;
|
||||
infoGrid.appendChild(ipv4Item);
|
||||
}
|
||||
if (data.ipv6 && data.ipv6.length > 0) {
|
||||
const ipv6Item = document.createElement('div');
|
||||
ipv6Item.className = 'info-item info-item-ip';
|
||||
ipv6Item.innerHTML = `<span class="info-label">IPv6 地址</span><span class="info-value" style="font-size: 0.65rem; word-break: break-all;">${escapeHtml(data.ipv6.join(', '))}</span>`;
|
||||
infoGrid.appendChild(ipv6Item);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Define metrics to show
|
||||
const cpuValueHtml = `
|
||||
<div style="display: flex; align-items: baseline; gap: 8px;">
|
||||
@@ -2068,7 +2092,8 @@
|
||||
p95_type: dom.p95TypeSelect ? dom.p95TypeSelect.value : 'tx',
|
||||
ps_filing: dom.psFilingInput ? dom.psFilingInput.value.trim() : '',
|
||||
icp_filing: dom.icpFilingInput ? dom.icpFilingInput.value.trim() : '',
|
||||
network_data_sources: Array.from(dom.networkSourceSelector.querySelectorAll('input[type="checkbox"]:checked')).map(cb => cb.value).join(',')
|
||||
network_data_sources: Array.from(dom.networkSourceSelector.querySelectorAll('input[type="checkbox"]:checked')).map(cb => cb.value).join(','),
|
||||
show_server_ip: dom.showServerIpInput ? (dom.showServerIpInput.value === "1") : false
|
||||
};
|
||||
|
||||
dom.btnSaveSiteSettings.disabled = true;
|
||||
|
||||
Reference in New Issue
Block a user