Files
vps-management-bot/tmp/fix-nezha-css6.py
2026-03-21 01:10:53 +08:00

27 lines
859 B
Python

import re
with open("/tmp/nezha-config-raw.yaml") as f:
content = f.read()
content = re.sub(r"custom_code:.*\n?", "", content)
css = (
'<style>'
'body{background:url(/static/bg.jpg) no-repeat center center fixed!important;background-size:cover!important}'
'#root,.loaded,.bg-background,.flex.min-h-screen{background:transparent!important}'
'main{background:transparent!important}'
'.rounded-lg.border.bg-card{background:rgba(255,255,255,0.5)!important;'
'backdrop-filter:blur(8px)!important;'
'-webkit-backdrop-filter:blur(8px)!important;'
'border:1px solid rgba(255,255,255,0.3)!important}'
'header,nav,footer{background:transparent!important}'
'</style>'
)
content = content.rstrip() + '\ncustom_code: "' + css + '"\n'
with open("/tmp/nezha-config-fixed.yaml", "w") as f:
f.write(content)
print("done")