This commit is contained in:
@@ -320,7 +320,7 @@ YOUTUBE_API_KEY = os.getenv('YOUTUBE_API_KEY', '')
|
||||
# ==========================================
|
||||
# 系統版本與路徑
|
||||
# ==========================================
|
||||
SYSTEM_VERSION = "V10.165"
|
||||
SYSTEM_VERSION = "V10.166"
|
||||
LOG_FILE_PATH = os.path.join(BASE_DIR, 'logs/system.log')
|
||||
public_url = PUBLIC_URL # 用於模板顯示
|
||||
|
||||
|
||||
@@ -24,6 +24,7 @@ CSS_PATH = Path("static/css/observability-system.css")
|
||||
WEB_CSS_PATH = Path("web/static/css/observability-system.css")
|
||||
SHELL_PATH = Path("templates/components/_ewoooc_shell.html")
|
||||
BASE_PATH = Path("templates/ewoooc_base.html")
|
||||
BASE_JS_PATH = Path("web/static/js/ewoooc-base.js")
|
||||
ROUTE_PATH = Path("routes/admin_observability_routes.py")
|
||||
|
||||
|
||||
@@ -286,9 +287,17 @@ def scan_base_topbar() -> list[str]:
|
||||
return [f"{BASE_PATH}: missing required base/topbar file"]
|
||||
|
||||
text = path.read_text(encoding="utf-8")
|
||||
findings = scan_required_snippets(BASE_PATH, REQUIRED_BASE_SNIPPETS, "base/topbar")
|
||||
js_path = ROOT / BASE_JS_PATH
|
||||
js_text = js_path.read_text(encoding="utf-8") if js_path.exists() else ""
|
||||
combined_text = f"{text}\n{js_text}"
|
||||
findings: list[str] = []
|
||||
if not js_path.exists():
|
||||
findings.append(f"{BASE_JS_PATH}: missing required base/topbar JS file")
|
||||
for snippet in REQUIRED_BASE_SNIPPETS:
|
||||
if snippet not in combined_text:
|
||||
findings.append(f"{BASE_PATH}: missing required base/topbar snippet `{snippet}`")
|
||||
for rule in FORBIDDEN_BASE_PATTERNS:
|
||||
for match in rule.pattern.finditer(text):
|
||||
for match in rule.pattern.finditer(combined_text):
|
||||
line = line_number(text, match.start())
|
||||
snippet = match.group(0).replace("\n", " ")[:90]
|
||||
findings.append(
|
||||
|
||||
Reference in New Issue
Block a user