✨ New system info collection, ready for copy/paste

Should hopefully make it easier in the future to collect data needed
for ticket processing. Can be accessed through System Information in the
About dialog (also directly linked from the footer and the settings),
via a new sub command `octoprint systeminfo` on the command
line and on the recovery page.

Currently included:

  * octoprint version
  * safe mode yes/no
  * printer firmware name (if connected)
  * browser user agent (if dump happens through API)
  * everything reported by the environment detector (that includes data
    from plugins as well that add to that, e.g. pi_support)
  * connectivity check information

Might be extended more in the future.
This commit is contained in:
Gina Häußge committed 2020-11-02 18:24:59 +01:00
1 parent d41feaec6d
commit a58e02940d
20 files changed
+262 -7

No files matched your search

+27
View File
@@ -29,6 +29,33 @@ def readUsageForFolders():
return jsonify(usage=_usageForFolders())
@api.route("/system/info", methods=["GET"])
@no_firstrun_access
@Permissions.SYSTEM.require(403)
def getSystemInfo():
from octoprint.cli.systeminfo import get_systeminfo
from octoprint.server import (
connectivityChecker,
environmentDetector,
printer,
safe_mode,
)
from octoprint.util import dict_flatten
systeminfo = get_systeminfo(environmentDetector, connectivityChecker)
systeminfo["browser.user_agent"] = request.headers.get("User-Agent")
systeminfo["octoprint.safe_mode"] = safe_mode is not None
if printer and printer.is_operational():
firmware_info = printer.firmware_info
if firmware_info:
systeminfo.update(
dict_flatten({"firmware": firmware_info["name"]}, prefix="printer")
)
return jsonify(systeminfo=systeminfo)
def _usageForFolders():
data = {}
for folder_name in s().get(["folder"]).keys():