feat(branding): system name/logo, horizontal logo on all pages
This commit is contained in:
+20
-1
@@ -28,4 +28,23 @@ async function doLogin() {
|
||||
|
||||
document.getElementById('pwdInput').addEventListener('keydown', e => { if (e.key === 'Enter') doLogin(); });
|
||||
document.getElementById('userInput').addEventListener('keydown', e => { if (e.key === 'Enter') doLogin(); });
|
||||
document.querySelector('.login button').addEventListener('click', doLogin);
|
||||
document.querySelector('.login button').addEventListener('click', doLogin);
|
||||
|
||||
(async () => {
|
||||
try {
|
||||
const res = await fetch(`${API}/api/public-settings`);
|
||||
if (!res.ok) return;
|
||||
const s = await res.json();
|
||||
const title = document.getElementById('loginTitle');
|
||||
if (title && (s.system_name || '').trim()) title.textContent = s.system_name;
|
||||
const logo = document.getElementById('loginLogo');
|
||||
if (logo && s.system_logo) {
|
||||
const img = document.createElement('img');
|
||||
img.src = s.system_logo;
|
||||
img.alt = '';
|
||||
logo.appendChild(img);
|
||||
logo.style.display = 'flex';
|
||||
}
|
||||
document.title = title ? title.textContent + ' — Вход' : document.title;
|
||||
} catch { /* ignore */ }
|
||||
})();
|
||||
Reference in New Issue
Block a user