When observer run, use observer task to get callback url and proxy lo… (#1719)

This commit is contained in:
Shuchang Zheng
2025-02-05 03:35:01 +08:00
committed by GitHub
parent 0c0a368c64
commit bbdd90058f
2 changed files with 15 additions and 2 deletions

View File

@@ -282,6 +282,10 @@ export type ObserverTask = {
modified_at: string; modified_at: string;
output: Record<string, unknown> | null; output: Record<string, unknown> | null;
summary: string | null; summary: string | null;
webhook_callback_url: string | null;
totp_verification_url: string | null;
totp_identifier: string | null;
proxy_location: ProxyLocation | null;
}; };
export type Createv2TaskRequest = { export type Createv2TaskRequest = {

View File

@@ -44,6 +44,15 @@ function WorkflowPostRunParameters() {
} }
const activeBlock = getActiveBlock(); const activeBlock = getActiveBlock();
const isObserverTask = workflowRun.observer_task !== null;
const webhookCallbackUrl = isObserverTask
? workflowRun.observer_task?.webhook_callback_url
: workflowRun.webhook_callback_url;
const proxyLocation = isObserverTask
? workflowRun.observer_task?.proxy_location
: workflowRun.proxy_location;
return ( return (
<div className="space-y-5"> <div className="space-y-5">
@@ -125,14 +134,14 @@ function WorkflowPostRunParameters() {
<div className="w-80"> <div className="w-80">
<h1 className="text-lg">Webhook Callback URL</h1> <h1 className="text-lg">Webhook Callback URL</h1>
</div> </div>
<Input value={workflowRun.webhook_callback_url ?? ""} readOnly /> <Input value={webhookCallbackUrl ?? ""} readOnly />
</div> </div>
<div className="flex gap-16"> <div className="flex gap-16">
<div className="w-80"> <div className="w-80">
<h1 className="text-lg">Proxy Location</h1> <h1 className="text-lg">Proxy Location</h1>
</div> </div>
<ProxySelector <ProxySelector
value={workflowRun.proxy_location ?? ProxyLocation.Residential} value={proxyLocation ?? ProxyLocation.Residential}
onChange={() => { onChange={() => {
// TODO // TODO
}} }}