]>
git.proxmox.com Git - pve-manager.git/blob - www/manager6/qemu/SSHKey.js
1 Ext
.define('PVE.qemu.SSHKeyInputPanel', {
2 extend
: 'Proxmox.panel.InputPanel',
3 xtype
: 'pveQemuSSHKeyInputPanel',
7 onGetValues: function(values
) {
10 values
.sshkeys
.trim();
12 if (!values
.sshkeys
.length
) {
14 values
.delete = 'sshkeys';
17 values
.sshkeys
= encodeURIComponent(values
.sshkeys
);
33 text
: gettext('Load SSH Key File'),
36 change: function(btn
, e
, value
) {
37 let view
= this.up('inputpanel');
39 Ext
.Array
.each(e
.target
.files
, function(file
) {
40 PVE
.Utils
.loadSSHKeyFromFile(file
, function(res
) {
41 let keysField
= view
.down('#sshkeys');
42 var old
= keysField
.getValue();
43 keysField
.setValue(old
+ res
);
52 initComponent: function() {
56 if (!window
.FileReader
) {
57 me
.down('#filebutton').setVisible(false);
62 Ext
.define('PVE.qemu.SSHKeyEdit', {
63 extend
: 'Proxmox.window.Edit',
67 initComponent: function() {
70 var ipanel
= Ext
.create('PVE.qemu.SSHKeyInputPanel');
73 subject
: gettext('SSH Keys'),
81 success: function(response
, options
) {
82 var data
= response
.result
.data
;
84 data
.sshkeys
= decodeURIComponent(data
.sshkeys
);
85 ipanel
.setValues(data
);