@ovh-ux/ng-log-live-tail
v2.4.0
Published
Poll a log API for displaying messages
Downloads
19
Readme
ng-log-live-tail
AngularJS log to customer module.
Poll a log API for displaying messages
Install
$ yarn add @ovh-ux/ng-log-live-tail
Usage
import angular from 'angular';
import '@ovh-ux/ng-log-live-tail';
angular.module('myApp', [ngLogToCustomer]).controller(
'MyCtrl',
/* @ngInject */ () => {
/** Pass keys information as an objet with keyNames and path in API returned data
* Note : _id is mandatory since it ensure a log is unique */
this.logKeys = {
_id: 'message._id',
requestReceivedTimestamp: 'message.audit_requestReceivedTimestamp_date',
verb: 'message.audit_verb',
authorizationDecision: 'message.audit_authorizationDecision',
responseStatus: 'message.audit_responseStatus',
user: 'message.audit_user',
requestURI: 'message.audit_requestURI',
};
this.logSrcUrl = 'http://my-log-url';
},
);
<div data-ng-controller="MyCtrl as $ctrl">
<log-to-customer source="$ctrl.logSrcUrl" log-keys="$ctrl.logKeys">
<!--Optionnal : right tile transclude content-->
<right-tile>Content will be placed right to the live tail. Tail will be fullscreen if no content is passed.</right-tile>
</log-to-customer>
</div>
Test
$ yarn test
Contributing
Always feel free to help out! Whether it's filing bugs and feature requests or working on some of the open issues, our contributing guide will help get you started.
License
BSD-3-Clause © OVH SAS