This commit is contained in:
Timothy Jaeryang Baek
2026-06-25 14:34:22 +01:00
parent 7453968678
commit 5576e6ed8a
5 changed files with 112 additions and 135 deletions
+35 -1
View File
@@ -61,6 +61,7 @@
let oauthClientId = '';
let oauthClientSecret = '';
let oauthServerUrl = '';
let oauthResourceParameter = 'auto';
let enable = true;
let loading = false;
@@ -225,6 +226,7 @@
id = data.info.id ?? '';
name = data.info.name ?? '';
description = data.info.description ?? '';
oauthResourceParameter = data.info.oauth_resource_parameter ?? 'auto';
}
if (data.config) {
@@ -258,7 +260,10 @@
info: {
id: id,
name: name,
description: description
description: description,
...(type === 'mcp' && ['oauth_2.1', 'oauth_2.1_static'].includes(auth_type)
? { oauth_resource_parameter: oauthResourceParameter }
: {})
}
}
]);
@@ -342,6 +347,9 @@
id: id,
name: name,
description: description,
...(type === 'mcp' && ['oauth_2.1', 'oauth_2.1_static'].includes(auth_type)
? { oauth_resource_parameter: oauthResourceParameter }
: {}),
...(oauthClientInfo ? { oauth_client_info: oauthClientInfo } : {}),
...(auth_type === 'oauth_2.1_static'
? {
@@ -377,6 +385,7 @@
oauthClientId = '';
oauthClientSecret = '';
oauthServerUrl = '';
oauthResourceParameter = 'auto';
enable = true;
functionNameFilterList = '';
@@ -404,6 +413,7 @@
oauthClientId = connection.info?.oauth_client_id ?? '';
oauthClientSecret = connection.info?.oauth_client_secret ?? '';
oauthServerUrl = connection.info?.oauth_server_url ?? '';
oauthResourceParameter = connection.info?.oauth_resource_parameter ?? 'auto';
enable = connection.config?.enable ?? true;
functionNameFilterList = connection.config?.function_name_filter_list ?? '';
@@ -874,6 +884,30 @@
</div>
{/if}
{#if type === 'mcp' && ['oauth_2.1', 'oauth_2.1_static'].includes(auth_type)}
<div class="flex gap-2 mt-2">
<div class="flex flex-col w-full">
<label
for="oauth-resource-parameter"
class={`mb-0.5 text-xs ${($settings?.highContrastMode ?? false) ? 'text-gray-800 dark:text-gray-100' : 'text-gray-500'}`}
>{$i18n.t('OAuth Resource Parameter')}</label
>
<div class="flex flex-1 items-center">
<select
id="oauth-resource-parameter"
class={`dark:bg-gray-900 w-full text-sm bg-transparent pr-5 ${($settings?.highContrastMode ?? false) ? 'placeholder:text-gray-700 dark:placeholder:text-gray-100' : 'outline-hidden placeholder:text-gray-300 dark:placeholder:text-gray-700'}`}
bind:value={oauthResourceParameter}
>
<option value="auto">{$i18n.t('Automatic')}</option>
<option value="include">{$i18n.t('Include')}</option>
<option value="omit">{$i18n.t('Omit')}</option>
</select>
</div>
</div>
</div>
{/if}
{#if !direct}
<div class="flex gap-2 mt-2">
<div class="flex flex-col w-full">