Cleanup styles and add Sanic palette
This commit is contained in:
parent
47b2459811
commit
a773ad2354
@ -30,7 +30,7 @@ class ErrorPage(BasePage):
|
|||||||
# FIXME: This needs to be done some place else but I am not digging into that now.
|
# FIXME: This needs to be done some place else but I am not digging into that now.
|
||||||
if "Internal Server Error" in title:
|
if "Internal Server Error" in title:
|
||||||
text = "The application encountered an unexpected error and could not continue."
|
text = "The application encountered an unexpected error and could not continue."
|
||||||
self.TITLE = E(f"App {request.app.name} cannot handle your request")
|
self.TITLE = E.strong(request.app.name)(" cannot handle your request")
|
||||||
self.title = title
|
self.title = title
|
||||||
self.text = text
|
self.text = text
|
||||||
self.request = request
|
self.request = request
|
||||||
@ -53,7 +53,7 @@ class ErrorPage(BasePage):
|
|||||||
context = getattr(self.exc, "context", None)
|
context = getattr(self.exc, "context", None)
|
||||||
if context:
|
if context:
|
||||||
self._key_value_table(
|
self._key_value_table(
|
||||||
"Exception context", "exception-context", context
|
"Issue context", "exception-context", context
|
||||||
)
|
)
|
||||||
|
|
||||||
if not debug:
|
if not debug:
|
||||||
@ -89,13 +89,13 @@ class ErrorPage(BasePage):
|
|||||||
def _key_value_table(
|
def _key_value_table(
|
||||||
self, title: str, table_id: str, data: Mapping[str, Any]
|
self, title: str, table_id: str, data: Mapping[str, Any]
|
||||||
) -> None:
|
) -> None:
|
||||||
with self.doc.table(id=table_id, class_="key-value-table"):
|
with self.doc.table(id=table_id, class_="key-value-table smalltext"):
|
||||||
self.doc.caption(title)
|
self.doc.caption(title)
|
||||||
for key, value in data.items():
|
for key, value in data.items():
|
||||||
try:
|
try:
|
||||||
self.doc.tr.td(key, class_="nobr key").td(value)
|
self.doc.tr.td(key, class_="nobr key").td(value)
|
||||||
# Printing values may cause a new exception, so suppress it
|
# Printing values may cause a new exception, so suppress it
|
||||||
except Exception:
|
except Exception:
|
||||||
self.doc.tr.td(key, class_="nobr key").td(
|
self.doc.tr.td(key, class_="nobr key").td.em(
|
||||||
E.em("Unable to display value")
|
"Unable to display value"
|
||||||
)
|
)
|
||||||
|
@ -8,7 +8,11 @@ html {
|
|||||||
body {
|
body {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
font-size: 1.25rem;
|
font-size: 1.25rem;
|
||||||
--accent: #ff0d68;
|
--sanic: #ff0d68;
|
||||||
|
--sanic-blue: #0092FF;
|
||||||
|
--sanic-yellow: #FFE900;
|
||||||
|
--sanic-purple: #833FE3;
|
||||||
|
--sanic-green: #16DB93;
|
||||||
}
|
}
|
||||||
|
|
||||||
body>* {
|
body>* {
|
||||||
|
@ -4,14 +4,13 @@ summary {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.tracerite {
|
.tracerite {
|
||||||
/* --color-var: var(--accent);
|
--color-var: var(--sanic-blue);
|
||||||
--color-val: #ff0; */
|
--color-val: var(--sanic-green);
|
||||||
--color-type: var(--accent);
|
--color-type: var(--sanic-purple);
|
||||||
}
|
}
|
||||||
|
|
||||||
.key-value-table {
|
.key-value-table {
|
||||||
margin: 2rem 0;
|
margin: 2rem 0;
|
||||||
border-collapse: collapse;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.key-value-table caption {
|
.key-value-table caption {
|
||||||
@ -21,32 +20,3 @@ summary {
|
|||||||
font-weight: 700;
|
font-weight: 700;
|
||||||
padding-bottom: 0.5rem;
|
padding-bottom: 0.5rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
.key-value-table td {
|
|
||||||
font-size: 1rem;
|
|
||||||
font-family: monospace;
|
|
||||||
border: 1px solid #888;
|
|
||||||
padding: 0.25rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
.key-value-table .key {
|
|
||||||
color: var(--accent)
|
|
||||||
}
|
|
||||||
|
|
||||||
mark {
|
|
||||||
position: relative;
|
|
||||||
}
|
|
||||||
|
|
||||||
mark[data-symbol="💣"]::before {
|
|
||||||
content: "Exception raised";
|
|
||||||
display: none;
|
|
||||||
position: absolute;
|
|
||||||
top: -1.25em;
|
|
||||||
right: 0;
|
|
||||||
padding: 0.25em;
|
|
||||||
background-color: var(--accent);
|
|
||||||
}
|
|
||||||
|
|
||||||
mark[data-symbol="💣"]:hover::before {
|
|
||||||
display: block;
|
|
||||||
}
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user