added icon and info page in web

This commit is contained in:
wt committed 2024-07-30 08:11:23 +07:00
1 parent f7e6243509
commit 1f0d4d0ea7
8 files changed
+70 -7

No files matched your search

Binary file not shown.

After

Width:  |  Height:  |  Size: 686 KiB

+8
View File
@@ -2,6 +2,7 @@ header {
width: 100vw; width: 100vw;
height: 50px; height: 50px;
padding: 10px; padding: 10px;
margin: 5px;
display: grid; display: grid;
grid-template-columns: 32% 32% 32%; grid-template-columns: 32% 32% 32%;
align-items: center; align-items: center;
@@ -40,6 +41,13 @@ header>h1 {
align-items: center; align-items: center;
} }
#openroutericon {
max-width: 50px;
max-height: 50px;
border-radius: 10px;
margin: 0 5px;
}
@media screen and (max-width: 400px) { @media screen and (max-width: 400px) {
header>h1 { header>h1 {
font-size: 15px; font-size: 15px;
+27
View File
@@ -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;
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 264 KiB

+13 -4
View File
@@ -12,6 +12,7 @@
<link rel="stylesheet" href="css/button.css"> <link rel="stylesheet" href="css/button.css">
<link rel="stylesheet" href="css/loader.css"> <link rel="stylesheet" href="css/loader.css">
<link rel="stylesheet" href="css/syslog.css"> <link rel="stylesheet" href="css/syslog.css">
<link rel="stylesheet" href="css/info.css">
<title>Openrouter Admin</title> <title>Openrouter Admin</title>
</head> </head>
@@ -26,8 +27,7 @@
<button class="linkbutton" id="infobutton">Info</button> <button class="linkbutton" id="infobutton">Info</button>
<button class="linkbutton" id="rebootbutton">Reboot</button> <button class="linkbutton" id="rebootbutton">Reboot</button>
</div> </div>
<h1>Openrouter Admin Uptime: <p id="uptime"></p> <h1><img id="openroutericon" src="favicon.ico" alt="icon">Openrouter Admin</h1>
</h1>
<div class="userbuttons"> <div class="userbuttons">
<h1 class="headerusername"></h1> <h1 class="headerusername"></h1>
<button class="exitbutton">Exit</button> <button class="exitbutton">Exit</button>
@@ -198,7 +198,16 @@
<div class="syslogdata"></div> <div class="syslogdata"></div>
</section> </section>
<!-- syslog block --> <!-- syslog block -->
<section class="infosection"></section> <section class="infosection">
<div class="inforect">
<label for="infoversion">Version: </label>
<p id="version">0.1.1</p>
</div>
<div class="inforect">
<label for="infouptime">Uptime: </label>
<p id="uptime"></p>
</div>
</section>
</div> </div>
<!-- settings block --> <!-- settings block -->
</section> </section>
@@ -292,7 +301,7 @@
<script src="js/reboot.js"></script> <script src="js/reboot.js"></script>
<script src="js/syslog.js"></script> <script src="js/syslog.js"></script>
<script src="js/uptime.js"></script> <script src="js/info/uptime.js"></script>
<script src="js/login.js"></script> <script src="js/login.js"></script>
</body> </body>
+16
View File
@@ -2,19 +2,28 @@ const settingssection = document.querySelector('.settingssection')
const settingsbutton = document.querySelector('#settingsbutton') const settingsbutton = document.querySelector('#settingsbutton')
const syslogsection = document.querySelector('.syslogsection') const syslogsection = document.querySelector('.syslogsection')
const syslogbutton = document.querySelector('#syslogbutton') const syslogbutton = document.querySelector('#syslogbutton')
const infobutton = document.querySelector('#infobutton')
const infosection = document.querySelector('.infosection')
const headermenubutton = document.querySelector('#headermenubutton') const headermenubutton = document.querySelector('#headermenubutton')
const headerlinks = document.querySelector('.links') const headerlinks = document.querySelector('.links')
// const header = document.querySelector('.header') // const header = document.querySelector('.header')
let uptimeintervalid
settingsbutton.addEventListener('click', () => { settingsbutton.addEventListener('click', () => {
settingssection.classList.add('active') settingssection.classList.add('active')
syslogsection.classList.remove('active') syslogsection.classList.remove('active')
infosection.classList.remove('active')
clearInterval(uptimeintervalid)
get_all_settings()
}) })
syslogbutton.addEventListener('click', () => { syslogbutton.addEventListener('click', () => {
syslogsection.classList.add('active') syslogsection.classList.add('active')
settingssection.classList.remove('active') settingssection.classList.remove('active')
infosection.classList.remove('active')
clearInterval(uptimeintervalid)
get_syslog_data() 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) { // if (window.screenX > 600) {
// header.removeChild(headermenubutton) // header.removeChild(headermenubutton)
// } else { // } else {
@@ -16,4 +16,8 @@ const get_uptime = () => {
}) })
} }
setInterval(get_uptime, 1000) window.addEventListener('load', () => {
if (infosection.classList.contains('active')) {
uptimeintervalid = setInterval(get_uptime, 1000)
}
})
+1 -2
View File
@@ -10,9 +10,8 @@ if (localStorage.getItem("token") === null) {
adminpanelsection.classList.remove('active') adminpanelsection.classList.remove('active')
loginform.classList.add('active') loginform.classList.add('active')
} else { } else {
get_all_settings()
adminpanelsection.classList.add('active') adminpanelsection.classList.add('active')
settingssection.classList.add('active') infosection.classList.add('active')
headerusername.innerHTML = JSON.parse(localStorage.getItem('userdata')).username headerusername.innerHTML = JSON.parse(localStorage.getItem('userdata')).username
} }