mirror of
https://github.com/donlon/cloudflare-error-page.git
synced 2025-12-19 14:59:28 +00:00
editor/ui: support non-number error_code
This commit is contained in:
@@ -60,7 +60,7 @@
|
||||
// can be changed if specified by '?from=<name>'
|
||||
let initialConfig = {
|
||||
"title": "Internal server error",
|
||||
"error_code": 500,
|
||||
"error_code": '500',
|
||||
"more_information": {
|
||||
"hidden": false,
|
||||
"text": "cloudflare.com",
|
||||
@@ -92,11 +92,11 @@
|
||||
const PRESETS = {
|
||||
"default": structuredClone(initialConfig),
|
||||
"empty": {
|
||||
"error_code": 500,
|
||||
"error_code": '500',
|
||||
},
|
||||
"catastrophic": {
|
||||
"title": "Catastrophic infrastructure failure",
|
||||
"error_code": 500,
|
||||
"error_code": '500',
|
||||
"browser_status": {
|
||||
"status": "error",
|
||||
"status_text": "Out of Memory"
|
||||
@@ -117,7 +117,7 @@
|
||||
},
|
||||
"working": {
|
||||
"title": "Web server is working",
|
||||
"error_code": 200,
|
||||
"error_code": '200',
|
||||
"more_information": {
|
||||
"hidden": true
|
||||
},
|
||||
@@ -216,7 +216,7 @@
|
||||
function readConfig() {
|
||||
return {
|
||||
title: $('title').value,
|
||||
error_code: Number($('error_code').value) || 500,
|
||||
error_code: $('error_code').value,
|
||||
more_information: {
|
||||
hidden: !!$('more_hidden').checked,
|
||||
text: $('more_text').value,
|
||||
@@ -562,7 +562,7 @@
|
||||
<div class="form-row">
|
||||
<label for="error_code">Error Code</label>
|
||||
<div class="control">
|
||||
<input id="error_code" type="number" class="form-control form-control-sm" />
|
||||
<input id="error_code" class="form-control form-control-sm" placeholder="500" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user