Skip to content

Commit

Permalink
Merge pull request #14035 from AUTOMATIC1111/sysinfo-json
Browse files Browse the repository at this point in the history
save sysinfo as .json
  • Loading branch information
AUTOMATIC1111 authored Nov 20, 2023
2 parents fc83af4 + 6d337bf commit 411da7c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion modules/launch_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,7 @@ def dump_sysinfo():
import datetime

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:
file.write(text)
Expand Down
2 changes: 1 addition & 1 deletion modules/ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -1308,7 +1308,7 @@ def download_sysinfo(attachment=False):
from fastapi.responses import PlainTextResponse

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}"'})

Expand Down

0 comments on commit 411da7c

Please sign in to comment.