mirror of
https://github.com/AUTOMATIC1111/stable-diffusion-webui.git
synced 2024-06-07 21:20:49 +00:00
Merge pull request #14035 from AUTOMATIC1111/sysinfo-json
save sysinfo as .json
This commit is contained in:
commit
411da7c281
@ -441,7 +441,7 @@ def dump_sysinfo():
|
|||||||
import datetime
|
import datetime
|
||||||
|
|
||||||
text = sysinfo.get()
|
text = sysinfo.get()
|
||||||
filename = f"sysinfo-{datetime.datetime.utcnow().strftime('%Y-%m-%d-%H-%M')}.txt"
|
filename = f"sysinfo-{datetime.datetime.utcnow().strftime('%Y-%m-%d-%H-%M')}.json"
|
||||||
|
|
||||||
with open(filename, "w", encoding="utf8") as file:
|
with open(filename, "w", encoding="utf8") as file:
|
||||||
file.write(text)
|
file.write(text)
|
||||||
|
@ -1308,7 +1308,7 @@ def setup_ui_api(app):
|
|||||||
from fastapi.responses import PlainTextResponse
|
from fastapi.responses import PlainTextResponse
|
||||||
|
|
||||||
text = sysinfo.get()
|
text = sysinfo.get()
|
||||||
filename = f"sysinfo-{datetime.datetime.utcnow().strftime('%Y-%m-%d-%H-%M')}.txt"
|
filename = f"sysinfo-{datetime.datetime.utcnow().strftime('%Y-%m-%d-%H-%M')}.json"
|
||||||
|
|
||||||
return PlainTextResponse(text, headers={'Content-Disposition': f'{"attachment" if attachment else "inline"}; filename="{filename}"'})
|
return PlainTextResponse(text, headers={'Content-Disposition': f'{"attachment" if attachment else "inline"}; filename="{filename}"'})
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user