优化
This commit is contained in:
@@ -34,6 +34,14 @@
|
||||
if (settings.page_name) {
|
||||
document.title = settings.page_name;
|
||||
}
|
||||
|
||||
// Handle page name visibility
|
||||
if (settings.show_page_name === 0) {
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
const lt = document.getElementById('logoText');
|
||||
if (lt) lt.style.display = 'none';
|
||||
});
|
||||
}
|
||||
})();
|
||||
</script>
|
||||
</head>
|
||||
@@ -448,6 +456,14 @@
|
||||
<label for="siteTitleInput">标题 (大屏左上角显示名称)</label>
|
||||
<input type="text" id="siteTitleInput" placeholder="例:数据可视化展示大屏">
|
||||
</div>
|
||||
<div class="form-group" style="margin-top: 15px;">
|
||||
<label for="showPageNameInput">是否显示左上角标题</label>
|
||||
<select id="showPageNameInput"
|
||||
style="padding: 10px 14px; background: var(--bg-input); border: 1px solid var(--border-color); border-radius: var(--radius-sm); color: var(--text-primary); width: 100%;">
|
||||
<option value="1">显示 (Show)</option>
|
||||
<option value="0">隐藏 (Hide)</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-group" style="margin-top: 15px;">
|
||||
<label for="logoUrlInput">Logo URL (白天/默认,支持图片链接)</label>
|
||||
<input type="url" id="logoUrlInput" placeholder="https://example.com/logo_light.png">
|
||||
|
||||
@@ -43,6 +43,7 @@
|
||||
serverSourceOption: document.getElementById('serverSourceOption'),
|
||||
faviconUrlInput: document.getElementById('faviconUrlInput'),
|
||||
logoUrlDarkInput: document.getElementById('logoUrlDarkInput'),
|
||||
showPageNameInput: document.getElementById('showPageNameInput'),
|
||||
// Site Settings
|
||||
modalTabs: document.querySelectorAll('.modal-tab'),
|
||||
tabContents: document.querySelectorAll('.tab-content'),
|
||||
@@ -1679,6 +1680,7 @@
|
||||
if (dom.psFilingInput) dom.psFilingInput.value = settings.ps_filing || '';
|
||||
if (dom.logoUrlDarkInput) dom.logoUrlDarkInput.value = settings.logo_url_dark || '';
|
||||
if (dom.faviconUrlInput) dom.faviconUrlInput.value = settings.favicon_url || '';
|
||||
if (dom.showPageNameInput) dom.showPageNameInput.value = settings.show_page_name !== undefined ? settings.show_page_name.toString() : "1";
|
||||
|
||||
// Apply to UI
|
||||
applySiteSettings(settings);
|
||||
@@ -1712,8 +1714,10 @@
|
||||
if (settings.page_name) {
|
||||
document.title = settings.page_name;
|
||||
}
|
||||
if (settings.title) {
|
||||
dom.logoText.textContent = settings.title;
|
||||
if (dom.logoText) {
|
||||
if (settings.title) dom.logoText.textContent = settings.title;
|
||||
// Handle visibility toggle
|
||||
dom.logoText.style.display = (settings.show_page_name === 0) ? 'none' : 'block';
|
||||
}
|
||||
|
||||
// Logo Icon
|
||||
@@ -1817,6 +1821,7 @@
|
||||
logo_url: dom.logoUrlInput ? dom.logoUrlInput.value.trim() : '',
|
||||
logo_url_dark: dom.logoUrlDarkInput ? dom.logoUrlDarkInput.value.trim() : '',
|
||||
favicon_url: dom.faviconUrlInput ? dom.faviconUrlInput.value.trim() : '',
|
||||
show_page_name: dom.showPageNameInput ? parseInt(dom.showPageNameInput.value) : 1,
|
||||
default_theme: dom.defaultThemeInput ? dom.defaultThemeInput.value : 'dark',
|
||||
show_95_bandwidth: dom.show95BandwidthInput ? (dom.show95BandwidthInput.value === "1") : false,
|
||||
p95_type: dom.p95TypeSelect ? dom.p95TypeSelect.value : 'tx',
|
||||
|
||||
Reference in New Issue
Block a user