- App
App model containing all data, methods, ajax calls of this application It runs on its own and views can 'observe' for changes to redraw.
- Observable
Simple Observable class to notify others listening for changes
- _autoScrollOnLive(argName) ⇒
string On live mode when new rows are coming and auto-scroll is on, scroll-down
- _autoScrollOnReset()
Auto-scroll top on logs reference change for example when we clean and add new rows, just scroll top
- _autoScrollOnSelected()
Auto-scroll to selected row: A row is selected and it was not the case earlier, so let's scroll to it if not in the screen!
- _computeTablePosition()
Fake big scroll Only dozen of rows are actually displayed in the table inside a big DIV scrolling so we need to calculate the position of the table inside it this is made for performance, DOM cannot handle 50k nodes
App model containing all data, methods, ajax calls of this application It runs on its own and views can 'observe' for changes to redraw.
Kind: global class
- App
- new App()
- .reconnect()
- .query() ⇒
xhr - .live(enabled) ⇒
bool - .onLiveMessage(log)
- .empty()
- .displayField(fieldName, value) ⇒
bool - .rawFilters(rawFilters)
- .rawFilter(field, operator, value) ⇒
string - .parsedFilters(field, operator) ⇒
string|date|number - .selected(row) ⇒
object - .moveSelected(n)
- .moveSelectedError(n)
- .logs(log(s), append) ⇒
array - .inspector(activated) ⇒
bool - .autoScroll(enabled) ⇒
bool - .max(max) ⇒
Number
Constructor, declares default properties and init Observable super class
Reconnect ws when connection is lost, 2s between tries
Kind: instance method of App
Query server for logs stored in DB
Kind: instance method of App
Returns: xhr - jquery ajax instance
Getter/setter of live mode state, if argument is provided it tells the server to start/stop sending logs by websocket
Kind: instance method of App
Returns: bool - live mode state
| Param | Type | Description |
|---|---|---|
| enabled | bool |
(optional) start/stop live mode |
Inserts log into list and notify observers
Kind: instance method of App
| Param | Type | Description |
|---|---|---|
| log | string |
log object to be inserted |
Empty all logs stored
Kind: instance method of App
Getter/setter if a field should be displayed or not
Kind: instance method of App
Returns: bool - if should be displayed
| Param | Type | Description |
|---|---|---|
| fieldName | string |
field to be set |
| value | boolean |
display or not |
Set many raw filters from an object, because it calls rawFilter, parsed filters will be setted too, it must be used to load any filter from outside model
Kind: instance method of App
| Param | Type | Description |
|---|---|---|
| rawFilters | object |
field->operator |
Getter/setter for input field, this also update the parsed/casted filters
Kind: instance method of App
Returns: string - always a string, to show to user
| Param | Type | Description |
|---|---|---|
| field | string |
name of the column |
| operator | string |
criteria to apply to the column |
| value | string |
the string given by user |
Getter for the parsed filters
Kind: instance method of App
Returns: string | date | number - the parsed value associated to this filter
| Param | Type | Description |
|---|---|---|
| field | string |
name of the column |
| operator | string |
criteria to apply to the column |
Getter/setter for the row selected in the table, we use virtualId as an id
Kind: instance method of App
Returns: object - the row selected or null
| Param | Type | Description |
|---|---|---|
| row | object | string |
the row to be selected, or its virtualId |
Move current cursor by n rows
Kind: instance method of App
| Param | Type | Description |
|---|---|---|
| n | Number |
can be negative or positive |
Move current cursor by n rows, but only errors
Kind: instance method of App
| Param | Type | Description |
|---|---|---|
| n | Number |
negative or positive number, Infinity for first and last error |
Getter/setter for logs, can append with second arg
Kind: instance method of App
Returns: array - logs in memory
| Param | Type | Description |
|---|---|---|
| log(s) | array | object |
the new log(s) |
| append | bool |
just push on last position and truncate if needed |
Getter/setter for the inspector
Kind: instance method of App
Returns: bool - if the inspector is enabled or not
| Param | Type | Description |
|---|---|---|
| activated | bool |
state of the inspector |
Getter/setter for the auto-scroll
Kind: instance method of App
Returns: bool - if the auto-scroll is enabled or not
| Param | Type | Description |
|---|---|---|
| enabled | bool |
state of auto-scroll |
Getter/setter for the max number of logs loaded in memory
Kind: instance method of App
Returns: Number - how many logs
| Param | Type | Description |
|---|---|---|
| max | Number |
how many logs |
Simple Observable class to notify others listening for changes
Kind: global class
Add an observer
Kind: instance method of Observable
| Param | Type | Description |
|---|---|---|
| callback | function |
will be called for each notification |
Remove an observer
Kind: instance method of Observable
| Param | Type | Description |
|---|---|---|
| callback | function |
the callback to remove |
Notify every observer that something changed
Kind: instance method of Observable
On live mode when new rows are coming and auto-scroll is on, scroll-down
Kind: global function
Returns: string - blabla
| Param | Type | Description |
|---|---|---|
| argName | string |
blabla |
Auto-scroll top on logs reference change for example when we clean and add new rows, just scroll top
Auto-scroll to selected row: A row is selected and it was not the case earlier, so let's scroll to it if not in the screen!
Fake big scroll Only dozen of rows are actually displayed in the table inside a big DIV scrolling so we need to calculate the position of the table inside it this is made for performance, DOM cannot handle 50k nodes
Kind: global function