From 624310a9852b014d2a6d3e4f1ce1fa3798a24423 Mon Sep 17 00:00:00 2001 From: Dan Janosik Date: Tue, 24 Mar 2020 17:02:15 -0400 Subject: [PATCH] - /admin: uptime item - trying to fix certbot... --- app.js | 2 ++ .../acme-challenge/certbot-challenges-here | 1 + routes/baseActionsRouter.js | 1 + views/admin.pug | 12 ++++++++++++ 4 files changed, 16 insertions(+) create mode 100644 public/.well-known/acme-challenge/certbot-challenges-here diff --git a/app.js b/app.js index 4977b33..a2694bf 100755 --- a/app.js +++ b/app.js @@ -359,6 +359,8 @@ function refreshNetworkVolumes() { app.onStartup = function() { + global.appStartTime = new Date().getTime(); + global.config = config; global.coinConfig = coins[config.coin]; global.coinConfigs = coins; diff --git a/public/.well-known/acme-challenge/certbot-challenges-here b/public/.well-known/acme-challenge/certbot-challenges-here new file mode 100644 index 0000000..785e05f --- /dev/null +++ b/public/.well-known/acme-challenge/certbot-challenges-here @@ -0,0 +1 @@ +certbot \ No newline at end of file diff --git a/routes/baseActionsRouter.js b/routes/baseActionsRouter.js index 8a5a7aa..59ccd5d 100644 --- a/routes/baseActionsRouter.js +++ b/routes/baseActionsRouter.js @@ -1469,6 +1469,7 @@ router.get("/tools", function(req, res, next) { }); router.get("/admin", function(req, res, next) { + res.locals.appStartTime = global.appStartTime; res.locals.memstats = v8.getHeapStatistics(); res.locals.rpcStats = global.rpcStats; diff --git a/views/admin.pug b/views/admin.pug index e1ec683..12a46de 100644 --- a/views/admin.pug +++ b/views/admin.pug @@ -15,6 +15,18 @@ block content div.tab-content div.tab-pane.active(id="tab-details", role="tabpanel") + div.card.shadow-sm.mb-3 + div.card-body + h3.h6 Basics + hr + + div.clearfix + div.row + div.summary-table-label Uptime + div.summary-table-content.text-monospace + - var uptime = moment.duration(new Date().getTime() - appStartTime); + span #{uptime.format()} + div.card.shadow-sm.mb-3 div.card-body h3.h6 Memory Stats