chore: auto-commit (8 archivos)
- CMakeLists.txt - app.md - data_http.cpp - data_http.h - main.cpp - tabs.cpp - tabs.h - appicon.ico Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -73,6 +73,7 @@ static void parse_step(const json& j, DagStepRow& s) {
|
||||
s.finished_at = get_str(j, "finished_at");
|
||||
s.duration_ms = get_int64(j, "duration_ms");
|
||||
s.error = get_str(j, "error");
|
||||
s.function_id = get_str(j, "function_id");
|
||||
}
|
||||
|
||||
static void parse_dag_info(const json& j, DagInfo& d) {
|
||||
@@ -245,4 +246,33 @@ bool trigger_dag_http(const std::string& api_url, const std::string& name,
|
||||
return true;
|
||||
}
|
||||
|
||||
bool get_function_http(const std::string& api_url,
|
||||
const std::string& function_id,
|
||||
FnInfo& out) {
|
||||
std::string host;
|
||||
int port;
|
||||
if (!parse_url(api_url, host, port)) return false;
|
||||
if (function_id.empty()) return false;
|
||||
HttpClient cli(host, port);
|
||||
auto res = cli.get("/api/functions/" + function_id);
|
||||
if (!res.ok()) {
|
||||
fprintf(stderr, "[dag_http] get_function(%s) failed: status=%d\n",
|
||||
function_id.c_str(), res.status);
|
||||
return false;
|
||||
}
|
||||
auto j = json::parse(res.body, nullptr, false);
|
||||
if (!j.is_object()) return false;
|
||||
|
||||
out.id = get_str(j, "id");
|
||||
out.name = get_str(j, "name");
|
||||
out.description = get_str(j, "description");
|
||||
out.signature = get_str(j, "signature");
|
||||
out.purity = get_str(j, "purity");
|
||||
out.domain = get_str(j, "domain");
|
||||
out.lang = get_str(j, "lang");
|
||||
out.uses_functions = get_str_array(j, "uses_functions");
|
||||
out.uses_types = get_str_array(j, "uses_types");
|
||||
return true;
|
||||
}
|
||||
|
||||
} // namespace dag_ui
|
||||
|
||||
Reference in New Issue
Block a user