gui: Fix setting page size on failed and locally changed modals (fixes #5421) (#5650)

This commit is contained in:
Simon Frei 2019-04-13 14:05:39 +02:00 committed by Jakob Borg
parent fca895a632
commit 8a4b65b937
3 changed files with 8 additions and 8 deletions

View File

@ -329,7 +329,7 @@ angular.module('syncthing.core')
});
$scope.$on(Events.FOLDER_ERRORS, function (event, arg) {
$scope.model[arg.data.folder].pullErrors = arg.data.errors.length;
$scope.model[arg.data.folder].errors = arg.data.errors.length;
});
$scope.$on(Events.FOLDER_SCAN_PROGRESS, function (event, arg) {
@ -653,7 +653,7 @@ angular.module('syncthing.core')
};
$scope.refreshFailed = function (page, perpage) {
var url = urlbase + '/folder/pullerrors?folder=' + encodeURIComponent($scope.failed.folder);
var url = urlbase + '/folder/errors?folder=' + encodeURIComponent($scope.failed.folder);
url += "&page=" + page + "&perpage=" + perpage;
$http.get(url).success(function (data) {
$scope.failed = data;
@ -676,7 +676,7 @@ angular.module('syncthing.core')
$scope.refreshLocalChanged = function (page, perpage) {
var url = urlbase + '/db/localchanged?folder=';
url += encodeURIComponent($scope.localChanged.folder);
url += encodeURIComponent($scope.localChangedFolder);
url += "&page=" + page + "&perpage=" + perpage;
$http.get(url).success(function (data) {
$scope.localChanged = data;
@ -2193,7 +2193,7 @@ angular.module('syncthing.core')
if (!$scope.model[folder]) {
return false;
}
return $scope.model[folder].pullErrors !== 0;
return $scope.model[folder].errors !== 0;
};
$scope.override = function (folder) {
@ -2201,7 +2201,7 @@ angular.module('syncthing.core')
};
$scope.showLocalChanged = function (folder) {
$scope.localChanged.folder = folder;
$scope.localChangedFolder = folder;
$scope.localChanged = $scope.refreshLocalChanged(1, 10);
$('#localChanged').modal().one('hidden.bs.modal', function () {
$scope.localChanged = {};

View File

@ -12,7 +12,7 @@
</table>
<dir-pagination-controls on-page-change="refreshFailed(newPageNumber, failed.perpage)" pagination-id="failed"></dir-pagination-controls>
<ul class="pagination pull-right">
<li ng-repeat="option in [10, 25, 50]" ng-class="{ active: failed.page == option }">
<li ng-repeat="option in [10, 25, 50]" ng-class="{ active: failed.perpage == option }">
<a href="#" ng-click="refreshFailed(failed.page, option)">{{option}}</a>
</li>
</ul>

View File

@ -10,14 +10,14 @@
<th translate>Size</th>
</tr>
</thead>
<tr dir-paginate="file in localChanged.files | itemsPerPage: localChanged.perpage" current-page="localChanged.page" total-items="model[localChanged.folder].receiveOnlyTotalItems" pagination-id="localChanged">
<tr dir-paginate="file in localChanged.files | itemsPerPage: localChanged.perpage" current-page="localChanged.page" total-items="model[localChangedFolder].receiveOnlyTotalItems" pagination-id="localChanged">
<td>{{file.name}}</td>
<td><span ng-hide="file.type == 'DIRECTORY'">{{file.size | binary}}B</span></td>
</tr>
</table>
<dir-pagination-controls on-page-change="refreshLocalChanged(newPageNumber, localChanged.perpage)" pagination-id="localChanged"></dir-pagination-controls>
<ul class="pagination pull-right">
<li ng-repeat="option in [10, 25, 50]" ng-class="{ active: localChanged.page == option }">
<li ng-repeat="option in [10, 25, 50]" ng-class="{ active: localChanged.perpage == option }">
<a href="#" ng-click="refreshLocalChanged(localChanged.page, option)">{{option}}</a>
</li>
</ul>