From ed675a61d725a17a8e342057c7a388ac94a7bb01 Mon Sep 17 00:00:00 2001 From: Jakob Borg Date: Mon, 6 Jan 2014 06:10:53 +0100 Subject: [PATCH] Prettify need table --- gui/app.js | 15 ++++++++++++++- gui/index.html | 6 +++--- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/gui/app.js b/gui/app.js index 098c4131..ad432259 100644 --- a/gui/app.js +++ b/gui/app.js @@ -28,10 +28,23 @@ syncthing.controller('SyncthingCtrl', function ($scope, $http) { data[id].outbps = 0; } } - $scope.connections = data; }); $http.get("/rest/need").success(function (data) { + var i, name; + for (i = 0; i < data.length; i++) { + name = data[i].Name.split("/"); + data[i].ShortName = name[name.length-1]; + } + data.sort(function (a, b) { + if (a.ShortName < b.ShortName) { + return -1; + } + if (a.ShortName > b.ShortName) { + return 1; + } + return 0; + }); $scope.need = data; }); }; diff --git a/gui/index.html b/gui/index.html index ed843451..1c1e77aa 100644 --- a/gui/index.html +++ b/gui/index.html @@ -56,10 +56,10 @@ body {

Files to Synchronize

- +
- - + +
{{file.Name}}{{file.Size | binary}}B{{file.ShortName}}{{file.Size | binary}}B