22 lines
562 B
Python
22 lines
562 B
Python
#!/usr/bin/env python3
|
|
"""V101c - Update orchestrator UI to display catalog_total instead of realtime"""
|
|
path = "/var/www/html/wevia-orchestrator.html"
|
|
with open(path, "rb") as f:
|
|
raw = f.read()
|
|
|
|
if b"d.totals.catalog_total" in raw:
|
|
print("ALREADY")
|
|
exit(0)
|
|
|
|
old = b"if(s)s.textContent=d.totals.realtime;"
|
|
if old not in raw:
|
|
print("MARKER NOT FOUND")
|
|
exit(1)
|
|
|
|
new = b"if(s)s.textContent=d.totals.catalog_total||d.totals.realtime;"
|
|
raw = raw.replace(old, new, 1)
|
|
|
|
with open(path, "wb") as f:
|
|
f.write(raw)
|
|
print(f"PATCHED size={len(raw)}")
|