Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
f0b3e1a
allow Node 12
PieterGit Jul 20, 2019
561f42a
Fix main view button alignment
sulkaharo Jul 21, 2019
6a7f598
Merge branch 'dev' of https://github.com/nightscout/cgm-remote-monito…
PieterGit Jul 21, 2019
8d6e551
allow Azure with Node ^10.15.2 and allow Node 12
PieterGit Jul 21, 2019
6e6cd29
drop Node `^12.6.0` from package.json, because it is not recommended…
PieterGit Jul 22, 2019
99e8d6f
up WEBSITE_NODE_DEFAULT_VERSION to 10.15.2
PieterGit Jul 22, 2019
1c94078
Update browser requirements
unsoluble Jul 22, 2019
7f5f74c
Perform HTTP to HTTPS redirect using 307 status
mastacheata Jul 22, 2019
2fed98a
Only set INSECURE_USE_HTTP as last resort
mastacheata Jul 22, 2019
3d5fc8d
Merge pull request #4778 from mastacheata/patch-2
sulkaharo Jul 23, 2019
eb3e4c8
Merge pull request #4779 from mastacheata/patch-1
sulkaharo Jul 23, 2019
0dd7347
Merge pull request #4775 from unsoluble/patch-1
sulkaharo Jul 23, 2019
ae2e8c9
Merge pull request #4782 from nightscout/master
sulkaharo Jul 23, 2019
c9b7e5c
Merge pull request #4769 from PieterGit/201907_dev
sulkaharo Jul 23, 2019
866b571
Update clock view notes
unsoluble Jul 23, 2019
3373c27
* Close button color is much dimmer and changes color appropriately i…
sulkaharo Jul 24, 2019
9acd999
Load the latest 'Sensor Stop' event in case user has a Start and Stop…
sulkaharo Jul 24, 2019
d2f21a5
Merge pull request #4794 from nightscout/load_sensor_stop
sulkaharo Jul 24, 2019
c7674ae
Renamed the config variable and inverted the boolean logic
sulkaharo Jul 24, 2019
3a3f41d
feat: Add support for different color prediction lines (#4792)
Erin879 Jul 24, 2019
a39b245
fix: Temp basal input fix for browsers that don't follow standards (S…
unsoluble Jul 24, 2019
9919d1e
Merge pull request #4788 from unsoluble/patch-3
sulkaharo Jul 24, 2019
7503512
Merge branch 'dev' into less_obtrusive_clock_close
sulkaharo Jul 24, 2019
2b0b19d
Adds a new feature for plugins, where plugin extended settings can be…
sulkaharo Jul 25, 2019
298a3f5
Add the new setting to README
sulkaharo Jul 26, 2019
6c01edb
Only show plugin settings in in client if the plugin is visible
sulkaharo Jul 26, 2019
71981de
Merge pull request #4793 from nightscout/less_obtrusive_clock_close
sulkaharo Jul 26, 2019
99ac3a6
Remove debug logging
sulkaharo Jul 26, 2019
6499480
Merge branch 'dev' into plugin_pref_ui
sulkaharo Jul 26, 2019
c9db3e3
Merge pull request #4799 from nightscout/plugin_pref_ui
sulkaharo Jul 26, 2019
7fe9fef
Assume any string in DISPLAY_UNITS that contains "mmol" indicates mmo…
sulkaharo Jul 27, 2019
fcca512
feat: validate temp target in Careportal (#4812)
sulkaharo Jul 27, 2019
cdc7669
Changed logic for the Clock Close button: 1) The show now defaults to…
sulkaharo Jul 29, 2019
5bf903e
Clock-color arrow wasn't reverting from its stale state (#4821)
unsoluble Jul 29, 2019
e1f0ac5
Small fix for if-modified-since header parsing (#4827)
sulkaharo Jul 29, 2019
c13d847
New utils.toFixed() for cleaner labels (#4822)
bassettb Jul 29, 2019
7947e30
feat: API improvements (#4806)
sulkaharo Jul 29, 2019
35c7dc4
* Allow users to set `DE_NORMALIZE_DATES=false` to have the REST API …
sulkaharo Jul 29, 2019
c2c534a
Update README.md
sulkaharo Jul 30, 2019
65fbaa1
Update CONTRIBUTING.md
sulkaharo Jul 30, 2019
1ada478
Bump version to 0.12.3
sulkaharo Jul 30, 2019
3a8f199
One more clock change - the SHOW_CLOCK_CLOSEBUTTON setting can now be…
sulkaharo Jul 30, 2019
f81298f
Release 0.12.3
sulkaharo Jul 30, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -303,12 +303,13 @@ To learn more about the Nightscout API, visit https://YOUR-SITE.com/api-docs.htm
* `SECURE_CSP` (`false`) - Add Content Security Policy headers. Possible values `false`, or `true`.
* `SECURE_CSP_REPORT_ONLY` (`false`) - If set to `true` allows to experiment with policies by monitoring (but not enforcing) their effects. Possible values `false`, or `true`.

### Views
### Views

There are a few alternate web views available from the main menu that display a simplified BG stream. (If you launch one of these in a fullscreen view in iOS, you can use a left-to-right swipe gesture to exit the view.)
* `Clock` - Shows current BG, trend arrow, and time of day. Grey text on a black background.
* `Color` - Shows current BG and trend arrow. White text on a background that changes color to indicate current BG threshold (green = in range; blue = below range; yellow = above range; red = urgent below/above).
* `Simple` - Shows current BG. Grey text on a black background.
* Optional configuration: set `SHOW_CLOCK_CLOSEBUTTON` (`true`) to `false` to hide the small X button to close the views

### Plugins

Expand Down
19 changes: 19 additions & 0 deletions lib/client/clock-client.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,10 @@ client.render = function render (xhr) {
if (m < 10) m = "0" + m;
$('#clock').text(h + ":" + m);

if (!window.serverSettings.settings.showClockClosebutton) {
$('#close').css('display', 'none');
}

// defined in the template this is loaded into
// eslint-disable-next-line no-undef
if (clockFace == 'clock-color') {
Expand All @@ -82,6 +86,11 @@ client.render = function render (xhr) {
var green = 'rgba(134,207,70,1)';
var blue = 'rgba(78,143,207,1)';

var darkRed = 'rgba(183,9,21,1)';
var darkYellow = 'rgba(214,168,0,1)';
var darkGreen = 'rgba(110,192,70,1)';
var darkBlue = 'rgba(78,143,187,1)';

var elapsedMins = Math.round(((now - last) / 1000) / 60);

// Insert the BG stale time text.
Expand All @@ -90,18 +99,28 @@ client.render = function render (xhr) {
// Threshold background coloring.
if (bgNum < bgLow) {
$('body').css('background-color', red);
$('#close').css('border-color', darkRed);
$('#close').css('color', darkRed);
}
if ((bgLow <= bgNum) && (bgNum < bgTargetBottom)) {
$('body').css('background-color', blue);
$('#close').css('border-color', darkBlue);
$('#close').css('color', darkBlue);
}
if ((bgTargetBottom <= bgNum) && (bgNum < bgTargetTop)) {
$('body').css('background-color', green);
$('#close').css('border-color', darkGreen);
$('#close').css('color', darkGreen);
}
if ((bgTargetTop <= bgNum) && (bgNum < bgHigh)) {
$('body').css('background-color', yellow);
$('#close').css('border-color', darkYellow);
$('#close').css('color', darkYellow);
}
if (bgNum >= bgHigh) {
$('body').css('background-color', red);
$('#close').css('border-color', darkRed);
$('#close').css('color', darkRed);
}

// Restyle body bg, and make the "x minutes ago" visible too.
Expand Down
33 changes: 17 additions & 16 deletions lib/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
var _ = require('lodash');
var levels = require('./levels');

function init ( ) {
function init () {

var settings = {
units: 'mg/dL'
Expand Down Expand Up @@ -41,12 +41,13 @@ function init ( ) {
, bgTargetTop: 180
, bgTargetBottom: 80
, bgLow: 55
},
insecureUseHttp: false,
secureHstsHeader: true,
secureHstsHeaderIncludeSubdomains: false,
secureHstsHeaderPreload: false,
secureCsp: false
}
, insecureUseHttp: false
, secureHstsHeader: true
, secureHstsHeaderIncludeSubdomains: false
, secureHstsHeaderPreload: false
, secureCsp: false
, showClockClosebutton: true
};

var valueMappers = {
Expand All @@ -67,7 +68,7 @@ function init ( ) {
, insecureUseHttp: mapTruthy
, secureHstsHeader: mapTruthy
, secureCsp: mapTruthy

, showClockClosebutton: mapTruthy
};

function mapNumberArray (value) {
Expand All @@ -77,7 +78,7 @@ function init ( ) {

if (isNaN(value)) {
var rawValues = value && value.split(' ') || [];
return _.map(rawValues, function (num) {
return _.map(rawValues, function(num) {
return isNaN(num) ? null : Number(num);
});
} else {
Expand Down Expand Up @@ -153,18 +154,18 @@ function init ( ) {
}

function anyEnabled (features) {
return _.findIndex(features, function (feature) {
return _.findIndex(features, function(feature) {
return enable.indexOf(feature) > -1;
}) > -1;
}

function prepareAlarmTypes ( ) {
function prepareAlarmTypes () {
var alarmTypes = _.filter(getAndPrepare('alarmTypes'), function onlyKnownTypes (type) {
return type === 'predict' || type === 'simple';
});

if (alarmTypes.length === 0) {
var thresholdWasSet = _.findIndex(wasSet, function (name) {
var thresholdWasSet = _.findIndex(wasSet, function(name) {
return name.indexOf('bg') === 0;
}) > -1;
alarmTypes = thresholdWasSet ? ['simple'] : ['predict'];
Expand Down Expand Up @@ -209,7 +210,7 @@ function init ( ) {
adjustShownPlugins();
}

function verifyThresholds() {
function verifyThresholds () {
var thresholds = settings.thresholds;

if (thresholds.bgTargetBottom >= thresholds.bgTargetTop) {
Expand All @@ -234,7 +235,7 @@ function init ( ) {
}
}

function adjustShownPlugins ( ) {
function adjustShownPlugins () {
var showPluginsUnset = settings.showPlugins && 0 === settings.showPlugins.length;

settings.showPlugins += ' delta direction upbat';
Expand All @@ -245,7 +246,7 @@ function init ( ) {
if (showPluginsUnset) {
//assume all enabled features are plugins and they should be shown for now
//it would be better to use the registered plugins, but it's not loaded yet...
_.forEach(settings.enable, function showFeature(feature) {
_.forEach(settings.enable, function showFeature (feature) {
if (isEnabled(feature)) {
settings.showPlugins += ' ' + feature;
}
Expand Down Expand Up @@ -289,7 +290,7 @@ function init ( ) {
var snoozeTime;

if (notify.eventName === 'high' && notify.level === levels.URGENT && settings.alarmUrgentHigh) {
snoozeTime = settings.alarmUrgentHighMins;
snoozeTime = settings.alarmUrgentHighMins;
} else if (notify.eventName === 'high' && settings.alarmHigh) {
snoozeTime = settings.alarmHighMins;
} else if (notify.eventName === 'low' && notify.level === levels.URGENT && settings.alarmUrgentLow) {
Expand Down
12 changes: 12 additions & 0 deletions views/clockviews/bgclock.css
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,18 @@ main {
height: 100vh;
}

#close {
position: absolute;
top: 10px;
right: 10px;
color: #333;
border-radius: 5px;
border: 2px solid #333;
padding: 5px;
width: 20px;
height: 20px;
}

.inner {
width: 100%;
-webkit-transform: translateY(-2%);
Expand Down
12 changes: 12 additions & 0 deletions views/clockviews/clock-color.css
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,18 @@ main {
height: 100vh;
}

#close {
position: absolute;
top: 10px;
right: 10px;
color: grey;
border-radius: 5px;
border: 2px solid grey;
padding: 5px;
width: 20px;
height: 20px;
}

.inner {
width: 100%;
-webkit-transform: translateY(-5%);
Expand Down
14 changes: 13 additions & 1 deletion views/clockviews/clock.css
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,18 @@ main {
height: 100vh;
}

#close {
position: absolute;
top: 10px;
right: 10px;
color: #333;
border-radius: 5px;
border: 2px solid #333;
padding: 5px;
width: 20px;
height: 20px;
}

.inner {
width: 100%;
-webkit-transform: translateY(-5%);
Expand Down Expand Up @@ -51,4 +63,4 @@ main {

#clock {
display: none;
}
}
2 changes: 1 addition & 1 deletion views/clockviews/shared.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
</head>

<body>
<a href="/"><div style="position: absolute; top: 10px; right: 10px; color: grey; border-radius: 5px; border: 2px solid grey; padding: 5px; width: 20px; height: 20px; ">X</div></a>
<a href="/"><div id="close">X</div></a>
<main>
<div class="inner">
<div id="trend">
Expand Down
2 changes: 1 addition & 1 deletion views/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@
</div>
<div class="container loading" id="container">
<div id="toolbar">
<div id="buttonbar" style="margin-right: 15px;" role="navigation" aria-label="Menu" >
<div id="buttonbar" style="margin-right: 0px;" role="navigation" aria-label="Menu" >
<a id="editbutton" class="tip" original-title="Edit Mode" aria-label="Edit Mode" href="#" style="display:none;"><i class="icon-edit"></i></a>
<a id="testAlarms" class="tip" original-title="Alarm Test / Smartphone Enable" aria-label="Alarm Test / Smartphone Enable" href="#"><i class="icon-volume"></i></a>
<a id="drawerToggle" class="tip" original-title="Settings" aria-label="Settings" href="#"><i class="icon-menu"></i></a>
Expand Down