Serve one alpha page: filters, roles, the tracker, and Jobs
/, GET /api/roles|companies|applications, POST /api/companies/{key}/affinity
and /api/applications[/{id}/status]. The Jinja2 template renders an empty
shell; static/app.js fills it and drives Save, affinity and status changes.
<desk-jobs> from pipeline.web mounts at the bottom so Pull can be started
from the page.
Store.roles gains q, function, remote, days and hide_muted, and company/
place move from a key match to a substring on the text a board wrote.
hide_muted filters in SQL before LIMIT: filtering after it shipped first and
broke immediately on real data, since Databricks' freshly pulled 884 roles
were the newest 200-plus rows in the table and muting it left nothing to
show.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
867ebe6405
commit
b44f78ca7e
13 files changed
+1143
-22
No files matched your search
+11
-14
@@ -1,23 +1,22 @@
|
||||
"""The application factory. A stub page until the reader lands: the queue's
|
||||
routes and socket from `pipeline.web.connect`, and a one-line index."""
|
||||
"""The application factory: the queue's routes and socket from
|
||||
`pipeline.web.connect`, roledesk's own JSON API, and the one page."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from pathlib import Path
|
||||
|
||||
from fastapi import FastAPI
|
||||
from fastapi.responses import HTMLResponse
|
||||
from fastapi.staticfiles import StaticFiles
|
||||
|
||||
from pipeline import Jobs
|
||||
from pipeline.web import connect
|
||||
from roledesk import config as config_mod
|
||||
from roledesk import jobs
|
||||
from roledesk.storage import Store
|
||||
from roledesk.web.api import router as api_router
|
||||
from roledesk.web.pages import router as pages_router
|
||||
|
||||
INDEX = """<!doctype html>
|
||||
<meta charset="utf-8"><title>roledesk</title>
|
||||
<p>roledesk: no reader yet.</p>
|
||||
<script type="module" src="/_jobs/jobs.js"></script>
|
||||
<desk-jobs></desk-jobs>
|
||||
"""
|
||||
WEB = Path(__file__).resolve().parent
|
||||
|
||||
|
||||
def create_app(config_path: str | None = None) -> FastAPI:
|
||||
@@ -31,11 +30,9 @@ def create_app(config_path: str | None = None) -> FastAPI:
|
||||
bootstrap=jobs.BOOTSTRAP, bootstrap_arg=config.path or "")
|
||||
app.state.config = config
|
||||
app.state.store = store
|
||||
|
||||
@app.get("/", response_class=HTMLResponse)
|
||||
def index() -> str:
|
||||
return INDEX
|
||||
|
||||
app.include_router(api_router)
|
||||
app.include_router(pages_router)
|
||||
app.mount("/static", StaticFiles(directory=WEB / "static"), name="static")
|
||||
return app
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user