This commit is contained in:
@@ -96,6 +96,7 @@ interface ServerFormBody {
|
||||
oauthClientSecret?: string;
|
||||
oauthScopes?: string;
|
||||
staticToken?: string;
|
||||
authHeaderName?: string;
|
||||
enabled?: boolean;
|
||||
}
|
||||
|
||||
@@ -108,6 +109,7 @@ const emptyForm = (): ServerFormBody => ({
|
||||
oauthClientSecret: '',
|
||||
oauthScopes: '',
|
||||
staticToken: '',
|
||||
authHeaderName: '',
|
||||
});
|
||||
|
||||
function FormField({ label, children }: { label: string; children: React.ReactNode }) {
|
||||
@@ -232,18 +234,32 @@ function AddServerForm({ sectionLabel, onSubmit, isPending }: AddServerFormProps
|
||||
</>
|
||||
)}
|
||||
|
||||
{/* API key field */}
|
||||
{/* API key fields */}
|
||||
{form.authKind === 'api_key' && (
|
||||
<FormField label="API key / Bearer token">
|
||||
<input
|
||||
className="w-full border border-hairline rounded px-2 py-1 text-[13px]"
|
||||
type="password"
|
||||
value={form.staticToken ?? ''}
|
||||
onChange={(e) => setForm({ ...form, staticToken: e.target.value })}
|
||||
placeholder="sk-..."
|
||||
required
|
||||
/>
|
||||
</FormField>
|
||||
<>
|
||||
<FormField label="API key / トークン">
|
||||
<input
|
||||
className="w-full border border-hairline rounded px-2 py-1 text-[13px]"
|
||||
type="password"
|
||||
value={form.staticToken ?? ''}
|
||||
onChange={(e) => setForm({ ...form, staticToken: e.target.value })}
|
||||
placeholder="sk-..."
|
||||
required
|
||||
/>
|
||||
</FormField>
|
||||
<FormField label="認証ヘッダ名 (任意 — 空なら Authorization: Bearer)">
|
||||
<input
|
||||
className="w-full border border-hairline rounded px-2 py-1 text-[13px] font-mono"
|
||||
value={form.authHeaderName ?? ''}
|
||||
onChange={(e) => setForm({ ...form, authHeaderName: e.target.value })}
|
||||
placeholder="xc-mcp-token"
|
||||
/>
|
||||
<span className="block text-[11px] text-slate-400 mt-1">
|
||||
指定すると、トークンをこのヘッダ名でそのまま送ります(Bearer 前置なし)。例: NocoDB は{' '}
|
||||
<code className="font-mono">xc-mcp-token</code>。
|
||||
</span>
|
||||
</FormField>
|
||||
</>
|
||||
)}
|
||||
|
||||
{formError && (
|
||||
|
||||
Reference in New Issue
Block a user