From 27191e42343f607db4212ee4b1a7916acd0e71f5 Mon Sep 17 00:00:00 2001 From: MacRimi Date: Tue, 25 Nov 2025 22:23:02 +0100 Subject: [PATCH] Update terminal-panel.tsx --- AppImage/components/terminal-panel.tsx | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/AppImage/components/terminal-panel.tsx b/AppImage/components/terminal-panel.tsx index cd120c0..cc8f9f1 100644 --- a/AppImage/components/terminal-panel.tsx +++ b/AppImage/components/terminal-panel.tsx @@ -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 = ({ websocketUrl, onCl setIsSearching(true) const apiUrl = getApiUrl() + const token = typeof window !== "undefined" ? localStorage.getItem("proxmenux-auth-token") : null + + const headers: Record = { + 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), })