An admin interface that builds itself from the dbbasic modules you install; its pages follow file paths, like CGI.

0 downloads

Download zip
Clone
Clone with git
git clone https://gitstable.com/git/askrobots/dbbasic-admin.git
HTTPS
https://gitstable.com/git/askrobots/dbbasic-admin.git
SSH
ssh://git@gitstable.com:2222/askrobots/dbbasic-admin.git

Cloning needs no sign-in. Pushing over HTTPS asks for your username and an access token. SSH needs your key under SSH keys.

danq9 Add automatic TSV discovery and admin handlers 5e2fd8f 1 year, 1 month ago History
nav.py · 624 bytes · 26 lines
1"""
2API endpoint for navigation items.
3
4Route: /admin/api/nav
5Returns: JSON array of navigation items
6"""
7
8import json
9from dbbasic_web.responses import json as json_response
10from dbbasic_admin.admin import build_nav
11
12
13def handle(request):
14 """
15 Return navigation items as JSON.
16
17 This endpoint is called by the admin UI to dynamically
18 build the sidebar navigation from core + discovered modules.
19
20 Returns:
21 JSON response with nav items array
22 """
23 nav_items = build_nav()
24
25 # Return as JSON using dbbasic_web's json response helper
26 return json_response(json.dumps(nav_items, indent=2))