acme: account: hide TOS checkbox during load and reuse field references

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
Thomas Lamprecht 2020-05-14 16:28:39 +02:00
parent e023535e15
commit 1d5c5ba19a
3 changed files with 15 additions and 4 deletions

View File

@ -83,6 +83,15 @@ sub update_storage_status {
return assemble($class, $txn, $data, $ctime, "storages.$nodename.$storeid");
}
sub _send_batch_size {
my ($class, $cfg) = @_;
my $proto = $cfg->{proto} || 'udp';
if ($proto eq 'tcp') {
return 56000;
}
return $class->SUPER::_send_batch_size($cfg);
}
sub _connect {
my ($class, $cfg) = @_;

View File

@ -69,7 +69,7 @@ sub _disconnect {
# UDP cannot do more than 64k at once. Overwrite for different protocol limits.
sub _send_batch_size {
my ($class, $cfg) = @_;
return 1200; # FIXME: why??? MTU fragmentation should be handled by layer2
return 1450; # assume 1500 MTU, empty IPv6 UDP packet needs 48 bytes overhead
}
# call with the smalles $data chunks possible
@ -77,7 +77,7 @@ sub add_metric_data {
my ($class, $txn, $data) = @_;
return if !defined($data);
my $batch_size = $class->_send_batch_size();
my $batch_size = $class->_send_batch_size($txn->{cfg});
my $data_length = length($data) // 0;
my $dataq_len = length($txn->{data}) // 0;

View File

@ -76,6 +76,7 @@ Ext.define('PVE.node.ACMEAccountCreate', {
disp.setValue(gettext('Loading'));
field.setValue(undefined);
checkbox.setValue(undefined);
checkbox.setHidden(true);
Proxmox.Utils.API2Request({
url: '/cluster/acme/tos',
@ -84,8 +85,9 @@ Ext.define('PVE.node.ACMEAccountCreate', {
directory: value
},
success: function(response, opt) {
me.up('window').down('#tos_url').setValue(response.result.data);
me.up('window').down('#tos_url_display').setValue(response.result.data);
field.setValue(response.result.data);
disp.setValue(response.result.data);
checkbox.setHidden(false);
},
failure: function(response, opt) {
Ext.Msg.alert(gettext('Error'), response.htmlStatus);