diff --git a/index.html b/index.html
index ef7336d2..b3865c22 100644
--- a/index.html
+++ b/index.html
@@ -46,7 +46,7 @@
-
+
@@ -113,7 +113,7 @@
{data: "client_status.avg_time", className: "right"},
{data: "client_status.shares_good", className: "right"},
{data: "client_status.shares_total", className: "right"},
- {data: "client_status.uptime", render: uptime},
+ {data: "client_status.uptime", render: uptime, className: "right"},
{data: "client_status.last_status_update", render: laststatus},
{
data: null,
@@ -454,7 +454,13 @@
function uptime( data, type, row ) {
if (type !== 'sort') {
- return moment.duration(data, "milliseconds");
+ var lastStatus = row.client_status.last_status_update * 1000;
+
+ if (isOnline(lastStatus)) {
+ return numeral(data/1000).format('00:00:00:00');
+ } else {
+ return "";
+ }
}
return data;
@@ -604,6 +610,7 @@
Shares Good |
Shares Total |
+ Uptime |
Last Update |
Edit |
@@ -625,6 +632,7 @@
|
|
|
+ |
diff --git a/src/cc/CCClient.cpp b/src/cc/CCClient.cpp
index 452cdc5b..83bab7a7 100644
--- a/src/cc/CCClient.cpp
+++ b/src/cc/CCClient.cpp
@@ -297,7 +297,7 @@ std::shared_ptr CCClient::performRequest(const std::string& r
void CCClient::refreshUptime()
{
std::chrono::time_point now = std::chrono::system_clock::now();
- auto uptime = std::chrono::duration_cast(m_self->m_startTime - now);
+ auto uptime = std::chrono::duration_cast(now - m_self->m_startTime);
m_self->m_clientStatus.setUptime(static_cast(uptime.count()));
}
diff --git a/src/cc/Httpd.cpp b/src/cc/Httpd.cpp
index fea7b390..e7527e23 100644
--- a/src/cc/Httpd.cpp
+++ b/src/cc/Httpd.cpp
@@ -59,8 +59,8 @@ bool Httpd::start()
m_daemon = MHD_start_daemon (MHD_USE_SELECT_INTERNALLY | MHD_USE_SSL,
static_cast(m_options->ccPort()), nullptr, nullptr, &Httpd::handler,
this, MHD_OPTION_CONNECTION_TIMEOUT, (unsigned int) 10,
- MHD_OPTION_HTTPS_MEM_KEY, m_keyPem,
- MHD_OPTION_HTTPS_MEM_CERT, m_certPem,
+ MHD_OPTION_HTTPS_MEM_KEY, m_keyPem.c_str(),
+ MHD_OPTION_HTTPS_MEM_CERT, m_certPem.c_str(),
MHD_OPTION_END);
}
# endif