Parcourir la source

Sort repos on directory (fixes #178)

Jakob Borg il y a 11 ans
Parent
commit
837f3a68ab
2 fichiers modifiés avec 10 ajouts et 3 suppressions
  1. 0 0
      auto/gui.files.go
  2. 10 3
      gui/app.js

Fichier diff supprimé car celui-ci est trop grand
+ 0 - 0
auto/gui.files.go


+ 10 - 3
gui/app.js

@@ -77,6 +77,13 @@ syncthing.controller('SyncthingCtrl', function ($scope, $http) {
         return a.NodeID > b.NodeID;
     }
 
+    function repoCompare(a, b) {
+        if (a.Directory < b.Directory) {
+            return -1;
+        }
+        return a.Directory > b.Directory;
+    }
+
     $scope.refresh = function () {
         $http.get(urlbase + '/system').success(function (data) {
             getSucceeded();
@@ -437,11 +444,11 @@ syncthing.controller('SyncthingCtrl', function ($scope, $http) {
             $scope.config = data;
             $scope.config.Options.ListenStr = $scope.config.Options.ListenAddress.join(', ');
 
-            var nodes = $scope.config.Nodes;
-            nodes.sort(nodeCompare);
-            $scope.nodes = nodes;
+            $scope.nodes = $scope.config.Nodes;
+            $scope.nodes.sort(nodeCompare);
 
             $scope.repos = $scope.config.Repositories;
+            $scope.repos.sort(repoCompare);
 
             $scope.refresh();
         });

Certains fichiers n'ont pas été affichés car il y a eu trop de fichiers modifiés dans ce diff