mirror of
https://github.com/nextcloud/passman.git
synced 2025-09-11 23:44:20 +08:00
fix vaults mover
This commit is contained in:
parent
22fe2fc754
commit
5f439862d5
6 changed files with 43 additions and 10 deletions
|
@ -98,6 +98,7 @@ class AdminController extends ApiController {
|
|||
|
||||
$c = $credential->jsonSerialize();
|
||||
$c['user_id'] = $destination_account;
|
||||
$c['icon'] = json_encode($c['icon']);
|
||||
$this->credentialService->updateCredential($c, true);
|
||||
}
|
||||
$vault->setUserId($destination_account);
|
||||
|
|
|
@ -2,6 +2,10 @@
|
|||
padding: 5px; }
|
||||
#passwordSharingSettings #mover input[type="text"] {
|
||||
width: 350px; }
|
||||
#passwordSharingSettings #mover .account_mover_selector {
|
||||
width: 350px; }
|
||||
#passwordSharingSettings #mover .account_mover_selector .select2-choice {
|
||||
height: 34px; }
|
||||
#passwordSharingSettings #requests-table {
|
||||
width: 100%; }
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"version": 3,
|
||||
"mappings": "AAGM,wCAAE;EACA,OAAO,EAAE,GAAG;AAGhB,kDAAkB;EAChB,KAAK,EAAE,KAAK;AAGhB,wCAAe;EACb,KAAK,EAAE,IAAI",
|
||||
"mappings": "AAGM,wCAAE;EACA,OAAO,EAAE,GAAG;AAGhB,kDAAkB;EAChB,KAAK,EAAE,KAAK;AAEd,uDAAwB;EACtB,KAAK,EAAE,KAAK;EACZ,uEAAgB;IACd,MAAM,EAAE,IAAI;AAIlB,wCAAe;EACb,KAAK,EAAE,IAAI",
|
||||
"sources": ["../sass/admin.scss"],
|
||||
"names": [],
|
||||
"file": "admin.css"
|
||||
|
|
|
@ -137,16 +137,38 @@ $(document).ready(function () {
|
|||
'source_account': '',
|
||||
'destination_account': ''
|
||||
};
|
||||
$(".username-autocomplete").autocomplete({
|
||||
source: OC.generateUrl('apps/passman/admin/search'),
|
||||
minLength: 1,
|
||||
select: function (event, ui) {
|
||||
accountMover[$(this).attr('id')] = ui.item.value;
|
||||
$('.account_mover_selector').select2({
|
||||
ajax: {
|
||||
url: OC.generateUrl('apps/passman/admin/search'),
|
||||
dataType: 'json',
|
||||
delay: 50,
|
||||
data: function (param) {
|
||||
return {
|
||||
term: param
|
||||
};
|
||||
},
|
||||
results: function (data) {
|
||||
var res = [];
|
||||
for (var i = 0; i < data.length; i++) {
|
||||
res.push({
|
||||
id: i,
|
||||
text: data[i].value
|
||||
});
|
||||
}
|
||||
return {
|
||||
results: res
|
||||
};
|
||||
},
|
||||
cache: true
|
||||
},
|
||||
placeholder: 'Search for a user',
|
||||
minimumInputLength: 1
|
||||
});
|
||||
|
||||
$('#move_credentials').click(function () {
|
||||
var self = this;
|
||||
accountMover.source_account = $('#s2id_source_account a .select2-chosen').html();
|
||||
accountMover.destination_account = $('#s2id_destination_account a .select2-chosen').html();
|
||||
$('#moveStatus').hide();
|
||||
$(self).attr('disabled', 'disabled');
|
||||
$(self).html('<i class="fa fa-spinner fa-spin"></i> ' + OC.L10N.translate('passman', 'Moving') + '...');
|
||||
|
|
|
@ -8,6 +8,12 @@
|
|||
input[type="text"]{
|
||||
width: 350px;
|
||||
}
|
||||
.account_mover_selector {
|
||||
width: 350px;
|
||||
.select2-choice {
|
||||
height: 34px;
|
||||
}
|
||||
}
|
||||
}
|
||||
#requests-table{
|
||||
width: 100%;
|
||||
|
|
|
@ -123,11 +123,11 @@ style('passman', 'vendor/font-awesome/font-awesome.min');
|
|||
<table class="table">
|
||||
<tr>
|
||||
<td><?php p($l->t('Source account')); ?> </td>
|
||||
<td><input class="username-autocomplete" type="text" id="source_account" name="source_account"></td>
|
||||
<td><input type="hidden" class="form-control account_mover_selector" id="source_account"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php p($l->t('Destination account')); ?> </td>
|
||||
<td><input class="username-autocomplete" type="text" id="destination_account" name="destination_account"></td>
|
||||
<td><input type="hidden" class="form-control account_mover_selector" id="destination_account"></td>
|
||||
</tr>
|
||||
</table>
|
||||
<button class="success" id="move_credentials">Move</button>
|
||||
|
|
Loading…
Add table
Reference in a new issue