pull/22338/head^2
zxhlyh 10 months ago
parent 83ab69d2eb
commit 580c9a668f

@ -75,20 +75,21 @@ const AddOAuthButton = ({
const renderCustomLabel = useCallback((item: FormSchema) => { const renderCustomLabel = useCallback((item: FormSchema) => {
return ( return (
<div> <div className='w-full'>
<div className='mb-4 flex rounded-xl bg-background-section-burn p-4'> <div className='mb-4 flex rounded-xl bg-background-section-burn p-4'>
<div className='mr-3 flex h-9 w-9 shrink-0 items-center justify-center rounded-lg border-[0.5px] border-components-card-border bg-components-card-bg shadow-lg'> <div className='mr-3 flex h-9 w-9 shrink-0 items-center justify-center rounded-lg border-[0.5px] border-components-card-border bg-components-card-bg shadow-lg'>
<RiInformation2Fill className='h-5 w-5 text-text-accent' /> <RiInformation2Fill className='h-5 w-5 text-text-accent' />
</div> </div>
<div className='grow'> <div className='w-0 grow'>
<div className='system-sm-regular mb-2'> <div className='system-sm-regular mb-1.5'>
{t('plugin.auth.clientInfo')} {t('plugin.auth.clientInfo')}
</div> </div>
{ {
redirect_uri && ( redirect_uri && (
<div className='system-sm-medium flex items-center'> <div className='system-sm-medium flex w-full py-0.5'>
{redirect_uri} <div className='w-0 grow break-words'>{redirect_uri}</div>
<ActionButton <ActionButton
className='shrink-0'
onClick={() => { onClick={() => {
navigator.clipboard.writeText(redirect_uri || '') navigator.clipboard.writeText(redirect_uri || '')
}} }}
@ -167,14 +168,16 @@ const AddOAuthButton = ({
buttonLeftClassName, buttonLeftClassName,
)}> )}>
{buttonText} {buttonText}
{
is_oauth_custom_client_enabled && (
<Badge
className='ml-1 border-text-primary-on-surface bg-components-badge-bg-dimm text-text-primary-on-surface'
>
{t('plugin.auth.custom')}
</Badge>
)
}
</div> </div>
{
is_oauth_custom_client_enabled && (
<Badge>
{t('plugin.auth.custom')}
</Badge>
)
}
<div className={cn( <div className={cn(
'h-4 w-[1px] bg-text-primary-on-surface opacity-[0.15]', 'h-4 w-[1px] bg-text-primary-on-surface opacity-[0.15]',
dividerClassName, dividerClassName,

@ -65,7 +65,7 @@ const OAuthClientSettings = ({
await setPluginOAuthCustomClient({ await setPluginOAuthCustomClient({
client_params: transformedValues, client_params: transformedValues,
enable_oauth_custom_client: true, enable_oauth_custom_client: __oauth_client__ === 'custom',
}) })
notify({ notify({
type: 'success', type: 'success',

@ -127,6 +127,7 @@ export const useGetPluginOAuthClientSchema = (
client_params?: Record<string, any> client_params?: Record<string, any>
redirect_uri?: string redirect_uri?: string
}>(url), }>(url),
staleTime: 0,
}) })
} }

Loading…
Cancel
Save