This commit is contained in:
2026-06-01 17:09:40 +03:00
parent 4c5da7e4d9
commit 40e364d9f6
5 changed files with 17 additions and 10 deletions

View File

@@ -124,7 +124,7 @@ function shouldSuppressApiErrorToast(endpoint: string, error: ApiError): boolean
*/
export const getWsUrl = (taskId: string): string => {
const protocol = typeof window !== 'undefined' && window.location.protocol === 'https:' ? 'wss:' : 'ws:';
const host = typeof window !== 'development' && typeof window !== 'undefined' ? window.location.host : 'localhost:8000';
const host = typeof window !== 'undefined' ? window.location.host : 'localhost:8000';
let url = `${protocol}//${host}/ws/logs/${taskId}`;
if (typeof window !== 'undefined') {
const token = localStorage.getItem('auth_token');
@@ -140,7 +140,7 @@ export const getWsUrl = (taskId: string): string => {
*/
export const getTaskEventsWsUrl = (): string => {
const protocol = typeof window !== 'undefined' && window.location.protocol === 'https:' ? 'wss:' : 'ws:';
const host = typeof window !== 'development' && typeof window !== 'undefined' ? window.location.host : 'localhost:8000';
const host = typeof window !== 'undefined' ? window.location.host : 'localhost:8000';
let url = `${protocol}//${host}/ws/task-events`;
if (typeof window !== 'undefined') {
const token = localStorage.getItem('auth_token');
@@ -156,7 +156,7 @@ export const getTaskEventsWsUrl = (): string => {
*/
export const getMaintenanceEventsWsUrl = (): string => {
const protocol = typeof window !== 'undefined' && window.location.protocol === 'https:' ? 'wss:' : 'ws:';
const host = typeof window !== 'development' && typeof window !== 'undefined' ? window.location.host : 'localhost:8000';
const host = typeof window !== 'undefined' ? window.location.host : 'localhost:8000';
let url = `${protocol}//${host}/ws/maintenance/events`;
if (typeof window !== 'undefined') {
const token = localStorage.getItem('auth_token');

View File

@@ -149,7 +149,7 @@
<div
class="bg-primary h-2.5 rounded-full transition-all duration-500"
style="width: {Math.min(progressPct, 100)}%"
/>
></div>
</div>
<!-- Stats grid -->
@@ -181,6 +181,7 @@
class:bg-destructive={uxState === 'failed'}
class:bg-gray-500={uxState === 'cancelled'}
onclick={handleClick}
onkeydown={(e) => { if (e.key === 'Enter' || e.key === ' ') { e.preventDefault(); handleClick(); } }}
role="button"
tabindex="0"
>