Commit Graph
181 Commits
Author SHA1 Message Date
Sulka HaroandGitHub 914ba78f36 Security improvement batch (#6622)
* Adds a new method for the server to push notifies to the client, which require administration privileges from the user. If there are messages in queue but user is not privileged, she is notified of pending messages

* Fix unit tests

* Increase timeouts on tests

* Add translations

* * Aggregate admin messages
* Send admin message on auth fail
* Sending messages over bus
* XSS filtering of objects sent over the REST API

* Warn users if their instance is world readable

* Fix adminnotifies init()

* Fix couple issues from Codacy
2021-01-07 22:46:55 +02:00
Sulka Haro 2c30b64c8c Add a missing localization, fix unit tests 2020-12-22 00:12:27 +02:00
Sulka Haro edfcf6eccd Fix authorization renewal 2020-12-21 21:09:18 +02:00
Sulka Haro c12ad765be * Refactor how the levels dependency is loaded, to fix some localization issues
* Moves reporting client to the bundles
2020-12-14 20:31:20 +02:00
Sulka HaroandGitHub 7fe8e32152 Refactor core auth (#6596)
* Auth resolve now supports async/await
* Read only tokens can be used for authentication and the UI shows privileges for these accounts correctly
* Failed attempt at authenticating an API_SECRET or token delays subsequent auth attempt by 5000 ms
2020-12-11 00:23:25 +02:00
Sulka Haro bc0f8170bb * Fix a bug with reloading while the server is starting
* Workaround for the plugins being re-executed multiple times in rapid succession during site load, causing timing issues
2020-12-09 19:57:22 +02:00
Sulka HaroandGitHub 4ace12594e Move localisation to Crowdin (#6518)
* Update Crowdin configuration file

* Update Crowdin configuration file

* Add languages for pushing

* Update Crowdin configuration file

* Update source file en.json

* New translations en.json (Finnish)

* New translations en.json (Finnish)

* New translations en.json (Romanian)

* New translations en.json (Dutch)

* New translations en.json (Croatian)

* New translations en.json (Portuguese, Brazilian)

* New translations en.json (Chinese Traditional)

* New translations en.json (Chinese Simplified)

* New translations en.json (Turkish)

* New translations en.json (Swedish)

* New translations en.json (Slovenian)

* New translations en.json (Russian)

* New translations en.json (Polish)

* New translations en.json (Korean)

* New translations en.json (French)

* New translations en.json (Japanese)

* New translations en.json (Italian)

* New translations en.json (Hungarian)

* New translations en.json (Hebrew)

* New translations en.json (Greek)

* New translations en.json (German)

* New translations en.json (Danish)

* New translations en.json (Czech)

* New translations en.json (Bulgarian)

* New translations en.json (Spanish)

* New translations en.json (Norwegian Bokmal)

* New translations en.json (Chinese Traditional)

* New translations en.json (Chinese Simplified)

* Remove folders

* New translations en.json (Romanian)

* New translations en.json (Korean)

* New translations en.json (Croatian)

* New translations en.json (Portuguese, Brazilian)

* New translations en.json (Chinese Traditional)

* New translations en.json (Turkish)

* New translations en.json (Swedish)

* New translations en.json (Slovenian)

* New translations en.json (Russian)

* New translations en.json (Polish)

* New translations en.json (Dutch)

* New translations en.json (Japanese)

* New translations en.json (French)

* New translations en.json (Italian)

* New translations en.json (Hungarian)

* New translations en.json (Hebrew)

* New translations en.json (Finnish)

* New translations en.json (Greek)

* New translations en.json (German)

* New translations en.json (Danish)

* New translations en.json (Czech)

* New translations en.json (Bulgarian)

* New translations en.json (Norwegian Bokmal)

* New translations en.json (Romanian)

* New translations en.json (Korean)

* New translations en.json (Croatian)

* New translations en.json (Portuguese, Brazilian)

* New translations en.json (Turkish)

* New translations en.json (Swedish)

* New translations en.json (Slovenian)

* New translations en.json (Russian)

* New translations en.json (Polish)

* New translations en.json (Dutch)

* New translations en.json (Japanese)

* New translations en.json (French)

* New translations en.json (Italian)

* New translations en.json (Hungarian)

* New translations en.json (Hebrew)

* New translations en.json (Finnish)

* New translations en.json (Greek)

* New translations en.json (German)

* New translations en.json (Danish)

* New translations en.json (Czech)

* New translations en.json (Bulgarian)

* New translations en.json (Norwegian Bokmal)

* Update Crowdin configuration file

* New translations en.json (Spanish)

* New translations en.json (Chinese Simplified)

* New translations en.json (Chinese Traditional)

* New translations en.json (Italian)

* New translations en.json (Croatian)

* New translations en.json (Portuguese, Brazilian)

* New translations en.json (Turkish)

* New translations en.json (Swedish)

* New translations en.json (Slovenian)

* New translations en.json (Russian)

* New translations en.json (Polish)

* New translations en.json (Dutch)

* New translations en.json (Korean)

* New translations en.json (Japanese)

* New translations en.json (Hungarian)

* New translations en.json (Hebrew)

* New translations en.json (Finnish)

* New translations en.json (Greek)

* New translations en.json (German)

* New translations en.json (Danish)

* New translations en.json (Czech)

* New translations en.json (Bulgarian)

* New translations en.json (French)

* New translations en.json (Romanian)

* New translations en.json (Norwegian Bokmal)

* Loading all languages now works

* * Fix unit tests
* Have server load localizations

* Adding some more keys

* New Crowdin updates (#6531)

* New translations en.json (Finnish)

* New translations en.json (Norwegian Bokmal)

* New translations en.json (Finnish)

* New translations en.json (Japanese)

* New translations en.json (Portuguese, Brazilian)

* New translations en.json (Chinese Traditional)

* New translations en.json (Chinese Simplified)

* New translations en.json (Turkish)

* New translations en.json (Swedish)

* New translations en.json (Slovenian)

* New translations en.json (Russian)

* New translations en.json (Polish)

* New translations en.json (Dutch)

* New translations en.json (Korean)

* New translations en.json (Italian)

* New translations en.json (Norwegian Bokmal)

* New translations en.json (Hungarian)

* New translations en.json (Hebrew)

* New translations en.json (Greek)

* New translations en.json (German)

* New translations en.json (Danish)

* New translations en.json (Czech)

* New translations en.json (Bulgarian)

* New translations en.json (Spanish)

* New translations en.json (French)

* New translations en.json (Romanian)

* New translations en.json (Croatian)

* Update source file en.json

* New translations en.json (Norwegian Bokmal)

* New translations en.json (Norwegian Bokmal)

* Remove old translation status tool

* Update CONTRIBUTING
2020-11-17 14:17:17 +02:00
Sulka Haro e7d080adf8 Increase load interval to 5 seconds 2020-11-15 10:46:35 +02:00
Sulka Haro 376c790710 Add runtime state tracking to Nightscout, where client now checks if the server has loaded initial data from Mongo before the user is directed to the UI 2020-11-14 11:05:43 +02:00
Jeremy Cunningham ace19e1d0f fix brushing recursion 2020-09-10 13:58:15 -05:00
Jeremy CunninghamandGitHub 89dfe21303 Openaps performance improvement (#5945)
* improve openaps plugin performance

* more performance improvements

(cherry picked from commit 076a2dd3b69093149994258eb0244ae61d68f44e)

* correct setting notEnacted variable

* remove unnecessary debug logging
2020-09-08 08:04:46 +03:00
Jeremy CunninghamandGitHub 7c5a69dd9a Fix d3 portrait to landscape brush failure (#5638)
* fix d3 portrait to landscape brush failure

* fix client.renderer.test for highlighBrushPoints function prototype change

* fix highlightBrush

* move brush reset inside check for valid brush
2020-05-05 22:13:21 +03:00
Andrew DixonandGitHub 17eb4ae7bc Option to switch off bolus amount outputs (#5522)
* Option to switch off bolus amount outputs (#5514)

* Fixing issue with carb value not be output when set to "none" (#5514)

* Adding additional output options (#5514)

* Adding environment variable option for 'x U and Over' option.

This option is BOLUS_RENDER_OVER with a default value of 1 and the value can be an integer or a float, e.g. 0.3, 1.5, 2, etc...

* Adding change to change the font size depending on the bolus value.

* Merge two "all" options to create an option that displays as SMB had.
2020-04-14 10:20:35 +03:00
JakobandSulka Haro 7dc292e056 Resolve unnecessary uses of eslint-ignore (#5436)
* Resolve unnecessary disabling of no-undef eslint rule

* Resolve unnecessary disabling of no-prototype-builtins eslint rule

* Resolve unnecessary disabling of no-unused-vars eslint rule

* Resolve unnecessary disabling of no-empty eslint rule
2020-01-12 20:13:29 +00:00
Jeremy CunninghamandSulka Haro 60be07c9ec Fix Graph Display Without Recent Devicestatus (#5409) 2020-01-06 10:55:04 +02:00
Sulka Haro 44519b939a Fix timeago alarms (again). The changes to the rendered had an unintended consequence of triggering the timeago detection less frequently, causing the code to think the client has been hibernating, thus suppressing the alarms. The update changes the clock to be updated more frequently (this updating the hibernation detection), fixing the issue 2020-01-01 13:11:46 +02:00
Jeremy CunninghamandSulka Haro 721aa0226c Fix auth dialog sizing error (#5314)
* Fix auth dialog sizing error

* Fix Client Init After Auth

(cherry picked from commit 1bf416c3bb964ed555850c3fc55977d69980b8e5)

* update NS minor version
2019-12-18 08:55:09 +02:00
Sulka HaroandGitHub 7b58a2251f Use auth tokens in api-secret (#5214)
* Allow auth tokens to be passed in the api-secret header and used in the client in place of the API secret

* Fix unit test

* Fix admin test

* Reload page when token is used as a secret
2019-12-06 12:27:54 +02:00
Jeremy Cunningham b5b2f2a201 fix clearing alarming when clearning CurrentSGV 2019-11-22 23:39:27 -06:00
Jeremy CunninghamandSulka Haro 534c4435a4 Don't use dynamic scale unless entries in database (#5195)
* don't use dynamic scale unless have entries

* fix report crash when no entries

* set forecastTime correctly when no entries present
2019-11-12 08:42:30 +02:00
Jeremy CunninghamandSulka Haro c4ee62b495 fix devicestatus retro merge (#5193) 2019-11-10 19:18:05 +00:00
Jeremy CunninghamandSulka Haro c1244eae12 Stop Focus Circles from Eating Entries (#5145)
* stop focus circles from eating entries

* fix forecastCircles remove

* resolve possible key collision

* Fixes a major bug where plugins were ran against a sandbox twice, causing issues with predictions. Fixes the look ahead timings.
2019-10-25 20:08:03 +03:00
Sulka Haro afd12fd7f0 Fix initial forecast point display 2019-10-23 23:50:41 +03:00
Sulka HaroandGitHub 243ff2e28e Load data in one pass (#5142)
* Fix layouting and load data in one go. Bonus points if you can fix the rendering for this

* fix focus target lines and high and low lines

* Remove debug logging. Change profile functions to clear the cache on new data, instead of calculating heavy hashes

* Remove unused code

* Fix tests

* Have Travis run tests on Node 10 and 12, not 13
2019-10-23 15:18:54 +03:00
Sulka HaroandGitHub fab24536dd Don't load retro data if not needed. Merge retro data faster if it's present. (#5141) 2019-10-22 10:12:58 +03:00
Sulka HaroandGitHub 2d07c5488a Performance fixes (#5134)
* Further fixes to profile data fetches, change the client to not create excessive amount of date objects

* Sort entries once on load and then rely on the sorting to find out the largest and smallest value

* Make the renderer reuse Date objects instead of instantiating a huge amount of dates all the time
2019-10-22 08:37:47 +03:00
Sulka HaroandGitHub e10d4838a8 Fix tests failing in dev (#5127)
* * Fix reporting test to match the new output
* Fix number formatter to return the expected 0 when data is NaN
* Remove excessive logging during test runs from cob plugin

* Run all tests in one go

* Fixes D3 invocations for tests. Note this also removes transition timers (most of which seemed to be timed so fast they actually had no effect as the timer was faster than what it takes to draw a frame in Nightscout)

* Run tests independently

* Try not running tap-set-exit

* Remove tap-set-exit
2019-10-22 00:10:06 +03:00
Jeremy CunninghamandPieterGit b8f28b0586 fix(d3): D3 libarry upgrade (lib for visualizing data such as main view, graphs, etc.) (#5081)
* initial commit for d3 upgrade

* d3 v5 mostly working except brush

* more work on the brush

* brush and layout mostly working now

* make open-right and open-left lines visible

* make brush selection hidden

* fix open-right, open-top, and now-line in retro mode

* fix setting brush to now

* fix updateBrushToNow to set start correctly

* add extent to updateBrushToNow

* fix inRetro to use dataExtent instead of domain

* move a debug log message to better location

* debug for brush movements

* cleanup adjusted range vs. brushed range

* fix syntax error

* remove transitions for brush movements

* log message for dataUpdate

* fix updating brush range when new data arrives

* fix keeping up with data when not in retro

* keep brush range at focusRangeMS during update

* fix variable name error

* keep chart in sync with current time when not in retro

* use short transition time

* test no opacity changes

* remove one more highlight and use small transition duration

* fix race condition

* fix for uncommanded going to retro

* fix syntax error

* update chart scales when new data arrives in retro mode

* Use consistent transition for scroll

* clean chart.updateContext

* comment out debug messages

* remove unused variable

* update renderer to account for no structure arg for d3 attr

* fix syntax error

* one more syntax error

* use requestAnimationFrame

(cherry picked from commit b610485597b2e9ecf46471994980136d3c17deec)

* forgot to update current scroll data

(cherry picked from commit 1ab26522cd4abd3fb77a76964469200fc50dc555)

* remove extra treatment circles

* try using class for selection

(cherry picked from commit 92f678c6fe8e2bb700dc61ab56a71d483c5a9988)

* reduce update required for focus circles

(cherry picked from commit 46aab643125c2a083807627b9fb6052faef2134f)

* reduce update required for focus treatments

(cherry picked from commit 23ba5c4bea4bf2ff75f2296e1edc606f311ef7fe)

* fix update prepare treat circles

(cherry picked from commit afcbbab40fe0c93e26e97152513845cf2c5ecf6f)

* use _id for treatments key

* do not use opacity for past entry circles

* replace scale.linear with scaleLinear

see https://github.com/d3/d3/blob/master/CHANGES.md#scales-d3-scale

(cherry picked from commit 3445eeeedd1c0d863ca5210d4cd32994a9da4d49)

* d3 upgrade axis

(cherry picked from commit 06a8a9283100a980ccb5bed7920bce96a5b138cc)

* d3 upgrade axis

(cherry picked from commit 1ac583ce2b1d0796f8d8f0d5f9b5ee29a051af1e)

* fix tooltip location

* fix plugin tooltip location

* update reports for d3 v5

* fix inner radius default for insulin distribution pie

* fix dynamic scaling issues

* fix single click scroll

* Fix font size on axis labels

* Render ticks on top of everything

* fix click to scroll jankiness

* move loading finished to the bottom of updateHeader
2019-10-21 14:06:05 +02:00
BluefoxandSulka Haro 196bcd65bd Fixed error if latestSGV not filled (#4919)
* (bluefox) add npmignore

* Make it runnable as npm package

* (bluefox) use absolute path for static folder

* Allow start not only from cgm-remote-monitor

* (bluefox) add polling option to make it possible the communication without socket.io

* 0.12.3-2
Allow slow communication without socket.io

* (bluefox) fix errors

* (bluefox) fix clock with authentication

* (bluefox) fix clock

* fix time

* Formatting

* Fix clock if authentication is enabled
Add .npmignore file

* Add time to clock view back

* Formatting

* Fix authentication dialog
Take browser language for auth dialog

* Select browser language for authentication dialog
Make authentication dialog bigger to suit for other languages.

* Update hashauth.js

* Update hashauth.js

* Update hashauth.js

* Update hashauth.js

* (bluefox) fix chart if no latestSGV defined

* Select language from localStorage

And get suitable language for the very first auth dialog (before the settings were read from server or user can select language in the configuration)

* Fix language selection

* Charts were fixed if no latestSGV value found
HTML formatting for "TDD average" and so on

* Remove .npmignore

* Some code formatting. No relevant changes

* Show "-?-" in clock mode if no measured value found.

* Small CSS Formatting
2019-09-17 20:47:30 +03:00
PieterGitandGitHub d0e14de83d Fix clock if authentication is enabled (#4914)
* Fix clock if authentication is enabled
Add .npmignore file

* Add time to clock view back

* Formatting

* Select browser language for authentication dialog
Make authentication dialog bigger to suit for other languages.

* Update hashauth.js

* Update hashauth.js

* Update hashauth.js

* Update hashauth.js

* Select language from localStorage

And get suitable language for the very first auth dialog (before the settings were read from server or user can select language in the configuration)

* remove extra `/ ` from clockview, otherwise bundle will not load and search for domain `bundle`

fixes https://github.com/nightscout/cgm-remote-monitor/pull/4860#pullrequestreview-277209223

* remove .npmignore for now.

should be merged in seperated PR

* small fixes
2019-08-22 20:50:51 +02:00
Sulka Haro 2b0b19d6df Adds a new feature for plugins, where plugin extended settings can be changed in the client. Needs expanding on later - currently only supports booleans as checkboxes. 2019-07-25 21:33:42 +03:00
Sulka HaroandGitHub 8f25a6e7a4 Fix all issues from ESLint (#4730)
* Cherry picks the ES language changes from #4690

* Fix small issues found in linting

* * Fix all but one eslint complaint in the bundled code
* Add eslint and js-beautify rc files into the repo
2019-07-17 15:04:57 +03:00
John WestonandPieterGit 83321faeaa Remove profile toggle and always show Profile Editor link (#4448)
* Remove Profile Editor toggle

`profile` isn't an optional plugin anymore; doesn't need this display toggle. (Plus it was erroneously toggling off in the absence of the `basal` plugin — see #4442.)

* Remove profilecontrol class
2019-03-05 22:02:32 +01:00
Sulka Haro 42feacc734 Improvement: causes client to say Ok Ok when the alarm test button is pressed, needed for speech to work on mobile browsers 2019-02-17 14:52:13 +02:00
Sulka HaroandGitHub 2da377d4e5 Have the UI fully update immediately after new data update. Debounce the Mongo loading for 5 seconds after data has been updated (#4189) 2019-01-12 11:34:26 +02:00
PieterGit ddbbfe2e17 Merge branch 'wip/fix-rawbg-calculations' of https://github.com/jpcunningh/cgm-remote-monitor into 201812_needs_testing 2018-12-31 12:39:56 +01:00
Jeremy Cunningham da31b3bb62 rawbg needs sbx with extended settings. 2018-08-16 22:13:14 -05:00
Sulka HaroandGitHub cb33193e08 Server-side localization fixes, better speech api use (#3724)
* Adds API to plugin manager that calls plugins to visualize alarms

* Refactoring how the translation object is managed after discovering every server-side plugin had it's own instance of the translations and the language code wasn't propagated to any code that generated alarms

* Add more missing translations

* Some more localization fixes
Update Finnish to 100% localized
Change Mongo connection to not stop retrying connecting

* Better scaling for mmol
Fix bug in detecting new BG values

* Delta calculation was the wrong way round :D

* add missing dutch translations

* Have tests bail early & tell Mocha to exit at the end of the run

* Try if Travis likes running tests one by one better

* Enable blocking IO for Travis
2018-07-27 16:04:07 +03:00
PieterGitandSulka Haro 1769f2d837 speech and Warning, Pump Battery Low Alarm issue during Clock testing... (#3709)
* Fix Warning, Pump Battery Low Alarm cannot be disabled

* fix Clock Views language.js

* see if this will solve the problems with the speech plugin detection at the client

* fix dutch spelling

* translate Clock Views:

* disable again

* Update language.js
2018-07-26 11:02:46 +03:00
Sulka Haro d80c6053df Fix speech plugin activation detection 2018-07-16 20:25:31 +03:00
PieterGit b5b05b15e8 temporary disable speechPlugin because it can't be disabled and is enabled by default 2018-07-11 23:30:06 +02:00
Sulka HaroandGitHub facad4a626 Speech plugin (#3325)
* Plugin to speak out CGM values as they arrive

* Formatting improvements

* Support using the actual lang for speech

* Added readme, prettified code
2018-07-08 17:55:30 +03:00
Sulka Haro 3e29bef5a4 Fixes a long-standing bug where the plugin pill visualization didn't update immediately when new data was loaded 2017-12-27 23:06:41 +02:00
Scott 38d35398d1 fix spelling of focusRangeMS 2017-10-16 18:03:08 -07:00
Sulka Haro edf8d7941b Hide loader on auth fail 2017-08-27 18:15:58 +03:00
Sulka Haro 0c12c10d84 Separate messages for loading the client and connecting to server 2017-08-27 17:42:37 +03:00
Sulka Haro 2bae58b567 Better looking loader screen, prevent CSS blocking 2017-08-26 19:16:54 +03:00
Sulka Haro eda7c7743c Trigger app on DOM ready event (as recommended by HTML5 spec). Detect if app is completely offline, auto-reload if needed. 2017-08-26 11:54:25 +03:00
Sulka Haro 7df05f0198 Removing Bower part 1 2017-08-15 22:24:23 +03:00
Jason Calabrese 18d14c654e resolve conflicts 2017-03-17 21:40:15 -07:00