diff --git a/src/features/providers/sheets/forms/BaseProviderForm.tsx b/src/features/providers/sheets/forms/BaseProviderForm.tsx index 03dd197..820bb16 100644 --- a/src/features/providers/sheets/forms/BaseProviderForm.tsx +++ b/src/features/providers/sheets/forms/BaseProviderForm.tsx @@ -635,7 +635,20 @@ export function BaseProviderForm({ defaultOpen >
-
+
+ {/* Add entry button on the left */} + + {/* Test all button on the right */}
- {apiKeyEntries.map((entry, idx) => { - const status = connectivity.openaiStatuses[idx] ?? { + {[...apiKeyEntries].reverse().map((entry, visualIdx) => { + const realIdx = apiKeyEntries.length - 1 - visualIdx; + const status = connectivity.openaiStatuses[realIdx] ?? { state: 'idle' as ConnectivityState, message: '', }; return ( -
+
- {t('providersPage.form.apiKeyEntry', { index: idx + 1 })} + {t('providersPage.form.apiKeyEntry', { index: realIdx + 1 })}
@@ -667,7 +681,7 @@ export function BaseProviderForm({ type="button" className={styles.connectivityBtnGhost} disabled={mutating || status.state === 'loading'} - onClick={() => void connectivity.runOpenAIKey(idx)} + onClick={() => void connectivity.runOpenAIKey(realIdx)} > {status.state === 'loading' ? ( @@ -683,7 +697,7 @@ export function BaseProviderForm({ onClick={() => updateField( 'apiKeyEntries', - apiKeyEntries.filter((_, i) => i !== idx) + apiKeyEntries.filter((_, i) => i !== realIdx) ) } > @@ -703,7 +717,7 @@ export function BaseProviderForm({ updateField( 'apiKeyEntries', apiKeyEntries.map((it, i) => - i === idx ? { ...it, apiKey: e.target.value } : it + i === realIdx ? { ...it, apiKey: e.target.value } : it ) ) } @@ -722,7 +736,7 @@ export function BaseProviderForm({ updateField( 'apiKeyEntries', apiKeyEntries.map((it, i) => - i === idx ? { ...it, proxyUrl: e.target.value } : it + i === realIdx ? { ...it, proxyUrl: e.target.value } : it ) ) } @@ -746,7 +760,7 @@ export function BaseProviderForm({ updateField( 'apiKeyEntries', apiKeyEntries.map((it, i) => - i === idx ? { ...it, headersText: e.target.value } : it + i === realIdx ? { ...it, headersText: e.target.value } : it ) ) } @@ -762,17 +776,6 @@ export function BaseProviderForm({
); })} -
) : null} diff --git a/src/features/providers/sheets/forms/sharedForm.module.scss b/src/features/providers/sheets/forms/sharedForm.module.scss index 9a1ecf8..0b8d3eb 100644 --- a/src/features/providers/sheets/forms/sharedForm.module.scss +++ b/src/features/providers/sheets/forms/sharedForm.module.scss @@ -221,6 +221,10 @@ margin-bottom: 2px; } +.entriesToolbarSplit { + justify-content: space-between; +} + .connectivityRow { display: flex; align-items: center;