Add typed depot logistics visibility, auto-strike, 16-block reach, and web panel controls
build / mod (push) Failing after 15s

This commit is contained in:
2026-12-04 13:37:54 +03:00
parent a02b7d1177
commit 76ef94b537
31 changed files with 2225 additions and 106 deletions
+20
View File
@@ -262,6 +262,26 @@ class Handler(BaseHTTPRequestHandler):
if data is None:
raise APIError(HTTPStatus.NOT_FOUND, "Кадр отсутствует в сохранённой карте")
return self.reply(HTTPStatus.OK, data)
if (verb, path) == ("POST", "/api/action"):
if not launch:
raise APIError(HTTPStatus.FORBIDDEN, "Управление требует доступа оператора")
body = self.body()
key, session = body["id"], body["session"]
act, value = body["action"], body["value"]
if (
not isinstance(key, str)
or not TOKEN.fullmatch(key)
or not isinstance(session, str)
or not TOKEN.fullmatch(session)
or not isinstance(act, str)
):
raise ValueError("bad action payload")
try:
result = self.server.bridge.action(key, owner, session, act, value)
except ValueError as error:
raise APIError(HTTPStatus.CONFLICT, str(error)) from error
status = HTTPStatus.OK if result.get("accepted") or result.get("status") != "pending" else HTTPStatus.ACCEPTED
return self.reply(status, result)
if path == "/api/launch" or path.startswith("/api/launch/"):
if not launch:
raise APIError(HTTPStatus.FORBIDDEN, "Запуск требует доступа оператора")