Admin: APP-Version + SW-Version im System-Panel — SW by-v439, APP_VER 418
This commit is contained in:
parent
e0c2b2bdc1
commit
664fb2a79b
4 changed files with 20 additions and 4 deletions
|
|
@ -569,6 +569,18 @@ async def system_info(user=Depends(require_admin)):
|
|||
except (OSError, AttributeError):
|
||||
pass
|
||||
|
||||
# SW-Cache-Version aus sw.js lesen
|
||||
sw_version = "?"
|
||||
try:
|
||||
import re as _re
|
||||
static_dir = os.getenv("STATIC_DIR", "/app/static")
|
||||
sw_content = open(os.path.join(static_dir, "sw.js")).readline()
|
||||
m = _re.search(r"'(by-v\d+)'", sw_content)
|
||||
if m:
|
||||
sw_version = m.group(1)
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
return {
|
||||
"db_size_mb": round(db_size_mb, 2),
|
||||
"media_size_mb": round(media_size_mb, 2),
|
||||
|
|
@ -576,6 +588,7 @@ async def system_info(user=Depends(require_admin)):
|
|||
"python_version": sys.version.split()[0],
|
||||
"disk_total_gb": round(disk_total_gb, 2),
|
||||
"disk_free_gb": round(disk_free_gb, 2),
|
||||
"sw_version": sw_version,
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue