From c3a6dfadb43971e070a6bf1a391a6a6bf8ff0e16 Mon Sep 17 00:00:00 2001 From: samanhappy Date: Fri, 20 Jun 2025 14:52:22 +0800 Subject: [PATCH] feat: Add dynamic header input fields for server configuration in ServerForm (#193) --- frontend/src/components/ServerForm.tsx | 43 ++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/frontend/src/components/ServerForm.tsx b/frontend/src/components/ServerForm.tsx index e040d70..e0e4452 100644 --- a/frontend/src/components/ServerForm.tsx +++ b/frontend/src/components/ServerForm.tsx @@ -615,6 +615,49 @@ const ServerForm = ({ onSubmit, onCancel, initialData = null, modalTitle, formEr )} + +
+
+ + +
+ {headerVars.map((headerVar, index) => ( +
+
+ handleHeaderVarChange(index, 'key', e.target.value)} + className="shadow appearance-none border rounded py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline w-1/2" + placeholder="Authorization" + /> + : + handleHeaderVarChange(index, 'value', e.target.value)} + className="shadow appearance-none border rounded py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline w-1/2" + placeholder="Bearer token..." + /> +
+ +
+ ))} +
) : serverType === 'sse' || serverType === 'streamable-http' ? ( <>