diff --git a/openrouter/src/web/Default_router_web_inerface_icon_with_wifi_icon_3.jpg b/openrouter/src/web/Default_router_web_inerface_icon_with_wifi_icon_3.jpg new file mode 100644 index 0000000..afdf752 Binary files /dev/null and b/openrouter/src/web/Default_router_web_inerface_icon_with_wifi_icon_3.jpg differ diff --git a/openrouter/src/web/css/header.css b/openrouter/src/web/css/header.css index b1302ee..aab2e97 100644 --- a/openrouter/src/web/css/header.css +++ b/openrouter/src/web/css/header.css @@ -2,6 +2,7 @@ header { width: 100vw; height: 50px; padding: 10px; + margin: 5px; display: grid; grid-template-columns: 32% 32% 32%; align-items: center; @@ -40,6 +41,13 @@ header>h1 { align-items: center; } +#openroutericon { + max-width: 50px; + max-height: 50px; + border-radius: 10px; + margin: 0 5px; +} + @media screen and (max-width: 400px) { header>h1 { font-size: 15px; diff --git a/openrouter/src/web/css/info.css b/openrouter/src/web/css/info.css new file mode 100644 index 0000000..1271e0d --- /dev/null +++ b/openrouter/src/web/css/info.css @@ -0,0 +1,27 @@ +.infosection { + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + opacity: 0; + pointer-events: none; + transition: 0.3s; + padding: 10px; +} + +.infosection.active { + opacity: 1; + pointer-events: all; +} + +.inforect { + background-color: gray; + max-width: 500px; + border-radius: 10px; + display: grid; + grid-template-columns: repeat(2, minmax(50px, 500px)); + align-items: center; + padding: 10px; + margin: 10px; +} diff --git a/openrouter/src/web/favicon.ico b/openrouter/src/web/favicon.ico new file mode 100644 index 0000000..430def6 Binary files /dev/null and b/openrouter/src/web/favicon.ico differ diff --git a/openrouter/src/web/index.html b/openrouter/src/web/index.html index c85debb..e4ee49a 100644 --- a/openrouter/src/web/index.html +++ b/openrouter/src/web/index.html @@ -12,6 +12,7 @@ + Openrouter Admin @@ -26,8 +27,7 @@ -

Openrouter Admin Uptime:

-

+

iconOpenrouter Admin

@@ -198,7 +198,16 @@
-
+
+
+ +

0.1.1

+
+
+ +

+
+
@@ -292,7 +301,7 @@ - + diff --git a/openrouter/src/web/js/header.js b/openrouter/src/web/js/header.js index 935acce..70e487f 100644 --- a/openrouter/src/web/js/header.js +++ b/openrouter/src/web/js/header.js @@ -2,19 +2,28 @@ const settingssection = document.querySelector('.settingssection') const settingsbutton = document.querySelector('#settingsbutton') const syslogsection = document.querySelector('.syslogsection') const syslogbutton = document.querySelector('#syslogbutton') +const infobutton = document.querySelector('#infobutton') +const infosection = document.querySelector('.infosection') const headermenubutton = document.querySelector('#headermenubutton') const headerlinks = document.querySelector('.links') // const header = document.querySelector('.header') +let uptimeintervalid + settingsbutton.addEventListener('click', () => { settingssection.classList.add('active') syslogsection.classList.remove('active') + infosection.classList.remove('active') + clearInterval(uptimeintervalid) + get_all_settings() }) syslogbutton.addEventListener('click', () => { syslogsection.classList.add('active') settingssection.classList.remove('active') + infosection.classList.remove('active') + clearInterval(uptimeintervalid) get_syslog_data() }) @@ -32,6 +41,13 @@ window.addEventListener('click', (e) => { } }) +infobutton.addEventListener('click', () => { + syslogsection.classList.remove('active') + settingssection.classList.remove('active') + infosection.classList.add('active') + uptimeintervalid = setInterval(get_uptime, 1000) +}) + // if (window.screenX > 600) { // header.removeChild(headermenubutton) // } else { diff --git a/openrouter/src/web/js/uptime.js b/openrouter/src/web/js/info/uptime.js similarity index 81% rename from openrouter/src/web/js/uptime.js rename to openrouter/src/web/js/info/uptime.js index 44a7405..2791e97 100644 --- a/openrouter/src/web/js/uptime.js +++ b/openrouter/src/web/js/info/uptime.js @@ -16,4 +16,8 @@ const get_uptime = () => { }) } -setInterval(get_uptime, 1000) +window.addEventListener('load', () => { + if (infosection.classList.contains('active')) { + uptimeintervalid = setInterval(get_uptime, 1000) + } +}) diff --git a/openrouter/src/web/js/login.js b/openrouter/src/web/js/login.js index e919f12..37e6fdd 100644 --- a/openrouter/src/web/js/login.js +++ b/openrouter/src/web/js/login.js @@ -10,9 +10,8 @@ if (localStorage.getItem("token") === null) { adminpanelsection.classList.remove('active') loginform.classList.add('active') } else { - get_all_settings() adminpanelsection.classList.add('active') - settingssection.classList.add('active') + infosection.classList.add('active') headerusername.innerHTML = JSON.parse(localStorage.getItem('userdata')).username }