Skip to content

Commit

Permalink
Update from original (#4)
Browse files Browse the repository at this point in the history
* Data cleaning pass 1

* * Glucose data smoothing / patching before calculating variability to reduce the effects of CGM noise
* Added calculation for GVI, PGS and Total Absolute Change calculation
* Refactored the server to use Webpack for the bundle generation instead of Browserify (since browserify-express seems to not work with Node 8 and is not maintained)
* Improved caching & compression of JS and CSS resources
* If NODE_ENV="development”, don’t cache resources for more than 10 seconds & generate a report about Bundle size

* Run packaging in post install instead of runtime

* CSS bundling

* Fix templates that linked to old bundle.js location

* Removing Bower part 1

* Flot plugins

* jQuery packaging has changed, adding these to the repo

* Generate source map, use a small font subset instead of loading complex CSS / font set from Google

* Added missing icons, changed how jQuery and jQuery-UI is packaged

* Bower is gone

* Remove Crossfilter (needed by /reports/compare, which is not supported right now)

* Oops forgot package-lock.json

* Revert back to using Open Sans, but embedded

* Re-enabled Ubuntu to fix the layouts. Icon font embedded.

* Update cache busters

* Added variability measure explanations to reporting

* Finnish localization

* Fix battery icon, some tests

* Added app cache manifest to speed things further

* Launch PNG was missing

* Return 404 on app cache request when in development mode, added bold weight Ubuntu

* Formatting improvements to app.js

* Added sync-exec in an attempt to appease Azure

* Added --scripts-prepend-node-path to Azure deploy script

* IT Language

* update language.js

update Russian translation

* RO update August, 27th - 2017

RO update

* Trigger app on DOM ready event (as recommended by HTML5 spec). Detect if app is completely offline, auto-reload if needed.

* Better looking loader screen, prevent CSS blocking

* Use ejs to render the app cache and cache buster tokens

* Forgot cache buster generator script

* Image had ugly artifacts

* Upgrade Travis to build with Node 8.4, update package.json to 8.4

* Doh, 8.1.4 is the latest version of Node available in Azure

* Added note on configuring Azure to README

* Separate messages for loading the client and connecting to server

* Hide loader on auth fail

* Support both node 8.1.4 (Azure) and node 8.4.0 (Heroku).

Make sure travis builds / tests both versions. Got this syntax from: Chevrotain/chevrotain@cedbffd and https://docs.microsoft.com/en-us/azure/nodejs-specify-node-version-azure-apps

* Unit tests fixed

* Increasing test timeout significantly due to Travis fails

* And add the longer timeout to Travis, too…

* Now it works

* Fixed Coverage running parameter order

* Report tests takes over 40 seconds to run in Travis, timeout increased

* More test fixes

* Increasing Travis timeouts ridiculously, we need to do something to this

* minor css fixes

* see if document ready is the problem when testing on travis

* Revert "see if document ready is the problem when testing on travis"

This reverts commit 7428040.

* Update openaps.js

* Update openaps.js

* Update openaps.test.js

Test for devicestatus-entries containing the correct spelling of the word "received" instead of "recieved" in OpenAPS versions 0.6.0 and later

* change node-uuid to uuid

* npm update

* add environment variables to .travis.yml

* increase timeout to 30 secs for admintools test and change environment variables for travis

* create bundle before tests and time tests execution for travis

* Makefiles requires tabs not space. I knew that...

* change Makefile

* last try for today

* set timeout of profileeditor.test to 30 seconds

* increase timeout for profileeditor tests

* only support node 8.4.0 and drop support for node 8.1.4

* bundle creation is done by npm postinstall, so should not be called explicit.

* revert tests/fixtures/headless.js

* revert test/fixtures/headless.js (now without changing indent)

* remove env's from .travis.yml (because they might not be needed)

* Move all html files to views folder, update to use the rendered cache buster

* Fix tests to uses the view path :D

* Update README to reflect correct Node version

* Implements nightscout#2689

* Implements nightscout#2456

* One cache buster wasn't updated to dynamic form

* decrease timeouts to detect regressions faster in future

* Admintools and profileeditor test fails with 20 sec timeout. Increasing to 25 sec.
```
not ok 1 admintools "before all" hook
  Error: timeout of 20000ms exceeded. Ensure the done() callback is being called in this test.
      at tests/admintools.test.js:177:7
      at Object.done (node_modules/benv/index.js:32:21)
      at process.nextTick (node_modules/jsdom/lib/old-api.js:347:18)
      at _combinedTickCallback (internal/process/next_tick.js:131:7)
      at process._tickCallback (internal/process/next_tick.js:180:9)

not ok 203 Profile editor "before each" hook for "should produce some html"
  Error: timeout of 20000ms exceeded. Ensure the done() callback is being called in this test.
      at tests/fixtures/headless.js:160:7
      at Object.module.exports.setup (node_modules/benv/index.js:24:56)
      at Function.init [as setup] (tests/fixtures/headless.js:16:10)
      at Context.<anonymous> (tests/profileeditor.test.js:94:14)
```

* optimize travis tests. see if 5 sec per test is enough (in stead of 50 sec per test)

* the following tests don't complete in 5 sec. increase timeout to 25 sec.

* increase profileeditor tests to 40 sec

* hasauth.test.js fails with 25 sec.  increasing to 40 sec

* Small fix to CGM data noise filtering

* Add Node version to DEV Azure deploy json

* Testing Node 8.1.4 for Azure

* Testing disabling heap dumps

* Update to 8.5.0 to see if that works without the problematic module

* add food to websockets

* add node env for deploy in azure

* change node to 8.5.0

* Prepare for 0.10 release

* Revert part of changes from previous merge

* Bump Nightscout version number to 0.10.1-dev

* Create issue_template.md

Adding an issue template to help solve bugs

* Fixes hourly filtering in distrubution reports, reported in nightscout#2864

* SVG dimension fix

Somehow the NONE.svg ended up with an incorrect rectangle shape; fixed
to match the aspect ratio of the other symbols.

* preserve original treatment collection

* add ZT (zero temp) prediction line

* package-lock.json

* display ZT PredBGs, and forecast tooltips

* remove extra-big tooltip target around treatments; reduce font sizes

* make R3/R4 elements into very short arcs to reposition labels

* Remove pattern regex from basal change field

Having the regex require integers means that only the numeric keypad
will pop on iOS. This prevents the entry of negative values, which is
pretty critical for temp basals.

* filter to only use actual SGV's (not rawbg's) to set the view window

* remove console.log

* Use lodash cloneDeep instead of JSON serialize/desearialize

* update Russian

* Cleanup: move cache buster token generation to /bin, remove /scripts

* Fix express-minify file cache path to reduce the memory footprint of the runtime

* Display RSSI on Loop pill

* Add missing fontello icons to main CSS

* Update version to release

* Loop RSSI fix

* One more Loop RSSI fix

* Always show RSSI

* Update dev version to 0.10.2

* exclude package-lock.json from git

* add package-lock.json to .gitignore to avoid merge conflicts

* comments

* revert font change

* Adding some test coverage for /lib/client/renderer.js

* send foods via websockets

* use websockeets instead of rest api for food

* add fat,protein,energy to food editor

* Re-enable source maps

* replace 3HR with 2HR and (default) 4HR views

* only show focusHours' worth of predictions; strip leading zero from bolus amounts

* fix spelling of focusRangeMS

* change default back to 3HR

* try larger label font: 35 instead of 25 (vs. 40)

* allow treatment bubbles to scale up past 1U/20g size

* change font size back to default in this branch

* change Bolus Snooze to Bolus IOB

* change Bolus Snooze to Bolus IOB

* back to smaller treatment dots

* handle AAPS profile switches well

* Fix URLs of [mongostring] and [autoconfigure]

* update nodejs to 8.7.0 and npm update

* do not upload temporary profiles from store

* also update nodjes used by travis from 8.5.0 to 8.7.0

* Increase timeout for careportal.test.js and pluginbase.test from 25 to 30 sec., just to be sure. I seem to work once with Node 8.7.0, but the test did a timeout once on Node 8.5.0 on Travis.

* increase timeout of admintools.test.js from 25 to 30 seconds

* pluginbase.test.js fails with 30 sec. upping to 40 sec timeout

```
not ok 188 pluginbase "before each" hook for "does stuff"
 Error: timeout of 30000ms exceeded. Ensure the done() callback is being called in this test.
```

* update to nodejs 8.8.0 and npm update

* npm update with nodejs 8.8.0

* Update version, remove package-lock.json

* upgrade node in .nvmrc from 8.1.4 to 8.8.0
set travis container to dist: trusty and give sudo: false a try

* set sudo back to required (used for docker and mongodb commands)

* more node upgrade stuff

* Update README.md

* Fix a bug with time comparison on if-modified-since support for treatments

* Check both created_at and timestamp fields for treatments in if-modified-since logic

