style(webui): refine typography and spacing
This commit is contained in:
1 parent
1adaefdce6
commit
079bf8537a
4 files changed
+757
No files matched your search
@@ -27,6 +27,11 @@ BASE_DIR = (
|
||||
|
||||
_TRUE_LITERALS = {"1", "true", "yes", "y", "on"}
|
||||
_FALSE_LITERALS = {"0", "false", "no", "n", "off", ""}
|
||||
_EMPTY_PNG_BYTES = bytes.fromhex(
|
||||
"89504e470d0a1a0a0000000d4948445200000001000000010806000000"
|
||||
"1f15c4890000000a49444154789c636000000200015dc1b2ea00000000"
|
||||
"49454e44ae426082"
|
||||
)
|
||||
|
||||
|
||||
def _is_local_request(handler) -> bool:
|
||||
@@ -270,6 +275,14 @@ def handle_get(handler, u, runner, csrf_token: str) -> None:
|
||||
return
|
||||
full = os.path.join(str(path_config.PROJECT_ROOT), safe)
|
||||
if not os.path.isfile(full):
|
||||
if safe == "pic/screenshot.png":
|
||||
handler.send_response(HTTPStatus.OK)
|
||||
handler.send_header("Content-Type", "image/png")
|
||||
handler.send_header("Content-Length", str(len(_EMPTY_PNG_BYTES)))
|
||||
handler.send_header("Cache-Control", "no-store")
|
||||
handler.end_headers()
|
||||
handler.wfile.write(_EMPTY_PNG_BYTES)
|
||||
return
|
||||
handler.send_error(HTTPStatus.NOT_FOUND)
|
||||
return
|
||||
ext = os.path.splitext(full)[1].lower()
|
||||
|
||||
Reference in new issue
Block a user