mirror of
https://github.com/usmannasir/cyberpanel.git
synced 2026-05-07 02:16:50 +02:00
Dashboard SSH pagination: fix ng-if scope shadowing for per-page and go-to
Use $parent ng-model bindings inside ng-if so values update the controller scope. Coerce per-page to int in slice math to avoid string concat bugs.
This commit is contained in:
@@ -1054,8 +1054,10 @@ var dashboardStatsControllerFn = function ($scope, $http, $timeout) {
|
||||
console.log('updateSSHLoginsPaginated: No data, cleared paginated array');
|
||||
return;
|
||||
}
|
||||
var start = ($scope.sshLoginsCurrentPage - 1) * $scope.sshLoginsPerPage;
|
||||
var end = start + $scope.sshLoginsPerPage;
|
||||
var per = parseInt($scope.sshLoginsPerPage, 10) || 10;
|
||||
$scope.sshLoginsPerPage = per;
|
||||
var start = ($scope.sshLoginsCurrentPage - 1) * per;
|
||||
var end = start + per;
|
||||
$scope.sshLoginsPaginated = $scope.sshLogins.slice(start, end);
|
||||
console.log('updateSSHLoginsPaginated: start=', start, 'end=', end, 'total=', $scope.sshLogins.length, 'paginated=', $scope.sshLoginsPaginated.length);
|
||||
};
|
||||
@@ -1084,6 +1086,12 @@ var dashboardStatsControllerFn = function ($scope, $http, $timeout) {
|
||||
$scope.sshLoginsGoToPage = $scope.sshLoginsCurrentPage;
|
||||
}
|
||||
};
|
||||
$scope.sshLoginsChangePerPage = function() {
|
||||
$scope.sshLoginsPerPage = parseInt($scope.sshLoginsPerPage, 10) || 10;
|
||||
$scope.sshLoginsCurrentPage = 1;
|
||||
$scope.sshLoginsGoToPage = 1;
|
||||
$scope.updateSSHLoginsPaginated();
|
||||
};
|
||||
|
||||
$scope.refreshSSHLogins = function() {
|
||||
$scope.loadingSSHLogins = true;
|
||||
@@ -1147,8 +1155,10 @@ var dashboardStatsControllerFn = function ($scope, $http, $timeout) {
|
||||
console.log('updateSSHLogsPaginated: No data, cleared paginated array');
|
||||
return;
|
||||
}
|
||||
var start = ($scope.sshLogsCurrentPage - 1) * $scope.sshLogsPerPage;
|
||||
var end = start + $scope.sshLogsPerPage;
|
||||
var per = parseInt($scope.sshLogsPerPage, 10) || 10;
|
||||
$scope.sshLogsPerPage = per;
|
||||
var start = ($scope.sshLogsCurrentPage - 1) * per;
|
||||
var end = start + per;
|
||||
$scope.sshLogsPaginated = $scope.sshLogs.slice(start, end);
|
||||
console.log('updateSSHLogsPaginated: start=', start, 'end=', end, 'total=', $scope.sshLogs.length, 'paginated=', $scope.sshLogsPaginated.length);
|
||||
};
|
||||
@@ -1177,6 +1187,12 @@ var dashboardStatsControllerFn = function ($scope, $http, $timeout) {
|
||||
$scope.sshLogsGoToPage = $scope.sshLogsCurrentPage;
|
||||
}
|
||||
};
|
||||
$scope.sshLogsChangePerPage = function() {
|
||||
$scope.sshLogsPerPage = parseInt($scope.sshLogsPerPage, 10) || 10;
|
||||
$scope.sshLogsCurrentPage = 1;
|
||||
$scope.sshLogsGoToPage = 1;
|
||||
$scope.updateSSHLogsPaginated();
|
||||
};
|
||||
|
||||
$scope.refreshSSHLogs = function() {
|
||||
$scope.loadingSSHLogs = true;
|
||||
|
||||
Reference in New Issue
Block a user