Skip to content

Commit

Permalink
#1062 add pagination to observable similar items
Browse files Browse the repository at this point in the history
  • Loading branch information
nadouani committed Aug 20, 2019
1 parent 0090706 commit d4f8fe4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
5 changes: 5 additions & 0 deletions ui/app/scripts/controllers/case/CaseObservablesItemCtrl.js
Expand Up @@ -23,6 +23,7 @@
$scope.analysisEnabled = VersionSrv.hasCortex();
$scope.cortexServers = $scope.analysisEnabled && appConfig.connectors.cortex.servers;
$scope.protectDownloadsWith = appConfig.config.protectDownloadsWith;
$scope.similarArtifactsLimit = 10;

$scope.editorOptions = {
lineNumbers: true,
Expand Down Expand Up @@ -125,6 +126,10 @@
}
};

$scope.showMoreSimilar = function() {
$scope.similarArtifactsLimit = $scope.similarArtifactsLimit + 10;
};

$scope.showReport = function (jobId) {
$scope.report = {};

Expand Down
Expand Up @@ -98,7 +98,7 @@ <h4 class="vpad10 text-primary">Links</h4>
</tr>
</thead>
<tbody>
<tr ng-repeat="a in similarArtifacts" style="cursor: pointer;" ng-click="openArtifact(a)" uib-tooltip="{{a.message}}" tooltip-popup-delay="500" tooltip-placement="bottom">
<tr ng-repeat="a in similarArtifacts | limitTo:similarArtifactsLimit" style="cursor: pointer;" ng-click="openArtifact(a)" uib-tooltip="{{a.message}}" tooltip-popup-delay="500" tooltip-placement="bottom">
<td align="center">
<span class="clickable fa"
ng-class="{true: 'fa-star', false: 'fa-star-o'}[a.ioc]"
Expand All @@ -116,5 +116,8 @@ <h4 class="vpad10 text-primary">Links</h4>
</tr>
</tbody>
</table>
<div class="mt-xxs text-center" ng-if="similarArtifactsLimit < similarArtifacts.length">
<a href ng-click="showMoreSimilar()"><i class="fa fa-angle-down"></i> Show more</a>
</div>
</div>
</div>

0 comments on commit d4f8fe4

Please sign in to comment.