From 6c5bc216508a66e7a6f16bf63c414d4c902625ec Mon Sep 17 00:00:00 2001 From: bassettb Date: Mon, 29 Jul 2019 11:32:20 -0400 Subject: [PATCH 1/6] Don't show calculated insulin from carbs --- lib/report_plugins/daytoday.js | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/report_plugins/daytoday.js b/lib/report_plugins/daytoday.js index 3445973402c..72eaf0de3a0 100644 --- a/lib/report_plugins/daytoday.js +++ b/lib/report_plugins/daytoday.js @@ -738,7 +738,6 @@ daytoday.report = function report_daytoday (datastorage, sorteddaystoshow, optio var label = ' ' + treatment.carbs + ' g'; if (treatment.protein) label += ' / ' + treatment.protein + ' g'; if (treatment.fat) label += ' / ' + treatment.fat + ' g'; - label += ' (' + client.utils.toFixedMin((treatment.carbs / ic), 2) + 'U)'; context.append('rect') .attr('y', yCarbsScale(treatment.carbs)) From 4638db55cc556e868a27ad0804891c622b7dad8b Mon Sep 17 00:00:00 2001 From: ireneusz-ptak <31506973+ireneusz-ptak@users.noreply.github.com> Date: Tue, 30 Jul 2019 17:07:34 +0200 Subject: [PATCH 2/6] staleTime div is missing in the clockview --- views/clockviews/shared.html | 1 + 1 file changed, 1 insertion(+) diff --git a/views/clockviews/shared.html b/views/clockviews/shared.html index f7d5f78cd25..247d1d46bb7 100644 --- a/views/clockviews/shared.html +++ b/views/clockviews/shared.html @@ -33,6 +33,7 @@
+
From 1a26b2a3e8997ec97f04e590ba0dcd5e045f8cda Mon Sep 17 00:00:00 2001 From: John Weston Date: Wed, 31 Jul 2019 11:16:02 -0700 Subject: [PATCH 3/6] Remove profile conversion warning This modal dialog about converting the profile to a format that 0.9.0 or earlier won't support is still popping on fresh installs, shouldn't be required at this point. --- static/profile/js/profileeditor.js | 7 ------- 1 file changed, 7 deletions(-) diff --git a/static/profile/js/profileeditor.js b/static/profile/js/profileeditor.js index c57dd4c7eae..c1443e5cade 100644 --- a/static/profile/js/profileeditor.js +++ b/static/profile/js/profileeditor.js @@ -671,13 +671,6 @@ adjustedRecord.defaultProfile = currentprofile; adjustedRecord.units = client.settings.units; - if (record.convertedOnTheFly) { - var result = window.confirm(translate('Profile is going to be saved in newer format used in Nightscout 0.9.0 and above and will not be usable in older versions anymore.\nAre you sure?')); - if (!result) { - return; - } - } - delete record.convertedOnTheFly; delete adjustedRecord.convertedOnTheFly; From 54ae53152863e3bbe65fe0cea98f2af817156900 Mon Sep 17 00:00:00 2001 From: Bluefox Date: Sat, 3 Aug 2019 21:06:25 +0200 Subject: [PATCH 4/6] Allow start nightscout from other directories but cgm-remote-monitor If I start nightscout from other path, e.g. from `/opt` and nightscout is in `/opt/cgm-remote-monitor`, it tries to find `/opt/tmp` what does not exist. --- app.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app.js b/app.js index 05f1d8ff694..5bc8956402b 100644 --- a/app.js +++ b/app.js @@ -254,7 +254,7 @@ function create (env, ctx) { } // Production bundling - var tmpFiles = express.static('tmp', { + var tmpFiles = express.static(__dirname + '/tmp', { maxAge: maxAge }); From 5e883886ee4727aad2e645bc098d58da7d3d7494 Mon Sep 17 00:00:00 2001 From: Bluefox Date: Sat, 3 Aug 2019 21:18:54 +0200 Subject: [PATCH 5/6] Formatting --- app.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/app.js b/app.js index 5bc8956402b..bbbb6f4d0cd 100644 --- a/app.js +++ b/app.js @@ -18,12 +18,12 @@ function create (env, ctx) { if (!insecureUseHttp) { console.info('Redirecting http traffic to https because INSECURE_USE_HTTP=', insecureUseHttp); app.use((req, res, next) => { - if (req.header('x-forwarded-proto') == 'https' || req.secure) { + if (req.header('x-forwarded-proto') === 'https' || req.secure) { next(); } else { res.redirect(307, `https://${req.header('host')}${req.url}`); } - }) + }); if (secureHstsHeader) { // Add HSTS (HTTP Strict Transport Security) header console.info('Enabled SECURE_HSTS_HEADER (HTTP Strict Transport Security)'); const helmet = require('helmet'); @@ -61,7 +61,7 @@ function create (env, ctx) { })); app.use(helmet.referrerPolicy({ policy: 'no-referrer' })); app.use(helmet.featurePolicy({ features: { payment: ["'none'"], } })); - app.use(bodyParser.json({ type: ['json', 'application/csp-report'] })) + app.use(bodyParser.json({ type: ['json', 'application/csp-report'] })); app.post('/report-violation', (req, res) => { if (req.body) { console.log('CSP Violation: ', req.body) @@ -84,7 +84,11 @@ function create (env, ctx) { let cacheBuster = 'developmentMode'; if (process.env.NODE_ENV !== 'development') { - cacheBuster = fs.readFileSync(process.cwd() + '/tmp/cacheBusterToken').toString().trim(); + if (fs.existsSync(process.cwd() + '/tmp/cacheBusterToken')) { + cacheBuster = fs.readFileSync(process.cwd() + '/tmp/cacheBusterToken').toString().trim(); + } else { + cacheBuster = fs.readFileSync(__dirname + '/tmp/cacheBusterToken').toString().trim(); + } } app.locals.cachebuster = cacheBuster; From 1c9d5b1409cc089f154041d3d64084ad0b4b346d Mon Sep 17 00:00:00 2001 From: Bluefox Date: Sat, 3 Aug 2019 21:22:14 +0200 Subject: [PATCH 6/6] Use not only from cgm-remote-monitor --- app.js | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/app.js b/app.js index bbbb6f4d0cd..1461266bbf1 100644 --- a/app.js +++ b/app.js @@ -258,9 +258,16 @@ function create (env, ctx) { } // Production bundling - var tmpFiles = express.static(__dirname + '/tmp', { - maxAge: maxAge - }); + var tmpFiles; + if (fs.existsSync(process.cwd() + '/tmp/cacheBusterToken')) { + tmpFiles = express.static('tmp', { + maxAge: maxAge + }); + } else { + tmpFiles = express.static(__dirname + '/tmp', { + maxAge: maxAge + }); + } // serve the static content app.use('/bundle', tmpFiles);