mirror of
https://github.com/MacRimi/ProxMenux.git
synced 2026-06-15 04:47:00 +00:00
Update AppImage 1.2.1.3
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
import type React from "react"
|
||||
import { useEffect, useRef, useState } from "react"
|
||||
import { API_PORT, fetchApi } from "@/lib/api-config" // Unificando importaciones de api-config en una sola línea con alias @/
|
||||
import { getTicketedWsUrl, getWsUrl } from "@/lib/terminal-ws"
|
||||
import { getTicketedWsUrl } from "@/lib/terminal-ws"
|
||||
import {
|
||||
Activity,
|
||||
Trash2,
|
||||
@@ -51,7 +51,20 @@ interface TerminalInstance {
|
||||
}
|
||||
|
||||
function getWebSocketUrl(): string {
|
||||
return getWsUrl("/ws/terminal")
|
||||
if (typeof window === "undefined") {
|
||||
return "ws://localhost:8008/ws/terminal"
|
||||
}
|
||||
|
||||
const { protocol, hostname, port } = window.location
|
||||
const isStandardPort = port === "" || port === "80" || port === "443"
|
||||
|
||||
const wsProtocol = protocol === "https:" ? "wss:" : "ws:"
|
||||
|
||||
if (isStandardPort) {
|
||||
return `${wsProtocol}//${hostname}/ws/terminal`
|
||||
} else {
|
||||
return `${wsProtocol}//${hostname}:${API_PORT}/ws/terminal`
|
||||
}
|
||||
}
|
||||
|
||||
function getApiUrl(endpoint?: string): string {
|
||||
|
||||
Reference in New Issue
Block a user