Skip to content

Commit

Permalink
Fix ID clash
Browse files Browse the repository at this point in the history
  • Loading branch information
enricoros committed Sep 20, 2023
1 parent a905a0d commit 908da13
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 6 deletions.
2 changes: 2 additions & 0 deletions src/common/components/FormInputKey.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import VisibilityOffIcon from '@mui/icons-material/VisibilityOff';


export function FormInputKey(props: {
id: string, // introduced to avoid clashes
label?: string, rightLabel?: string | React.JSX.Element,
description?: string | React.JSX.Element,
value: string, onChange: (value: string) => void,
Expand Down Expand Up @@ -39,6 +40,7 @@ export function FormInputKey(props: {
</Box>}

<Input
id={props.id}
variant={props.required ? 'outlined' : 'outlined' /* 'soft */}
value={props.value} onChange={handleChange}
placeholder={props.required ? props.placeholder ? 'required: ' + props.placeholder : 'required' : props.placeholder || '...'}
Expand Down
2 changes: 1 addition & 1 deletion src/modules/elevenlabs/ElevenlabsSettings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export function ElevenlabsSettings() {
</FormControl>

<FormInputKey
label='ElevenLabs API Key'
id='elevenlabs-key' label='ElevenLabs API Key'
rightLabel={requiresKey ? 'required' : '✔️ already set in server'}
value={apiKey} onChange={setApiKey}
required={requiresKey} isError={!isValidKey}
Expand Down
2 changes: 1 addition & 1 deletion src/modules/llms/anthropic/AnthropicSourceSetup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export function AnthropicSourceSetup(props: { sourceId: DModelSourceId }) {
return <Box sx={{ display: 'flex', flexDirection: 'column', gap: settingsGap }}>

<FormInputKey
label={'Anthropic API Key'}
id='anthropic-key' label='Anthropic API Key'
rightLabel={<>{needsUserKey
? !anthropicKey && <Link level='body-sm' href='https://www.anthropic.com/earlyaccess' target='_blank'>request Key</Link>
: '✔️ already set in server'
Expand Down
3 changes: 2 additions & 1 deletion src/modules/llms/localai/LocalAISourceSetup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,9 @@ export function LocalAISourceSetup(props: { sourceId: DModelSourceId }) {
</Typography>

<FormInputKey
id='localai-key' label='LocalAI URL'
required noKey
label='LocalAI URL' rightLabel={<Link level='body-sm' href='https://localai.io' target='_blank'>Learn more</Link>}
rightLabel={<Link level='body-sm' href='https://localai.io' target='_blank'>Learn more</Link>}
placeholder='e.g., http://127.0.0.1:8080'
value={oaiHost} onChange={value => updateSetup({ oaiHost: value })}
/>
Expand Down
2 changes: 1 addition & 1 deletion src/modules/llms/openai/OpenAISourceSetup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export function OpenAISourceSetup(props: { sourceId: DModelSourceId }) {
return <Box sx={{ display: 'flex', flexDirection: 'column', gap: settingsGap }}>

<FormInputKey
label={'API Key'}
id='openai-key' label='API Key'
rightLabel={<>{needsUserKey
? !oaiKey && <><Link level='body-sm' href='https://platform.openai.com/account/api-keys' target='_blank'>create Key</Link> and <Link level='body-sm' href='https://openai.com/waitlist/gpt-4-api' target='_blank'>apply to GPT-4</Link></>
: '✔️ already set in server'
Expand Down
2 changes: 1 addition & 1 deletion src/modules/llms/openrouter/OpenRouterSourceSetup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export function OpenRouterSourceSetup(props: { sourceId: DModelSourceId }) {
{/*</Box>*/}

<FormInputKey
label={'OpenRouter API Key'}
id='openrouter-key' label='OpenRouter API Key'
rightLabel={<>{needsUserKey
? !oaiKey && <Link level='body-sm' href='https://openrouter.ai/keys' target='_blank'>create key</Link>
: '✔️ already set in server'
Expand Down
2 changes: 1 addition & 1 deletion src/modules/prodia/ProdiaSettings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export function ProdiaSettings() {
</FormHelperText>

<FormInputKey
label='Prodia API Key'
id='prodia-key' label='Prodia API Key'
rightLabel={requiresKey ? 'required' : '✔️ already set in server'}
value={apiKey} onChange={setApiKey}
required={requiresKey} isError={!isValidKey}
Expand Down

1 comment on commit 908da13

@vercel
Copy link

@vercel vercel bot commented on 908da13 Sep 20, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

big-agi – ./

get.big-agi.com
big-agi-enricoros.vercel.app
big-agi-git-main-enricoros.vercel.app

Please sign in to comment.