mirror of
https://github.com/AUTOMATIC1111/stable-diffusion-webui.git
synced 2026-04-26 09:19:23 +00:00
Authenticated Sysinfo
This commit is contained in:
@@ -213,3 +213,13 @@ def get_config():
|
||||
return json.load(f)
|
||||
except Exception as e:
|
||||
return str(e)
|
||||
|
||||
|
||||
def download_sysinfo(attachment=False):
|
||||
from fastapi.responses import PlainTextResponse
|
||||
from datetime import datetime
|
||||
|
||||
text = get()
|
||||
filename = f"sysinfo-{datetime.utcnow().strftime('%Y-%m-%d-%H-%M')}.json"
|
||||
|
||||
return PlainTextResponse(text, headers={'Content-Disposition': f'{"attachment" if attachment else "inline"}; filename="{filename}"'})
|
||||
|
||||
Reference in New Issue
Block a user