mirror of
https://github.com/donlon/cloudflare-error-page.git
synced 2025-12-19 14:59:28 +00:00
miscellaneous fixes
This commit is contained in:
@@ -8,7 +8,7 @@ from flask import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
root_dir = os.path.join(os.path.dirname(os.path.abspath(__file__)), '../../')
|
root_dir = os.path.join(os.path.dirname(os.path.abspath(__file__)), '../../')
|
||||||
res_folder = os.path.join(root_dir, 'editor/frontend/dist')
|
res_folder = os.path.join(root_dir, 'editor/web/dist')
|
||||||
|
|
||||||
bp = Blueprint('editor', __name__, url_prefix='/')
|
bp = Blueprint('editor', __name__, url_prefix='/')
|
||||||
|
|
||||||
|
|||||||
@@ -39,7 +39,6 @@ def get_page_params(name: str) -> dict:
|
|||||||
@bp.route('/', defaults={'name': 'default'})
|
@bp.route('/', defaults={'name': 'default'})
|
||||||
@bp.route('/<path:name>')
|
@bp.route('/<path:name>')
|
||||||
def index(name: str):
|
def index(name: str):
|
||||||
name = os.path.basename(name) # keep only the base name
|
|
||||||
lower_name = name.lower()
|
lower_name = name.lower()
|
||||||
if name != lower_name:
|
if name != lower_name:
|
||||||
return redirect(lower_name)
|
return redirect(lower_name)
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
<meta charset="utf-8" />
|
<meta charset="utf-8" />
|
||||||
<title>Cloudflare Error Page Editor</title>
|
<title>Cloudflare Error Page Editor</title>
|
||||||
|
|
||||||
<meta name="description" content="Online editor to create customized Cloudflare-styled error pages.">
|
<meta name="description" content="Online editor to create customized Cloudflare-style error pages.">
|
||||||
<meta name="keywords" content="cloudflare,error,page,editor">
|
<meta name="keywords" content="cloudflare,error,page,editor">
|
||||||
<link rel="canonical" href="https://virt.moe/cferr/editor/" />
|
<link rel="canonical" href="https://virt.moe/cferr/editor/" />
|
||||||
|
|
||||||
@@ -19,12 +19,12 @@
|
|||||||
<meta property="og:site_name" content="moe::virt" />
|
<meta property="og:site_name" content="moe::virt" />
|
||||||
<meta property="og:title" content="Cloudflare error page editor" />
|
<meta property="og:title" content="Cloudflare error page editor" />
|
||||||
<meta property="og:url" content="https://virt.moe/cferr/editor/" />
|
<meta property="og:url" content="https://virt.moe/cferr/editor/" />
|
||||||
<meta property="og:description" content="Online editor to create customized Cloudflare-styled error pages" />
|
<meta property="og:description" content="Online editor to create customized Cloudflare-style error pages" />
|
||||||
|
|
||||||
<meta property="twitter:card" content="summary" />
|
<meta property="twitter:card" content="summary" />
|
||||||
<meta property="twitter:site" content="moe::virt" />
|
<meta property="twitter:site" content="moe::virt" />
|
||||||
<meta property="twitter:title" content="Cloudflare error page editor" />
|
<meta property="twitter:title" content="Cloudflare error page editor" />
|
||||||
<meta property="twitter:description" content="Online editor to create customized Cloudflare-styled error pages" />
|
<meta property="twitter:description" content="Online editor to create customized Cloudflare-style error pages" />
|
||||||
|
|
||||||
<meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1" />
|
<meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1" />
|
||||||
|
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ const PRESETS = {
|
|||||||
title: 'Catastrophic infrastructure failure',
|
title: 'Catastrophic infrastructure failure',
|
||||||
error_code: '500',
|
error_code: '500',
|
||||||
more_information: {
|
more_information: {
|
||||||
for: 'no information',
|
for: 'no help at all',
|
||||||
},
|
},
|
||||||
browser_status: {
|
browser_status: {
|
||||||
status: 'error',
|
status: 'error',
|
||||||
@@ -136,7 +136,10 @@ function getDefaultPresetName() {
|
|||||||
const key = 'from';
|
const key = 'from';
|
||||||
let name = extractUrlParam(window.location.search, key);
|
let name = extractUrlParam(window.location.search, key);
|
||||||
if (!name) {
|
if (!name) {
|
||||||
name = extractUrlParam(window.location.hash.substr(1), key);
|
name = extractUrlParam(window.location.hash.substring(1), key);
|
||||||
|
}
|
||||||
|
if (name) {
|
||||||
|
name = name.replace(/[^\w\d]/g, '')
|
||||||
}
|
}
|
||||||
return name;
|
return name;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"title": "Catastrophic infrastructure failure",
|
"title": "Catastrophic infrastructure failure",
|
||||||
"more_information": {
|
"more_information": {
|
||||||
"for": "no information"
|
"for": "no help at all"
|
||||||
},
|
},
|
||||||
"browser_status": {
|
"browser_status": {
|
||||||
"status": "error",
|
"status": "error",
|
||||||
|
|||||||
Reference in New Issue
Block a user