Update terminal-panel.tsx

This commit is contained in:
MacRimi
2025-11-25 22:23:02 +01:00
parent 7b0110ce42
commit 27191e4234

View File

@@ -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),
})