Skip to content

Commit

Permalink
#65 Add PAP support to analyzers UI
Browse files Browse the repository at this point in the history
  • Loading branch information
nadouani committed Jul 26, 2018
1 parent fc938f7 commit ee59a77
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,21 @@ <h4>
ng-options="tlp.value as tlp.key for tlp in $ctrl.Tlps" ng-required="$ctrl.analyzer.configuration.check_tlp"></select>
</div>
</div>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">Enable PAP check</label>
<div class="col-sm-9 form-inline">
<div class="btn-group">
<label uib-btn-radio="true" class="btn btn-default" ng-model="$ctrl.analyzer.configuration.check_pap">True</label>
<label uib-btn-radio="false" class="btn btn-default" ng-model="$ctrl.analyzer.configuration.check_pap">False</label>
</div>
<div class="form-group" style="margin-left: 30px;" ng-show="$ctrl.analyzer.configuration.check_pap">
<label>Max PAP</label>
<select class="form-control" style="width: 200px;" ng-model="$ctrl.analyzer.configuration.max_pap" ng-options="tlp.value as tlp.key for tlp in $ctrl.Tlps"
ng-required="$ctrl.analyzer.configuration.check_pap"></select>
</div>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">HTTP Proxy</label>
<div class="col-sm-9">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@ export default class AnalyzerEditController {
_.forEach(globalConfig, cnf => {
if (analyzer.configuration[cnf] === undefined) {
analyzer.configuration[cnf] =
this.configuration.config[cnf] !== undefined
? this.configuration.config[cnf]
: undefined;
this.configuration.config[cnf] !== undefined ?
this.configuration.config[cnf] :
undefined;
}
});

Expand All @@ -66,6 +66,12 @@ export default class AnalyzerEditController {
if (analyzer.configuration.max_tlp === undefined) {
analyzer.configuration.max_tlp = 2;
}
if (analyzer.configuration.check_pap === undefined) {
analyzer.configuration.check_pap = true;
}
if (analyzer.configuration.max_pap === undefined) {
analyzer.configuration.max_pap = 2;
}

this.analyzer = analyzer;
}
Expand All @@ -77,4 +83,4 @@ export default class AnalyzerEditController {
cancel() {
this.$uibModalInstance.dismiss('cancel');
}
}
}

0 comments on commit ee59a77

Please sign in to comment.