v0.31.1
This commit is contained in:
1 parent
76b8bb7ee2
commit
24af7478b8
29 files changed
+321
-171
No files matched your search
@@ -1,14 +1,25 @@
|
||||
from pathlib import Path
|
||||
|
||||
APP_PARTS = ("core.js", "preferences.js", "config-history.js", "runtime.js", "settings.js")
|
||||
APP_PARTS = ("core.js", "refresh.js", "preferences.js", "config-history.js", "runtime.js", "settings.js")
|
||||
PANEL_PARTS = (
|
||||
"management.js", "drafts.js", "integrations.js", "vhosts.js",
|
||||
"web-server-profiles.js", "web-server.js", "docker.js", "streams.js",
|
||||
"redirects.js", "host404.js", "traffic-panel.js", "cache-panel.js",
|
||||
"transform-panel.js", "acme.js", "settings.js", "file-logs.js",
|
||||
)
|
||||
VHOST_PARTS = ("core.js", "health.js", "editor.js", "render.js")
|
||||
|
||||
def _read(root: Path, folder: str, parts: tuple[str, ...]) -> str:
|
||||
return "\n".join((root / "src/admin/web" / folder / part).read_text(encoding="utf-8") for part in parts)
|
||||
|
||||
def read_app_js(root: Path) -> str:
|
||||
return _read(root, "app", APP_PARTS)
|
||||
|
||||
def read_vhosts_js(root: Path) -> str:
|
||||
body = _read(root, "vhosts", VHOST_PARTS)
|
||||
return "(() => {\n" + body + "\n})();\n"
|
||||
return "(() => {\n" + body + "\n})();"
|
||||
|
||||
def read_app_js(root: Path) -> str:
|
||||
primary = _read(root, "app", APP_PARTS)
|
||||
panel = "\n".join(
|
||||
read_vhosts_js(root) if name == "vhosts.js" else (root / "src/admin/web" / name).read_text(encoding="utf-8")
|
||||
for name in PANEL_PARTS
|
||||
)
|
||||
return primary + "\n" + panel
|
||||
Reference in new issue
Block a user