Prettify need table
This commit is contained in:
parent
60b00af0bb
commit
ed675a61d7
15
gui/app.js
15
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;
|
||||
});
|
||||
};
|
||||
|
|
|
@ -56,10 +56,10 @@ body {
|
|||
|
||||
<div ng-show="model.needFiles > 0">
|
||||
<h2>Files to Synchronize</h2>
|
||||
<table class="table table-condesed table-striped">
|
||||
<table class="table table-condensed table-striped">
|
||||
<tr ng-repeat="file in need track by $index">
|
||||
<td>{{file.Name}}</td>
|
||||
<td>{{file.Size | binary}}B</td>
|
||||
<td><abbr title="{{file.Name}}">{{file.ShortName}}</abbr></td>
|
||||
<td class="text-right">{{file.Size | binary}}B</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
|
Loading…
Reference in New Issue