Skip to content

Commit de53899

Browse files
author
Rafael Grigorian
committed
Fixed #21
1 parent 41bc7e3 commit de53899

File tree

13 files changed

+249
-23
lines changed

13 files changed

+249
-23
lines changed
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<?php
2+
3+
namespace JetRails\Cloudflare\Controller\Adminhtml\Api\Network\Http3;
4+
5+
use JetRails\Cloudflare\Controller\Adminhtml\Getter;
6+
7+
/**
8+
* This controller inherits from a generic controller that implements the
9+
* base functionality for interfacing with a getter model. This action
10+
* simply loads the initial value through the Cloudflare API. The rest of
11+
* this class extends on that functionality and adds more endpoints.
12+
* @version 1.2.4
13+
* @package JetRails® Cloudflare
14+
* @author Rafael Grigorian <development@jetrails.com>
15+
* @copyright © 2018 JETRAILS, All rights reserved
16+
* @license MIT https://opensource.org/licenses/MIT
17+
*/
18+
class Index extends Getter {}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<?php
2+
3+
namespace JetRails\Cloudflare\Controller\Adminhtml\Api\Network\Http3;
4+
5+
use JetRails\Cloudflare\Controller\Adminhtml\Toggle as BaseToggle;
6+
7+
/**
8+
* This controller inherits from a generic controller that implements the
9+
* base functionality for interfacing with a switch section. This section
10+
* simply loads the initial value through the Cloudflare API as well as
11+
* gives the ability to change the value of said section to be on or off
12+
* though the 'toggle' action.
13+
* @version 1.2.4
14+
* @package JetRails® Cloudflare
15+
* @author Rafael Grigorian <development@jetrails.com>
16+
* @copyright © 2018 JETRAILS, All rights reserved
17+
* @license MIT https://opensource.org/licenses/MIT
18+
*/
19+
class Toggle extends BaseToggle {}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<?php
2+
3+
namespace JetRails\Cloudflare\Controller\Adminhtml\Api\Network\ZeroRttConnectionResumption;
4+
5+
use JetRails\Cloudflare\Controller\Adminhtml\Getter;
6+
7+
/**
8+
* This controller inherits from a generic controller that implements the
9+
* base functionality for interfacing with a getter model. This action
10+
* simply loads the initial value through the Cloudflare API. The rest of
11+
* this class extends on that functionality and adds more endpoints.
12+
* @version 1.2.4
13+
* @package JetRails® Cloudflare
14+
* @author Rafael Grigorian <development@jetrails.com>
15+
* @copyright © 2018 JETRAILS, All rights reserved
16+
* @license MIT https://opensource.org/licenses/MIT
17+
*/
18+
class Index extends Getter {}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<?php
2+
3+
namespace JetRails\Cloudflare\Controller\Adminhtml\Api\Network\ZeroRttConnectionResumption;
4+
5+
use JetRails\Cloudflare\Controller\Adminhtml\Toggle as BaseToggle;
6+
7+
/**
8+
* This controller inherits from a generic controller that implements the
9+
* base functionality for interfacing with a switch section. This section
10+
* simply loads the initial value through the Cloudflare API as well as
11+
* gives the ability to change the value of said section to be on or off
12+
* though the 'toggle' action.
13+
* @version 1.2.4
14+
* @package JetRails® Cloudflare
15+
* @author Rafael Grigorian <development@jetrails.com>
16+
* @copyright © 2018 JETRAILS, All rights reserved
17+
* @license MIT https://opensource.org/licenses/MIT
18+
*/
19+
class Toggle extends BaseToggle {}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<?php
2+
3+
namespace JetRails\Cloudflare\Model\Adminhtml\Api\Network;
4+
5+
use JetRails\Cloudflare\Model\Adminhtml\Api\Setter;
6+
7+
/**
8+
* This model class inherits from the Setter model. It essentially wraps
9+
* that class in order to send passed data to the Cloudflare API endpoint.
10+
* @version 1.2.4
11+
* @package JetRails® Cloudflare
12+
* @author Rafael Grigorian <development@jetrails.com>
13+
* @copyright © 2018 JETRAILS, All rights reserved
14+
* @license MIT https://opensource.org/licenses/MIT
15+
*/
16+
class Http3 extends Setter {
17+
18+
/**
19+
* @var string _endpoint Appended to zone endpoint
20+
* @var string _dataKey Key name used for value
21+
* @var integer _settingType Value cast type before sending
22+
*/
23+
protected $_endpoint = "settings/http3";
24+
protected $_dataKey = "value";
25+
protected $_settingType = self::TYPE_SWITCH;
26+
27+
}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<?php
2+
3+
namespace JetRails\Cloudflare\Model\Adminhtml\Api\Network;
4+
5+
use JetRails\Cloudflare\Model\Adminhtml\Api\Setter;
6+
7+
/**
8+
* This model class inherits from the Setter model. It essentially wraps
9+
* that class in order to send passed data to the Cloudflare API endpoint.
10+
* @version 1.2.4
11+
* @package JetRails® Cloudflare
12+
* @author Rafael Grigorian <development@jetrails.com>
13+
* @copyright © 2018 JETRAILS, All rights reserved
14+
* @license MIT https://opensource.org/licenses/MIT
15+
*/
16+
class ZeroRttConnectionResumption extends Setter {
17+
18+
/**
19+
* @var string _endpoint Appended to zone endpoint
20+
* @var string _dataKey Key name used for value
21+
* @var integer _settingType Value cast type before sending
22+
*/
23+
protected $_endpoint = "settings/0rtt";
24+
protected $_dataKey = "value";
25+
protected $_settingType = self::TYPE_SWITCH;
26+
27+
}

