feat: local providers refactor & enhancement (#1968)
* feat: improve local providers health monitoring and model management - Add automatic health monitoring initialization for enabled providers - Add LM Studio model management and display functionality - Fix endpoint status detection by setting default base URLs - Replace mixed icon libraries with consistent Lucide icons only - Fix button styling with transparent backgrounds - Add comprehensive setup guides with web-researched content - Add proper navigation with back buttons between views - Fix all TypeScript and linting issues in LocalProvidersTab 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com> * Remove Service Status tab and related code The Service Status tab and all associated files, components, and provider checkers have been deleted. References to 'service-status' have been removed from tab constants, types, and the control panel. This simplifies the settings UI and codebase by eliminating the service status monitoring feature. * Update LocalProvidersTab.tsx * Fix all linter and TypeScript errors in local providers components - Remove unused imports and fix import formatting - Fix type-only imports for OllamaModel and LMStudioModel - Fix Icon component usage in ProviderCard.tsx - Clean up unused imports across all local provider files - Ensure all TypeScript and ESLint checks pass --------- Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,64 @@
|
||||
import React from 'react';
|
||||
import { CheckCircle, XCircle, Loader2, AlertCircle } from 'lucide-react';
|
||||
import { classNames } from '~/utils/classNames';
|
||||
|
||||
interface HealthStatusBadgeProps {
|
||||
status: 'healthy' | 'unhealthy' | 'checking' | 'unknown';
|
||||
responseTime?: number;
|
||||
className?: string;
|
||||
}
|
||||
|
||||
function HealthStatusBadge({ status, responseTime, className }: HealthStatusBadgeProps) {
|
||||
const getStatusConfig = () => {
|
||||
switch (status) {
|
||||
case 'healthy':
|
||||
return {
|
||||
color: 'text-green-500',
|
||||
bgColor: 'bg-green-500/10 border-green-500/20',
|
||||
Icon: CheckCircle,
|
||||
label: 'Healthy',
|
||||
};
|
||||
case 'unhealthy':
|
||||
return {
|
||||
color: 'text-red-500',
|
||||
bgColor: 'bg-red-500/10 border-red-500/20',
|
||||
Icon: XCircle,
|
||||
label: 'Unhealthy',
|
||||
};
|
||||
case 'checking':
|
||||
return {
|
||||
color: 'text-blue-500',
|
||||
bgColor: 'bg-blue-500/10 border-blue-500/20',
|
||||
Icon: Loader2,
|
||||
label: 'Checking',
|
||||
};
|
||||
default:
|
||||
return {
|
||||
color: 'text-bolt-elements-textTertiary',
|
||||
bgColor: 'bg-bolt-elements-background-depth-3 border-bolt-elements-borderColor',
|
||||
Icon: AlertCircle,
|
||||
label: 'Unknown',
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
const config = getStatusConfig();
|
||||
const Icon = config.Icon;
|
||||
|
||||
return (
|
||||
<div
|
||||
className={classNames(
|
||||
'flex items-center gap-2 px-3 py-1.5 rounded-lg text-xs font-medium border transition-colors',
|
||||
config.bgColor,
|
||||
config.color,
|
||||
className,
|
||||
)}
|
||||
>
|
||||
<Icon className={classNames('w-3 h-3', { 'animate-spin': status === 'checking' })} />
|
||||
<span>{config.label}</span>
|
||||
{responseTime !== undefined && status === 'healthy' && <span className="opacity-75">({responseTime}ms)</span>}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
export default HealthStatusBadge;
|
||||
Reference in New Issue
Block a user