logger.js¶
-
CreateTabs
(host)¶ Creates a tab for the output of a host. If the tab already existed no action is taken
-
addOutput
(host, identifier, message, stream, stop)¶ Appends the output of a command to the panel.
Arguments: - host (str) – The name of the host that created the output
- identifier (str) – An identifier of this output stream
- message (str) – The message
- stream (str) – The name of the stream (stdout or stderr)
- stop (bool) – A boolean that indicates if the message indicates the EOF of the stream
-
bindEvents
()¶ Binds all the required DOM events
-
createOutput
(host, identifier, command)¶ Appends a frame to display the output of a node
Arguments: - host (str) – The name of the host (IP or URL)
- identifier (str) – A random identifier
- command (str) – The name of the command.
-
createSocket
(url, callback)¶ Creates the socket connection and performs some testing of it
Arguments: - url (str) – The websocket ip or url
- callback (function) – A callback that is invoked if the connection is opened successfully
-
escapeHTML
(string)¶ Escapes potentially malicious HTML strings, based on the mustache.js escaping function. See http://stackoverflow.com/a/12034334/2628463
-
newConnection
()¶ Notifies the income of a new output stream
-
onmessage
(evt)¶ Determines whether the message is a new output stream, creating a new frame or an already existing one, appending the message to the existing frame.
Arguments: - evt (object) – The event object, containing the message
-
onopen
(evt)¶ Sends the secure cookie to the server in order to register for events and invokes the callback function. The authentication is based on the HMAC message stored in the cookie
Arguments: - evt (object) – An object with the opening event information.
-
parseTabs
(selector)¶ Creates or updates the event bindings of the tabs under the element specified by
selector
Arguments: - selector (str) – The DOM element that the tabs are children of
-
ready
()¶ Initializes the components of the view
-
resetConnectionsCounter
()¶ Resets the connections counter