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}
|
||||
|
||||
@@ -93,6 +93,11 @@ export const SignOutIcon: React.FC<React.SVGProps<SVGSVGElement>> = (props) => (
|
||||
|
||||
export const TestTubeIcon: React.FC<React.SVGProps<SVGSVGElement>> = (props) => (
|
||||
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" strokeWidth={1.5} stroke="currentColor" {...props}>
|
||||
<path strokeLinecap="round" strokeLinejoin="round" d="M9.75 3.104v5.714a2.25 2.25 0 01-.659 1.591L5 14.5M9.75 3.104c-.251.023-.501.05-.75.082m.75-.082a24.301 24.301 0 014.5 0m0 0v5.714c0 .597.237 1.17.659 1.591L19.8 15.3M14.25 3.104c.251.023.501.05.75.082M19.8 15.3l-1.57.393A9.065 9.065 0 0112 15a9.065 9.065 0 00-6.23.693L5 14.5m14.8.8l1.402 1.402c1.232 1.232.65 3.318-1.067 3.611A48.309 48.309 0 0112 21c-2.773 0-5.491-.235-8.135-.687-1.718-.293-2.3-2.379-1.067-3.61L5 14.5" />
|
||||
</svg>
|
||||
);
|
||||
|
||||
export const TrashIcon: React.FC<React.SVGProps<SVGSVGElement>> = (props) => (
|
||||
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" strokeWidth={1.5} stroke="currentColor" {...props}>
|
||||
<path strokeLinecap="round" strokeLinejoin="round" d="M14.74 9l-.346 9m-4.788 0L9.26 9m9.968-3.21c.342.052.682.107 1.022.166m-1.022-.165L18.16 19.673a2.25 2.25 0 01-2.244 2.077H8.084a2.25 2.25 0 01-2.244-2.077L4.772 5.79m14.456 0a48.108 48.108 0 00-3.478-.397m-12 .562c.34-.059.68-.114 1.022-.165m0 0a48.11 48.11 0 013.478-.397m7.5 0v-.916c0-1.18-.91-2.164-2.09-2.201a51.964 51.964 0 00-3.32 0c-1.18.037-2.09 1.022-2.09 2.201v.916m7.5 0a48.667 48.667 0 00-7.5 0" />
|
||||
</svg>
|
||||
);
|
||||
Reference in New Issue
Block a user