34 lines
1.5 KiB
Python
34 lines
1.5 KiB
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}'
|
||
|
|
'[class*="bg-card"],button[class*="rounded-full"]{background-color:rgba(255,255,255,0.01)!important;'
|
||
|
|
'backdrop-filter:blur(2px) saturate(100%)!important;'
|
||
|
|
'-webkit-backdrop-filter:blur(2px) saturate(100%)!important;'
|
||
|
|
'border-radius:16px!important;'
|
||
|
|
'border:1px solid rgba(255,255,255,0.2)!important;'
|
||
|
|
'transition:all 0.3s ease!important;'
|
||
|
|
'position:relative!important;overflow:hidden!important}'
|
||
|
|
'header,nav,footer{background:transparent!important}'
|
||
|
|
'.text-stone-400,.text-stone-500,.opacity-50,.text-muted-foreground,p.text-xs,span.text-xs{color:rgba(40,40,40,0.8)!important;opacity:1!important;font-weight:500!important}'
|
||
|
|
'[class*="bg-card"] p,[class*="bg-card"] span,.font-medium,.font-semibold{color:#2a2a2a!important}'
|
||
|
|
'.text-sm.font-medium{color:#2a2a2a!important;opacity:1!important}'
|
||
|
|
'div[role="tablist"]{background:rgba(0,0,0,0.05)!important;border:1px solid rgba(0,0,0,0.08)!important;backdrop-filter:blur(2px)!important}'
|
||
|
|
'</style>'
|
||
|
|
)
|
||
|
|
|
||
|
|
content = content.rstrip() + '\ncustom_code: "' + css + '"\n'
|
||
|
|
|
||
|
|
with open("/tmp/nezha-config-fixed.yaml", "w") as f:
|
||
|
|
f.write(content)
|
||
|
|
|
||
|
|
print("done")
|