]>
git.proxmox.com Git - pve-manager.git/blob - www/manager6/qemu/RNGEdit.js
1 Ext
. define ( 'PVE.qemu.RNGInputPanel' , {
2 extend
: 'Proxmox.panel.InputPanel' ,
3 xtype
: 'pveRNGInputPanel' ,
5 // FIXME: enable once we bumped doc-gen so this ref is included
6 //onlineHelp: 'qm_virtio_rng',
8 onGetValues : function ( values
) {
9 if ( values
. max_bytes
=== "" ) {
10 values
. max_bytes
= "0" ;
11 } else if ( values
. max_bytes
=== "1024" && values
. period
=== "" ) {
12 delete values
. max_bytes
;
15 var ret
= PVE
. Parser
. printPropertyString ( values
);
22 setValues : function ( values
) {
23 if ( values
. max_bytes
== 0 ) {
24 values
. max_bytes
= null ;
27 this . callParent ( arguments
);
31 xclass
: 'Ext.app.ViewController' ,
34 change : function ( el
, newVal
) {
35 let limitWarning
= this . lookupReference ( 'limitWarning' );
36 limitWarning
. setHidden (!! newVal
);
40 change : function ( el
, newVal
) {
41 let limitWarning
= this . lookupReference ( 'sourceWarning' );
42 limitWarning
. setHidden ( newVal
!== '/dev/random' );
51 xtype
: 'proxmoxKVComboBox' ,
52 value
: '/dev/urandom' ,
53 fieldLabel
: gettext ( 'Entropy source' ),
56 [ '/dev/urandom' , '/dev/urandom' ],
57 [ '/dev/random' , '/dev/random' ],
58 [ '/dev/hwrng' , '/dev/hwrng' ],
68 fieldLabel
: gettext ( 'Limit (Bytes/Period)' ),
70 emptyText
: gettext ( 'unlimited' ),
77 fieldLabel
: gettext ( 'Period' ) + ' (ms)' ,
82 xtype
: 'displayfield' ,
83 reference
: 'sourceWarning' ,
84 value
: gettext ( 'Using /dev/random as entropy source is discouraged, as it can lead to host entropy starvation. /dev/urandom is preferred, and does not lead to a decrease in security in practice.' ),
89 xtype
: 'displayfield' ,
90 reference
: 'limitWarning' ,
91 value
: gettext ( 'Disabling the limiter can potentially allow a guest to overload the host. Proceed with caution.' ),
97 Ext
. define ( 'PVE.qemu.RNGEdit' , {
98 extend
: 'Proxmox.window.Edit' ,
100 subject
: gettext ( 'VirtIO RNG' ),
103 xtype
: 'pveRNGInputPanel' ,
106 initComponent : function () {
113 success : function ( response
) {
114 me
. vmconfig
= response
. result
. data
;
116 var rng0
= me
. vmconfig
. rng0
;
118 me
. setValues ( PVE
. Parser
. parsePropertyString ( rng0
));