refactor: update imports fabledscryer → roundtable
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1 +1 @@
|
||||
# fabledscryer/settings/__init__.py
|
||||
# roundtable/settings/__init__.py
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
# fabledscryer/settings/routes.py
|
||||
# roundtable/settings/routes.py
|
||||
from __future__ import annotations
|
||||
import json
|
||||
import logging
|
||||
from pathlib import Path
|
||||
from quart import Blueprint, current_app, render_template, request, redirect, url_for, session
|
||||
|
||||
from fabledscryer.auth.middleware import require_role
|
||||
from fabledscryer.core.audit import log_audit
|
||||
from fabledscryer.models.users import UserRole
|
||||
from fabledscryer.core.settings import (
|
||||
from roundtable.auth.middleware import require_role
|
||||
from roundtable.core.audit import log_audit
|
||||
from roundtable.models.users import UserRole
|
||||
from roundtable.core.settings import (
|
||||
DEFAULTS, get_all_settings, set_setting,
|
||||
to_smtp_cfg, to_webhook_cfg, to_ansible_cfg, to_plugins_cfg,
|
||||
to_oidc_cfg, to_ldap_cfg,
|
||||
@@ -232,12 +232,12 @@ async def ansible_sync_source(idx: int):
|
||||
source = sources[idx]
|
||||
if source.get("type") != "git":
|
||||
return '<span style="color:var(--text-muted);font-size:0.8rem;">Not a git source</span>'
|
||||
from fabledscryer.ansible.sources import git_pull
|
||||
from fabledscryer.core.settings import to_ansible_cfg
|
||||
from roundtable.ansible.sources import git_pull
|
||||
from roundtable.core.settings import to_ansible_cfg
|
||||
async with current_app.db_sessionmaker() as db:
|
||||
settings = await get_all_settings(db)
|
||||
ansible_cfg = to_ansible_cfg(settings)
|
||||
from fabledscryer.ansible.sources import get_sources
|
||||
from roundtable.ansible.sources import get_sources
|
||||
resolved = next((s for s in get_sources(ansible_cfg) if s["name"] == source["name"]), None)
|
||||
if resolved is None:
|
||||
return '<span style="color:var(--red);font-size:0.8rem;">Could not resolve source path</span>'
|
||||
@@ -295,7 +295,7 @@ async def save_auth_settings():
|
||||
await log_audit(current_app, session.get("user_id"), session.get("username", ""),
|
||||
"settings.saved", detail={"section": "auth"})
|
||||
# Clear OIDC discovery cache so new settings take effect
|
||||
from fabledscryer.auth.oidc import _discovery_cache
|
||||
from roundtable.auth.oidc import _discovery_cache
|
||||
_discovery_cache.clear()
|
||||
return redirect(url_for("settings.auth_settings"))
|
||||
|
||||
@@ -327,7 +327,7 @@ async def save_reports():
|
||||
@settings_bp.post("/reports/send-now/")
|
||||
@require_role(UserRole.admin)
|
||||
async def send_report_now():
|
||||
from fabledscryer.core.reports import send_report
|
||||
from roundtable.core.reports import send_report
|
||||
async with current_app.db_sessionmaker() as db:
|
||||
settings = await get_all_settings(db)
|
||||
ok, message = await send_report(current_app._get_current_object())
|
||||
@@ -442,7 +442,7 @@ async def plugin_detail(name: str):
|
||||
if plugin is None:
|
||||
return redirect(url_for("settings.plugins"))
|
||||
_merge_plugin_config([plugin], to_plugins_cfg(settings))
|
||||
from fabledscryer.core.plugin_manager import _LOADED_PLUGINS, get_plugin_failures
|
||||
from roundtable.core.plugin_manager import _LOADED_PLUGINS, get_plugin_failures
|
||||
return await render_template(
|
||||
"settings/plugin_detail.html",
|
||||
plugin=plugin,
|
||||
@@ -471,7 +471,7 @@ async def save_plugin_detail(name: str):
|
||||
await set_setting(db, f"plugin.{name}", plugin_cfg)
|
||||
|
||||
await _reload_app_config()
|
||||
from fabledscryer.core.plugin_index import clear_catalog_cache
|
||||
from roundtable.core.plugin_index import clear_catalog_cache
|
||||
clear_catalog_cache()
|
||||
|
||||
new_enabled = plugin_cfg.get("enabled", False)
|
||||
@@ -480,7 +480,7 @@ async def save_plugin_detail(name: str):
|
||||
await log_audit(current_app, session.get("user_id"), session.get("username", ""),
|
||||
action, entity_type="plugin", entity_id=name)
|
||||
if new_enabled and not old_enabled:
|
||||
from fabledscryer.core.plugin_manager import hot_reload_plugin
|
||||
from roundtable.core.plugin_manager import hot_reload_plugin
|
||||
hot_reload_plugin(current_app._get_current_object(), name)
|
||||
|
||||
if name == "ups":
|
||||
@@ -505,7 +505,7 @@ async def plugin_repos_add():
|
||||
async with current_app.db_sessionmaker() as db:
|
||||
async with db.begin():
|
||||
await _save_plugin_repos(db, repos)
|
||||
from fabledscryer.core.plugin_index import clear_catalog_cache
|
||||
from roundtable.core.plugin_index import clear_catalog_cache
|
||||
clear_catalog_cache()
|
||||
return await _plugin_repos_partial({"plugins.repositories": repos})
|
||||
|
||||
@@ -521,7 +521,7 @@ async def plugin_repos_remove(idx: int):
|
||||
async with current_app.db_sessionmaker() as db:
|
||||
async with db.begin():
|
||||
await _save_plugin_repos(db, repos)
|
||||
from fabledscryer.core.plugin_index import clear_catalog_cache
|
||||
from roundtable.core.plugin_index import clear_catalog_cache
|
||||
clear_catalog_cache()
|
||||
return await _plugin_repos_partial({"plugins.repositories": repos})
|
||||
|
||||
@@ -541,7 +541,7 @@ async def plugin_repos_save(idx: int):
|
||||
async with current_app.db_sessionmaker() as db:
|
||||
async with db.begin():
|
||||
await _save_plugin_repos(db, repos)
|
||||
from fabledscryer.core.plugin_index import clear_catalog_cache
|
||||
from roundtable.core.plugin_index import clear_catalog_cache
|
||||
clear_catalog_cache()
|
||||
return await _plugin_repos_partial({"plugins.repositories": repos})
|
||||
|
||||
@@ -595,8 +595,8 @@ async def plugins_catalog():
|
||||
error="No plugin repositories configured.",
|
||||
)
|
||||
|
||||
from fabledscryer.core.plugin_index import fetch_catalog
|
||||
from fabledscryer.core.plugin_manager import _LOADED_PLUGINS
|
||||
from roundtable.core.plugin_index import fetch_catalog
|
||||
from roundtable.core.plugin_manager import _LOADED_PLUGINS
|
||||
|
||||
force = request.args.get("refresh") == "1"
|
||||
try:
|
||||
@@ -637,7 +637,7 @@ async def install_plugin(name: str):
|
||||
message="No download URL provided.",
|
||||
)
|
||||
|
||||
from fabledscryer.core.plugin_manager import download_and_install_plugin, hot_reload_plugin
|
||||
from roundtable.core.plugin_manager import download_and_install_plugin, hot_reload_plugin
|
||||
|
||||
ok, msg = await download_and_install_plugin(
|
||||
current_app._get_current_object(), name, download_url, checksum
|
||||
@@ -671,7 +671,7 @@ async def install_plugin(name: str):
|
||||
@require_role(UserRole.admin)
|
||||
async def reload_plugin(name: str):
|
||||
"""Hot-reload a plugin that was installed but not yet active."""
|
||||
from fabledscryer.core.plugin_manager import hot_reload_plugin
|
||||
from roundtable.core.plugin_manager import hot_reload_plugin
|
||||
ok, msg = hot_reload_plugin(current_app._get_current_object(), name)
|
||||
return await render_template(
|
||||
"settings/_install_result.html",
|
||||
@@ -687,7 +687,7 @@ async def reload_plugin(name: str):
|
||||
async def restart_app_route():
|
||||
"""Trigger an in-app restart (replaces the process via os.execv)."""
|
||||
import asyncio
|
||||
from fabledscryer.core.plugin_manager import restart_app
|
||||
from roundtable.core.plugin_manager import restart_app
|
||||
|
||||
# Schedule the restart slightly after we return the response
|
||||
async def _delayed_restart():
|
||||
|
||||
Reference in New Issue
Block a user