mirror of
https://github.com/langgenius/dify.git
synced 2026-05-04 01:18:05 +08:00
refactor(sandbox): sandbox provider system default configuration
This commit is contained in:
@ -47,7 +47,7 @@ const ProviderCard = ({
|
||||
<span className="system-md-semibold text-text-primary">
|
||||
{provider.label}
|
||||
</span>
|
||||
{provider.is_system_configured && (
|
||||
{provider.is_system_configured && !provider.is_tenant_configured && (
|
||||
<span className="system-2xs-medium rounded-[5px] border border-divider-deep px-[5px] py-[3px] text-text-tertiary">
|
||||
{t('sandboxProvider.managedBySaas', { ns: 'common' })}
|
||||
</span>
|
||||
|
||||
@ -10,18 +10,6 @@ export const getSandboxProviderListContract = base
|
||||
.input(type<unknown>())
|
||||
.output(type<SandboxProvider[]>())
|
||||
|
||||
export const getSandboxProviderContract = base
|
||||
.route({
|
||||
path: '/workspaces/current/sandbox-provider/{providerType}',
|
||||
method: 'GET',
|
||||
})
|
||||
.input(type<{
|
||||
params: {
|
||||
providerType: string
|
||||
}
|
||||
}>())
|
||||
.output(type<SandboxProvider>())
|
||||
|
||||
export const saveSandboxProviderConfigContract = base
|
||||
.route({
|
||||
path: '/workspaces/current/sandbox-provider/{providerType}/config',
|
||||
@ -60,11 +48,3 @@ export const activateSandboxProviderContract = base
|
||||
}
|
||||
}>())
|
||||
.output(type<{ result: string }>())
|
||||
|
||||
export const getActiveSandboxProviderContract = base
|
||||
.route({
|
||||
path: '/workspaces/current/sandbox-provider/active',
|
||||
method: 'GET',
|
||||
})
|
||||
.input(type<unknown>())
|
||||
.output(type<{ provider_type: string | null }>())
|
||||
|
||||
@ -16,8 +16,6 @@ import { bindPartnerStackContract, invoicesContract } from './console/billing'
|
||||
import {
|
||||
activateSandboxProviderContract,
|
||||
deleteSandboxProviderConfigContract,
|
||||
getActiveSandboxProviderContract,
|
||||
getSandboxProviderContract,
|
||||
getSandboxProviderListContract,
|
||||
saveSandboxProviderConfigContract,
|
||||
} from './console/sandbox-provider'
|
||||
@ -40,11 +38,9 @@ export const consoleRouterContract = {
|
||||
},
|
||||
sandboxProvider: {
|
||||
getSandboxProviderList: getSandboxProviderListContract,
|
||||
getSandboxProvider: getSandboxProviderContract,
|
||||
saveSandboxProviderConfig: saveSandboxProviderConfigContract,
|
||||
deleteSandboxProviderConfig: deleteSandboxProviderConfigContract,
|
||||
activateSandboxProvider: activateSandboxProviderContract,
|
||||
getActiveSandboxProvider: getActiveSandboxProviderContract,
|
||||
},
|
||||
appAsset: {
|
||||
tree: treeContract,
|
||||
|
||||
@ -12,14 +12,6 @@ export const useGetSandboxProviderList = () => {
|
||||
})
|
||||
}
|
||||
|
||||
export const useGetSandboxProvider = (providerType: string) => {
|
||||
return useQuery({
|
||||
queryKey: consoleQuery.sandboxProvider.getSandboxProvider.queryKey({ input: { params: { providerType } } }),
|
||||
queryFn: () => consoleClient.sandboxProvider.getSandboxProvider({ params: { providerType } }),
|
||||
enabled: !!providerType,
|
||||
})
|
||||
}
|
||||
|
||||
export const useSaveSandboxProviderConfig = () => {
|
||||
const queryClient = useQueryClient()
|
||||
return useMutation({
|
||||
@ -65,10 +57,3 @@ export const useActivateSandboxProvider = () => {
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
export const useGetActiveSandboxProvider = () => {
|
||||
return useQuery({
|
||||
queryKey: consoleQuery.sandboxProvider.getActiveSandboxProvider.queryKey(),
|
||||
queryFn: () => consoleClient.sandboxProvider.getActiveSandboxProvider(),
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user