summaryrefslogtreecommitdiffstats
path: root/gui
diff options
context:
space:
mode:
authorJakob Borg <jakob@nym.se>2014-05-11 15:25:06 -0300
committerJakob Borg <jakob@nym.se>2014-05-11 15:25:06 -0300
commit837f3a68abd0d2ad6a920e04f8086e7a8230176a (patch)
treefc3143649b7ce12cf462cc55e6bc8dd257affdcc /gui
parent59e45c5c686f1a1ec13e00f4b1ef4f03136245e3 (diff)
Sort repos on directory (fixes #178)
Diffstat (limited to 'gui')
-rw-r--r--gui/app.js13
1 files changed, 10 insertions, 3 deletions
diff --git a/gui/app.js b/gui/app.js
index ca92178a75..926a52cfef 100644
--- a/gui/app.js
+++ b/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();
});