mirror of
https://github.com/windmill-labs/windmill.git
synced 2026-08-26 00:01:37 +00:00
nits
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "windmill-components",
|
||||
"version": "1.444.0",
|
||||
"version": "1.444.2",
|
||||
"scripts": {
|
||||
"dev": "vite dev",
|
||||
"build": "vite build",
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
import CopyableCodeBlock from '$lib/components/details/CopyableCodeBlock.svelte'
|
||||
import { bash } from 'svelte-highlight/languages'
|
||||
import { HttpTriggerService } from '$lib/gen'
|
||||
import { page } from '$app/stores'
|
||||
// import { page } from '$app/stores'
|
||||
import { isCloudHosted } from '$lib/cloud'
|
||||
import { base } from '$lib/base'
|
||||
import type { CaptureInfo } from './CaptureSection.svelte'
|
||||
@@ -59,7 +59,7 @@
|
||||
}
|
||||
|
||||
function getHttpRoute(route_path: string | undefined) {
|
||||
return `${$page.url.origin}${base}/api/r/${
|
||||
return `${location.origin}${base}/api/r/${
|
||||
isCloudHosted() ? $workspaceStore + '/' : ''
|
||||
}${route_path}`
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
import { typescript } from 'svelte-highlight/languages'
|
||||
import ClipboardPanel from '../details/ClipboardPanel.svelte'
|
||||
import { copyToClipboard } from '$lib/utils'
|
||||
import { page } from '$app/stores'
|
||||
// import { page } from '$app/stores'
|
||||
import { base } from '$lib/base'
|
||||
import TriggerTokens from './TriggerTokens.svelte'
|
||||
import { workspaceStore, userStore } from '$lib/stores'
|
||||
@@ -54,7 +54,7 @@
|
||||
$: webhooks = isFlow ? computeFlowWebhooks(path) : computeScriptWebhooks(hash, path)
|
||||
|
||||
function computeScriptWebhooks(hash: string | undefined, path: string) {
|
||||
let webhookBase = `${$page.url.origin}${base}/api/w/${$workspaceStore}/jobs`
|
||||
let webhookBase = `${location.origin}${base}/api/w/${$workspaceStore}/jobs`
|
||||
return {
|
||||
async: {
|
||||
hash: `${webhookBase}/run/h/${hash}`,
|
||||
@@ -69,7 +69,7 @@
|
||||
}
|
||||
|
||||
function computeFlowWebhooks(path: string) {
|
||||
let webhooksBase = `${$page.url.origin}${base}/api/w/${$workspaceStore}/jobs`
|
||||
let webhooksBase = `${location.origin}${base}/api/w/${$workspaceStore}/jobs`
|
||||
|
||||
let urlAsync = `${webhooksBase}/run/f/${path}`
|
||||
let urlSync = `${webhooksBase}/run_wait_result/f/${path}`
|
||||
@@ -158,7 +158,7 @@ function waitForJobCompletion(UUID) {
|
||||
return new Promise(async (resolve, reject) => {
|
||||
try {
|
||||
const endpoint = \`${
|
||||
$page.url.origin
|
||||
location.origin
|
||||
}/api/w/${$workspaceStore}/jobs_u/completed/get_result_maybe/\${UUID}\`;
|
||||
const checkResponse = await fetch(endpoint, {
|
||||
method: 'GET',
|
||||
@@ -186,7 +186,7 @@ function waitForJobCompletion(UUID) {
|
||||
return `${mainFunction}\n\n${triggerJobFunction}\n\n${waitForJobCompletionFunction}`
|
||||
}
|
||||
|
||||
let captureUrl = `${$page.url.origin}/api/w/${$workspaceStore}/capture_u/webhook/${
|
||||
let captureUrl = `${location.origin}/api/w/${$workspaceStore}/capture_u/webhook/${
|
||||
isFlow ? 'flow' : 'script'
|
||||
}/${path}`
|
||||
|
||||
@@ -211,7 +211,7 @@ ${
|
||||
webhookType === 'sync'
|
||||
? 'echo -E $RESULT | jq'
|
||||
: `
|
||||
URL="${$page.url.origin}/api/w/${$workspaceStore}/jobs_u/completed/get_result_maybe/$UUID"
|
||||
URL="${location.origin}/api/w/${$workspaceStore}/jobs_u/completed/get_result_maybe/$UUID"
|
||||
while true; do
|
||||
curl -s -H "Authorization: Bearer $TOKEN" $URL -o res.json
|
||||
COMPLETED=$(cat res.json | jq .completed)
|
||||
|
||||
Reference in New Issue
Block a user