diff --git a/.gitignore b/.gitignore index f8a110f..38da6d9 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,2 @@ __pycache__/ -message.sqlite3 +.vscode/ diff --git a/.vscode/settings.json b/.vscode/settings.json deleted file mode 100644 index bda2103..0000000 --- a/.vscode/settings.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "cSpell.words": [ - "corsheaders", - "TAUTH", - "TCOMMON" - ] -} diff --git a/config.py b/config.py index 3a1cc49..fe03ac0 100644 --- a/config.py +++ b/config.py @@ -24,5 +24,6 @@ ENABLED_APPLICATIONS: dict[str, Literal[False] | None | tuple[str, str, str]] = # The tokens set here should match the tokens in other services. If they don't, the service will refuse to start. # "service": ("token", "internal_url", "public_url") "auth": ("Secret tAuth-specific token", "http://localhost:8000", "http://localhost:8000"), - "message": ("Secret tMessage-specific token", "http://localhost:8001", "http://localhost:8001") + "message": ("Secret tMessage-specific token", "http://localhost:8001", "http://localhost:8001"), + "blog": ("Secret tBlog-specific token", "http://localhost:8002", "http://localhost:8002") } diff --git a/tcommon/static/css/base.css b/tcommon/static/css/base.css index 0b39a9d..1f960e7 100644 --- a/tcommon/static/css/base.css +++ b/tcommon/static/css/base.css @@ -29,6 +29,10 @@ body { color: rgb(var(--base)); } +::-webkit-scrollbar { + display: none; +} + code, pre:not(.not-code) { font-family: "Ubuntu Mono"; background-color: rgb(var(--mantle)); @@ -117,7 +121,8 @@ textarea:focus { } input[type="submit"], -button { +button, +select { background-color: rgb(var(--mantle)); color: rgb(var(--text)); font-family: "DejaVu Sans"; @@ -131,6 +136,10 @@ button { transition: outline-color 0.25s, background-color 0.25s; } +select { + border-radius: 4px +} + input[type="checkbox"] { display: block; height: 0; @@ -174,8 +183,8 @@ input[type="checkbox"]:checked + label[data-fake-checkbox]::before { background-color: rgb(var(--accent)); } -ul, -ol { +small ul, +small ol { padding-left: 15px; } @@ -228,7 +237,7 @@ button:active { @keyframes kf-success-anim { 0% { - outline-color: rgba(var(--green), 255); + outline-color: rgba(var(--green), 100%); } 100% { @@ -236,6 +245,10 @@ button:active { } } +.success { color: rgb(var(--green)); } +.warning { color: rgb(var(--yellow)); } +.error { color: rgb(var(--red)); } + #container { text-align: center; padding: 10px; diff --git a/tcommon/static/js/base.js b/tcommon/static/js/base.js index 83aa9d6..7ca301d 100644 --- a/tcommon/static/js/base.js +++ b/tcommon/static/js/base.js @@ -29,5 +29,15 @@ function refreshTimestamps() { } } +function onLoad() { + for (const el of document.querySelectorAll("[data-localize-number]")) { + el.innerText = (new Intl.NumberFormat()).format(+el.dataset.localizeNumber); + } + + refreshTimestamps(); +} + +window.onload = onLoad; + setInterval(refreshTimestamps, 5000); refreshTimestamps(); diff --git a/tcommon/views/api.py b/tcommon/views/api.py index d0b34fb..f2cf938 100644 --- a/tcommon/views/api.py +++ b/tcommon/views/api.py @@ -39,7 +39,7 @@ def initialize(request: WSGIRequest) -> HttpResponse: } for service in [ - "auth", "message" + "auth", "message", "blog" ]: if service in ENABLED_APPLICATIONS and isinstance(s := ENABLED_APPLICATIONS[service], tuple): resp["services"][service] = {