Use the dashboard url instead of the API url for the View logs link

This commit is contained in:
Eric Allam
2024-04-09 15:15:16 +01:00
parent 279717b092
commit 328947dbfd
2 changed files with 12 additions and 3 deletions
+5
View File
@@ -0,0 +1,5 @@
---
"trigger.dev": patch
---
Use the dashboard url instead of the API url for the View logs link
+7 -3
View File
@@ -112,7 +112,7 @@ export async function devCommand(dir: string, options: DevCommandOptions) {
return;
}
const devInstance = await startDev(dir, options, authorization.auth);
const devInstance = await startDev(dir, options, authorization.auth, authorization.dashboardUrl);
const { waitUntilExit } = devInstance.devReactElement;
await waitUntilExit();
}
@@ -120,7 +120,8 @@ export async function devCommand(dir: string, options: DevCommandOptions) {
async function startDev(
dir: string,
options: DevCommandOptions,
authorization: { apiUrl: string; accessToken: string }
authorization: { apiUrl: string; accessToken: string },
dashboardUrl: string
) {
let rerender: (node: React.ReactNode) => void | undefined;
@@ -174,6 +175,7 @@ async function startDev(
return (
<DevUI
dashboardUrl={dashboardUrl}
config={configParam}
apiUrl={apiUrl}
apiKey={devEnv.data.apiKey}
@@ -209,6 +211,7 @@ async function startDev(
type DevProps = {
config: ResolvedConfig;
dashboardUrl: string;
apiUrl: string;
apiKey: string;
environmentClient: CliApiClient;
@@ -220,6 +223,7 @@ type DevProps = {
function useDev({
config,
dashboardUrl,
apiUrl,
apiKey,
environmentClient,
@@ -251,7 +255,7 @@ function useDev({
});
const backgroundWorkerCoordinator = new BackgroundWorkerCoordinator(
`${apiUrl}/projects/v3/${config.project}`
`${dashboardUrl}/projects/v3/${config.project}`
);
websocket.addEventListener("open", async (event) => {});