mirror of
https://github.com/octoleo/syncthing.git
synced 2024-11-08 22:31:04 +00:00
Edit device after accepting new connection (fixes #1929)
This will open the "edit device" dialogue after accepting a new device connection. This will allow the user to specify the name of the device or leave it blank in case they want to accept whatever the device advertises once it connects.
This commit is contained in:
parent
ba01433381
commit
8120535a35
@ -135,8 +135,8 @@
|
||||
</div>
|
||||
<div class="panel-footer clearfix">
|
||||
<div class="pull-right">
|
||||
<button type="button" class="btn btn-sm btn-success" ng-click="addNewDeviceID(device)">
|
||||
<span class="fa fa-check"></span> <span translate>Add</span>
|
||||
<button type="button" class="btn btn-sm btn-success" ng-click="addDevice(device)">
|
||||
<span class="fa fa-plus"></span> <span translate>Add Device</span>
|
||||
</button>
|
||||
<button type="button" class="btn btn-sm btn-danger" ng-click="ignoreRejectedDevice(device)">
|
||||
<span class="fa fa-times"></span> <span translate>Ignore</span>
|
||||
|
@ -970,13 +970,14 @@ angular.module('syncthing.core')
|
||||
$('#idqr').modal('show');
|
||||
};
|
||||
|
||||
$scope.addDevice = function () {
|
||||
$http.get(urlbase + '/system/discovery')
|
||||
$scope.addDevice = function (deviceID) {
|
||||
return $http.get(urlbase + '/system/discovery')
|
||||
.success(function (registry) {
|
||||
$scope.discovery = registry;
|
||||
})
|
||||
.then(function () {
|
||||
$scope.currentDevice = {
|
||||
deviceID: deviceID,
|
||||
_addressesStr: 'dynamic',
|
||||
compression: 'metadata',
|
||||
introducer: false,
|
||||
@ -1016,18 +1017,7 @@ angular.module('syncthing.core')
|
||||
$scope.saveDevice = function () {
|
||||
$('#editDevice').modal('hide');
|
||||
$scope.saveDeviceConfig($scope.currentDevice);
|
||||
};
|
||||
|
||||
$scope.addNewDeviceID = function (device) {
|
||||
var deviceCfg = {
|
||||
deviceID: device,
|
||||
_addressesStr: 'dynamic',
|
||||
compression: 'metadata',
|
||||
introducer: false,
|
||||
selectedFolders: {}
|
||||
};
|
||||
$scope.saveDeviceConfig(deviceCfg);
|
||||
$scope.dismissDeviceRejection(device);
|
||||
$scope.dismissDeviceRejection($scope.currentDevice.deviceID);
|
||||
};
|
||||
|
||||
$scope.saveDeviceConfig = function (deviceCfg) {
|
||||
|
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user