From 2ab2597e003dd59545dab27c58a108658f02e8dc Mon Sep 17 00:00:00 2001 From: Kevin Froman Date: Tue, 8 Oct 2019 23:17:29 -0500 Subject: [PATCH] correct placeholder color in dark theme, use better uptime display --- static-data/www/shared/main/stats.js | 25 ++++++++++++++++++- .../www/shared/main/themes/styles-dark.css | 4 +++ 2 files changed, 28 insertions(+), 1 deletion(-) diff --git a/static-data/www/shared/main/stats.js b/static-data/www/shared/main/stats.js index 9e769b28..3265ce4f 100755 --- a/static-data/www/shared/main/stats.js +++ b/static-data/www/shared/main/stats.js @@ -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')){ case "0": sec_description_str = 'normal' @@ -49,7 +72,7 @@ if (sec_description_str !== 'normal'){ function getStats(){ stats = JSON.parse(httpGet('getstats', webpass)) - uptimeDisplay.innerText = stats['uptime'] + ' seconds' + uptimeDisplay.innerText = seconds2time(stats['uptime']) connectedDisplay.innerText = stats['connectedNodes'] storedBlockDisplay.innerText = stats['blockCount'] queuedBlockDisplay.innerText = stats['blockQueueCount'] diff --git a/static-data/www/shared/main/themes/styles-dark.css b/static-data/www/shared/main/themes/styles-dark.css index 0952aac9..ccf1b672 100644 --- a/static-data/www/shared/main/themes/styles-dark.css +++ b/static-data/www/shared/main/themes/styles-dark.css @@ -67,3 +67,7 @@ html{ background-color: #1E1E1E; color: white; } + +.textarea::placeholder, .input::placeholder{ + color: white; +} \ No newline at end of file