From c8150f3261f54c1b704de60a104f06034c99c226 Mon Sep 17 00:00:00 2001 From: WerWolv Date: Wed, 21 Jun 2023 00:21:16 +0200 Subject: [PATCH] impr: Make statistics format not suck a whole lot --- main/source/init/tasks.cpp | 14 ++++++++++++-- .../content/popups/popup_telemetry_request.hpp | 16 ++++++++++++++-- 2 files changed, 26 insertions(+), 4 deletions(-) diff --git a/main/source/init/tasks.cpp b/main/source/init/tasks.cpp index 406a4604d..af01c9211 100644 --- a/main/source/init/tasks.cpp +++ b/main/source/init/tasks.cpp @@ -81,8 +81,18 @@ namespace hex::init { // Make telemetry request nlohmann::json telemetry = { { "uuid", uuid }, - { "version", fmt::format("{}/{}", IMHEX_VERSION, ImHexApi::System::isPortableVersion() ? "Portable" : "Installed") }, - { "os", fmt::format("{}/{}/{}/{}", ImHexApi::System::getOSName(), ImHexApi::System::getOSVersion(), ImHexApi::System::getArchitecture(), ImHexApi::System::getGPUVendor()) } + { "format_version", "1" }, + { "imhex_version", IMHEX_VERSION }, + #if defined(GIT_COMMIT_HASH_LONG) && defined(GIT_BRANCH) + { "imhex_commit", fmt::format("{}@{}", GIT_COMMIT_HASH_LONG, GIT_BRANCH) }, + #else + { "imhex_commit", "??@??" }, + #endif + { "install_type", ImHexApi::System::isPortableVersion() ? "Portable" : "Installed" }, + { "os", ImHexApi::System::getOSName() }, + { "os_version", ImHexApi::System::getOSVersion() }, + { "arch", ImHexApi::System::getArchitecture() }, + { "gpu_vendor", ImHexApi::System::getGPUVendor() } }; HttpRequest telemetryRequest("POST", ImHexApiURL + "/telemetry"s); diff --git a/plugins/builtin/include/content/popups/popup_telemetry_request.hpp b/plugins/builtin/include/content/popups/popup_telemetry_request.hpp index d928fae56..48760afa1 100644 --- a/plugins/builtin/include/content/popups/popup_telemetry_request.hpp +++ b/plugins/builtin/include/content/popups/popup_telemetry_request.hpp @@ -46,13 +46,25 @@ namespace hex::plugin::builtin { ImGui::TableNextColumn(); ImGui::TextUnformatted("hex.builtin.welcome.server_contact.data_collected.version"_lang); ImGui::TableNextColumn(); - ImGui::TextUnformatted(IMHEX_VERSION); + ImGui::TextFormatted("{}/{}@{}/{}", + IMHEX_VERSION, + #if defined (GIT_COMMIT_HASH_LONG) && defined (GIT_BRANCH) + GIT_COMMIT_HASH_LONG, GIT_BRANCH, + #else + "??", "??", + #endif + ImHexApi::System::isPortableVersion() ? "Portable" : "Installed" + ); ImGui::TableNextRow(); ImGui::TableNextColumn(); ImGui::TextUnformatted("hex.builtin.welcome.server_contact.data_collected.os"_lang); ImGui::TableNextColumn(); - ImGui::TextWrapped("%s/%s/%s", ImHexApi::System::getOSName().c_str(), ImHexApi::System::getOSVersion().c_str(), ImHexApi::System::getArchitecture().c_str()); + ImGui::TextFormattedWrapped("{}/{}/{}/{}", + ImHexApi::System::getOSName(), + ImHexApi::System::getOSVersion(), + ImHexApi::System::getArchitecture(), + ImHexApi::System::getGPUVendor()); ImGui::EndTable(); }