mirror of
https://github.com/usmannasir/cyberpanel.git
synced 2026-05-06 18:47:54 +02:00
Dashboard SSH: bind tables to paginated arrays so page/per-page works
ng-repeat used full sshLogins/sshLogs while pagination updated sshLoginsPaginated/sshLogsPaginated; rows never changed.
This commit is contained in:
@@ -1046,7 +1046,7 @@
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr ng-repeat="login in sshLogins">
|
||||
<tr ng-repeat="login in sshLoginsPaginated">
|
||||
<td><strong>{$ login.user $}</strong></td>
|
||||
<td><code style="background: #f0f0ff; padding: 2px 6px; border-radius: 4px; font-size: 11px;">{$ login.ip $}</code></td>
|
||||
<td>
|
||||
@@ -1081,21 +1081,25 @@
|
||||
<div style="display: flex; align-items: center; gap: 12px;">
|
||||
<span style="color: #64748b; font-size: 13px;">Show</span>
|
||||
<select ng-model="sshLoginsPerPage" ng-change="sshLoginsChangePerPage()" style="padding: 6px 10px; border: 1px solid #e2e8f0; border-radius: 6px; font-size: 13px; background: white;">
|
||||
<option value="10">10</option>
|
||||
<option value="20">20</option>
|
||||
<option value="50">50</option>
|
||||
<option value="100">100</option>
|
||||
<option ng-value="10">10</option>
|
||||
<option ng-value="20">20</option>
|
||||
<option ng-value="50">50</option>
|
||||
<option ng-value="100">100</option>
|
||||
</select>
|
||||
<span style="color: #64748b; font-size: 13px;">per page</span>
|
||||
</div>
|
||||
<div style="display: flex; align-items: center; gap: 8px;">
|
||||
<span style="color: #64748b; font-size: 13px;">{$ (sshLoginsPage - 1) * sshLoginsPerPage + 1 $}-{$ (sshLoginsPage * sshLoginsPerPage > sshLoginsTotal ? sshLoginsTotal : sshLoginsPage * sshLoginsPerPage) $} of {$ sshLoginsTotal $}</span>
|
||||
<button ng-click="sshLoginsGoToPage(sshLoginsPage - 1)" ng-disabled="sshLoginsPage <= 1" style="padding: 6px 12px; border: 1px solid #e2e8f0; border-radius: 6px; background: white; cursor: pointer; font-size: 13px;" title="Previous">
|
||||
<span style="color: #64748b; font-size: 13px;">{$ getSSHLoginsStart() $}-{$ getSSHLoginsEnd() $} of {$ sshLogins.length $}</span>
|
||||
<button ng-click="sshLoginsPrevPage()" ng-disabled="sshLoginsCurrentPage <= 1" style="padding: 6px 12px; border: 1px solid #e2e8f0; border-radius: 6px; background: white; cursor: pointer; font-size: 13px;" title="Previous">
|
||||
<i class="fas fa-chevron-left"></i>
|
||||
</button>
|
||||
<button ng-click="sshLoginsGoToPage(sshLoginsPage + 1)" ng-disabled="sshLoginsPage >= sshLoginsTotalPages" style="padding: 6px 12px; border: 1px solid #e2e8f0; border-radius: 6px; background: white; cursor: pointer; font-size: 13px;" title="Next">
|
||||
<span style="color: #64748b; font-size: 12px;">Page {$ sshLoginsCurrentPage $} / {$ getSSHLoginsTotalPages() || 1 $}</span>
|
||||
<button ng-click="sshLoginsNextPage()" ng-disabled="sshLoginsCurrentPage >= getSSHLoginsTotalPages()" style="padding: 6px 12px; border: 1px solid #e2e8f0; border-radius: 6px; background: white; cursor: pointer; font-size: 13px;" title="Next">
|
||||
<i class="fas fa-chevron-right"></i>
|
||||
</button>
|
||||
<span style="color: #64748b; font-size: 13px; margin-left: 8px;">Go to</span>
|
||||
<input type="number" min="1" ng-model="sshLoginsGoToPage" ng-keydown="$event.keyCode === 13 && sshLoginsGoToPageNumber()" style="width: 72px; padding: 6px 8px; border: 1px solid #e2e8f0; border-radius: 6px; font-size: 13px;" />
|
||||
<button ng-click="sshLoginsGoToPageNumber()" style="padding: 6px 10px; border: 1px solid #e2e8f0; border-radius: 6px; background: white; cursor: pointer; font-size: 13px;">Go</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1258,7 +1262,7 @@
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr ng-repeat="log in sshLogs">
|
||||
<tr ng-repeat="log in sshLogsPaginated">
|
||||
<td><strong>{$ log.timestamp $}</strong></td>
|
||||
<td><code style="background: #f0f0ff; padding: 4px 8px; border-radius: 4px; font-size: 11px; display: inline-block; word-break: break-word; overflow-wrap: break-word;">{$ log.message $}</code></td>
|
||||
<td>
|
||||
@@ -1304,21 +1308,25 @@
|
||||
<div style="display: flex; align-items: center; gap: 12px;">
|
||||
<span style="color: #64748b; font-size: 13px;">Show</span>
|
||||
<select ng-model="sshLogsPerPage" ng-change="sshLogsChangePerPage()" style="padding: 6px 10px; border: 1px solid #e2e8f0; border-radius: 6px; font-size: 13px; background: white;">
|
||||
<option value="10">10</option>
|
||||
<option value="25">25</option>
|
||||
<option value="50">50</option>
|
||||
<option value="100">100</option>
|
||||
<option ng-value="10">10</option>
|
||||
<option ng-value="25">25</option>
|
||||
<option ng-value="50">50</option>
|
||||
<option ng-value="100">100</option>
|
||||
</select>
|
||||
<span style="color: #64748b; font-size: 13px;">per page</span>
|
||||
</div>
|
||||
<div style="display: flex; align-items: center; gap: 8px;">
|
||||
<span style="color: #64748b; font-size: 13px;">{$ (sshLogsPage - 1) * sshLogsPerPage + 1 $}-{$ (sshLogsPage * sshLogsPerPage > sshLogsTotal ? sshLogsTotal : sshLogsPage * sshLogsPerPage) $} of {$ sshLogsTotal $}</span>
|
||||
<button ng-click="sshLogsGoToPage(sshLogsPage - 1)" ng-disabled="sshLogsPage <= 1" style="padding: 6px 12px; border: 1px solid #e2e8f0; border-radius: 6px; background: white; cursor: pointer; font-size: 13px;" title="Previous">
|
||||
<span style="color: #64748b; font-size: 13px;">{$ getSSHLogsStart() $}-{$ getSSHLogsEnd() $} of {$ sshLogs.length $}</span>
|
||||
<button ng-click="sshLogsPrevPage()" ng-disabled="sshLogsCurrentPage <= 1" style="padding: 6px 12px; border: 1px solid #e2e8f0; border-radius: 6px; background: white; cursor: pointer; font-size: 13px;" title="Previous">
|
||||
<i class="fas fa-chevron-left"></i>
|
||||
</button>
|
||||
<button ng-click="sshLogsGoToPage(sshLogsPage + 1)" ng-disabled="sshLogsPage >= sshLogsTotalPages" style="padding: 6px 12px; border: 1px solid #e2e8f0; border-radius: 6px; background: white; cursor: pointer; font-size: 13px;" title="Next">
|
||||
<span style="color: #64748b; font-size: 12px;">Page {$ sshLogsCurrentPage $} / {$ getSSHLogsTotalPages() || 1 $}</span>
|
||||
<button ng-click="sshLogsNextPage()" ng-disabled="sshLogsCurrentPage >= getSSHLogsTotalPages()" style="padding: 6px 12px; border: 1px solid #e2e8f0; border-radius: 6px; background: white; cursor: pointer; font-size: 13px;" title="Next">
|
||||
<i class="fas fa-chevron-right"></i>
|
||||
</button>
|
||||
<span style="color: #64748b; font-size: 13px; margin-left: 8px;">Go to</span>
|
||||
<input type="number" min="1" ng-model="sshLogsGoToPage" ng-keydown="$event.keyCode === 13 && sshLogsGoToPageNumber()" style="width: 72px; padding: 6px 8px; border: 1px solid #e2e8f0; border-radius: 6px; font-size: 13px;" />
|
||||
<button ng-click="sshLogsGoToPageNumber()" style="padding: 6px 10px; border: 1px solid #e2e8f0; border-radius: 6px; background: white; cursor: pointer; font-size: 13px;">Go</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user