From d5a1e7d19d186bb36ea14ff40558eb7e7b43a097 Mon Sep 17 00:00:00 2001 From: LordGrey <48840279+Lord-Grey@users.noreply.github.com> Date: Sat, 14 Nov 2020 16:34:31 +0100 Subject: [PATCH] Add additional system info (#1078) --- CHANGELOG.md | 15 +++++------ assets/webconfig/content/about.html | 36 ++++++++++++++------------ assets/webconfig/js/content_logging.js | 34 ++++++++++++------------ include/utils/SysInfo.h | 2 ++ libsrc/api/JsonAPI.cpp | 2 ++ libsrc/utils/CMakeLists.txt | 13 ++++++++++ libsrc/utils/SysInfo.cpp | 5 ++++ src/hyperiond/hyperiond.cpp | 22 ++++++++-------- src/hyperiond/main.cpp | 9 +------ 9 files changed, 78 insertions(+), 60 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 16d2d452..ae3ea185 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,28 +13,27 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Provide additional details on Hardware/CPU information - Allow execution with option "--version", while another hyperion daemon is running - New language support: Russian and Chinese (simplified) (#1005) -- added libcec to deb/rpm dependency list -- updated some language files +- Added libcec to deb/rpm dependency list +- Updated some language files - New LED Device SK9822 (#1005) - Support SK9822 type LEDs with adaptive brightness control via SPI (#1017) - Provide additional details on Hardware/CPU information (#1045) -Allow execution with option "--version", while another hyperion daemon is running + - Allow execution with option "--version", while another hyperion daemon is running - New blackbar detection mode "Letterbox", that considers only bars at the top and bottom of picture - Systray icons added - Issue #925 (#1040) - DirectX9 Grabber (#1039) - Added DirectX SDK to CompileHowto -- Hide Systray on exit & Install DirectX Redistributable -- Read-Only configuration database suppor +- Hide Window Systray icon on Hyperion exit & Install DirectX Redistributable +- Read-Only configuration database support ### Changed - boblight: reduce cpu time spent on memcopy and parsing rgb values (#1016) - Windows Installer/Uninstaller notification when Hyperion is running (#1033) - Updated Windows Dependencies -- cleanup packages.cmake & extend NSIS plugin directory +- Cleanup packages.cmake & extend NSIS plugin directory - Optimize images (#1058) - Update LICENSE - Change links from http to https (#1067) - - UI: Separate LED-Layout creation from UI code - Docs: Refreshed EN JSON API documentation @@ -45,7 +44,7 @@ Allow execution with option "--version", while another hyperion daemon is runnin - Fix #1007 - LED's retain last state after clearing a source (#1008) - Fix Lightpack issue #1015 (#1049) - Fix #771 color calibration for Kodi 18 (#1044) -- Fix various JSON API issues #1022, #1019, #997, #993, #992, #976, #969, #964, #980 (#1036) +- Fix various JSON API issues (#1036) - Fix issue #909, Have ratio correction first and then scale (#1047) - Fix display argument in hyperion-qt (#1027) - Fix typos (#1051) diff --git a/assets/webconfig/content/about.html b/assets/webconfig/content/about.html index d53eebb0..665dbc4b 100644 --- a/assets/webconfig/content/about.html +++ b/assets/webconfig/content/about.html @@ -35,33 +35,35 @@ var sys = window.sysInfo.system; var shy = window.sysInfo.hyperion; var info = "
Hyperion Server: \n"; - info += '- Build: ' + shy.build + '\n'; - info += '- Build time: ' + shy.time + '\n'; - info += '- Git Remote: ' + shy.gitremote + '\n'; - info += '- Version: ' + shy.version + '\n'; - info += '- UI Lang: ' + storedLang + ' (BrowserLang: ' + navigator.language + ')\n'; - info += '- UI Access: ' + storedAccess + '\n'; - //info += 'Log lvl: ' + window.serverConfig.logger.level + '\n'; - info += '- Avail Capt: ' + window.serverInfo.grabbers.available + '\n'; - info += '- Database: ' + (shy.readOnlyMode ? "ready-only" : "read/write") + '\n'; + info += '- Build: ' + shy.build + '\n'; + info += '- Build time: ' + shy.time + '\n'; + info += '- Git Remote: ' + shy.gitremote + '\n'; + info += '- Version: ' + shy.version + '\n'; + info += '- UI Lang: ' + storedLang + ' (BrowserLang: ' + navigator.language + ')\n'; + info += '- UI Access: ' + storedAccess + '\n'; + //info += '- Log lvl: ' + window.serverConfig.logger.level + '\n'; + info += '- Avail Capt: ' + window.serverInfo.grabbers.available + '\n'; + info += '- Database: ' + (shy.readOnlyMode ? "ready-only" : "read/write") + '\n'; info += '\n'; info += 'Hyperion Server OS: \n'; - info += '- Distribution: ' + sys.prettyName + '\n'; - info += '- Architecture: ' + sys.architecture + '\n'; + info += '- Distribution: ' + sys.prettyName + '\n'; + info += '- Architecture: ' + sys.architecture + '\n'; if (sys.cpuModelName) - info += '- CPU Model: ' + sys.cpuModelName + '\n'; + info += '- CPU Model: ' + sys.cpuModelName + '\n'; if (sys.cpuModelType) - info += '- CPU Type: ' + sys.cpuModelType + '\n'; + info += '- CPU Type: ' + sys.cpuModelType + '\n'; if (sys.cpuRevision) - info += '- CPU Revision: ' + sys.cpuRevision + '\n'; + info += '- CPU Revision: ' + sys.cpuRevision + '\n'; if (sys.cpuHardware) - info += '- CPU Hardware: ' + sys.cpuHardware + '\n'; + info += '- CPU Hardware: ' + sys.cpuHardware + '\n'; - info += '- Kernel: ' + sys.kernelType + ' (' + sys.kernelVersion + ' (WS: ' + sys.wordSize + '))\n'; - info += '- Browser: ' + navigator.userAgent + ''; + info += '- Kernel: ' + sys.kernelType + ' (' + sys.kernelVersion + ' (WS: ' + sys.wordSize + '))\n'; + info += '- Qt Version: ' + sys.qtVersion + '\n'; + info += '- Python Version: ' + sys.pyVersion + '\n'; + info += '- Browser: ' + navigator.userAgent + ' '; var fc = ['' + $.i18n("about_version") + '', $.i18n("about_build"), $.i18n("about_builddate"), $.i18n("about_translations"), $.i18n("about_resources", $.i18n("general_webui_title")), "System info (Github Issue)", $.i18n("about_3rd_party_licenses")]; var sc = [currentVersion, si.build, si.time, '(' + availLang.length + ')
' + lang + '
' + $.i18n("about_contribute") + '
', libh, info, '']; diff --git a/assets/webconfig/js/content_logging.js b/assets/webconfig/js/content_logging.js index 5faf2b05..8ace208d 100644 --- a/assets/webconfig/js/content_logging.js +++ b/assets/webconfig/js/content_logging.js @@ -73,30 +73,32 @@ $(document).ready(function() { //create general info info = "### GENERAL ### \n"; - info += 'Build: '+shy.build+'\n'; - info += 'Build time: '+shy.time+'\n'; - info += 'Version: '+shy.version+'\n'; - info += 'UI Lang: '+storedLang+' (BrowserL: '+navigator.language+')\n'; - info += 'UI Access: '+storedAccess+'\n'; - info += 'Log lvl: '+window.serverConfig.logger.level+'\n'; - info += 'Avail Capt: '+window.serverInfo.grabbers.available+'\n'; - info += 'Database: '+(shy.readOnlyMode ? "ready-only" : "read/write")+'\n'; + info += 'Build: '+shy.build+'\n'; + info += 'Build time: '+shy.time+'\n'; + info += 'Version: '+shy.version+'\n'; + info += 'UI Lang: '+storedLang+' (BrowserL: '+navigator.language+')\n'; + info += 'UI Access: '+storedAccess+'\n'; + info += 'Log lvl: '+window.serverConfig.logger.level+'\n'; + info += 'Avail Capt: '+window.serverInfo.grabbers.available+'\n'; + info += 'Database: '+(shy.readOnlyMode ? "ready-only" : "read/write")+'\n'; info += '\n'; - info += 'Distribution:'+sys.prettyName+'\n'; - info += 'Architecture:'+sys.architecture+'\n'; + info += 'Distribution: '+sys.prettyName+'\n'; + info += 'Architecture: '+sys.architecture+'\n'; if (sys.cpuModelName) - info += 'CPU Model: ' + sys.cpuModelName + '\n'; + info += 'CPU Model: ' + sys.cpuModelName + '\n'; if (sys.cpuModelType) - info += 'CPU Type: ' + sys.cpuModelType + '\n'; + info += 'CPU Type: ' + sys.cpuModelType + '\n'; if (sys.cpuRevision) - info += 'CPU Revision:' + sys.cpuRevision + '\n'; + info += 'CPU Revision: ' + sys.cpuRevision + '\n'; if (sys.cpuHardware) - info += 'CPU Hardware:' + sys.cpuHardware + '\n'; + info += 'CPU Hardware: ' + sys.cpuHardware + '\n'; - info += 'Kernel: '+sys.kernelType+' ('+sys.kernelVersion+' (WS: '+sys.wordSize+'))\n'; - info += 'Browser/OS: '+navigator.userAgent+'\n\n'; + info += 'Kernel: ' + sys.kernelType+' ('+sys.kernelVersion+' (WS: '+sys.wordSize+'))' + '\n'; + info += 'Qt Version: ' + sys.qtVersion + '\n'; + info += 'Python Version: ' + sys.pyVersion + '\n'; + info += 'Browser/OS: ' + navigator.userAgent + '\n\n'; //create prios info += "### PRIORITIES ### \n"; diff --git a/include/utils/SysInfo.h b/include/utils/SysInfo.h index 3c9ec27c..22d80c27 100644 --- a/include/utils/SysInfo.h +++ b/include/utils/SysInfo.h @@ -21,6 +21,8 @@ public: QString prettyName; QString hostName; QString domainName; + QString qtVersion; + QString pyVersion; }; static HyperionSysInfo get(); diff --git a/libsrc/api/JsonAPI.cpp b/libsrc/api/JsonAPI.cpp index d899e177..f5711b2c 100644 --- a/libsrc/api/JsonAPI.cpp +++ b/libsrc/api/JsonAPI.cpp @@ -285,6 +285,8 @@ void JsonAPI::handleSysInfoCommand(const QJsonObject &, const QString &command, system["prettyName"] = data.prettyName; system["hostName"] = data.hostName; system["domainName"] = data.domainName; + system["qtVersion"] = data.qtVersion; + system["pyVersion"] = data.pyVersion; info["system"] = system; QJsonObject hyperion; diff --git a/libsrc/utils/CMakeLists.txt b/libsrc/utils/CMakeLists.txt index 6b3865ac..40e7efe6 100644 --- a/libsrc/utils/CMakeLists.txt +++ b/libsrc/utils/CMakeLists.txt @@ -1,5 +1,17 @@ # Define the current source locations +# Include the python directory. Also include the parent (which is for example /usr/include) +# which may be required when it is not includes by the (cross-) compiler by default. +if (NOT CMAKE_VERSION VERSION_LESS "3.12") + find_package(Python3 COMPONENTS Interpreter Development REQUIRED) + include_directories(${Python3_INCLUDE_DIRS} ${Python3_INCLUDE_DIRS}/..) + add_compile_definitions(PYTHON_VERSION_MAJOR_MINOR=${Python3_VERSION_MAJOR}${Python3_VERSION_MINOR}) +else() + find_package (PythonLibs ${PYTHON_VERSION_STRING} EXACT) # Maps PythonLibs to the PythonInterp version of the main cmake + include_directories(${PYTHON_INCLUDE_DIRS} ${PYTHON_INCLUDE_DIRS}/..) + add_definitions(-DPYTHON_VERSION_MAJOR_MINOR=${PYTHON_VERSION_MAJOR}${PYTHON_VERSION_MINOR}) +endif() + SET(CURRENT_HEADER_DIR ${CMAKE_SOURCE_DIR}/include/utils) SET(CURRENT_SOURCE_DIR ${CMAKE_SOURCE_DIR}/libsrc/utils) @@ -15,6 +27,7 @@ add_library(hyperion-utils target_link_libraries(hyperion-utils hyperion + python Qt5::Core Qt5::Gui Qt5::Network diff --git a/libsrc/utils/SysInfo.cpp b/libsrc/utils/SysInfo.cpp index e5fa1625..3136899d 100644 --- a/libsrc/utils/SysInfo.cpp +++ b/libsrc/utils/SysInfo.cpp @@ -1,3 +1,6 @@ +// Python includes +#include