mirror of
https://github.com/chriswritescode-dev/opencode-manager.git
synced 2026-12-06 21:04:23 +01:00
Add provider connection status tracking and API key setup flow
This commit is contained in:
1 parent
614c6ebce8
commit
15643ae06b
4 files changed
+258
-115
No files matched your search
@@ -3,7 +3,7 @@ import { Button } from '@/components/ui/button'
|
||||
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '@/components/ui/card'
|
||||
import { Badge } from '@/components/ui/badge'
|
||||
import { Loader2, Check, X, Shield } from 'lucide-react'
|
||||
import { providerCredentialsApi, getProviders, type Provider } from '@/api/providers'
|
||||
import { providerCredentialsApi, getProviders } from '@/api/providers'
|
||||
import { oauthApi, type OAuthAuthorizeResponse } from '@/api/oauth'
|
||||
import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query'
|
||||
import { OAuthAuthorizeDialog } from './OAuthAuthorizeDialog'
|
||||
@@ -16,12 +16,14 @@ export function ProviderSettings() {
|
||||
const [oauthResponse, setOauthResponse] = useState<OAuthAuthorizeResponse | null>(null)
|
||||
const queryClient = useQueryClient()
|
||||
|
||||
const { data: providers, isLoading: providersLoading } = useQuery<Provider[]>({
|
||||
const { data: providersData, isLoading: providersLoading } = useQuery({
|
||||
queryKey: ['providers'],
|
||||
queryFn: () => getProviders(),
|
||||
staleTime: 300000,
|
||||
})
|
||||
|
||||
const providers = providersData?.providers
|
||||
|
||||
const { data: credentialsList, isLoading: credentialsLoading } = useQuery({
|
||||
queryKey: ['provider-credentials'],
|
||||
queryFn: () => providerCredentialsApi.list(),
|
||||
|
||||
Reference in new issue
Block a user