| 233 | |
| 234 | // Fetch YAML file content |
| 235 | export async function fetchWorkflowYAML(filename) { |
| 236 | try { |
| 237 | const response = await fetch(apiUrl(`/api/workflows/${encodeURIComponent(filename)}/get`)) |
| 238 | if (!response.ok) { |
| 239 | throw new Error(`Failed to load YAML file: ${filename}, status: ${response.status}`) |
| 240 | } |
| 241 | const data = await response.json() |
| 242 | return data.content |
| 243 | } catch (err) { |
| 244 | console.error('Failed to load YAML file:', err) |
| 245 | throw err |
| 246 | } |
| 247 | } |
| 248 | |
| 249 | // Fetch YAML for the specified workflow |
| 250 | export async function fetchYaml(filename) { |