9
0
mirror of https://github.com/donlon/cloudflare-error-page.git synced 2025-12-19 14:59:28 +00:00

miscellaneous updates

This commit is contained in:
Anthony Donlon
2025-12-09 22:17:34 +08:00
parent 46b4c99e72
commit d1dc6b3bc2
5 changed files with 19 additions and 26 deletions

View File

@@ -28,8 +28,8 @@
<meta name="viewport" content="width=device-width,initial-scale=1" />
<script src="https://cdn.jsdelivr.net/npm/ejs@3.1.10/ejs.min.js"></script>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet">
<script src="https://virt.moe/assets/cloudflare-error-page/ejs.min.js"></script>
<link href="https://virt.moe/assets/cloudflare-error-page/bootstrap.min.css" rel="stylesheet">
<script>
(async function () {
@@ -331,6 +331,8 @@
doc.write(pageHtml);
doc.close();
updateStatusBlockStyles();
// store last rendered HTML for "open in new tab"
lastRenderedHtml = pageHtml;
}
@@ -426,7 +428,6 @@
inp.addEventListener('input', debounce(() => {
// Update status block color classes for quick visual feedback in the editor
render();
updateStatusBlockStyles();
}, 200));
// for radio change events (error_source)
if (inp.type === 'radio') inp.addEventListener('change', () => { render(); });
@@ -595,7 +596,7 @@
<div class="form-row mb-3">
<label for="presetSelect">Preset</label>
<select id="presetSelect" class="form-select form-select-sm">
<option value="default">Default</option>
<option value="default">Internal server error (Default)</option>
<option value="empty">Empty</option>
<option value="catastrophic">Catastrophic failure</option>
<option value="working">Server working</option>
@@ -838,10 +839,10 @@
</div>
<div class="mt-2 text-center">&gt;&gt; Star this project on
<a href="https://github.com/donlon/cloudflare-error-page" target="_blank">Github</a>
<a href="https://github.com/donlon/cloudflare-error-page" target="_blank">GitHub</a>
</div>
<div class="mt-2" style="font-size: 0.9em;">You can also embed the error page into your own website. See
<div class="mt-2" style="font-size: 0.9em;">You can also embed this error page into your own website. See
<a href="https://github.com/donlon/cloudflare-error-page#quickstart-for-programmers"
target="_blank">Quickstart</a> in the
homepage for steps.
@@ -862,10 +863,5 @@
</div>
</div>
<!-- JS: Bootstrap bundle -->
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js"></script>
</body>
</html>
</html>

View File

@@ -7,7 +7,7 @@ BEHIND_PROXY = true
# Some random secret, will be auto-generated if empty
SECRET_KEY = ''
# Main database URL
# Main database URI
SQLALCHEMY_DATABASE_URI = 'sqlite:///database.db'
# Rate limit storage for Flask-Limiter

View File

@@ -0,0 +1,3 @@
Flask
Flask-Limiter
Flask-SqlAlchemy

View File

@@ -113,7 +113,7 @@ def get(name: str):
params['creator_info'] = {
'hidden': False,
'text': 'CF Error Page Editor',
'link': f'https://virt.moe/cloudflare-error-page/editor/#from={name}',
'link': request.host_url[:-1] + url_for('editor.index') + f'#from={name}',
}
# Always escape HTML
params['what_happened'] = html.escape(params.get('what_happened', '')) # TODO: common render function?