1
0
mirror of synced 2024-12-01 02:37:18 +01:00

feat: Added new imhex/capabilities network interface

This commit is contained in:
WerWolv 2023-05-16 11:01:40 +02:00
parent 14341d611d
commit 636ed0095d
3 changed files with 20 additions and 2 deletions

View File

@ -451,7 +451,7 @@ macro(addBundledLibraries)
set_property(TARGET libwolv-io PROPERTY POSITION_INDEPENDENT_CODE ON)
set_property(TARGET libwolv-hash PROPERTY POSITION_INDEPENDENT_CODE ON)
set_property(TARGET libwolv-containers PROPERTY POSITION_INDEPENDENT_CODE ON)
set_property(TARGET libwolv-net PROPERTY POSITION_INDEPENDENT_CODE ON)
set(XDGPP_INCLUDE_DIRS "${EXTERN_LIBS_FOLDER}/xdgpp")
set(CURL_USE_MBEDTLS ON)

@ -1 +1 @@
Subproject commit 7fea1070bd4c2d6767ac3ca6ececbb312c5a5049
Subproject commit 113917c4472d61692ac8e8feff922d416efcef1d

View File

@ -12,6 +12,24 @@ namespace hex::plugin::builtin {
return { };
});
ContentRegistry::CommunicationInterface::registerNetworkEndpoint("imhex/capabilities", [](const nlohmann::json &) -> nlohmann::json {
nlohmann::json result;
result["build"] = {
{ "version", IMHEX_VERSION },
{ "commit", GIT_COMMIT_HASH_LONG },
{ "branch", GIT_BRANCH },
};
std::vector<std::string> commands;
for (const auto&[command, callback] : ContentRegistry::CommunicationInterface::impl::getNetworkEndpoints())
commands.emplace_back(command);
result["commands"] = commands;
return result;
});
}
}