@d34dman/flowdrop 0.0.7 → 0.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -43,6 +43,7 @@
|
|
|
43
43
|
}>;
|
|
44
44
|
// API configuration - optional, defaults to '/api/flowdrop'
|
|
45
45
|
apiBaseUrl?: string;
|
|
46
|
+
endpointConfig?: EndpointConfig;
|
|
46
47
|
}
|
|
47
48
|
|
|
48
49
|
let {
|
|
@@ -57,7 +58,8 @@
|
|
|
57
58
|
pipelineId,
|
|
58
59
|
navbarTitle,
|
|
59
60
|
navbarActions = [],
|
|
60
|
-
apiBaseUrl
|
|
61
|
+
apiBaseUrl,
|
|
62
|
+
endpointConfig: propEndpointConfig
|
|
61
63
|
}: Props = $props();
|
|
62
64
|
|
|
63
65
|
// Create breadcrumb-style title - at top level to avoid store subscription issues
|
|
@@ -182,10 +184,17 @@
|
|
|
182
184
|
|
|
183
185
|
/**
|
|
184
186
|
* Initialize API endpoints
|
|
185
|
-
*
|
|
187
|
+
* Priority: propEndpointConfig > existingConfig > apiBaseUrl > default
|
|
186
188
|
*/
|
|
187
189
|
async function initializeApiEndpoints(): Promise<void> {
|
|
188
|
-
//
|
|
190
|
+
// First priority: Use endpointConfig prop if provided (from mountFlowDropApp)
|
|
191
|
+
if (propEndpointConfig) {
|
|
192
|
+
setEndpointConfig(propEndpointConfig);
|
|
193
|
+
endpointConfig = propEndpointConfig;
|
|
194
|
+
return;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
// Second priority: Check if endpoint config is already set (e.g., by parent layout)
|
|
189
198
|
const { getEndpointConfig } = await import('../services/api.js');
|
|
190
199
|
const existingConfig = getEndpointConfig();
|
|
191
200
|
|
|
@@ -195,7 +204,7 @@
|
|
|
195
204
|
return;
|
|
196
205
|
}
|
|
197
206
|
|
|
198
|
-
// Use provided apiBaseUrl or default
|
|
207
|
+
// Third priority: Use provided apiBaseUrl or default
|
|
199
208
|
const baseUrl = apiBaseUrl || '/api/flowdrop';
|
|
200
209
|
|
|
201
210
|
const config = createEndpointConfig(baseUrl, {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { Workflow } from '../types/index.js';
|
|
2
|
+
import type { EndpointConfig } from '../config/endpoints.js';
|
|
2
3
|
interface Props {
|
|
3
4
|
workflow?: Workflow;
|
|
4
5
|
height?: string | number;
|
|
@@ -18,6 +19,7 @@ interface Props {
|
|
|
18
19
|
onclick?: (event: Event) => void;
|
|
19
20
|
}>;
|
|
20
21
|
apiBaseUrl?: string;
|
|
22
|
+
endpointConfig?: EndpointConfig;
|
|
21
23
|
}
|
|
22
24
|
declare const App: import("svelte").Component<Props, {}, "">;
|
|
23
25
|
type App = ReturnType<typeof App>;
|
|
@@ -10,12 +10,14 @@
|
|
|
10
10
|
import LogsSidebar from './LogsSidebar.svelte';
|
|
11
11
|
import { FlowDropApiClient } from '../api/client.js';
|
|
12
12
|
import type { Workflow } from '../types/index.js';
|
|
13
|
+
import type { EndpointConfig } from '../config/endpoints.js';
|
|
13
14
|
|
|
14
15
|
interface Props {
|
|
15
16
|
pipelineId: string;
|
|
16
17
|
workflow: Workflow;
|
|
17
18
|
apiClient?: FlowDropApiClient;
|
|
18
19
|
baseUrl?: string;
|
|
20
|
+
endpointConfig?: EndpointConfig;
|
|
19
21
|
onActionsReady?: (
|
|
20
22
|
actions: Array<{
|
|
21
23
|
label: string;
|
|
@@ -27,10 +29,10 @@
|
|
|
27
29
|
) => void;
|
|
28
30
|
}
|
|
29
31
|
|
|
30
|
-
let { pipelineId, workflow, apiClient, baseUrl, onActionsReady }: Props = $props();
|
|
32
|
+
let { pipelineId, workflow, apiClient, baseUrl, endpointConfig, onActionsReady }: Props = $props();
|
|
31
33
|
|
|
32
34
|
// Initialize API client if not provided
|
|
33
|
-
const client = apiClient || new FlowDropApiClient(baseUrl || "/api/flowdrop");
|
|
35
|
+
const client = apiClient || new FlowDropApiClient(endpointConfig?.baseUrl || baseUrl || "/api/flowdrop");
|
|
34
36
|
|
|
35
37
|
// Pipeline status and job data
|
|
36
38
|
let pipelineStatus = $state<string>('unknown');
|
|
@@ -276,6 +278,7 @@
|
|
|
276
278
|
readOnly={true}
|
|
277
279
|
{nodeStatuses}
|
|
278
280
|
{pipelineId}
|
|
281
|
+
{endpointConfig}
|
|
279
282
|
/>
|
|
280
283
|
|
|
281
284
|
<!-- Logs Sidebar -->
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { FlowDropApiClient } from '../api/client.js';
|
|
2
2
|
import type { Workflow } from '../types/index.js';
|
|
3
|
+
import type { EndpointConfig } from '../config/endpoints.js';
|
|
3
4
|
interface Props {
|
|
4
5
|
pipelineId: string;
|
|
5
6
|
workflow: Workflow;
|
|
6
7
|
apiClient?: FlowDropApiClient;
|
|
7
8
|
baseUrl?: string;
|
|
9
|
+
endpointConfig?: EndpointConfig;
|
|
8
10
|
onActionsReady?: (actions: Array<{
|
|
9
11
|
label: string;
|
|
10
12
|
href: string;
|
package/dist/svelte-app.js
CHANGED