From f7baff87e0c44e2fbe7ebb2f8b92315341faf346 Mon Sep 17 00:00:00 2001 From: Arne Durr Date: Sun, 22 Dec 2024 02:13:55 +0100 Subject: [PATCH] And forgot to do the type check, and a cosmetic fix --- .../settings/providers/ProvidersTab.tsx | 21 ++++++++----------- app/lib/git/components/ProviderCard.tsx | 10 +++++++++ app/lib/git/providers/github/index.ts | 8 +++---- 3 files changed, 23 insertions(+), 16 deletions(-) diff --git a/app/components/settings/providers/ProvidersTab.tsx b/app/components/settings/providers/ProvidersTab.tsx index 58c8dac6b..e03731f43 100644 --- a/app/components/settings/providers/ProvidersTab.tsx +++ b/app/components/settings/providers/ProvidersTab.tsx @@ -35,8 +35,8 @@ export default function ProvidersTab() { newFilteredProviders.sort((a, b) => a.name.localeCompare(b.name)); // Split providers into regular and URL-configurable - const regular = newFilteredProviders.filter(p => !URL_CONFIGURABLE_PROVIDERS.includes(p.name)); - const urlConfigurable = newFilteredProviders.filter(p => URL_CONFIGURABLE_PROVIDERS.includes(p.name)); + const regular = newFilteredProviders.filter((p) => !URL_CONFIGURABLE_PROVIDERS.includes(p.name)); + const urlConfigurable = newFilteredProviders.filter((p) => URL_CONFIGURABLE_PROVIDERS.includes(p.name)); setFilteredProviders([...regular, ...urlConfigurable]); }, [providers, searchTerm, isLocalModel]); @@ -112,8 +112,8 @@ export default function ProvidersTab() { ); }; - const regularProviders = filteredProviders.filter(p => !URL_CONFIGURABLE_PROVIDERS.includes(p.name)); - const urlConfigurableProviders = filteredProviders.filter(p => URL_CONFIGURABLE_PROVIDERS.includes(p.name)); + const regularProviders = filteredProviders.filter((p) => !URL_CONFIGURABLE_PROVIDERS.includes(p.name)); + const urlConfigurableProviders = filteredProviders.filter((p) => URL_CONFIGURABLE_PROVIDERS.includes(p.name)); return (
@@ -128,22 +128,19 @@ export default function ProvidersTab() {
{/* Regular Providers Grid */} -
- {regularProviders.map(renderProviderCard)} -
+
{regularProviders.map(renderProviderCard)}
{/* URL Configurable Providers Section */} {urlConfigurableProviders.length > 0 && (

Experimental Providers

- These providers are experimental and allow you to run AI models locally or connect to your own infrastructure. They require additional setup but offer more flexibility. + These providers are experimental and allow you to run AI models locally or connect to your own + infrastructure. They require additional setup but offer more flexibility.

-
- {urlConfigurableProviders.map(renderProviderCard)} -
+
{urlConfigurableProviders.map(renderProviderCard)}
)} ); -} \ No newline at end of file +} diff --git a/app/lib/git/components/ProviderCard.tsx b/app/lib/git/components/ProviderCard.tsx index 1f3807cda..26f4914c1 100644 --- a/app/lib/git/components/ProviderCard.tsx +++ b/app/lib/git/components/ProviderCard.tsx @@ -57,6 +57,16 @@ export function ProviderCard({
  • {step}
  • ))} +

    + + {provider.tokenSetupSetupUrl} + +

    diff --git a/app/lib/git/providers/github/index.ts b/app/lib/git/providers/github/index.ts index 707138e59..3dd493f1c 100644 --- a/app/lib/git/providers/github/index.ts +++ b/app/lib/git/providers/github/index.ts @@ -16,7 +16,7 @@ export const githubProvider: GitProvider = { icon: 'i-mdi:github-icon', }; -let project: Endpoints['GET /repos/{owner}/{repo}']['response']['data'] | null = null; +let project: Endpoints['GET /repos/{owner}/{repo}']['response']['data'] | any = null; let octokit: Octokit; export const githubAPI: GitProviderAPI = { @@ -201,7 +201,7 @@ export const githubAPI: GitProviderAPI = { return { success: true, - message: `Repository created and code pushed: ${project?.html_url}`, + message: `Repository created and code pushed: ${project.html_url}`, }; } @@ -212,7 +212,7 @@ export const githubAPI: GitProviderAPI = { await this.createCommit(files, commitMsg); return { success: true, - message: `Successfully commit to: ${project?.html_url}`, + message: `Successfully commit to: ${project.html_url}`, }; } catch (error: any) { if (error.message.includes('Update is not a fast-forward')) { @@ -247,7 +247,7 @@ export const githubAPI: GitProviderAPI = { return { success: true, - message: `Successfully commit to: ${project?.html_url}`, + message: `Successfully commit to: ${project.html_url}`, }; } catch (error: any) { console.error('Error pushing to GitHub:', error);