Requires
- module:events
- module:dygraph-combined
- module:toastr
- module:js-cookie
- module:session
- module:lib/update_db
- module:lib/monitoring_graph
- module:jquery-mobile
- module:jquery-mobile-datebox
Classes
Members
(inner) db_info_is_called
Gets database information.
(private, inner) using_prefix
Updates the login/logout buttons and user status. Called during session
changes
Methods
(private, inner) AddDBButtonToHeader($header_left) → {String|String}
Adds DB "flash" button to the header toolbar. This can be blinked to
indicate DB activity.
Parameters:
Name | Type | Description |
---|---|---|
$header_left |
Object | header portion on the left side |
Returns:
-
adb - db name
- Type
- String
-
prettyname - db name, pretty version
- Type
- String
(inner) addLogMessage(msg)
Appends the message to the logging facility (available in status)
Parameters:
Name | Type | Description |
---|---|---|
msg |
string |
(private, inner) BuildDBList(ev,, ui,)
Builds database list (subsystems)
Parameters:
Name | Type | Description |
---|---|---|
ev, |
Object | jQuery event |
ui, |
Object | jQuery info |
(private, inner) CheckUserStatus(callback(login_name))
Check current user status
Parameters:
Name | Type | Description |
---|---|---|
callback(login_name) |
function |
(inner) database_status()
Build database status table. This is called on index.html
(private, inner) DatabaseStatus()
DatabaseStatus object. "Global" object designed to handle updating the
interface according to updates to DBs.
(inner) dateFromKey(arr) → {Object}
Get Date object from array
Parameters:
Name | Type | Description |
---|---|---|
arr |
Array | Array like ["name", YY, MM, DD, H, M, S] or [YY, MM, DD, H, M, S, "name"] |
Returns:
- Type
- Object
(inner) get_current_db_name(pathname) → {String}
Get current db name, guessed from either the path of the page, or the passed
in path
Parameters:
Name | Type | Description |
---|---|---|
pathname |
String | (Optional) |
Returns:
name of db (e.g. "nedm%2Fraspberries")
- Type
- String
(inner) get_database(name) → {nEDMDB}
Get database by name
Parameters:
Name | Type | Description |
---|---|---|
name |
String | (Optional) - name of database *or* return from get_current_db_name |
Returns:
database object (with updated interface)
- Type
- nEDMDB
(inner) globalSetting(key, valueopt) → {Object|String|Number}
Set and return global settings. Internally, these settings should be
persistent when closing a browser.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
key |
String | key to save global setting | |
value |
Object | String | Number |
<optional> |
value to set. If not given, function reads out current value. |
Returns:
current globalSetting associated with key. undefined if not found.
- Type
- Object | String | Number
(private, inner) HandleDatabaseChanges(msg,)
Handles aggregate database messages (changes feed)
emits "db_update" events, which can be listened to (see on_db_updates)
Parameters:
Name | Type | Description |
---|---|---|
msg, |
Object | Message from EventSource |
(private, inner) HandleLocalStorage()
Turns on listening to aggregate DB changes.
Called by a session change.
(inner) keyFromDate(date) → {Array}
Get Array from Date Object, not UTC
Parameters:
Name | Type | Description |
---|---|---|
date |
Object |
Returns:
arr - [YY, MM, DD, H, M, S]
- Type
- Array
(inner) keyFromUTCDate(date) → {Array}
Get Array from Date Object, assumes Date is UTC
Parameters:
Name | Type | Description |
---|---|---|
date |
Object |
Returns:
arr - [YY, MM, DD, H, M, S]
- Type
- Array
(inner) on_db_updates(callback)
Listen for changes from aggregate database
Parameters:
Name | Type | Description |
---|---|---|
callback |
module:lib/nedm.OnDBUpdates |
(private, inner) RefreshUpdates()
Refreshes updates by removing aggregate feed running
(inner) registerUser(un, pw, tryLogin, callback(Boolean))
Signup on server
Parameters:
Name | Type | Description |
---|---|---|
un |
String | username |
pw |
String | password |
tryLogin |
Boolean | try Login when a successful signup |
callback(Boolean) |
function | called with status of login. |
(inner) remove_db_updates(callback)
Remove changes callback
Parameters:
Name | Type | Description |
---|---|---|
callback |
module:lib/nedm.OnDBUpdates |
(private, inner) ResetLocalStorage()
Reset the local storage, and cancels feed if shutdown is true.
(inner) show_error_window(error, msg)
Show toastr error window
Parameters:
Name | Type | Description |
---|---|---|
error |
String | Error type |
msg |
String | More detailed message |
(private, inner) StartFeed()
Starts an actual feed
(inner) startWebSocketListener(url, prependopt)
Start websocket listener
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
url |
String | url and port name | |
prepend |
String |
<optional> |
prepends to output log |
(inner) stopWebSocketListener(url)
Stop websocket listener
Parameters:
Name | Type | Description |
---|---|---|
url |
String | url and port name |
(private, inner) UpdateDBStatus(ev,, ui,)
Updates showing the DB status as a toastr status
Parameters:
Name | Type | Description |
---|---|---|
ev, |
Object | jQuery event |
ui, |
Object | jQuery info |
(private, inner) UpdateHeader(ev,, ui,)
Updates header toolbar to show correct DB name.
Also calls through to UpdateButtons
Parameters:
Name | Type | Description |
---|---|---|
ev, |
Object | jQuery event |
ui, |
Object | jQuery info |
(inner) validate(un, pw, callback(Boolean))
Login to server
Parameters:
Name | Type | Description |
---|---|---|
un |
String | username |
pw |
String | password |
callback(Boolean) |
function | called with status of login. |
Type Definitions
DBUpdateMessage
DB update callback message
Type:
- Object
Properties:
Name | Type | Description |
---|---|---|
db |
String | name of database |
type |
String | type of message |
OnDBUpdates(msg)
DB update callback function
Parameters:
Name | Type | Description |
---|---|---|
msg |
module:lib/nedm.DBUpdateMessage |