* Add Total daily pasal to profile editor.

Small improvoment to profile editor while geting familiar
about the code. Added a simple estimated total daily basal field.

* Bump 8.8.0 to 8.8.1

* cherry pick 33f16f4

* merge rendering

* Revert "add package-lock.json to .gitignore to avoid merge conflicts"

This reverts commit ec25130.
We now use  npm-shrinkwrap.json

* fix merge errors, up version and fix test

fix merge errros by reverting views/index.html and lib/client/renderer.js,
up version in bower.json, npm-shrinkwrap.json and package.json
fix test/client.renderer.test.js

* bring back the ' U' for non-SMB's (> 1U insulin and with carbs)

* Revert "bring back the ' U' for non-SMB's (> 1U insulin and with carbs)"

This reverts commit edbf22b.

* fix typo foucusRangeMS to focusRangeMS in lib/client/chart.js

* for some reasone change from foucusRangeMS to focusRangeMS was not implemented in lib/client/index.js

This was fixed on ZT branch in nightscout@38d3539

* bring back the ' U' for non-SMB's (> 1U insulin and with carbs)

* More test coverage for /lib/client/renderer.js (highlightBrushPoints)

* display Sensitivity Ratio in OpenAPS pill

* add comma

* Fix SAGE pill test failing due to summer time change

