gui: Fix & improve sharing with untrusted device (#7148)

This commit is contained in:
Simon Frei 2020-11-24 22:02:16 +01:00 committed by GitHub
parent 100ef10d84
commit e5c1948b94
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 4 deletions

View File

@ -15,8 +15,13 @@
<input class="form-control input-sm" type="password" placeholder="{{'Received data is already encrypted' | translate}}" disabled />
</span>
<span ng-switch-default ng-switch="selected[id]">
<span ng-switch-when='true' ng-class="{'has-error': untrusted && !encryptionPasswords[id]}">
<input class="form-control input-sm" type="{{plain ? 'text' : 'password'}}" ng-model="encryptionPasswords[id]" ng-required="untrusted" placeholder="{{'If untrusted, enter encryption password' | translate}}" />
<span ng-switch-when='true' ng-switch="untrusted">
<span ng-switch-when='true' ng-class="{'has-error': !encryptionPasswords[id]}">
<input class="form-control input-sm" type="{{plain ? 'text' : 'password'}}" ng-model="encryptionPasswords[id]" required placeholder="{{'Device is untrusted, enter encryption password' | translate}}" />
</span>
<span ng-switch-default>
<input class="form-control input-sm" type="{{plain ? 'text' : 'password'}}" ng-model="encryptionPasswords[id]" placeholder="{{'If untrusted, enter encryption password' | translate}}" />
</span>
</span>
<span ng-switch-default>
<input class="form-control input-sm" type="password" placeholder="{{'Not shared' | translate}}" disabled />

View File

@ -72,7 +72,7 @@
<a href="#" ng-click="selectAllSharedFolders(false)" translate>Deselect All</a></small>
</p>
<div class="form-group" ng-repeat="folder in currentSharing.shared">
<share-template selected="currentSharing.selected" encryption-passwords="currentSharing.encryptionPasswords" id="{{folder.id}}" label="{{folderLabel(folder.id)}}" folder-type="{{folder.type}}" untrusted="{{device.untrusted}}" />
<share-template selected="currentSharing.selected" encryption-passwords="currentSharing.encryptionPasswords" id="{{folder.id}}" label="{{folderLabel(folder.id)}}" folder-type="{{folder.type}}" untrusted="{{currentDevice.untrusted}}" />
</div>
</div>
<div class="form-horizontal" ng-if="currentSharing.unrelated.length">
@ -83,7 +83,7 @@
<a href="#" ng-click="selectAllUnrelatedFolders(false)" translate>Deselect All</a></small>
</p>
<div class="form-group" ng-repeat="folder in currentSharing.unrelated">
<share-template selected="currentSharing.selected" encryption-passwords="currentSharing.encryptionPasswords" id="{{folder.id}}" label="{{folderLabel(folder.id)}}" folder-type="{{folder.type}}" untrusted="{{device.untrusted}}" />
<share-template selected="currentSharing.selected" encryption-passwords="currentSharing.encryptionPasswords" id="{{folder.id}}" label="{{folderLabel(folder.id)}}" folder-type="{{folder.type}}" untrusted="{{currentDevice.untrusted}}" />
</div>
</div>
</div>