Skip to content

Commit

Permalink
Default HTTP 404/500 error pages
Browse files Browse the repository at this point in the history
  • Loading branch information
drmad committed Feb 29, 2024
1 parent 6a8f379 commit 261d735
Show file tree
Hide file tree
Showing 4 changed files with 85 additions and 0 deletions.
57 changes: 57 additions & 0 deletions base/resources/views/http-status/404-debug.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
<html>
<head><style>
body{margin: 0px; font-family: sans-serif}
header{background: #008080; color: white; padding: 15px}
section{padding: 10px;}
h1{margin: 0px; font-weight: normal; font-size: 200%}
h2{margin: 0px; font-weight: normal; font-size: 120%}
a[data-code] {color: #AAF; font-size: 80%; font-variant: small-caps; border: 1px solid #AAF; border-radius: 10px; padding: 0px 10px; }
a[data-code].hidden {display: none}

li {font-family: monospace}
div.code-line span.class{color: #008080}
div.code-line span.method{color: #008080; font-weight: bold}
div.code-line span.args{color: #888}

table {font-family: monospace; border-collapse:collapse; width: 100%}

table.code {table-layout: fixed; border: 1px solid #eee; margin: 10px 0px; display: none; max-width: 50vw;overflow: hidden}
table.code td:first-child{width: 25px; background: #eee;color:#aaa;text-align: right; padding: 0px 10px; user-select: none}
table.code td:nth-child(2){width: 100%; padding-left: 20px; white-space: pre; overflow: hidden}
table.code tr.selected{background: #FFA}
table.code tr.selected td:first-child {color: black; font-weight: bold}
table.information th {width: 200px; text-align: right; background: #e0eeee; padding: 2px 4px; vertical-align: top}
table.information td {padding-left: 10px; border-bottom: 1px solid #eee}

span.methods {font-weight: bold; color: #008080}
span.path {font-weight: bold}
span.empty {font-style: italic}
</style>
<title>Not found</title>
</head>
<body>
<header>
<h1>Unmatched routing rule</h1>
<h2><?=$target?></h2>
</header>

<main><section>
<h2>Routing rules</h2>
<ul>
<?php foreach($rules as $rule):?>
<li>
<span class="methods"><?=$rule['methods']?></span>
<?php if ($rule['path']):?>
<span class="path"><?=$rule['path']?></span>
<?php else: ?>
<span class="empty">(empty)</span>
<?php endif?>

🠒
<span class="target"><?=$rule['target']?></span>
</li>
<?php endforeach ?>
</ul>
</section></main>
</body>
</html>
14 changes: 14 additions & 0 deletions base/resources/views/http-status/404.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<html>
<style>
body {height: 100%; font-family: sans-serif}
main {position: relative; width: 350px; top: 50%; left: 50%; transform: translate(-50%,-50%)}
h1 {font-size: 400%}
</style>
<main>
<h1>Nop.</h1>
<p>This page doesn't exists</p>
<p>
<a href="javascript:history.back()">&laquo; Go back</a> &bull;
</p>
</main>
</html>
Empty file.
14 changes: 14 additions & 0 deletions base/resources/views/http-status/500.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<html>
<style>
body {height: 100%; font-family: sans-serif}
main {position: relative; width: 350px; top: 50%; left: 50%; transform: translate(-50%,-50%)}
h1 {font-size: 400%}
</style>
<main>
<h1>Oops! 😱</h1>
<p>Something has gone terribly wrong. Please retry in a few moments.</p>
<p>
<a href="javascript:history.back()">&laquo; Go back</a>
</p>
</main>
</html>

0 comments on commit 261d735

Please sign in to comment.