* Upgrading to 8.9.0 LTS (first LTS release!) and also let travis run on both Node 8.9.0 and Node 9.0.0 (to make sure we don't introduce future problems with Node 9.0.0).
Node 8.9.0 LTS will be the recommended version.

* Drop building with nodejs 9.0.0 for now. Once NodeJS v10 almost appears were gonna test against that version.

* Update German translation

* Update German translation

* added dutch translations

* Update Loop pill RSSI (nightscout#3034)

* Update package.json

* update package.json

* Update loop.js

* test

* add BLE RSSI

* add BLE RSSI

* update RSSI time stamp

* update Loop RSSI reporting

* update Loop RSSI reporting

* show RSSI and pumpRSSI in Loop pill, if available

* update Loop pill RSSI

* Update RSSI in Loop pill

* Upgrade to node 8.9.1 and npm update and some dutch translation fixes (nightscout#3037)

* upgrade to node 8.9.1

* further improve dutch language

* remove duplicate dutch line Filter

* remove dutch language.js record that was defined two times

* fix duplicate german language record

* reapply npm-shrinkwrap.json to fix unit tests

* another try to get a proper npm-shrinkwrap.json

* shorten minutes ago in dutch to improve formatting of status pills

* deviceInfo.recent null check (nightscout#3048)

* add root mean squared out of range metric (nightscout#3045)

* Add recommended bolus and eventual BG to Loop pill (nightscout#3040)

* Update package.json

* update package.json

* Update loop.js

* test

* add BLE RSSI

* add BLE RSSI

* update RSSI time stamp

* update Loop RSSI reporting

* update Loop RSSI reporting

* show RSSI and pumpRSSI in Loop pill, if available

* update Loop pill RSSI

* Update RSSI in Loop pill

* Add recommended bolus to Loop pill

* Add eventual BG to Loop pill

* Update test for Loop pill with eventual BG

* Update test for Loop pill with eventual BG

* Update bgclock.html (nightscout#3039)

* Update index.html

* Update index.html

* Update index.html

* Update index.html

Remove alarms.

* Update index.html

* Update index.html

Removed alarms:

Line 669 & 670
            <audio src="audio/alarm.mp3" preload="auto" loop="true" class="alarm mp3" type="audio/mp3"></audio>
	    <audio src="audio/alarm2.mp3" preload="auto" loop="true" class="urgent alarm2 mp3" type="audio/mp3"></audio>

* Add Trend Arrow

Add Trend Arrow to glucose value

* Update index.html

* Update version, improvements to glucose distribution filtering

* fix reports (nightscout#3078)

* fix profile functions

* fix loading of profile switch treatments

* Shrinkwrap update

* Downgrade npm to fix deployment issues

* Smarter formatting based on amount of data (nightscout#3086)

* Smarter formatting based on amount of data, to make sure the rendering works for both SMB and non-SMB users

* Move comment to where it belongs, changed math so first 10 treatments don't reduce scaling

*  better rendering of treatments with duration (nightscout#3082)

* fix profile functions

* fix loading of profile switch treatments

* better rendering treatments with duration

* * Update Finnish localization
* Change SMB visualization to be more friendly
* Add BG Clock to navigation
* Updated release version

* 24 hour clock support for bgclock.html

* Going down to 8.9.0 for Azure

* Alternate versions in package.json

* One final change that should run on both Heroku and Azure
  • Loading branch information
grhulz authored Feb 28, 2018
1 parent 003f51c commit bbf01a8
Show file tree
Hide file tree
Showing 158 changed files with 18,224 additions and 1,479 deletions.
18 changes: 18 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Don't include the .git history in the Docker image:
.git

# Items from .gitignore
bower_components/
node_modules/
bundle/bundle.out.js
.idea/
*.iml
my.env
*.env
static/bower_components/
.*.sw?
.DS_Store
.vagrant
/iisnode
coverage/
npm-debug.log
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ node_modules/

bundle/bundle.out.js

.vscode/
.idea/
*.iml
my.env
Expand All @@ -20,3 +21,6 @@ static/bower_components/
coverage/

npm-debug.log
*.heapsnapshot

/tmp
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
8.9.1
26 changes: 9 additions & 17 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,15 @@
language: node_js
sudo: false
sudo: required
dist: trusty
node_js:
- 0.10
- 0.12
- 4
- 5
- "8.9.1"
matrix:
fast_finish: true
allow_failures:
- node_js: 4
- node_js: 5
services: mongodb
services:
- mongodb
- docker
script: make travis
after_success:
- nvm version
- if [[ ! -z "$DOCKER_USER" ]]; then docker login -u ${DOCKER_USER} -p ${DOCKER_PASS} && git checkout -- . && git clean -fd . && make docker_release; fi
after_script: make report
env:
- CXX=g++-4.8
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- g++-4.8
6 changes: 5 additions & 1 deletion COPYRIGHT
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
Copyright (C) 2015 The Nightscout Foundation, http://www.nightscoutfoundation.org

We track contributions on a per-patch basis using git.
Please see our published git log:
* https://github.com/nightscout/cgm-remote-monitor/commits/master

18 changes: 18 additions & 0 deletions Dockerfile.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
FROM node:8.9.1

MAINTAINER Nightscout Contributors

RUN apt-get update && \
apt-get -y dist-upgrade

RUN mkdir -p /opt/app
ADD . /opt/app
WORKDIR /opt/app

RUN npm install && \
npm run postinstall && \
npm run env

EXPOSE 1337

CMD ["node", "server.js"]
37 changes: 33 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,13 @@ ISTANBUL=./node_modules/.bin/istanbul
ANALYZED=./coverage/lcov.info
export CODACY_REPO_TOKEN=e29ae5cf671f4f918912d9864316207c

DOCKER_IMAGE=nightscout/cgm-remote-monitor-travis

all: test

coverage:
NODE_ENV=test ${MONGO_SETTINGS} \
${ISTANBUL} cover ${MOCHA} -- -R tap ${TESTS}
${ISTANBUL} cover ${MOCHA} -- --timeout 15000 -R tap ${TESTS}

report:
test -f ${ANALYZED} && \
Expand All @@ -39,10 +41,37 @@ report:
YOURPACKAGE_COVERAGE=1 ./node_modules/codacy-coverage/bin/codacy-coverage.js) || echo "NO COVERAGE"

test:
${MONGO_SETTINGS} ${MOCHA} -R tap ${TESTS}
${MONGO_SETTINGS} ${MOCHA} --timeout 30000 -R tap ${TESTS}

travis:
NODE_ENV=test ${MONGO_SETTINGS} \
${ISTANBUL} cover ${MOCHA} --report lcovonly -- -R tap ${TESTS}
${ISTANBUL} cover ${MOCHA} --report lcovonly -- --timeout 5000 -R tap ${TESTS}

docker_release:
# Get the version from the package.json file
$(eval DOCKER_TAG=$(shell cat package.json | jq '.version' | tr -d '"'))
$(eval NODE_VERSION=$(shell cat .nvmrc))
#
# Create a Dockerfile that contains the correct NodeJS version
cat Dockerfile.example | sed -e "s/^FROM node:.*/FROM node:${NODE_VERSION}/" > Dockerfile
#
# Rebuild the image. We do this with no-cache so that we have all security upgrades,
# since that's more important than fewer layers in the Docker image.
docker build --no-cache=true -t $(DOCKER_IMAGE):$(DOCKER_TAG) .
# Push an image to Docker Hub with the version from package.json:
docker push $(DOCKER_IMAGE):$(DOCKER_TAG)
#
# Push the master branch to Docker hub as 'latest'
if [ "$(TRAVIS_BRANCH)" = "master" ]; then \
docker tag $(DOCKER_IMAGE):$(DOCKER_TAG) $(DOCKER_IMAGE):latest && \
docker push $(DOCKER_IMAGE):latest; \
fi
#
# Push the dev branch to Docker Hub as 'latest_dev'
if [ "$(TRAVIS_BRANCH)" = "dev" ]; then \
docker tag $(DOCKER_IMAGE):$(DOCKER_TAG) $(DOCKER_IMAGE):latest_dev && \
docker push $(DOCKER_IMAGE):latest_dev; \
fi
rm -f Dockerfile

.PHONY: all coverage report test travis
.PHONY: all coverage docker_release report test travis
18 changes: 12 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,22 +105,24 @@ Community maintained fork of the

Requirements:

- [Node.js](http://nodejs.org/)
- [Node.js](http://nodejs.org/) 8.9.0 LTS (use [Install instructions for Node](https://nodejs.org/en/download/package-manager/) or `setup.sh`)

Clone this repo then install dependencies into the root of the project:

```bash
$ npm install
```

#Usage
If deploying the software to Microsoft Azure, you must set *WEBSITE_NODE_DEFAULT_VERSION* in the app settings to *8.9.0* **before** you deploy the latest Nightscout or the site deployment will likely fail. Other hosting environments do not require this setting.

# Usage

The data being uploaded from the server to the client is from a
MongoDB server such as [mongolab][mongodb].

[mongodb]: https://mongolab.com
[autoconfigure]: http://nightscout.github.io/pages/configure/
[mongostring]: http://nightscout.github.io/pages/mongostring/
[autoconfigure]: https://nightscout.github.io/pages/configure/
[mongostring]: https://nightscout.github.io/pages/mongostring/
[update-fork]: http://nightscout.github.io/pages/update-fork/

## Updating my version?
Expand Down Expand Up @@ -218,6 +220,7 @@ To learn more about the Nightscout API, visit https://YOUR-SITE.com/api-docs.htm
* `SSL_CERT` - Path to your ssl cert file, so that ssl(https) can be enabled directly in node.js
* `SSL_CA` - Path to your ssl ca file, so that ssl(https) can be enabled directly in node.js
* `HEARTBEAT` (`60`) - Number of seconds to wait in between database checks
* `DEBUG_MINIFY` (`true`) - Debug option, setting to `false` will disable bundle minification to help tracking down error and speed up development


### Predefined values for your browser settings (optional)
Expand Down Expand Up @@ -374,6 +377,7 @@ To learn more about the Nightscout API, visit https://YOUR-SITE.com/api-docs.htm
Generic Pump Monitoring for OpenAPS, MiniMed Connect, RileyLink, t:slim, with more on the way
* Requires `DEVICESTATUS_ADVANCED="true"` to be set
* `PUMP_ENABLE_ALERTS` (`false`) - Set to `true` to enable notifications for Pump battery and reservoir.
* `PUMP_WARNONSUSPEND` (`false`) - Set to `true` to get an alarm when the pump is suspended.
* `PUMP_FIELDS` (`reservoir battery`) - The fields to display by default. Any of the following fields: `reservoir`, `battery`, `clock`, `status`, and `device`
* `PUMP_RETRO_FIELDS` (`reservoir battery clock`) - The fields to display in retro mode. Any of the above fields.
* `PUMP_WARN_CLOCK` (`30`) - The number of minutes ago that needs to be exceed before an alert is triggered.
Expand Down Expand Up @@ -492,7 +496,7 @@ Easy to emulate on the commandline:

From now on you can run using
```bash
$ env $(cat my.env) PORT=1337 node server.js
$ (eval $(cat my.env | sed 's/^/export /') && PORT=1337 node server.js)
```

Your hosting provider probably has a way to set these through their GUI.
Expand Down Expand Up @@ -532,7 +536,9 @@ License
[agpl-3]: http://www.gnu.org/licenses/agpl-3.0.txt

cgm-remote-monitor - web app to broadcast cgm readings
Copyright (C) 2015 The Nightscout Foundation, http://www.nightscoutfoundation.org.
Copyright (C) 2017 Nightscout contributors. See the COPYRIGHT file
at the root directory of this distribution and at
https://github.com/nightscout/cgm-remote-monitor/blob/master/COPYRIGHT

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published
Expand Down
Loading

0 comments on commit bbf01a8

Please sign in to comment.