Skip to content

Commit 4186dc2

Browse files
author
Rafael Grigorian
committed
Fixed #107
1 parent f55c8b0 commit 4186dc2

File tree

9 files changed

+154
-0
lines changed

9 files changed

+154
-0
lines changed
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<?php
2+
3+
/**
4+
* This model class inherits from the Setter model. It essentially wraps
5+
* that class in order to send passed data to the Cloudflare API endpoint.
6+
* @version 1.1.5
7+
* @package JetRails® Cloudflare
8+
* @author Rafael Grigorian <[email protected]>
9+
* @copyright © 2018 JETRAILS, All rights reserved
10+
* @license MIT https://opensource.org/licenses/MIT
11+
*/
12+
class JetRails_Cloudflare_Model_Adminhtml_Api_Network_Http3
13+
extends JetRails_Cloudflare_Model_Adminhtml_Api_Setter {
14+
15+
/**
16+
* @var string _endpoint Appended to zone endpoint
17+
* @var string _dataKey Key name used for value
18+
* @var integer _settingType Value cast type before sending
19+
*/
20+
protected $_endpoint = "settings/http3";
21+
protected $_dataKey = "value";
22+
protected $_settingType = self::TYPE_SWITCH;
23+
24+
}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<?php
2+
3+
/**
4+
* This model class inherits from the Setter model. It essentially wraps
5+
* that class in order to send passed data to the Cloudflare API endpoint.
6+
* @version 1.1.5
7+
* @package JetRails® Cloudflare
8+
* @author Rafael Grigorian <[email protected]>
9+
* @copyright © 2018 JETRAILS, All rights reserved
10+
* @license MIT https://opensource.org/licenses/MIT
11+
*/
12+
class JetRails_Cloudflare_Model_Adminhtml_Api_Network_ZeroRttConnectionResumption
13+
extends JetRails_Cloudflare_Model_Adminhtml_Api_Setter {
14+
15+
/**
16+
* @var string _endpoint Appended to zone endpoint
17+
* @var string _dataKey Key name used for value
18+
* @var integer _settingType Value cast type before sending
19+
*/
20+
protected $_endpoint = "settings/0rtt";
21+
protected $_dataKey = "value";
22+
protected $_settingType = self::TYPE_SWITCH;
23+
24+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<?php
2+
3+
/**
4+
* This controller inherits from a generic controller that implements the
5+
* base functionality for interfacing with a switch section. This section
6+
* simply loads the initial value through the Cloudflare API as well as
7+
* gives the ability to change the value of said section to be on or off
8+
* though the 'toggle' action.
9+
* @version 1.1.5
10+
* @package JetRails® Cloudflare
11+
* @author Rafael Grigorian <[email protected]>
12+
* @copyright © 2018 JETRAILS, All rights reserved
13+
* @license MIT https://opensource.org/licenses/MIT
14+
*/
15+
class JetRails_Cloudflare_Cloudflare_Api_Network_Http3Controller
16+
extends JetRails_Cloudflare_Controller_Toggle {}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<?php
2+
3+
/**
4+
* This controller inherits from a generic controller that implements the
5+
* base functionality for interfacing with a switch section. This section
6+
* simply loads the initial value through the Cloudflare API as well as
7+
* gives the ability to change the value of said section to be on or off
8+
* though the 'toggle' action.
9+
* @version 1.1.5
10+
* @package JetRails® Cloudflare
11+
* @author Rafael Grigorian <[email protected]>
12+
* @copyright © 2018 JETRAILS, All rights reserved
13+
* @license MIT https://opensource.org/licenses/MIT
14+
*/
15+
class JetRails_Cloudflare_Cloudflare_Api_Network_ZeroRttConnectionResumptionController
16+
extends JetRails_Cloudflare_Controller_Toggle {}

src/app/design/adminhtml/base/default/template/cloudflare/network.phtml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44

55
echo $this->renderSections ( "network", array (
66
"http_2",
7+
"http_3",
8+
"zero_rtt_connection_resumption",
79
"ipv6_compatibility",
810
"websockets",
911
"pseudo_ipv4",
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
<section
2+
class="cloudflare network http_3 initialize loading"
3+
data-endpoint="<?php echo $this->getApiEndpoint () ?>"
4+
data-form-key="<?php echo $this->getFormKey () ?>"
5+
data-tab-name="network"
6+
data-section-name="http_3" >
7+
<div class="row" >
8+
<div class="wrapper_left" >
9+
<span class="section_title" >HTTP/3 (with QUIC)</span>
10+
<p>Accelerates HTTP requests by using QUIC, which provides encryption and performance improvements compared to TCP and TLS.</p>
11+
</div>
12+
<div class="wrapper_right" >
13+
<div>
14+
<label class="switch" >
15+
<input class="trigger" type="checkbox" name="mode" data-target="toggle" />
16+
<span class="knob" ></span>
17+
</label>
18+
</div>
19+
<div class="lightbox" style="background-image: url(<?php echo $this->getSkinUrl ('images/cloudflare/loading.svg') ?>)" ></div>
20+
</div>
21+
</div>
22+
<div class="row collapsable" >
23+
<div class="wrapper_bottom" >
24+
<a data-tab="help" >Help</a>
25+
</div>
26+
<div data-tab-content="help" >
27+
<h4>What is HTTP/3?</h4>
28+
<p>HTTP/3 is a major revision of the Web’s protocol designed to take advantage of QUIC, a new encrypted-by-default Internet transport protocol that provides a number of improvements designed to accelerate HTTP traffic as well as make it more secure.</p>
29+
</div>
30+
</div>
31+
</section>
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
<section
2+
class="cloudflare network zero_rtt_connection_resumption initialize loading"
3+
data-endpoint="<?php echo $this->getApiEndpoint () ?>"
4+
data-form-key="<?php echo $this->getFormKey () ?>"
5+
data-tab-name="network"
6+
data-section-name="zero_rtt_connection_resumption" >
7+
<div class="row" >
8+
<div class="wrapper_left" >
9+
<span class="section_title" >0-RTT Connection Resumption</span>
10+
<p>Improves performance for clients who have previously connected to your website.</p>
11+
</div>
12+
<div class="wrapper_right" >
13+
<div>
14+
<label class="switch" >
15+
<input class="trigger" type="checkbox" name="mode" data-target="toggle" />
16+
<span class="knob" ></span>
17+
</label>
18+
</div>
19+
<div class="lightbox" style="background-image: url(<?php echo $this->getSkinUrl ('images/cloudflare/loading.svg') ?>)" ></div>
20+
</div>
21+
</div>
22+
<div class="row collapsable" >
23+
<div class="wrapper_bottom" >
24+
<a data-tab="help" >Help</a>
25+
</div>
26+
<div data-tab-content="help" >
27+
<h4>What is 0-RTT Connection Resumption?</h4>
28+
<p>0-RTT Connection Resumption allows the client’s first request to be sent before the TLS or QUIC connection is fully established, resulting in faster connection times, when the client is resuming a connection that was previously already established.</p>
29+
</div>
30+
</div>
31+
</section>
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
const $ = require ("jquery")
2+
const switchElement = require ("cloudflare/generic/switch")
3+
4+
$(document).on ( "cloudflare.network.http_3.initialize", switchElement.initialize )
5+
$(document).on ( "cloudflare.network.http_3.toggle", switchElement.toggle )
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
const $ = require ("jquery")
2+
const switchElement = require ("cloudflare/generic/switch")
3+
4+
$(document).on ( "cloudflare.network.zero_rtt_connection_resumption.initialize", switchElement.initialize )
5+
$(document).on ( "cloudflare.network.zero_rtt_connection_resumption.toggle", switchElement.toggle )

0 commit comments

Comments
 (0)