Fix version panel showing 'null' instead of timestamp, exclude current version from list, auto-refresh versions after upload

This commit is contained in:
2026-02-24 17:19:12 +08:00
parent 9c2809c195
commit e06f653606
3 changed files with 17 additions and 6 deletions

View File

@@ -1301,12 +1301,14 @@ def object_versions(bucket_name: str, object_key: str):
for v in resp.get("Versions", []):
if v.get("Key") != object_key:
continue
if v.get("IsLatest", False):
continue
versions.append({
"version_id": v.get("VersionId", ""),
"last_modified": v["LastModified"].isoformat() if v.get("LastModified") else None,
"size": v.get("Size", 0),
"etag": v.get("ETag", "").strip('"'),
"is_latest": v.get("IsLatest", False),
"is_latest": False,
})
return jsonify({"versions": versions})
except (ClientError, EndpointConnectionError, ConnectionClosedError) as exc: