Prettify need table
This commit is contained in:
15
gui/app.js
15
gui/app.js
@@ -28,10 +28,23 @@ syncthing.controller('SyncthingCtrl', function ($scope, $http) {
|
|||||||
data[id].outbps = 0;
|
data[id].outbps = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$scope.connections = data;
|
$scope.connections = data;
|
||||||
});
|
});
|
||||||
$http.get("/rest/need").success(function (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;
|
$scope.need = data;
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -56,10 +56,10 @@ body {
|
|||||||
|
|
||||||
<div ng-show="model.needFiles > 0">
|
<div ng-show="model.needFiles > 0">
|
||||||
<h2>Files to Synchronize</h2>
|
<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">
|
<tr ng-repeat="file in need track by $index">
|
||||||
<td>{{file.Name}}</td>
|
<td><abbr title="{{file.Name}}">{{file.ShortName}}</abbr></td>
|
||||||
<td>{{file.Size | binary}}B</td>
|
<td class="text-right">{{file.Size | binary}}B</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user