Deploy Inicial do SteelCheck com Docker Build Automatizado
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import React, { useState, useCallback, useEffect } from 'react';
|
||||
import { KeyIcon, SaveIcon, TestTubeIcon } from './Icons';
|
||||
import { KeyIcon, SaveIcon, TestTubeIcon, TrashIcon } from './Icons';
|
||||
import { PROVIDERS, type AIProvider } from '../types/providers';
|
||||
import { testApiKey, type ModelInfo } from '../services/apiTestService';
|
||||
|
||||
@@ -31,6 +31,12 @@ export const ApiKeySetup: React.FC<ApiKeySetupProps> = ({ onKeySave }) => {
|
||||
const providerConfig = PROVIDERS.find(p => p.id === savedProvider);
|
||||
setModel(savedModel || providerConfig?.defaultModel || '');
|
||||
}
|
||||
|
||||
const lastKey = localStorage.getItem('last-api-key');
|
||||
if (lastKey) {
|
||||
setLocalApiKey(lastKey);
|
||||
setIsValid(isValidApiKey(lastKey));
|
||||
}
|
||||
}, []);
|
||||
|
||||
useEffect(() => {
|
||||
@@ -274,7 +280,23 @@ export const ApiKeySetup: React.FC<ApiKeySetupProps> = ({ onKeySave }) => {
|
||||
onKeyDown={(e) => e.key === 'Enter' && handleTestApi()}
|
||||
autoComplete="off"
|
||||
/>
|
||||
<div className="absolute inset-y-0 right-0 flex items-center pr-2">
|
||||
<div className="absolute inset-y-0 right-0 flex items-center pr-2 gap-2">
|
||||
{localApiKey && (
|
||||
<button
|
||||
type="button"
|
||||
onClick={() => {
|
||||
setLocalApiKey('');
|
||||
setIsValid(null);
|
||||
setError(null);
|
||||
setTestStatus('idle');
|
||||
localStorage.removeItem('last-api-key');
|
||||
}}
|
||||
className="p-2 text-slate-400 hover:text-red-500 transition-colors"
|
||||
title="Apagar chave salva"
|
||||
>
|
||||
<TrashIcon className="w-4 h-4" />
|
||||
</button>
|
||||
)}
|
||||
<button
|
||||
type="button"
|
||||
onClick={handleTestApi}
|
||||
|
||||
Reference in New Issue
Block a user