Show running app in Apps page

This commit is contained in:
Yukino Song
2025-02-07 21:11:03 +08:00
parent 9481418e0d
commit 58bbfc3e67
6 changed files with 50 additions and 12 deletions

View File

@@ -552,6 +552,8 @@ namespace confighttp {
}
}
file_tree["current_app"] = proc::proc.get_running_app_uuid();
send_response(response, file_tree);
} catch (std::exception &e) {
BOOST_LOG(warning) << "GetApps: "sv << e.what();

View File

@@ -604,6 +604,7 @@ namespace proc {
_app_id = -1;
_app_name.clear();
_app = {};
display_name.clear();
initial_display.clear();
_launch_session.reset();
@@ -636,6 +637,10 @@ namespace proc {
return _app_name;
}
std::string proc_t::get_running_app_uuid() {
return _app.uuid;
}
boost::process::environment proc_t::get_env() {
return _env;
}

View File

@@ -117,6 +117,7 @@ namespace proc {
std::vector<ctx_t> &get_apps();
std::string get_app_image(int app_id);
std::string get_last_run_app_name();
std::string get_running_app_uuid();
boost::process::environment get_env();
void terminate(bool immediate = false);