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 = $credential->jsonSerialize();
|
||||||
$c['user_id'] = $destination_account;
|
$c['user_id'] = $destination_account;
|
||||||
|
$c['icon'] = json_encode($c['icon']);
|
||||||
$this->credentialService->updateCredential($c, true);
|
$this->credentialService->updateCredential($c, true);
|
||||||
}
|
}
|
||||||
$vault->setUserId($destination_account);
|
$vault->setUserId($destination_account);
|
||||||
|
|
|
@ -2,6 +2,10 @@
|
||||||
padding: 5px; }
|
padding: 5px; }
|
||||||
#passwordSharingSettings #mover input[type="text"] {
|
#passwordSharingSettings #mover input[type="text"] {
|
||||||
width: 350px; }
|
width: 350px; }
|
||||||
|
#passwordSharingSettings #mover .account_mover_selector {
|
||||||
|
width: 350px; }
|
||||||
|
#passwordSharingSettings #mover .account_mover_selector .select2-choice {
|
||||||
|
height: 34px; }
|
||||||
#passwordSharingSettings #requests-table {
|
#passwordSharingSettings #requests-table {
|
||||||
width: 100%; }
|
width: 100%; }
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"version": 3,
|
"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"],
|
"sources": ["../sass/admin.scss"],
|
||||||
"names": [],
|
"names": [],
|
||||||
"file": "admin.css"
|
"file": "admin.css"
|
||||||
|
|
|
@ -137,16 +137,38 @@ $(document).ready(function () {
|
||||||
'source_account': '',
|
'source_account': '',
|
||||||
'destination_account': ''
|
'destination_account': ''
|
||||||
};
|
};
|
||||||
$(".username-autocomplete").autocomplete({
|
$('.account_mover_selector').select2({
|
||||||
source: OC.generateUrl('apps/passman/admin/search'),
|
ajax: {
|
||||||
minLength: 1,
|
url: OC.generateUrl('apps/passman/admin/search'),
|
||||||
select: function (event, ui) {
|
dataType: 'json',
|
||||||
accountMover[$(this).attr('id')] = ui.item.value;
|
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 () {
|
$('#move_credentials').click(function () {
|
||||||
var self = this;
|
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();
|
$('#moveStatus').hide();
|
||||||
$(self).attr('disabled', 'disabled');
|
$(self).attr('disabled', 'disabled');
|
||||||
$(self).html('<i class="fa fa-spinner fa-spin"></i> ' + OC.L10N.translate('passman', 'Moving') + '...');
|
$(self).html('<i class="fa fa-spinner fa-spin"></i> ' + OC.L10N.translate('passman', 'Moving') + '...');
|
||||||
|
|
|
@ -8,8 +8,14 @@
|
||||||
input[type="text"]{
|
input[type="text"]{
|
||||||
width: 350px;
|
width: 350px;
|
||||||
}
|
}
|
||||||
|
.account_mover_selector {
|
||||||
|
width: 350px;
|
||||||
|
.select2-choice {
|
||||||
|
height: 34px;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
#requests-table{
|
#requests-table{
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -123,11 +123,11 @@ style('passman', 'vendor/font-awesome/font-awesome.min');
|
||||||
<table class="table">
|
<table class="table">
|
||||||
<tr>
|
<tr>
|
||||||
<td><?php p($l->t('Source account')); ?> </td>
|
<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>
|
||||||
<tr>
|
<tr>
|
||||||
<td><?php p($l->t('Destination account')); ?> </td>
|
<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>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
<button class="success" id="move_credentials">Move</button>
|
<button class="success" id="move_credentials">Move</button>
|
||||||
|
|
Loading…
Add table
Reference in a new issue