-
Notifications
You must be signed in to change notification settings - Fork 71.7k
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
Question on variable name spaces #22
Comments
Typical way to do this is to create a new endpoint: The in |
Would be simpler to put a <script src="/config.js"></script> and have the |
I'd rather store this stuff in mongo than force everyone to edit a configuration file. Also the alerts aren't triggered off the high/low lines now so there will be some confusion with that. |
Sorry if I am being overzealous by closing this, the amount of open issues is messing with my "ADD". ;) You are welcome to reopen it if you like. |
Makea send to close, I think the settings api will take care of this |
…d_yarn/follow-redirects-1.14.9 Bump follow-redirects from 1.14.7 to 1.14.9
Hey there - been working on consolidating the db config and the new bg thresholds into a single config file tonight. I modified server.js to suck in the name/value pairs. Where I'm stuck is figuring out how to get the "bgLow" and "bgHigh" variables accessible to /js/client.js... which is still executed on the server-side.
In my servlet and JSP days I had page and session and global contexts to place variables, but I can't quite figure out how to do it in this context. I'm new to node.js and searched around but there's a lot about Express, but it doesn't appear to be doing that.
Can you point me in the right direction? I'm really trying to get this done in order to make available "step 1" of the improved user configuration. I know discussion included a gui, putting into a db, etc... but I'm trying to take one step at a time.
Update 6/25 1pm ET: I went into client.js and replaced the bg values of 80 with "bgLow" and 180 with "bgHigh". Then I created two new variables within client.js (taking server.js out of the equation) for bgLow (70) and bgHigh (200) to visually confirm the lines on the graph are updated -- but they remain 80 and 180. So I'm trying to understand if I could be getting whacked by the nodeStatic caching? I can hit the /nightscout.appcache and see the cache configuration, and the setting is for 30 days or something.
Here's an example of what I'm doing...
// add a y-axis line that shows the low bg threshold
focus.append('line')
.attr('class', 'low-line')
.attr('x1', xScale(dataRange[0]))
.attr('y1', yScale(bgLow))
.attr('x2', xScale(dataRange[1]))
.attr('y2', yScale(bgLow))
// .attr('y2', yScale(80))
.style('stroke-dasharray', ('3, 3'))
.attr('stroke', 'grey');
So...
Thanks
The text was updated successfully, but these errors were encountered: