-
Notifications
You must be signed in to change notification settings - Fork 640
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
184 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
(function() { | ||
'use strict'; | ||
angular.module('theHiveControllers').controller('CaseExportCtrl', | ||
function($scope, $state, $stateParams, $timeout, PSearchSrv, CaseTabsSrv, categories) { | ||
var self = this; | ||
|
||
this.caseId = $stateParams.caseId; | ||
this.searchForm = {}; | ||
var tabName = 'export-' + this.caseId; | ||
|
||
// MISP category/type map | ||
this.categories = categories; | ||
|
||
// Add tab | ||
CaseTabsSrv.addTab(tabName, { | ||
name: tabName, | ||
label: 'Export', | ||
closable: true, | ||
state: 'app.case.export', | ||
params: {} | ||
}); | ||
|
||
// Select tab | ||
$timeout(function() { | ||
CaseTabsSrv.activateTab(tabName); | ||
}, 0); | ||
|
||
|
||
this.artifacts = PSearchSrv(this.caseId, 'case_artifact', { | ||
scope: $scope, | ||
baseFilter: { | ||
'_and': [{ | ||
'_parent': { | ||
"_type": "case", | ||
"_query": { | ||
"_id": $scope.caseId | ||
} | ||
} | ||
}, { | ||
'ioc': true | ||
}, { | ||
'status': 'Ok' | ||
}] | ||
}, | ||
filter: this.searchForm.searchQuery !== '' ? { | ||
_string: this.searchForm.searchQuery | ||
} : '', | ||
loadAll: true, | ||
sort: '-startDate', | ||
pageSize: 30, | ||
onUpdate: function () { | ||
self.enhanceArtifacts(); | ||
}, | ||
nstats: true | ||
}); | ||
|
||
this.enhanceArtifacts = function(data) { | ||
console.log(data); | ||
} | ||
|
||
} | ||
); | ||
})(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
<div class="row"> | ||
<div class="col-md-12 mv-s" ng-show="$vm.artifacts.total === 0"> | ||
<div class="empty-message">No records.</div> | ||
</div> | ||
</div> | ||
|
||
<!-- list of artifacts--> | ||
<div class="row"> | ||
<div class="col-md-12" ng-show="$vm.artifacts.total > 0"> | ||
|
||
<psearch control="$vm.artifacts"></psearch> | ||
|
||
<form class="form-inline"> | ||
<div class="form-group"> | ||
<label class="sr-only" for="exampleInputEmail3">Email address</label> | ||
<input type="email" class="form-control" id="exampleInputEmail3" placeholder="Email"> | ||
</div> | ||
<div class="form-group"> | ||
<label class="sr-only" for="exampleInputPassword3">Password</label> | ||
<input type="password" class="form-control" id="exampleInputPassword3" placeholder="Password"> | ||
</div> | ||
<div class="checkbox"> | ||
<label> | ||
<input type="checkbox"> Remember me | ||
</label> | ||
</div> | ||
<button type="submit" class="btn btn-default">Sign in</button> | ||
</form> | ||
|
||
<table class="table table-striped table-hover valigned"> | ||
<thead> | ||
<tr> | ||
<th width="10" class="p-0"></th> | ||
<th width="20"> | ||
<input type="checkbox" ng-change="selectAll()" ng-model="selection.all" ng-disabled="switchTEList"></input> | ||
</th> | ||
<th width="150">Type</th> | ||
<th>Data/Filename</th> | ||
<th width="300">Tags</th> | ||
<th width="150">MISP Category</th> | ||
<th width="150">MISP Type</th> | ||
<th width="20"> </th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
<tr ng-repeat="artifact in $vm.artifacts.values"> | ||
<td class="p-0 bg-tlp-{{artifact.tlp}} clickable" ng-click="filterByTlp(artifact.tlp)"></td> | ||
<td> | ||
<input type="checkbox" ng-change="selectArtifact(artifact)" ng-model="selection.list[artifact.id]"> | ||
</td> | ||
<td> | ||
<a href="" ng-click="addFilterValue('dataType', artifact.dataType)"><span ng-bind="artifact.dataType"></span></a> | ||
</td> | ||
<td class="wrap clickable" ng-click="openArtifact(artifact)">{{(artifact.data | fang) || (artifact.attachment.name | fang)}}</td> | ||
<td> | ||
<span ng-repeat="l in artifact.tags"> | ||
<span class="label label-primary mr-xxxs pointer" ng-click="addFilterValue('tags', l)"> | ||
<i class="glyphicon glyphicon-tag"></i> <span ng-bind="l"></span> | ||
</span> | ||
</span> | ||
</td> | ||
<td> | ||
<em ng-if="!artifact.exportCategory">Not specified</em> | ||
<em ng-if="artifact.exportCategory">Not specified</em> | ||
</td> | ||
<td> | ||
<em ng-if="!artifact.exportType">Not specified</em> | ||
<em ng-if="artifact.exportType">Not specified</em> | ||
</td> | ||
<td> | ||
<i class="fa fa-check"></i> | ||
<i class="fa fa-exclamation-triangle"></i> | ||
</td> | ||
</tr> | ||
</tbody> | ||
</table> | ||
<psearch ng-if="!switchTEList" control="artifacts"></psearch> | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters