1
0
mirror of synced 2025-02-17 18:59:21 +01:00

impr: Make statistics format not suck a whole lot

This commit is contained in:
WerWolv 2023-06-21 00:21:16 +02:00
parent 6d1f639bc6
commit c8150f3261
2 changed files with 26 additions and 4 deletions

View File

@ -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);

View File

@ -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();
}