Show IPA version in operation logs

This commit is contained in:
shenlei
2026-10-10 10:02:28 +09:00
parent 74ff4701d6
commit 2bd5c7057f
3 changed files with 50 additions and 11 deletions
+3 -2
View File
@@ -298,8 +298,9 @@ async def get_download_link(task_id: str, request: Request, user: dict = Depends
from .config import load_config
from ..config import DOWNLOAD_URL_EXPIRE_SECONDS
from ..services.distribution import DistributionError, get_published_download_url
task_config = json.loads(task.config_json or "{}")
download_url = get_published_download_url(
json.loads(task.config_json or "{}"),
task_config,
load_config().get("upload", {}),
task.oss_url,
)
@@ -319,7 +320,7 @@ async def get_download_link(task_id: str, request: Request, user: dict = Depends
from ..services.audit_log import record_operation
record_operation(db, user, "ipa_download_requested", request=request, task=task,
resource_type="ipa", resource_name=task.oss_url,
detail={"controlled": True})
detail={"controlled": True, "version": task_config.get("VERSION", "")})
db.commit()
return {"url": download_url, "expires_in": DOWNLOAD_URL_EXPIRE_SECONDS}