Skip to content
This repository has been archived by the owner on Jan 3, 2023. It is now read-only.

Commit

Permalink
Solve #1939, Add goto certain page support in action page (#1945)
Browse files Browse the repository at this point in the history
  • Loading branch information
rum2mojito authored and littlezhou committed Sep 26, 2018
1 parent 9f17c76 commit 3f87c0d
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,12 @@
</style>

<!-- The form -->
<div align="right">
<input id="search" type="text" float="left" placeholder="Search.." name="search"\>
<button id="searchBtn" type="submit" value="Submit" ng-click="getContent()">search</button>
</div>
<form class="form-inline" role="group" style="float: right;">
<div class="form-group mx-sm-3 mb-2" align="right">
<input class="form-control" id="search" type="text" float="right" placeholder="Search..." name="search"\>
</div>
<button class="btn btn-primary mb-2" id="searchBtn" type="submit" value="Submit" ng-click="getContent()">search</button>
</form>
<div class="col-md-12" onmousemove="getPosition(event)">
<br/>
<table class="table table-bordered">
Expand Down Expand Up @@ -119,11 +121,19 @@ <h4>No action is running</h4>
<strong>Total Number:</strong>
{{totalNumber}}
</div>
<div class="btn-group" role="group" style="float: right;">
<form class="form-inline">
<div class="form-group mx-sm-2 mb-1" align="right">
<input size="6" class="form-control" id="page" type="text" float="left" placeholder="page..." name="page"\>
</div>
<button class="btn btn-primary mb-1" id="pageBtn" type="submit" value="Submit" ng-click="jumpToPage()">Go</button>
</form>
</div>
<div class="btn-group" role="group" style="float: right;">
<button type="button" class="btn btn-default" ng-click="gotoPage(1)">First</button>
<button type="button" class="btn btn-default" ng-show="currentPage > 1"
ng-click="gotoPage(currentPage - 1)">&laquo;</button>
<button type="button" class="btn btn-default" disabled>{{currentPage}}</button>
<button type="button" class="btn btn-default">{{currentPage}}</button>
<button type="button" class="btn btn-default"
ng-repeat="i in [1, 2, 3, 4, 5]"
ng-show="currentPage + i <= totalPage" ng-click="gotoPage(currentPage + i)">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,18 @@ angular.module('zeppelinWebApp')

};

$scope.jumpToPage = function () {
var index = document.getElementById('page').value;
if (index > $scope.totalPage) {
index = $scope.totalPage;
}
else if (index < 1 || isNaN(index)) {
index = 1;
}
document.getElementById('page').value = index;
$scope.gotoPage(Number(index));
};

$scope.gotoPage = function (index) {
if (!$scope.searching) {
$scope.currentPage = index;
Expand Down

0 comments on commit 3f87c0d

Please sign in to comment.