mirror of
https://gitlab.com/crafty-controller/crafty-4.git
synced 2024-08-30 18:23:09 +00:00
Add platform & crafty version info to support logs
This commit is contained in:
parent
b69cdd757e
commit
31ee894603
@ -1,6 +1,7 @@
|
|||||||
import os
|
import os
|
||||||
import pathlib
|
import pathlib
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
import platform
|
||||||
import shutil
|
import shutil
|
||||||
import time
|
import time
|
||||||
import logging
|
import logging
|
||||||
@ -172,6 +173,19 @@ class Controller:
|
|||||||
id="logs_" + str(exec_user["user_id"]),
|
id="logs_" + str(exec_user["user_id"]),
|
||||||
args=[temp_dir, temp_zip_storage + ".zip", exec_user],
|
args=[temp_dir, temp_zip_storage + ".zip", exec_user],
|
||||||
)
|
)
|
||||||
|
# Make version file .txt when we download it for support
|
||||||
|
# Most people have a default editor for .txt also more mobile friendly...
|
||||||
|
FileHelpers.copy_file(
|
||||||
|
os.path.join(self.project_root, "app", "config", "version.json"),
|
||||||
|
os.path.join(temp_dir, "crafty_sys_info.txt"),
|
||||||
|
)
|
||||||
|
with open(
|
||||||
|
os.path.join(temp_dir, "crafty_sys_info.txt"), "a", encoding="utf-8"
|
||||||
|
) as f:
|
||||||
|
f.write("\n")
|
||||||
|
f.write("OS Info:\n")
|
||||||
|
f.write("OS: " + str(platform.system()) + "\n")
|
||||||
|
f.write("Version: " + str(platform.release()))
|
||||||
FileHelpers.make_compressed_archive(temp_zip_storage, temp_dir)
|
FileHelpers.make_compressed_archive(temp_zip_storage, temp_dir)
|
||||||
if len(self.helper.websocket_helper.clients) > 0:
|
if len(self.helper.websocket_helper.clients) > 0:
|
||||||
self.helper.websocket_helper.broadcast_user(
|
self.helper.websocket_helper.broadcast_user(
|
||||||
|
Loading…
Reference in New Issue
Block a user