| 124 | } |
| 125 | |
| 126 | void HttpHandler::HandleAllRunningProcesses(http::web_request &req, http::web_response &rep) { |
| 127 | auto rgm = context_->GetRunGameManager(); |
| 128 | auto rps = rgm->GetRunningProcesses(); |
| 129 | json obj = json::array(); |
| 130 | for (const std::shared_ptr<ProcessInfo>& rp : rps) { |
| 131 | json item; |
| 132 | item["pid"] = rp->pid_; |
| 133 | auto exe_path = rp->exe_full_path_; |
| 134 | StringUtil::Replace(exe_path, "\\", "/"); |
| 135 | item["exe_path"] = exe_path; |
| 136 | item["icon"] = rp->icon_name_; |
| 137 | obj.push_back(item); |
| 138 | } |
| 139 | auto resp = WrapBasicInfo(200, "ok", obj); |
| 140 | rep.fill_json(resp); |
| 141 | } |
| 142 | |
| 143 | void HttpHandler::HandleKillProcess(http::web_request &req, http::web_response &rep) { |
| 144 | int pid = 0; |
no test coverage detected