From 7d441964e91432e24fdb1d4b0f4f47eb690c3a1c Mon Sep 17 00:00:00 2001 From: "Scott E. Graves" Date: Sat, 1 Mar 2025 07:32:23 -0600 Subject: [PATCH] fixes --- repertory/librepertory/src/app_config.cpp | 1 - repertory/repertory/src/ui/handlers.cpp | 12 ++++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/repertory/librepertory/src/app_config.cpp b/repertory/librepertory/src/app_config.cpp index 84d5e1e8..e41c7600 100644 --- a/repertory/librepertory/src/app_config.cpp +++ b/repertory/librepertory/src/app_config.cpp @@ -726,7 +726,6 @@ auto app_config::default_data_directory(const provider_type &prov) -> std::string { return utils::path::combine(app_config::get_root_data_directory(), { - REPERTORY_DATA_NAME, app_config::get_provider_name(prov), }); } diff --git a/repertory/repertory/src/ui/handlers.cpp b/repertory/repertory/src/ui/handlers.cpp index 197ed935..7de39978 100644 --- a/repertory/repertory/src/ui/handlers.cpp +++ b/repertory/repertory/src/ui/handlers.cpp @@ -127,6 +127,18 @@ handlers::handlers(mgmt_app_config *config, httplib::Server *server) res.status = http_error_codes::ok; }); + server->Get("/api/v1/mount_status", [](const httplib::Request &req, + auto &&res) { + auto prov = provider_type_from_string(req.get_param_value("type")); + + auto lines = + handlers::read_process(prov, req.get_param_value("name"), "-status"); + + auto result = nlohmann::json::parse(utils::string::join(lines, '\n')); + res.set_content(result.dump(), "application/json"); + res.status = http_error_codes::ok; + }); + event_system::instance().start(); static std::atomic this_server{server_};