Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update my site #24

Merged
merged 277 commits into from
Apr 19, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
277 commits
Select commit Hold shift + click to select a range
058548e
Merge pull request #28 from nightscout/master
ELUTE Jan 21, 2015
57c8e99
Merge branch 'release/0.6.4' into dev
jasoncalabrese Feb 14, 2015
a3c9682
fix coveralls badge branch
dduugg Feb 15, 2015
d529801
merged master into mqtt/init
jasoncalabrese Feb 16, 2015
ecdabe8
overhaul Makefile and .travis.yml
dduugg Feb 14, 2015
64ad3f7
fix environmental variable example
dduugg Feb 25, 2015
7772e2e
Merge pull request #34 from nightscout/master
ELUTE Feb 25, 2015
c205057
Merge pull request #435 from dduugg/wip/fix-readme
jasoncalabrese Feb 25, 2015
cc812e4
Merge pull request #417 from dduugg/wip/travis
jasoncalabrese Feb 25, 2015
d616b6c
Merge pull request #416 from dduugg/wip/contributing
jasoncalabrese Feb 25, 2015
abbd231
Merge branch 'dev' into wip/mqtt/init
jasoncalabrese Feb 26, 2015
ea1dbcc
forgot to git add some profile api files
Sep 25, 2014
7653ef5
no POSTs yet
Sep 25, 2014
6080f67
more cherry-picking and porting of the profile api/storage from iob-cob
Sep 25, 2014
7f550b8
start getting browserify-express hooked up to expose a shared IOB module
jasoncalabrese Mar 1, 2015
91365a7
Merge branch 'wip/enable-profile' into wip/enable-iob
jasoncalabrese Mar 1, 2015
ba05243
use IOB module to display IOB on th chart
jasoncalabrese Mar 1, 2015
d9f0c4c
removed debugs
jasoncalabrese Mar 1, 2015
a693304
now using new IOB module for /pebble
jasoncalabrese Mar 1, 2015
85a19c7
clean up
jasoncalabrese Mar 1, 2015
5a13393
only load treatments and profile if iob is enabled
jasoncalabrese Mar 1, 2015
ee9dcae
more clean up
jasoncalabrese Mar 1, 2015
d7d917b
create all docs before calling back
dduugg Feb 18, 2015
81a174e
clean up api.entries.test.js
dduugg Feb 18, 2015
b946f86
prettify example.json
dduugg Feb 18, 2015
f7f08fa
fix alignment issues in entries.js
dduugg Feb 18, 2015
99a6978
fix undefined err
dduugg Feb 28, 2015
bccc5e1
ignore npm-debug.log
dduugg Mar 1, 2015
13751df
rm unnecessary return statements
dduugg Mar 1, 2015
127e4f5
added mocks for treatments and profile so the pebble test doesn't fail
jasoncalabrese Mar 1, 2015
0aea8a7
very basic IOB test
jasoncalabrese Mar 1, 2015
5ac9978
Merge pull request #424 from dduugg/wip/fix-create
jasoncalabrese Mar 3, 2015
aa9233b
new pill display for BG delta and IOB
jasoncalabrese Mar 6, 2015
508d582
Merge branch 'dev' into wip/enable-iob
jasoncalabrese Mar 6, 2015
2b26c0e
rm dead code
dduugg Mar 7, 2015
2deb495
Merge pull request #465 from dduugg/wip/dead-code
jasoncalabrese Mar 7, 2015
3b92707
simplify boolean assignment
dduugg Mar 7, 2015
d90acea
Merge pull request #466 from dduugg/wip/simplify-boolean
jasoncalabrese Mar 7, 2015
c1a9bdd
new pill colors from @jimsiff
jasoncalabrese Mar 7, 2015
7fb088c
Merge branch 'dev' into wip/enable-iob
jasoncalabrese Mar 7, 2015
5159859
stop pills from overlapping time in narrow mode
jasoncalabrese Mar 7, 2015
2fc4147
improved iob display and rounding
jasoncalabrese Mar 7, 2015
26786e6
fix iob test to expect new updated iob display value
jasoncalabrese Mar 7, 2015
6134e11
more css hacking for the arrows
jasoncalabrese Mar 7, 2015
edfcbc0
more adjustments of pill tops for different screen sizes
jasoncalabrese Mar 7, 2015
bf2bac6
some cleanup suggested by @dduugg and some more IOB tests
jasoncalabrese Mar 8, 2015
06235ff
resort package dependencies
jasoncalabrese Mar 8, 2015
7bd9446
move all the browserify bundle config to a new module
jasoncalabrese Mar 8, 2015
1e27704
Merge pull request #452 from nightscout/wip/enable-iob
jasoncalabrese Mar 8, 2015
f21c317
updated with dev
jasoncalabrese Mar 8, 2015
23dc58f
no more % based font-sizes; combined #noButton and #bgButton
jasoncalabrese Mar 9, 2015
1efb651
better arrow alignment
jasoncalabrese Mar 9, 2015
c4817b5
fixed bug found by @francescaneri that made clicking on toolbar butto…
jasoncalabrese Mar 11, 2015
89129e4
lots of css adjustments based on everyone's feedback
jasoncalabrese Mar 11, 2015
912bf3a
use smaller font for chart when height is < 480px
jasoncalabrese Mar 11, 2015
5e970c4
lots of font adjustments, X/Y, tooltips, treatment labels
jasoncalabrese Mar 12, 2015
28bac8d
removed debug
jasoncalabrese Mar 12, 2015
631ae67
add back missing warn/urgent stale data time ago colors; add future d…
jasoncalabrese Mar 12, 2015
758b868
smaller font for chart when screen is shorted than 480px
jasoncalabrese Mar 12, 2015
967f519
added back + in delta
jasoncalabrese Mar 12, 2015
d08f5f7
use async.parallel to make multiple mongo queries at once and get rid…
jasoncalabrese Mar 12, 2015
2dc7536
fixed mocks used in pebble test and them bugs found by tests
jasoncalabrese Mar 12, 2015
3a22002
use full hight of the chart (removed 20px top padding); move x-axis l…
jasoncalabrese Mar 12, 2015
6357212
Update pebble.js
ELUTE Mar 12, 2015
051f49b
uncomment testing hack that shouldn't have been committed
jasoncalabrese Mar 12, 2015
1e9ac9c
Merge branch 'wip/last-cal' of github.com:nightscout/cgm-remote-monit…
jasoncalabrese Mar 12, 2015
7b6f054
removed .toFixed(0)'s and fixed tests
jasoncalabrese Mar 12, 2015
50dd57d
made direction arrow a little smaller for the max-width: 750px break …
jasoncalabrese Mar 13, 2015
2639e57
Merge pull request #471 from nightscout/wip/no-percents
jasoncalabrese Mar 13, 2015
ebcb49c
bumped version to 0.7.0-dev
jasoncalabrese Mar 13, 2015
896ae9e
Merge branch 'dev' into wip/last-cal
jasoncalabrese Mar 13, 2015
3162422
a little clean up
jasoncalabrese Mar 13, 2015
b7fc6b9
added initial compression of everything so we can start testing and s…
jasoncalabrese Mar 14, 2015
206a8fd
fixed bug that caused BG color not to change on new data
jasoncalabrese Mar 14, 2015
bcd3fa0
make sure the socket.io.js file that is sent to the client gets gzipp…
jasoncalabrese Mar 14, 2015
a1f963a
make bad data easier to find and prevent errors
jasoncalabrese Mar 14, 2015
b2782fc
group bad data warnings
jasoncalabrese Mar 14, 2015
77f0fdc
Merge pull request #476 from nightscout/wip/last-cal
jasoncalabrese Mar 14, 2015
1fb7923
fixed issue with delta always being 0 in /pebble
jasoncalabrese Mar 14, 2015
5b526a1
don't removed urgent/warning when based on BG range when there is an …
jasoncalabrese Mar 14, 2015
86e2493
do everything we can to find a BG for a treatment; better unit conver…
jasoncalabrese Mar 14, 2015
d2be75a
use an updated fontello font to include an hourglass glyph instead of…
jasoncalabrese Mar 14, 2015
e6c1c3d
use icon-hourglass instead of icon-hourglass-1
jasoncalabrese Mar 14, 2015
686e9af
fix from @sulkaharo, now we should be able to correctly render treatm…
jasoncalabrese Mar 14, 2015
daab336
Merge pull request #481 from nightscout/wip/treatment-bg-scale
jasoncalabrese Mar 14, 2015
c4a2f02
Merge pull request #480 from nightscout/wip/delta-fix
jasoncalabrese Mar 14, 2015
9228db9
get rid of &nbsp; to pull the hourglass and X closer together
jasoncalabrese Mar 14, 2015
06c1008
Merge pull request #482 from nightscout/wip/hourglass-glyph
jasoncalabrese Mar 14, 2015
2496a13
initial support for an adjustable focus range
jasoncalabrese Mar 15, 2015
f472ca3
hide focus range selectors when there is an alarm in narrow mode
jasoncalabrese Mar 15, 2015
c54a322
button clean up
jasoncalabrese Mar 15, 2015
45f4979
prevent some flashing while data loads
jasoncalabrese Mar 15, 2015
26ba414
better scaling when using bigger ranges; use same color as clock foe …
jasoncalabrese Mar 15, 2015
98417ae
Merge branch 'dev' into wip/mqtt/init
jasoncalabrese Mar 15, 2015
bf5c3dd
bigger pills for bigger screens; only use the briter gray for the pil…
jasoncalabrese Mar 16, 2015
17600b7
fixed radius of time ago value
jasoncalabrese Mar 16, 2015
39b141f
make clicking on the focus ranges more responsive by using a timeout
jasoncalabrese Mar 16, 2015
7309e66
another radius tweek
jasoncalabrese Mar 16, 2015
b73aec7
only show 'time ago' offset == -1 (only while loading)
jasoncalabrese Mar 16, 2015
9f183a4
Merge pull request #483 from nightscout/wip/focus-range
jimsiff Mar 16, 2015
647dec2
display uploader battery next to time ago
jasoncalabrese Mar 16, 2015
9062a6c
smaller battery icon when screen < 800px
jasoncalabrese Mar 16, 2015
acceaa5
respect potential I/O errors in pebble response
bewest Mar 16, 2015
2376352
does compression interfere with socket.io?
bewest Mar 16, 2015
8cebeb3
turn off double compression?
bewest Mar 16, 2015
ad9ea58
try different approach for azure git scm commit id
bewest Mar 16, 2015
5d96424
fix deploy syntax error
bewest Mar 16, 2015
5c66dc8
try letting kudu move everything
bewest Mar 16, 2015
ba3dda9
fixing casing!
bewest Mar 16, 2015
47a0679
sniff for azure differently
bewest Mar 16, 2015
429d3b2
better handling of potentional errors and null vars
jasoncalabrese Mar 17, 2015
71f4628
Merge pull request #488 from nightscout/wip/pebble-io-errors
jasoncalabrese Mar 17, 2015
494cae2
Merge branch 'dev' into wip/battery-status
jasoncalabrese Mar 17, 2015
cce7622
some tweeks for the battery and time ago pills
jasoncalabrese Mar 17, 2015
1940cf4
turn off double compression?
bewest Mar 16, 2015
df14b24
Merge branch 'dev' into wip/battery-status
jasoncalabrese Mar 17, 2015
46f4a40
adjust size in case where BG is at LOW or HIGH limit
jasoncalabrese Mar 17, 2015
4e17e8e
check for azure and check for value
bewest Mar 17, 2015
04d1d37
a couple more little css tweeks for battery
jasoncalabrese Mar 17, 2015
b38748a
removed first attempt to disable compression for sockets since it did…
jasoncalabrese Mar 17, 2015
b0d8bde
Merge pull request #484 from nightscout/wip/battery-status
jasoncalabrese Mar 17, 2015
5894ea7
Merge pull request #489 from nightscout/wip/socket-io-no-compress
jasoncalabrese Mar 17, 2015
4a6aa99
Merge pull request #492 from nightscout/wip/pebble-io-errors
jasoncalabrese Mar 17, 2015
b914f41
fixed bug where the now line would jump when changing the focus range…
jasoncalabrese Mar 18, 2015
a697813
some more css tweeks
jasoncalabrese Mar 18, 2015
a291a0e
Merge pull request #496 from nightscout/wip/context-range-fix
jasoncalabrese Mar 18, 2015
469d868
rebasing, it seems to run
bewest Mar 18, 2015
1a38f4e
fix broken test
bewest Nov 2, 2014
ca54f38
better future data warning
jasoncalabrese Mar 18, 2015
1f01d03
remove debug
jasoncalabrese Mar 18, 2015
6705b62
bring back ensureIndexes
bewest Nov 4, 2014
c2a1141
much smoother opening/closing of the settings and treatment drawers
jasoncalabrese Mar 18, 2015
82032f4
Merge branch 'wip/mqtt/rebased' into wip/mqtt/init
bewest Mar 18, 2015
fd47ec9
stop moving the margin-left of the container when a drawer is opened …
jasoncalabrese Mar 18, 2015
0cdd3c0
rm spurious tmp file
bewest Mar 18, 2015
7578c1a
make mqtt listener more unique
bewest Mar 18, 2015
d185010
remove spurious, unused code
bewest Mar 18, 2015
186fdff
fixed bug that caused the treatment to be added 2 times
jasoncalabrese Mar 18, 2015
2575b6a
New profile api
MilosKozak Mar 18, 2015
c2d7daa
Removed unneeded var
MilosKozak Mar 18, 2015
034a95f
Merge pull request #497 from nightscout/wip/future-data
jasoncalabrese Mar 18, 2015
9fedd9e
Merge pull request #498 from nightscout/wip/open-close
jasoncalabrese Mar 19, 2015
d0d708c
Merge pull request #190 from nightscout/wip/mqtt/init
jasoncalabrese Mar 19, 2015
0af24b6
env got dropped off durring refactoring and missed in testing
jasoncalabrese Mar 19, 2015
90e2bfc
resolve conflicts with @MilosKozak's profile-api after MQTT
jasoncalabrese Mar 19, 2015
5eb51bc
Merge branch 'MilosKozak-profile-api' into dev
jasoncalabrese Mar 19, 2015
95746ab
allow API to search things better
bewest Mar 19, 2015
ed264b1
initial display of noise level when rawbg is enabled
jasoncalabrese Mar 20, 2015
1431be6
display rawbg in top right if enabled; fix alarm button border
jasoncalabrese Mar 20, 2015
4f11948
allows api queries like: ?find[type]=mbg
bewest Mar 20, 2015
7b55466
Merge pull request #50 from nightscout/wip/noise
ELUTE Mar 21, 2015
f88ea05
add circle around raw
ELUTE Mar 21, 2015
58ded60
Merge pull request #508 from ELUTE/wip/rawcircle
jasoncalabrese Mar 21, 2015
209e359
tons of css adjustments, moved rawbg to the left, focus selectors to …
jasoncalabrese Mar 21, 2015
084e00b
don't let the tip of the arrow get clipped
jasoncalabrese Mar 21, 2015
9bed536
fixed some bugs releated to when to show raw, also more css tweeks
jasoncalabrese Mar 21, 2015
f58b2fa
adjusted (max-height: 480px) and (min-width: 400px) break point to pr…
jasoncalabrese Mar 21, 2015
bafba6d
don't crash if enable not defined
bewest Mar 21, 2015
88a09ee
make ENABLE optional
bewest Mar 21, 2015
4cfcb30
fix mqtt client id for digitalocean/dokku
bewest Mar 21, 2015
b3a5cf4
only update the chart when the document is visible
jasoncalabrese Mar 22, 2015
b3d5b17
new raw bg/noise vertical pill
jasoncalabrese Mar 22, 2015
661f282
Merge branch 'wip/only-when-visible' into wip/noise
jasoncalabrese Mar 22, 2015
94252cd
Merge pull request #509 from nightscout/wip/mqtt/init
jasoncalabrese Mar 22, 2015
f308fa2
Merge pull request #506 from nightscout/wip/noise
jasoncalabrese Mar 22, 2015
8889ceb
Merge pull request #504 from nightscout/wip/api-params
jasoncalabrese Mar 22, 2015
ff60b64
Merge branch 'wip/init/forever' into wip/ENABLE-is-optional
bewest Mar 22, 2015
28e42c2
Merge pull request #511 from nightscout/wip/ENABLE-is-optional
jasoncalabrese Mar 23, 2015
a7f68f4
workaround to a rounding issue that shows -0.00 iob
jasoncalabrese Mar 23, 2015
df400b8
Merge pull request #512 from nightscout/wip/iob-formatting
bewest Mar 23, 2015
ffc7445
Browser defaults
MilosKozak Mar 19, 2015
d07d4a8
removed unnecessary logs
MilosKozak Mar 19, 2015
fed1d47
rebased, resolved conflicts
MilosKozak Mar 23, 2015
a06d7cc
fix a bug that caused a treatment's glucose value to be ignored and t…
jasoncalabrese Mar 24, 2015
91bb489
removed debug code
jasoncalabrese Mar 24, 2015
10826e5
refresh chart when alarm cleared from an other client
jasoncalabrese Mar 24, 2015
7ed57fc
minor whitespace cleanup
jasoncalabrese Mar 24, 2015
7b269c6
Merge branch 'MilosKozak-env' into dev
jasoncalabrese Mar 24, 2015
cb235ca
Merge pull request #519 from nightscout/wip/gray-after-alarm-fix
jasoncalabrese Mar 24, 2015
e9a0ba3
Merge pull request #518 from nightscout/wip/treatment-position-fix
jasoncalabrese Mar 24, 2015
282cde5
removed duplicate default NIGHT_MODE browser setting
jasoncalabrese Mar 24, 2015
73eb642
added display of bg and delta in html title
justingshreve Mar 26, 2015
4edddd1
fix bug that caused raw to not be displayed durring startup when nois…
jasoncalabrese Mar 27, 2015
d8164d5
removed debug
jasoncalabrese Mar 27, 2015
2bfa20c
show bg (and rawbg/noise) even if there isn't a previous value
jasoncalabrese Mar 28, 2015
e1777e9
some clean up
jasoncalabrese Mar 28, 2015
4063454
always set the units even if we aren't going to show a delta
jasoncalabrese Mar 29, 2015
6dd5c20
anything that starts with dexcom should be treated the same (g4 with …
jasoncalabrese Mar 29, 2015
dd54c58
clean up
jasoncalabrese Mar 29, 2015
2bac45a
Merge pull request #534 from nightscout/wip/raw-startup
jasoncalabrese Mar 29, 2015
1a129f4
use selected time format for tooltips and x axises
jasoncalabrese Mar 29, 2015
a8bdca0
fixed typos
jasoncalabrese Mar 29, 2015
291e347
remove 0 padding in 12hr format
jasoncalabrese Mar 29, 2015
dbadddc
adjust size of chart font
jasoncalabrese Mar 29, 2015
75b787b
updateTitle called when new svg is received
justingshreve Mar 30, 2015
5f5a113
Merge pull request #533 from justingshreve/bg-to-title2
jasoncalabrese Mar 30, 2015
aae55d2
Merge pull request #536 from nightscout/wip/tooltip-times
jasoncalabrese Mar 30, 2015
42230f6
use new sysTime field
jasoncalabrese Apr 1, 2015
f3a3d0d
use readENV for MQTT_MONITOR
jasoncalabrese Apr 2, 2015
fff5230
support for heroku COMIT_HASH env var if GIT HEAD isn't found
jasoncalabrese Apr 2, 2015
396e2af
use env.mqtt_client_id
jasoncalabrese Apr 2, 2015
fe978c5
Merge pull request #539 from nightscout/wip/systime-upsert
jasoncalabrese Apr 2, 2015
39b4ef9
after closing the drawer scroll to the top
jasoncalabrese Apr 3, 2015
8905be9
improvements for the title; current bg status, and delta
jasoncalabrese Apr 3, 2015
786fcb1
more fixes for the title
jasoncalabrese Apr 3, 2015
71dbca5
and still more fixes for the title
jasoncalabrese Apr 3, 2015
15d5ff8
use the customTitle from browserSettings instead onf browserStorage s…
jasoncalabrese Apr 3, 2015
513b434
adjust position of tooltips to reduce overlaping the trend line
jasoncalabrese Apr 3, 2015
835d24d
trying to make the updateToNow when becoming work better
jasoncalabrese Apr 3, 2015
fac066c
Add DISPLAY_UNITS and Papertrail addon
jimsiff Apr 3, 2015
2fd2ab6
A few more tweaks
jimsiff Apr 3, 2015
d1c66b8
Merge pull request #546 from jimsiff/wip/focus-info
jasoncalabrese Apr 3, 2015
182004d
added a 'Use server defaults' button to reset local storage
jasoncalabrese Apr 4, 2015
fdea816
Merge branch 'wip/focus-info' of github.com:nightscout/cgm-remote-mon…
jasoncalabrese Apr 4, 2015
6cd8638
changed reset button into a link and some other css tweeks; only remo…
jasoncalabrese Apr 4, 2015
b89efd6
added some basic validation to prevent bad treatment data (from bad b…
jasoncalabrese Apr 4, 2015
53f5f63
don't set focus to eventType since it causes iOS to open the selectio…
jasoncalabrese Apr 4, 2015
f1b1928
Merge pull request #543 from nightscout/wip/focus-info
jasoncalabrese Apr 4, 2015
d79835e
first pass merging sgv and sensor records
jasoncalabrese Apr 5, 2015
cea0ff1
egg hunt
jasoncalabrese Apr 5, 2015
6a3a8bd
egg hunt
jasoncalabrese Apr 5, 2015
94f75e3
harder hunting
jasoncalabrese Apr 5, 2015
dd375be
harder hunting
jasoncalabrese Apr 5, 2015
12fb927
make sure we can handle without sgvs or sensors
jasoncalabrese Apr 5, 2015
a95b752
Merge pull request #548 from nightscout/wip/mqtt-merge
jasoncalabrese Apr 6, 2015
d456cbd
until next year...
jasoncalabrese Apr 6, 2015
423d1c1
first pass at client side alarm for stale data
jasoncalabrese Apr 10, 2015
9a54310
create a better default mqtt clientId by hashing the mongo host/db/co…
jasoncalabrese Apr 15, 2015
6eb1b62
clean/sort up package.json
jasoncalabrese Apr 15, 2015
51462bb
added basic units module to unify all mg/dl to mmol display conversion
jasoncalabrese Apr 15, 2015
d344b72
very simple mg/dl to mmol display tests
jasoncalabrese Apr 15, 2015
7d9570c
removed unused getEntries function
jasoncalabrese Apr 15, 2015
6691a1f
expand code coverage and find/fix bug with /entries/:id
jasoncalabrese Apr 15, 2015
fecb507
Merge pull request #560 from nightscout/wip/entries-cleanup
jasoncalabrese Apr 16, 2015
f3a5a36
Merge branch 'dev' into wip/mqtt-clientid
jasoncalabrese Apr 16, 2015
bafac13
don't let the client id get longer than 23 chars
jasoncalabrese Apr 16, 2015
4b855b5
Merge pull request #558 from nightscout/wip/mqtt-clientid
jasoncalabrese Apr 16, 2015
1e469c2
merged dev into wip/push-mmol-cals and fixed conflicts
jasoncalabrese Apr 16, 2015
a1c4b21
Merge pull request #559 from nightscout/wip/push-mmol-cals
jasoncalabrese Apr 16, 2015
ef9b11a
Merge branch 'dev' into wip/stale-data
jasoncalabrese Apr 16, 2015
91a424f
added env vars with client overrides for timeago warn/urgent mins; ma…
jasoncalabrese Apr 16, 2015
c1db196
make drawer submit button full width for better thumb access
jasoncalabrese Apr 17, 2015
2ee1cab
don't change backgroud of batter pill when there's a stale data alarm…
jasoncalabrese Apr 17, 2015
1ad0896
Merge pull request #554 from nightscout/wip/stale-data
jasoncalabrese Apr 17, 2015
bb697e5
fix browserify-express watch path, thanks @sulkaharo
jasoncalabrese Apr 17, 2015
71c2363
update logos and favicons
jasoncalabrese Apr 18, 2015
ccc98de
tweek labels for the stale data alarms
jasoncalabrese Apr 18, 2015
a08d3f4
Merge pull request #566 from nightscout/wip/enchilada-prep
jasoncalabrese Apr 19, 2015
da7b24b
version bump
jasoncalabrese Apr 19, 2015
c11d4c7
Merge branch 'release/0.7.0'
jasoncalabrese Apr 19, 2015
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
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
bower_components/
node_modules/


bundle/bundle.out.js

.idea/
*.iml
my.env
Expand All @@ -15,3 +18,5 @@ static/bower_components/

# istanbul output
coverage/

npm-debug.log
18 changes: 6 additions & 12 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,8 @@
language: node_js
sudo: false
node_js:
- "0.10"
- "0.11"
matrix:
allow_failures:
- node_js: "0.11"
services:
- mongodb
before_script:
- sleep 10
- echo mongo mongo_travis
script:
- make travis
- "0.10"
- "0.12"
services: mongodb
script: make travis
after_script: make report
5 changes: 2 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,14 @@
[build-url]: https://travis-ci.org/nightscout/cgm-remote-monitor
[dependency-img]: https://img.shields.io/david/nightscout/cgm-remote-monitor.svg
[dependency-url]: https://david-dm.org/nightscout/cgm-remote-monitor
[coverage-img]: https://img.shields.io/coveralls/nightscout/cgm-remote-monitor/coverage.svg
[coverage-url]: https://coveralls.io/r/nightscout/cgm-remote-monitor?branch=dev
[coverage-img]: https://img.shields.io/coveralls/nightscout/cgm-remote-monitor/master.svg
[coverage-url]: https://coveralls.io/r/nightscout/cgm-remote-monitor?branch=master
[gitter-img]: https://img.shields.io/badge/Gitter-Join%20Chat%20%E2%86%92-1dce73.svg
[gitter-url]: https://gitter.im/nightscout/public
[ready-img]: https://badge.waffle.io/nightscout/cgm-remote-monitor.svg?label=ready&title=Ready
[waffle]: https://waffle.io/nightscout/cgm-remote-monitor
[progress-img]: https://badge.waffle.io/nightscout/cgm-remote-monitor.svg?label=in+progress&title=In+Progress


## Design

Participate in the design process by creating an issue to discuss your
Expand Down
40 changes: 30 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@

# Nightscout tests/builds/analysis
TESTS=tests/*.js
MONGO_CONNECTION?=mongodb://localhost/test_db
CUSTOMCONNSTR_mongo_settings_collection?=test_settings
Expand All @@ -7,19 +8,38 @@ MONGO_SETTINGS=MONGO_CONNECTION=${MONGO_CONNECTION} \
CUSTOMCONNSTR_mongo_collection=${CUSTOMCONNSTR_mongo_collection} \
CUSTOMCONNSTR_mongo_settings_collection=${CUSTOMCONNSTR_mongo_settings_collection}

# XXX.bewest: Mocha is an odd process, and since things are being
# wrapped and transformed, this odd path needs to be used, not the
# normal wrapper. When ./node_modules/.bin/mocha is used, no coverage
# information is generated. This happens because typical shell
# wrapper performs process management that mucks with the test
# coverage reporter's ability to instrument the tests correctly.
# Hard coding it to the local with our pinned version is bigger for
# initial installs, but ensures a consistent environment everywhere.
# On Travis, ./node_modules/.bin and other `nvm` and `npm` bundles are
# inserted into the default `$PATH` enviroinment, making pointing to
# the unwrapped mocha executable necessary.
MOCHA=./node_modules/mocha/bin/_mocha
# Pinned from dependency list.
ISTANBUL=./node_modules/.bin/istanbul
ANALYZED=./coverage/lcov.info

all: test

travis-cov:
NODE_ENV=test \
${MONGO_SETTINGS} \
istanbul cover ./node_modules/mocha/bin/_mocha --report lcovonly -- -vvv -R tap ${TESTS} && \
cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js && \
rm -rf ./coverage
coverage:
NODE_ENV=test ${MONGO_SETTINGS} \
${ISTANBUL} cover ${MOCHA} -- -R tap ${TESTS}

report:
test -f ${ANALYZED} && \
(npm install coveralls && cat ${ANALYZED} | \
./node_modules/.bin/coveralls) || echo "NO COVERAGE"

test:
${MONGO_SETTINGS} \
mocha --verbose -vvv -R tap ${TESTS}
${MONGO_SETTINGS} ${MOCHA} -R tap ${TESTS}

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

.PHONY: test
.PHONY: all coverage report test travis
2 changes: 1 addition & 1 deletion Procfile
Original file line number Diff line number Diff line change
@@ -1 +1 @@
web: node server.js
web: ./node_modules/.bin/forever --minUptime 100 -c node server.js
22 changes: 20 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ Use the [autoconfigure tool][autoconfigure] to sync an uploader to your config.

#### Features/Labs

* `ENABLE` - Used to enable optional features, expects a space delimited list such as: `careportal rawbg` (also `rawbg-on` to show raw data by default)
* `ENABLE` - Used to enable optional features, expects a space delimited list such as: `careportal rawbg iob`
* `API_SECRET` - A secret passphrase that must be at least 12 characters long, required to enable `POST` and `PUT`; also required for the Care Portal
* `BG_HIGH` (`260`) - must be set using mg/dl units; the high BG outside the target range that is considered urgent
* `BG_TARGET_TOP` (`180`) - must be set using mg/dl units; the top of the target range, also used to draw the line on the chart
Expand All @@ -114,11 +114,29 @@ Use the [autoconfigure tool][autoconfigure] to sync an uploader to your config.
* `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


#### Predefined values for your browser settings (optional)
* `TIME_FORMAT` (`12`)- possible values `12` or `24`
* `NIGHT_MODE` (`off`) - possible values `on` or `off`
* `SHOW_RAWBG` (`never`) - possible values `always`, `never` or `noise`
* `CUSTOM_TITLE` (`Nightscout`) - Usually name of T1
* `THEME` (`default`) - possible values `default` or `colors`
* `ALARM_URGENT_HIGH` (`on`) - possible values `on` or `off`
* `ALARM_HIGH` (`on`) - possible values `on` or `off`
* `ALARM_LOW` (`on`) - possible values `on` or `off`
* `ALARM_URGENT_LOW` (`on`) - possible values `on` or `off`
* `ALARM_TIMEAGO_WARN` (`on`) - possible values `on` or `off`
* `ALARM_TIMEAGO_WARN_MINS` (`15`) - minutes since the last reading to trigger a warning
* `ALARM_TIMEAGO_URGENT` (`on`) - possible values `on` or `off`
* `ALARM_TIMEAGO_URGENT_MINS` (`30`) - minutes since the last reading to trigger a urgent alarm


## Setting environment variables
Easy to emulate on the commandline:

```bash
echo 'MONGO_CONNECTION="mongodb://sally:[email protected]:99999/nightscout"' >> my.env
echo 'MONGO_CONNECTION=mongodb://sally:[email protected]:99999/nightscout' >> my.env
echo 'MONGO_COLLECTION=entries' >> my.env
```

From now on you can run using
Expand Down
59 changes: 59 additions & 0 deletions app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@

var express = require('express');
var compression = require('compression');
function create (env, ctx) {
///////////////////////////////////////////////////
// api and json object variables
///////////////////////////////////////////////////
var api = require('./lib/api/')(env, ctx.entries, ctx.settings, ctx.treatments, ctx.profiles, ctx.devicestatus);
var pebble = ctx.pebble;

var app = express();
app.entries = ctx.entries;
app.treatments = ctx.treatments;
app.profiles = ctx.profiles;
app.devicestatus = ctx.devicestatus;
var appInfo = env.name + ' ' + env.version;
app.set('title', appInfo);
app.enable('trust proxy'); // Allows req.secure test on heroku https connections.

app.use(compression({filter: shouldCompress}));

function shouldCompress(req, res) {
//TODO: return false here if we find a condition where we don't want to compress
// fallback to standard filter function
return compression.filter(req, res);
}

//if (env.api_secret) {
// console.log("API_SECRET", env.api_secret);
//}
app.use('/api/v1', api);


// pebble data
app.get('/pebble', pebble(ctx.entries, ctx.treatments, ctx.profiles, ctx.devicestatus, env));

//app.get('/package.json', software);

// define static server
//TODO: JC - changed cache to 1 hour from 30d ays to bypass cache hell until we have a real solution
var staticFiles = express.static(env.static_files, {maxAge: 60 * 60 * 1000});

// serve the static content
app.use(staticFiles);

var bundle = require('./bundle')();
app.use(bundle);

// Handle errors with express's errorhandler, to display more readable error messages.

// Handle errors with express's errorhandler, to display more readable error messages.
var errorhandler = require('errorhandler');
//if (process.env.NODE_ENV === 'development') {
app.use(errorhandler());
//}
return app;
}
module.exports = create;

8 changes: 7 additions & 1 deletion app.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@
"value": "",
"required": true
},
"DISPLAY_UNITS": {
"description": "Server display units for BG values. Default null value implies 'mg/dl'. Set to 'mmol' to change the server to mmol mode.",
"value": "",
"required": false
},
"ENABLE": {
"description": "Space delimited list of optional features to enable, such as 'careportal'.",
"value": "",
Expand Down Expand Up @@ -54,6 +59,7 @@
}
},
"addons": [
"mongolab:sandbox"
"mongolab:sandbox",
"papertrail"
]
}
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "nightscout",
"version": "0.6.4",
"version": "0.7.0",
"dependencies": {
"angularjs": "1.3.0-beta.19",
"bootstrap": "~3.2.0",
Expand Down
13 changes: 13 additions & 0 deletions bundle/bundle.source.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
(function () {

window.Nightscout = window.Nightscout || {};

window.Nightscout = {
iob: require('../lib/iob')()
, units: require('../lib/units')()
};

console.info("Nightscout bundle ready", window.Nightscout);

})();

17 changes: 17 additions & 0 deletions bundle/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
'use strict';

var browserify_express = require('browserify-express');

function bundle() {
return browserify_express({
entry: __dirname + '/bundle.source.js',
watch: __dirname + '/../lib/',
mount: '/public/js/bundle.js',
verbose: true,
//minify: true,
bundle_opts: { debug: true }, // enable inline sourcemap on js files
write_file: __dirname + '/bundle.out.js'
});
}

module.exports = bundle;
1 change: 1 addition & 0 deletions deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ selectNodeVersion () {
# ----------

echo Handling node.js deployment.
echo "\"$SCM_COMMIT_ID\"" > $DEPLOYMENT_SOURCE/scm-commit-id.json

# 1. KuduSync
if [[ "$IN_PLACE_DEPLOYMENT" -ne "1" ]]; then
Expand Down
72 changes: 63 additions & 9 deletions env.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,29 +21,80 @@ function config ( ) {
var software = require('./package.json');
var git = require('git-rev');

if (readENV('SCM_GIT_EMAIL') == 'windowsazure' && readENV('ScmType') == 'GitHub') {
git.cwd('/home/site/repository');
}
if (readENV('SCM_COMMIT_ID')) {
env.head = readENV('SCM_COMMIT_ID');
if (readENV('APPSETTING_ScmType') == readENV('ScmType') && readENV('ScmType') == 'GitHub') {
env.head = require('./scm-commit-id.json');
console.log("SCM COMMIT ID", env.head);
} else {
git.short(function record_git_head (head) {
console.log("GIT HEAD", head);
env.head = head;
env.head = head || readENV('SCM_COMMIT_ID') || readENV('COMMIT_HASH', '');
});
}
env.version = software.version;
env.name = software.name;

env.DISPLAY_UNITS = readENV('DISPLAY_UNITS', 'mg/dl');
env.PORT = readENV('PORT', 1337);
env.mongo = readENV('MONGO_CONNECTION') || readENV('MONGO') || readENV('MONGOLAB_URI');
env.mongo_collection = readENV('MONGO_COLLECTION', 'entries');
env.MQTT_MONITOR = readENV('MQTT_MONITOR', null);
if (env.MQTT_MONITOR) {
var hostDbCollection = [env.mongo.split('mongodb://').pop().split('@').pop( ), env.mongo_collection].join('/');
var mongoHash = crypto.createHash('sha1');
mongoHash.update(hostDbCollection);
//some MQTT servers only allow the client id to be 23 chars
env.mqtt_client_id = mongoHash.digest('base64').substring(0, 23);
console.info('Using Mongo host/db/collection to create the default MQTT client_id', hostDbCollection);
if (env.MQTT_MONITOR.indexOf('?clientId=') == -1) {
console.info('Set MQTT client_id to: ', env.mqtt_client_id);
} else {
console.info('MQTT configured to use a custom client id, it will override the default: ', env.mqtt_client_id);
}
}
env.settings_collection = readENV('MONGO_SETTINGS_COLLECTION', 'settings');
env.treatments_collection = readENV('MONGO_TREATMENTS_COLLECTION', 'treatments');
env.profile_collection = readENV('MONGO_PROFILE_COLLECTION', 'profile');
env.devicestatus_collection = readENV('MONGO_DEVICESTATUS_COLLECTION', 'devicestatus');

env.enable = readENV('ENABLE');
env.enable = readENV('ENABLE', "");

env.defaults = { // currently supported keys must defined be here
'units': 'mg/dL'
, 'timeFormat': '12'
, 'nightMode': false
, 'showRawbg': 'never'
, 'customTitle': 'Nightscout'
, 'theme': 'default'
, 'alarmUrgentHigh': true
, 'alarmHigh': true
, 'alarmLow': true
, 'alarmUrgentLow': true
, 'alarmTimeAgoWarn': true
, 'alarmTimeAgoWarnMins': 15
, 'alarmTimeAgoUrgent': true
, 'alarmTimeAgoUrgentMins': 30
, 'language': 'en' // not used yet
} ;

// add units from separate variable
env.defaults.units = env.DISPLAY_UNITS;

// Highest priority per line defaults
env.defaults.timeFormat = readENV('TIME_FORMAT', env.defaults.timeFormat);
env.defaults.nightMode = readENV('NIGHT_MODE', env.defaults.nightMode);
env.defaults.showRawbg = readENV('SHOW_RAWBG', env.defaults.showRawbg);
env.defaults.customTitle = readENV('CUSTOM_TITLE', env.defaults.customTitle);
env.defaults.theme = readENV('THEME', env.defaults.theme);
env.defaults.alarmUrgentHigh = readENV('ALARM_URGENT_HIGH', env.defaults.alarmUrgentHigh);
env.defaults.alarmHigh = readENV('ALARM_HIGH', env.defaults.alarmHigh);
env.defaults.alarmLow = readENV('ALARM_LOW', env.defaults.alarmLow);
env.defaults.alarmUrgentLow = readENV('ALARM_URGENT_LOW', env.defaults.alarmUrgentLow);
env.defaults.alarmTimeAgoWarn = readENV('ALARM_TIMEAGO_WARN', env.defaults.alarmTimeAgoWarn);
env.defaults.alarmTimeAgoWarnMins = readENV('ALARM_TIMEAGO_WARN_MINS', env.defaults.alarmTimeAgoWarnMins);
env.defaults.alarmTimeAgoUrgent = readENV('ALARM_TIMEAGO_URGENT', env.defaults.alarmTimeAgoUrgent);
env.defaults.alarmTimeAgoUrgentMins = readENV('ALARM_TIMEAGO_URGENT_MINS', env.defaults.alarmTimeAgoUrgentMins);

//console.log(JSON.stringify(env.defaults));

env.SSL_KEY = readENV('SSL_KEY');
env.SSL_CERT = readENV('SSL_CERT');
env.SSL_CA = readENV('SSL_CA');
Expand Down Expand Up @@ -145,7 +196,10 @@ function readENV(varName, defaultValue) {
|| process.env[varName]
|| process.env[varName.toLowerCase()];

return value || defaultValue;
if (typeof value === 'string' && value.toLowerCase() == 'on') value = true;
if (typeof value === 'string' && value.toLowerCase() == 'off') value = false;

return value != null ? value : defaultValue;
}

module.exports = config;
Loading