feat: add reload button
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
24f2aff90a
commit
2032816eaa
@ -21,7 +21,14 @@ from members_lumbung_space.keycloak import init_keycloak
|
|||||||
from members_lumbung_space.nextcloud import init_resource_map
|
from members_lumbung_space.nextcloud import init_resource_map
|
||||||
from members_lumbung_space.oidc import init_oidc
|
from members_lumbung_space.oidc import init_oidc
|
||||||
from members_lumbung_space.redis import Redis, init_redis
|
from members_lumbung_space.redis import Redis, init_redis
|
||||||
from members_lumbung_space.routes import health, invite, oidc, register, root
|
from members_lumbung_space.routes import (
|
||||||
|
health,
|
||||||
|
invite,
|
||||||
|
oidc,
|
||||||
|
register,
|
||||||
|
resource,
|
||||||
|
root,
|
||||||
|
)
|
||||||
|
|
||||||
log = logging.getLogger("uvicorn")
|
log = logging.getLogger("uvicorn")
|
||||||
log.setLevel(APP_LOG_LEVEL)
|
log.setLevel(APP_LOG_LEVEL)
|
||||||
@ -73,3 +80,4 @@ app.include_router(oidc.router)
|
|||||||
app.include_router(register.router)
|
app.include_router(register.router)
|
||||||
app.include_router(root.router)
|
app.include_router(root.router)
|
||||||
app.include_router(health.router)
|
app.include_router(health.router)
|
||||||
|
app.include_router(resource.router)
|
||||||
|
16
members_lumbung_space/routes/resource.py
Normal file
16
members_lumbung_space/routes/resource.py
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
"""Resource map routes."""
|
||||||
|
|
||||||
|
from fastapi import APIRouter, Depends, Request
|
||||||
|
from fastapi.responses import RedirectResponse
|
||||||
|
|
||||||
|
from members_lumbung_space.dependencies import logged_in
|
||||||
|
|
||||||
|
router = APIRouter()
|
||||||
|
|
||||||
|
|
||||||
|
@router.get("/resource/generate", dependencies=[Depends(logged_in)])
|
||||||
|
async def generate_resource_map(request: Request):
|
||||||
|
from members_lumbung_space.nextcloud import init_resource_map
|
||||||
|
|
||||||
|
await init_resource_map(request.app)
|
||||||
|
return RedirectResponse(request.url_for("home"))
|
@ -48,8 +48,15 @@
|
|||||||
|
|
||||||
<div>
|
<div>
|
||||||
<h2>Resource map</h2>
|
<h2>Resource map</h2>
|
||||||
<p>(i have no idea how to render this)<p>
|
|
||||||
|
<p>
|
||||||
|
<a href="{{ url_for('generate_resource_map') }}">Regenerate</a>
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<p>(PS. i have no idea how to render this)<p>
|
||||||
|
|
||||||
<div>{{ resource_map }}</div>
|
<div>{{ resource_map }}</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
Loading…
Reference in New Issue
Block a user