feat(turnstile): двухконтурный учет СКУД, реестры исключений с автокомплитом 1С и калибровка таймзон
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
"""
|
||||
===============================================================================
|
||||
FILE: scripts/diagnostics/make_web_snapshot.py
|
||||
ROLE: Генерация слепка Web API, LLM-движка и клиентских скриптов.
|
||||
ROLE: Генерация актуального слепка Web API, фронтенда (HTML/JS) и LLM-движка.
|
||||
===============================================================================
|
||||
"""
|
||||
|
||||
@@ -12,37 +12,56 @@ ROOT_DIR = os.path.abspath(os.path.join(os.path.dirname(__file__), "..", ".."))
|
||||
OUTPUT_FILE = os.path.join(ROOT_DIR, "web_api_code_snapshot.md")
|
||||
|
||||
WEB_TARGET_FILES = [
|
||||
# Главная точка входа и роутеры
|
||||
"modules/web_api/main.py",
|
||||
"modules/web_api/routers/chat.py",
|
||||
"modules/web_api/routers/auth.py",
|
||||
"modules/web_api/routers/tasks.py",
|
||||
"modules/web_api/routers/remote_workers.py",
|
||||
"modules/web_api/routers/manual_absences.py",
|
||||
"modules/web_api/routers/exceptions.py",
|
||||
"modules/web_api/routers/snapshots.py",
|
||||
"modules/web_api/routers/tasks.py",
|
||||
"modules/web_api/routers/auth.py",
|
||||
"modules/web_api/routers/admin.py",
|
||||
"modules/web_api/routers/files.py",
|
||||
"modules/web_api/routers/context.py",
|
||||
|
||||
# LLM ядро
|
||||
"modules/web_api/llm/agent.py",
|
||||
"modules/web_api/llm/db_tools.py",
|
||||
"modules/web_api/llm/schemas.py",
|
||||
"modules/web_api/llm/core/context_manager.py",
|
||||
"modules/web_api/llm/core/tool_injector.py",
|
||||
"modules/web_api/llm/core/ollama_client.py",
|
||||
"modules/web_api/llm/db_tools.py",
|
||||
"modules/web_api/llm/core/fast_path.py",
|
||||
"modules/web_api/static/js/app.js",
|
||||
"modules/web_api/static/js/auth.js",
|
||||
"modules/web_api/llm/core/context_manager.py",
|
||||
"modules/web_api/llm/core/ollama_client.py",
|
||||
"modules/web_api/llm/core/tool_injector.py",
|
||||
|
||||
# Фронтенд (Разметка и клиентские скрипты)
|
||||
"modules/web_api/static/index.html",
|
||||
"modules/web_api/static/js/sidebar.js",
|
||||
"modules/web_api/static/js/tasks.js",
|
||||
"modules/web_api/static/js/manual_absences.js",
|
||||
"modules/web_api/static/js/chat/core.js",
|
||||
"modules/web_api/static/js/chat/task_widget.js"
|
||||
"modules/web_api/static/js/chat/task_widget.js",
|
||||
"modules/web_api/static/js/auth.js",
|
||||
"modules/web_api/static/js/app.js"
|
||||
]
|
||||
|
||||
|
||||
def create_web_snapshot():
|
||||
content = ["# 🌐 WEB API & LLM AGENT CODE SNAPSHOT\n"]
|
||||
content = ["# 🌐 WEB API & FRONTEND CODE SNAPSHOT\n"]
|
||||
included_count = 0
|
||||
|
||||
for rel_path in WEB_TARGET_FILES:
|
||||
full_path = os.path.join(ROOT_DIR, rel_path)
|
||||
if os.path.exists(full_path):
|
||||
ext = os.path.splitext(rel_path)[1].replace(".", "")
|
||||
lang = "js" if ext == "js" else ("py" if ext == "py" else "text")
|
||||
lang_map = {
|
||||
"js": "js",
|
||||
"py": "py",
|
||||
"html": "html",
|
||||
"css": "css",
|
||||
"json": "json"
|
||||
}
|
||||
lang = lang_map.get(ext, "text")
|
||||
try:
|
||||
with open(full_path, "r", encoding="utf-8") as f:
|
||||
file_text = f.read()
|
||||
@@ -50,12 +69,14 @@ def create_web_snapshot():
|
||||
included_count += 1
|
||||
except Exception as e:
|
||||
print(f"[⚠️] Ошибка чтения {rel_path}: {e}")
|
||||
else:
|
||||
print(f"[ℹ️] Пропущен отсутствующий файл: {rel_path}")
|
||||
|
||||
with open(OUTPUT_FILE, "w", encoding="utf-8") as f:
|
||||
f.write("\n".join(content))
|
||||
|
||||
size_kb = os.path.getsize(OUTPUT_FILE) / 1024
|
||||
print(f"\n[✓] Web API слепок создан: {OUTPUT_FILE}")
|
||||
print(f"\n[✓] Web API + Фронтенд слепок создан: {OUTPUT_FILE}")
|
||||
print(f" Включено файлов: {included_count} | Размер: {size_kb:.1f} KB\n")
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user