Display Last Seen value in the UI

This commit is contained in:
Audrius Butkevicius
2014-08-22 20:35:22 +01:00
parent 84c6f147ad
commit c66b24feeb
3 changed files with 23 additions and 2 deletions

View File

@@ -80,6 +80,7 @@ syncthing.controller('SyncthingCtrl', function ($scope, $http, $translate, $loca
$scope.repos = {};
$scope.seenError = '';
$scope.upgradeInfo = {};
$scope.stats = {};
$http.get(urlbase+"/lang").success(function (langs) {
// Find the first language in the list provided by the user's browser
@@ -175,6 +176,7 @@ syncthing.controller('SyncthingCtrl', function ($scope, $http, $translate, $loca
$scope.$on('NodeDisconnected', function (event, arg) {
delete $scope.connections[arg.data.id];
refreshNodeStats();
});
$scope.$on('NodeConnected', function (event, arg) {
@@ -332,10 +334,18 @@ syncthing.controller('SyncthingCtrl', function ($scope, $http, $translate, $loca
});
}
var refreshNodeStats = debounce(function () {
$http.get(urlbase+"/stats/node").success(function (data) {
$scope.stats = data;
console.log("refreshNodeStats", data);
});
}, 500);
$scope.init = function() {
refreshSystem();
refreshConfig();
refreshConnectionStats();
refreshNodeStats();
$http.get(urlbase + '/version').success(function (data) {
$scope.version = data;
@@ -1049,6 +1059,12 @@ syncthing.filter('clean', function () {
};
});
syncthing.filter('asDate', function() {
return function (input) {
return new Date(input);
}
})
syncthing.directive('optionEditor', function () {
return {
restrict: 'C',