Skip to content

Commit

Permalink
#195 Display report0Danalyzer report taxonomies
Browse files Browse the repository at this point in the history
  • Loading branch information
nadouani committed Jun 4, 2019
1 parent 99d2076 commit 593377e
Show file tree
Hide file tree
Showing 4 changed files with 96 additions and 37 deletions.
6 changes: 4 additions & 2 deletions www/src/app/core/core.module.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import requireRolesDirective from './directives/require-roles/require-roles.dire
import compareToDirective from './directives/compare-to/compare-to.directive';
import userAvatarDirective from './directives/user-avatar/user-avatar.directive';
import tlpDirective from './directives/tlp/tlp.directive';
import taxonomieDirective from './directives/taxonomie/taxonomie.directive';
import autofocusDirective from './directives/autofocus/autofocus.directive';

import constants from './services/constants';
Expand Down Expand Up @@ -37,8 +38,9 @@ fixedHeightDirective(core);
fileChooserDirective(core);
requireRolesDirective(core);
compareToDirective(core);
userAvatarDirective(core);
userAvatarDirective(core)
tlpDirective(core);
taxonomieDirective(core);
autofocusDirective(core);

/* Common services */
Expand All @@ -54,4 +56,4 @@ constants(core);
/* Filters */
fangFilter(core);

export default core;
export default core;
26 changes: 26 additions & 0 deletions www/src/app/core/directives/taxonomie/taxonomie.directive.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
'use strict';

import _ from 'lodash/core';

import tpl from './taxonomie.html';

export default function (app) {
app.directive('taxonomie', taxonomie);

function taxonomie() {
'ngInject';

return {
templateUrl: tpl,
scope: {
taxonomies: '='
},
replace: true,
link: linkFn
};

function linkFn(scope) {

}
}
}
15 changes: 15 additions & 0 deletions www/src/app/core/directives/taxonomie/taxonomie.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<div>
<div class="flexwrap mt-xxs" ng-if="taxonomies.length > 0">
<span class="label mb-xxxs mr-xxxs label-default" ng-repeat="taxonomy in taxonomies" ng-class="{'info': 'label-info',
'safe': 'label-success',
'suspicious': 'label-warning',
'malicious': 'label-danger'
}[taxonomy.level]">
{{taxonomy.namespace}}:{{taxonomy.predicate}}{{(taxonomy.value != undefined && taxonomy.value!= null) ? '="'+taxonomy.value+'"': ''}}
</span>
</div>

<div ng-if="taxonomies.length === 0">
<em class="text-muted mr-xxxs">No summary available</em>
</div>
</div>
86 changes: 51 additions & 35 deletions www/src/app/pages/jobs/components/job.details.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,40 +5,56 @@
</div>
<div class="box-body with-border">

<strong>Artifact</strong>
<p>
<span>[{{$ctrl.job.dataType | uppercase}}]</span>
<span ng-if="$ctrl.job.type !== 'responder'">{{(($ctrl.job.dataType === 'file') ? $ctrl.job.attachment.name: $ctrl.job.data) | fang}}</span>
<span ng-if="$ctrl.job.type === 'responder'">{{$ctrl.job.label || 'No Label'}}</span>

</p>
<p ng-if="">
[{{$ctrl.job.dataType | uppercase}}] {{(($ctrl.job.dataType === 'file') ? $ctrl.job.attachment.name : $ctrl.job.data) | fang}}
</p>
<hr>

<strong>Date</strong>
<p>
<span am-time-ago="$ctrl.job.date"></span>
</p>
<hr>

<strong>TLP</strong>
<p>
<tlp value="$ctrl.job.tlp"></tlp>
</p>
<hr>

<strong>PAP</strong>
<p>
<tlp value="$ctrl.job.pap" namespace="PAP"></tlp>
</p>
<hr>


<strong>Status</strong>
<p>
<span class="label label-default" ng-class="{'Success': 'label-success', 'InProgress': 'label-warning', 'Failure': 'label-danger'}[$ctrl.job.status]">{{$ctrl.job.status}}</span>
</p>
<div>
<strong>Artifact</strong>
<p class="wrap">
<span>[{{$ctrl.job.dataType | uppercase}}]</span>
<span
ng-if="$ctrl.job.type !== 'responder'">{{(($ctrl.job.dataType === 'file') ? $ctrl.job.attachment.name: $ctrl.job.data) | fang}}</span>
<span ng-if="$ctrl.job.type === 'responder'">{{$ctrl.job.label || 'No Label'}}</span>

</p>
<p ng-if="">
[{{$ctrl.job.dataType | uppercase}}]
{{(($ctrl.job.dataType === 'file') ? $ctrl.job.attachment.name : $ctrl.job.data) | fang}}
</p>
</div>

<div>
<strong>Date</strong>
<p>
<span am-time-ago="$ctrl.job.date"></span>
</p>
</div>

<div>
<strong>TLP</strong>
<p>
<tlp value="$ctrl.job.tlp"></tlp>
</p>
</div>

<div>
<strong>PAP</strong>
<p>
<tlp value="$ctrl.job.pap" namespace="PAP"></tlp>
</p>
</div>

<div>
<strong>Status</strong>
<p>
<span class="label label-default"
ng-class="{'Success': 'label-success', 'InProgress': 'label-warning', 'Failure': 'label-danger'}[$ctrl.job.status]">{{$ctrl.job.status}}</span>
</p>
</div>

<div ng-if="$ctrl.job.report.summary">
<strong>Report summary</strong>
<p>
<taxonomie taxonomies="$ctrl.job.report.summary.taxonomies"></taxonomie>
</p>
</div>

</div>
</div>

0 comments on commit 593377e

Please sign in to comment.