Angular: ajenti.core ******************** This Angular module contains core components of Ajenti frontend. Services -------- .. js:class:: config .. js:data:: data Config file content object .. js:function:: load() Gets complete configuration data of the backend :returns: promise .. js:function:: save() Updates and saves configuration data :returns: promise .. js:function:: getUserConfig() Gets per-user configuration data of the backend :returns: promise → per-user Ajenti config object .. js:function:: setUserConfig(config) Updates and saves per-user configuration data :param object config: updated configuration data from ``getUserConfig()`` :returns: promise .. js:class:: core .. js:function:: pageReload() Reloads the current URL .. js:function:: restart() Restarts the Ajenti process .. js:class:: hotkeys Captures shortcut key events .. js:data:: ENTER, ESC Respective key codes .. js:function:: on(scope, handler, mode='keydown') Registers a hotkey handler in the provided ``scope`` :param $scope scope: ``$scope`` to install handler into :param function(keyCode,\ rawEvent) handler: handler function. If the function returns a truthy value, event is cancelled and other handlers aren't notified. :param string mode: one of ``keydown``, ``keypress`` or ``keyup``. .. js:class:: identity Provides info on the authentication status and user/machine identity .. js:data:: user Name of the logged in user .. js:data:: effective Effective UID of the server process .. js:data:: machine.name User-provided name of the machine .. js:data:: isSuperuser Whether current user is a superuser or not .. js:function:: auth(username, password, mode) Attempts to authenticate current session as ``username:password`` with a ``mode`` of ``normal`` or ``sudo`` .. js:function:: login() Redirects user to a login dialog .. js:function:: logout() Deauthenticates current session .. js:function:: elevate() Redirects user to a sudo elevation dialog .. js:class:: messagebox Provides interface to modal messagebox engine .. js:function:: show(options) Opens a new messagebox. :param object options: :param string options.title: :param string options.text: :param string options.positive: positive action button text. Clicking it will resolve the returned promise. :param string options.negative: negative action button text. Clicking it will reject the returned promise. :param string options.template: (optional) custom body template :param boolean options.scrollable: whether message body is scrollable :param boolean options.progress: whether to display an indeterminate progress indicator in the message :returns: a Promise-like object with an additional ``close()`` method. .. js:class:: notify .. js:function:: info(title, text) .. js:function:: success(title, text) .. js:function:: warning(title, text) .. js:function:: error(title, text) Shows an appropriately styled notification .. js:function:: custom(style, title, text, url) Shows a clickable notification leading to ``url``. .. js:class:: pageTitle Alters page ``