mirror of
https://github.com/MacRimi/ProxMenux.git
synced 2025-12-18 02:06:34 +00:00
Update terminal-panel.tsx
This commit is contained in:
parent
7b0110ce42
commit
27191e4234
@ -2,7 +2,7 @@
|
||||
|
||||
import type React from "react"
|
||||
import { useEffect, useRef, useState } from "react"
|
||||
import { API_PORT } from "@/lib/api-config"
|
||||
import { API_PORT } from "../lib/api-config"
|
||||
import {
|
||||
Activity,
|
||||
Trash2,
|
||||
@ -226,11 +226,19 @@ export const TerminalPanel: React.FC<TerminalPanelProps> = ({ websocketUrl, onCl
|
||||
setIsSearching(true)
|
||||
|
||||
const apiUrl = getApiUrl()
|
||||
const token = typeof window !== "undefined" ? localStorage.getItem("proxmenux-auth-token") : null
|
||||
|
||||
const headers: Record<string, string> = {
|
||||
Accept: "application/json",
|
||||
}
|
||||
|
||||
if (token) {
|
||||
headers["Authorization"] = `Bearer ${token}`
|
||||
}
|
||||
|
||||
const response = await fetch(`${apiUrl}/api/terminal/search-command?q=${encodeURIComponent(query)}`, {
|
||||
method: "GET",
|
||||
headers: {
|
||||
Accept: "application/json",
|
||||
},
|
||||
headers,
|
||||
signal: AbortSignal.timeout(10000),
|
||||
})
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user