App Class
The main app class.
Item Index
Methods
- _buildServiceView
- _prefetch_service
- activateHotkeys
- behaviors.timestamp.callback
- check_user_credentials
- destructor
- enableBehaviors
- getModelURL
- initializer
- keyCodeToString
- loadService
- logout
- on_database_changed
- onEnvironmentNameChange
- onEnvPermissionDenied
- onLogin
- onProviderTypeChange
- show_charm
- show_charm_collection
- show_environment
- show_environment.callback
- show_login
- show_notifications_overview
- show_notifications_view
- show_service
- show_service_config
- show_service_constraints
- show_service_relations
- show_unit
- showRootView
Attributes
Methods
_buildServiceView
()
private
_prefetch_service
()
private
activateHotkeys
()
Activate the keyboard listeners. Only called by the main index.html, not by the tests' one.
behaviors.timestamp.callback
()
Wait for the DOM to be built before rendering timestamps.
check_user_credentials
-
req -
res -
next
Ensure that the current user has authenticated.
Parameters:
-
reqObjectThe request.
-
resObject???
-
nextObjectThe next route handler.
destructor
()
Release resources and inform subcomponents to do the same.
enableBehaviors
()
Hook up all of the declared behaviors.
getModelURL
-
model -
[intent]
Object routing support
This utility helps map from model objects to routes defined on the App object. See the routes Attribute for additional information.
Parameters:
-
modelObjectThe model to determine a route URL for.
-
[intent]Object optionalthe name of an intent associated with a route. When more than one route can match a model, the route without an intent is matched when this attribute is missing. If intent is provided as a string, it is matched to the
intentattribute specified on the route. This is effectively a tag.
initializer
-
cfg
Parameters:
-
cfgObjectApplication configuration data.
keyCodeToString
-
keyCode
Transform a numeric keyCode value to its string version. Example: 16 returns 'shift'.
Parameters:
-
keyCodeNumberThe numeric value of a key.
Returns:
loadService
()
Model interactions -> move to db layer
logout
-
req
Log the current user out and show the login screen again.
Parameters:
-
reqObjectThe request.
Returns:
on_database_changed
()
On database changes update the view.
onEnvironmentNameChange
()
Display the Environment Name.
The environment name can arrive asynchronously. Instead of updating the display from the environment view (a separtion of concerns violation), we update it here.
onEnvPermissionDenied
-
evt
Notify with an error when the user tries to change the environment without permission.
Parameters:
-
evtObjectAn event object (with "title" and "message" attributes).
Returns:
onLogin
-
evt
Hide the login mask and redispatch the router.
When the environment gets a response from a login attempt, it fires a login event, to which this responds.
Parameters:
-
evtObjectAn event object (with a "data.result" attribute).
onProviderTypeChange
()
Display the provider type.
The provider type arrives asynchronously. Instead of updating the display from the environment code (a separation of concerns violation), we update it here.
show_charm
()
show_charm_collection
()
show_environment
()
show_environment.callback
()
Let the component framework know that the view has been rendered.
show_login
()
Undefined
Show the login screen.
Returns:
show_notifications_overview
()
show_notifications_view
()
notifications is a preserved view that remains rendered on all main
views. We manually create an instance of this view and insert it into
the App's view metadata.
show_service
()
show_service_config
()
show_service_constraints
()
show_service_relations
()
show_unit
()
showRootView
()
Shows the root view of the application erasing all namespaces
