all: Add a global change list
GitHub-Pull-Request: https://github.com/syncthing/syncthing/pull/3694
This commit is contained in:
committed by
Audrius Butkevicius
parent
dd7bb6c4b8
commit
0725e3af38
@@ -51,6 +51,7 @@ angular.module('syncthing.core')
|
||||
$scope.failedPageSize = 10;
|
||||
$scope.scanProgress = {};
|
||||
$scope.themes = [];
|
||||
$scope.globalChangeEvents = {};
|
||||
|
||||
$scope.localStateTotal = {
|
||||
bytes: 0,
|
||||
@@ -186,6 +187,7 @@ angular.module('syncthing.core')
|
||||
|
||||
$scope.$on(Events.LOCAL_INDEX_UPDATED, function (event, arg) {
|
||||
refreshFolderStats();
|
||||
refreshGlobalChanges();
|
||||
});
|
||||
|
||||
$scope.$on(Events.DEVICE_DISCONNECTED, function (event, arg) {
|
||||
@@ -629,6 +631,15 @@ angular.module('syncthing.core')
|
||||
}).error($scope.emitHTTPError);
|
||||
}, 2500);
|
||||
|
||||
var refreshGlobalChanges = debounce(function () {
|
||||
$http.get(urlbase + "/events/disk?limit=15").success(function (data) {
|
||||
data = data.reverse();
|
||||
$scope.globalChangeEvents = data;
|
||||
|
||||
console.log("refreshGlobalChanges", data);
|
||||
}).error($scope.emitHTTPError);
|
||||
}, 2500);
|
||||
|
||||
$scope.refresh = function () {
|
||||
refreshSystem();
|
||||
refreshDiscoveryCache();
|
||||
@@ -912,6 +923,16 @@ angular.module('syncthing.core')
|
||||
return '';
|
||||
};
|
||||
|
||||
$scope.friendlyNameFromShort = function (shortID) {
|
||||
var matches = $scope.devices.filter(function (n) {
|
||||
return n.deviceID.substr(0, 7) === shortID;
|
||||
});
|
||||
if (matches.length !== 1) {
|
||||
return shortID;
|
||||
}
|
||||
return matches[0].name;
|
||||
};
|
||||
|
||||
$scope.findDevice = function (deviceID) {
|
||||
var matches = $scope.devices.filter(function (n) {
|
||||
return n.deviceID === deviceID;
|
||||
@@ -1268,7 +1289,11 @@ angular.module('syncthing.core')
|
||||
$scope.folderEditor = form;
|
||||
break;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
$scope.globalChanges = function () {
|
||||
$('#globalChanges').modal();
|
||||
};
|
||||
|
||||
$scope.editFolder = function (folderCfg) {
|
||||
$scope.currentFolder = angular.copy(folderCfg);
|
||||
|
||||
27
gui/default/syncthing/device/globalChangesModalView.html
Normal file
27
gui/default/syncthing/device/globalChangesModalView.html
Normal file
@@ -0,0 +1,27 @@
|
||||
<style> th, td { padding: 6px; } </style>
|
||||
<modal id="globalChanges" status="default" icon="{{'history'}}" heading="{{'Global Changes' | translate}}" large="yes" closeable="yes">
|
||||
<div class="modal-body">
|
||||
<table>
|
||||
<tr>
|
||||
<th translate>Device</th>
|
||||
<th translate>Action</th>
|
||||
<th translate>Type</th>
|
||||
<th translate>Path</th>
|
||||
<th translate>Time</th>
|
||||
</tr>
|
||||
<tr ng-repeat="changeEvent in globalChangeEvents">
|
||||
<td ng-if="changeEvent.data.modifiedBy">{{friendlyNameFromShort(changeEvent.data.modifiedBy)}}</td>
|
||||
<td ng-if="!changeEvent.data.modifiedBy"><span translate>Unknown</span></td>
|
||||
<td>{{changeEvent.data.action}}</td>
|
||||
<td>{{changeEvent.data.type}}</td>
|
||||
<td>{{changeEvent.data.path}}</td>
|
||||
<td>{{changeEvent.time | date:'medium'}}</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default btn-sm" data-dismiss="modal">
|
||||
<span class="fa fa-times"></span> <span translate>Close</span>
|
||||
</button>
|
||||
</div>
|
||||
</model>
|
||||
Reference in New Issue
Block a user