correct placeholder color in dark theme, use better uptime display

master
Kevin Froman 2019-10-08 23:17:29 -05:00
parent b10bbe7c52
commit 2ab2597e00
2 changed files with 28 additions and 1 deletions

View File

@ -34,6 +34,29 @@ function showSecStatNotice(){
} }
} }
function seconds2time (seconds) {
//func from https://stackoverflow.com/a/7579799/2465421 by https://stackoverflow.com/users/14555/jottos
var hours = Math.floor(seconds / 3600)
var minutes = Math.floor((seconds - (hours * 3600)) / 60)
var seconds = seconds - (hours * 3600) - (minutes * 60)
var time = ""
if (hours != 0) {
time = hours+":"
}
if (minutes != 0 || time !== "") {
minutes = (minutes < 10 && time !== "") ? "0"+minutes : String(minutes)
time += minutes+":"
}
if (time === "") {
time = seconds+"s"
}
else {
time += (seconds < 10) ? "0"+seconds : String(seconds)
}
return time
}
switch (httpGet('/config/get/general.security_level')){ switch (httpGet('/config/get/general.security_level')){
case "0": case "0":
sec_description_str = 'normal' sec_description_str = 'normal'
@ -49,7 +72,7 @@ if (sec_description_str !== 'normal'){
function getStats(){ function getStats(){
stats = JSON.parse(httpGet('getstats', webpass)) stats = JSON.parse(httpGet('getstats', webpass))
uptimeDisplay.innerText = stats['uptime'] + ' seconds' uptimeDisplay.innerText = seconds2time(stats['uptime'])
connectedDisplay.innerText = stats['connectedNodes'] connectedDisplay.innerText = stats['connectedNodes']
storedBlockDisplay.innerText = stats['blockCount'] storedBlockDisplay.innerText = stats['blockCount']
queuedBlockDisplay.innerText = stats['blockQueueCount'] queuedBlockDisplay.innerText = stats['blockQueueCount']

View File

@ -67,3 +67,7 @@ html{
background-color: #1E1E1E; background-color: #1E1E1E;
color: white; color: white;
} }
.textarea::placeholder, .input::placeholder{
color: white;
}