Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions archon-ui-main/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions archon-ui-main/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
"react-router-dom": "^6.26.2",
"socket.io-client": "^4.8.1",
"tailwind-merge": "latest",
"uuid": "^11.1.0",
"zod": "^3.25.46"
},
"devDependencies": {
Expand All @@ -45,6 +46,7 @@
"@types/node": "^20.19.0",
"@types/react": "^18.3.1",
"@types/react-dom": "^18.3.1",
"@types/uuid": "^10.0.0",
"@typescript-eslint/eslint-plugin": "^5.54.0",
"@typescript-eslint/parser": "^5.54.0",
"@vitejs/plugin-react": "^4.2.1",
Expand Down
23 changes: 4 additions & 19 deletions archon-ui-main/src/config/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,25 +12,10 @@ export function getApiUrl(): string {
return import.meta.env.VITE_API_URL;
}

// For relative URLs in production (goes through proxy)
if (import.meta.env.PROD) {
return '';
}

// For development, construct from window location
const protocol = window.location.protocol;
const host = window.location.hostname;
const port = import.meta.env.ARCHON_SERVER_PORT;

if (!port) {
throw new Error(
'ARCHON_SERVER_PORT environment variable is required. ' +
'Please set it in your environment variables. ' +
'Default value: 8181'
);
}

return `${protocol}//${host}:${port}`;
// In both development (via Vite proxy) and production, we use a relative path.
// This ensures that requests are proxied correctly by the dev server or
// sent to the same origin in production.
return '';
}

// Get the base path for API endpoints
Expand Down
3 changes: 2 additions & 1 deletion archon-ui-main/src/services/testService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ export interface TestStatus {
}

import { getApiUrl, getWebSocketUrl } from '../config/api';
import { v4 as uuidv4 } from 'uuid';

// Use unified API configuration
const API_BASE_URL = getApiUrl();
Expand Down Expand Up @@ -159,7 +160,7 @@ class TestService {
onError?: (error: Error) => void,
onComplete?: () => void
): Promise<string> {
const execution_id = crypto.randomUUID();
const execution_id = uuidv4();

try {
// Send initial status
Expand Down