Add instance nav prefs, env config UI, and PM2 restart.
P1-P4: configurable nav/section visibility in system settings, full .env editor with restart badges, password change, runtime hot overrides, and single-instance pm2 restart. Works in hub embed iframe. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -19,6 +19,7 @@ EMBED_TABS: tuple[str, ...] = (
|
||||
"records",
|
||||
"stats",
|
||||
"risk_policy",
|
||||
"env_config",
|
||||
"settings",
|
||||
)
|
||||
|
||||
@@ -34,6 +35,7 @@ PATH_TO_EMBED_TAB: dict[str, str] = {
|
||||
"/records": "records",
|
||||
"/stats": "stats",
|
||||
"/risk_policy": "risk_policy",
|
||||
"/env_config": "env_config",
|
||||
"/settings": "settings",
|
||||
}
|
||||
|
||||
@@ -166,6 +168,9 @@ def register_embed_routes(
|
||||
tab = (tab or "").strip()
|
||||
if tab not in EMBED_TABS:
|
||||
return jsonify({"ok": False, "msg": "unknown tab"}), 404
|
||||
allowed_fn = app.config.get("INSTANCE_TAB_ALLOWED_FN")
|
||||
if callable(allowed_fn) and not allowed_fn(tab):
|
||||
return jsonify({"ok": False, "msg": "tab disabled"}), 403
|
||||
html = render_main_page_fn(tab, embed_mode="fragment")
|
||||
if isinstance(html, Response):
|
||||
html = html.get_data(as_text=True)
|
||||
|
||||
Reference in New Issue
Block a user