/**@jsx React.DOM*/ /* global conjur, React, jQuery */ (function(conjur, React, $) { 'use strict'; var Chart = conjur.views.Chart, ChartHelperMixin = conjur.views.ChartHelperMixin, FoldableAuditSection = conjur.views.FoldableAuditSection; var Activity = React.createClass({ mixins: [ChartHelperMixin], getDefaultProps: function() { return { options: { legend: { slogins: 'Logins', ssudo: 'Sudo calls', sreads: 'Secret reads', supdates: 'Secret updates', fsudo: 'Sudo failures', freads: 'Secret read failures', fupdates: 'Secret update failures', fother: 'Other failures' }, axis: { y: { label: 'Value' } } } }; }, getDefaultItem: function() { return { slogins: 0, ssudo: 0, fsudo: 0, sreads: 0, freads: 0, supdates: 0, fupdates: 0, fother: 0 }; }, getEventType: function(e) { if (e.hasOwnProperty('facility') && e.facility === 'ssh') { if (e.allowed === true) { if (e.action === 'sudo') { return 'ssudo'; } if (e.action === 'login') { return 'slogins'; } } if (e.allowed === false) { if (e.action === 'sudo') { return 'fsudo'; } } } if ((e.action === 'check') && e.hasOwnProperty('resource') && e.resource.split(':')[1] === 'variable') { if (e.hasOwnProperty('error') || e.allowed === false) { if (e.privilege === 'execute') { return 'freads'; } if (e.privilege === 'update') { return 'fupdates'; } } if (!e.hasOwnProperty('error') && e.allowed !== false) { if (e.privilege === 'execute') { return 'sreads'; } if (e.privilege === 'update') { return 'supdates'; } } } if (e.hasOwnProperty('error') || e.allowed === false) { return 'fother'; } return null; }, render: function() { var data = this.getData(this.props.audit); return (