src/app/code/JetRails/Cloudflare/view/adminhtml/templates/network.phtml

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

55
echo $block->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_2 initialize loading"
3+
data-endpoint="<?php echo $block->getApiEndpoint () ?>"
4+
data-form-key="<?php echo $block->getFormKey () ?>"
5+
data-tab-name="network"
6+
data-section-name="http_2" >
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 $block->getViewFileUrl ('JetRails_Cloudflare/images/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 http_2 initialize loading"
3+
data-endpoint="<?php echo $block->getApiEndpoint () ?>"
4+
data-form-key="<?php echo $block->getFormKey () ?>"
5+
data-tab-name="network"
6+
data-section-name="http_2" >
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 $block->getViewFileUrl ('JetRails_Cloudflare/images/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>

src/app/code/JetRails/Cloudflare/view/adminhtml/web/js/bundle.js

Lines changed: 46 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -12154,7 +12154,7 @@ requireAll ( __webpack_require__(39) )
1215412154
requireAll ( __webpack_require__(42) )
1215512155
requireAll ( __webpack_require__(49) )
1215612156
requireAll ( __webpack_require__(55) )
12157-
requireAll ( __webpack_require__(64) )
12157+
requireAll ( __webpack_require__(66) )
1215812158

1215912159
$(window).on ( "load", function () {
1216012160

@@ -17110,13 +17110,15 @@ return $.fn.scrollParent = function( includeHidden ) {
1711017110

1711117111
var map = {
1711217112
"./http_2.js": 56,
17113-
"./ip_geolocation.js": 57,
17114-
"./ipv6_compatibility.js": 58,
17115-
"./maximum_upload_size.js": 59,
17116-
"./pseudo_ipv4.js": 60,
17117-
"./response_buffering.js": 61,
17118-
"./true_client_ip_header.js": 62,
17119-
"./websockets.js": 63
17113+
"./http_3.js": 57,
17114+
"./ip_geolocation.js": 58,
17115+
"./ipv6_compatibility.js": 59,
17116+
"./maximum_upload_size.js": 60,
17117+
"./pseudo_ipv4.js": 61,
17118+
"./response_buffering.js": 62,
17119+
"./true_client_ip_header.js": 63,
17120+
"./websockets.js": 64,
17121+
"./zero_rtt_connection_resumption.js": 65
1712017122
};
1712117123
function webpackContext(req) {
1712217124
return __webpack_require__(webpackContextResolve(req));
@@ -17152,12 +17154,23 @@ $(document).on ( "cloudflare.network.http_2.toggle", switchElement.toggle )
1715217154
const $ = __webpack_require__ (0)
1715317155
const switchElement = __webpack_require__ (1)
1715417156

17157+
$(document).on ( "cloudflare.network.http_3.initialize", switchElement.initialize )
17158+
$(document).on ( "cloudflare.network.http_3.toggle", switchElement.toggle )
17159+
17160+
17161+
/***/ }),
17162+
/* 58 */
17163+
/***/ (function(module, exports, __webpack_require__) {
17164+
17165+
const $ = __webpack_require__ (0)
17166+
const switchElement = __webpack_require__ (1)
17167+
1715517168
$(document).on ( "cloudflare.network.ip_geolocation.initialize", switchElement.initialize )
1715617169
$(document).on ( "cloudflare.network.ip_geolocation.toggle", switchElement.toggle )
1715717170

1715817171

1715917172
/***/ }),
17160-
/* 58 */
17173+
/* 59 */
1716117174
/***/ (function(module, exports, __webpack_require__) {
1716217175

1716317176
const $ = __webpack_require__ (0)
@@ -17168,7 +17181,7 @@ $(document).on ( "cloudflare.network.ipv6_compatibility.toggle", switchElement.t
1716817181

1716917182

1717017183
/***/ }),
17171-
/* 59 */
17184+
/* 60 */
1717217185
/***/ (function(module, exports, __webpack_require__) {
1717317186

1717417187
const $ = __webpack_require__ (0)
@@ -17179,7 +17192,7 @@ $(document).on ( "cloudflare.network.maximum_upload_size.update", selectElement.
1717917192

1718017193

1718117194
/***/ }),
17182-
/* 60 */
17195+
/* 61 */
1718317196
/***/ (function(module, exports, __webpack_require__) {
1718417197

1718517198
const $ = __webpack_require__ (0)
@@ -17190,7 +17203,7 @@ $(document).on ( "cloudflare.network.pseudo_ipv4.update", selectElement.update )
1719017203

1719117204

1719217205
/***/ }),
17193-
/* 61 */
17206+
/* 62 */
1719417207
/***/ (function(module, exports, __webpack_require__) {
1719517208

1719617209
const $ = __webpack_require__ (0)
@@ -17201,7 +17214,7 @@ $(document).on ( "cloudflare.network.response_buffering.toggle", switchElement.t
1720117214

1720217215

1720317216
/***/ }),
17204-
/* 62 */
17217+
/* 63 */
1720517218
/***/ (function(module, exports, __webpack_require__) {
1720617219

1720717220
const $ = __webpack_require__ (0)
@@ -17212,7 +17225,7 @@ $(document).on ( "cloudflare.network.true_client_ip_header.toggle", switchElemen
1721217225

1721317226

1721417227
/***/ }),
17215-
/* 63 */
17228+
/* 64 */
1721617229
/***/ (function(module, exports, __webpack_require__) {
1721717230

1721817231
const $ = __webpack_require__ (0)
@@ -17223,13 +17236,24 @@ $(document).on ( "cloudflare.network.websockets.toggle", switchElement.toggle )
1722317236

1722417237

1722517238
/***/ }),
17226-
/* 64 */
17239+
/* 65 */
17240+
/***/ (function(module, exports, __webpack_require__) {
17241+
17242+
const $ = __webpack_require__ (0)
17243+
const switchElement = __webpack_require__ (1)
17244+
17245+
$(document).on ( "cloudflare.network.zero_rtt_connection_resumption.initialize", switchElement.initialize )
17246+
$(document).on ( "cloudflare.network.zero_rtt_connection_resumption.toggle", switchElement.toggle )
17247+
17248+
17249+
/***/ }),
17250+
/* 66 */
1722717251
/***/ (function(module, exports, __webpack_require__) {
1722817252

1722917253
var map = {
17230-
"./email_address_obfuscation.js": 65,
17231-
"./hotlink_protection.js": 66,
17232-
"./server_side_excludes.js": 67
17254+
"./email_address_obfuscation.js": 67,
17255+
"./hotlink_protection.js": 68,
17256+
"./server_side_excludes.js": 69
1723317257
};
1723417258
function webpackContext(req) {
1723517259
return __webpack_require__(webpackContextResolve(req));
@@ -17245,10 +17269,10 @@ webpackContext.keys = function webpackContextKeys() {
1724517269
};
1724617270
webpackContext.resolve = webpackContextResolve;
1724717271
module.exports = webpackContext;
17248-
webpackContext.id = 64;
17272+
webpackContext.id = 66;
1724917273

1725017274
/***/ }),
17251-
/* 65 */
17275+
/* 67 */
1725217276
/***/ (function(module, exports, __webpack_require__) {
1725317277

1725417278
const $ = __webpack_require__ (0)
@@ -17259,7 +17283,7 @@ $(document).on ( "cloudflare.scrape_shield.email_address_obfuscation.toggle", sw
1725917283

1726017284

1726117285
/***/ }),
17262-
/* 66 */
17286+
/* 68 */
1726317287
/***/ (function(module, exports, __webpack_require__) {
1726417288

1726517289
const $ = __webpack_require__ (0)
@@ -17270,7 +17294,7 @@ $(document).on ( "cloudflare.scrape_shield.hotlink_protection.toggle", switchEle
1727017294

1727117295

1727217296
/***/ }),
17273-
/* 67 */
17297+
/* 69 */
1727417298
/***/ (function(module, exports, __webpack_require__) {
1727517299

1727617300
const $ = __webpack_require__ (0)

0 commit comments

Comments
 (0)