mirror of
https://github.com/catlog22/Claude-Code-Workflow.git
synced 2026-03-01 15:03:57 +08:00
feat: initialize monorepo with package.json for CCW workflow platform
This commit is contained in:
@@ -12,7 +12,6 @@ import {
|
||||
Trash2,
|
||||
Settings,
|
||||
CheckCircle2,
|
||||
XCircle,
|
||||
MoreVertical,
|
||||
Link as LinkIcon,
|
||||
} from 'lucide-react';
|
||||
@@ -35,7 +34,6 @@ import {
|
||||
} from '@/hooks/useApiSettings';
|
||||
import { useNotifications } from '@/hooks/useNotifications';
|
||||
import type { CliSettingsEndpoint } from '@/lib/api';
|
||||
import { cn } from '@/lib/utils';
|
||||
|
||||
// ========== Types ==========
|
||||
|
||||
@@ -163,7 +161,7 @@ export function CliSettingsList({
|
||||
onEditCliSettings,
|
||||
}: CliSettingsListProps) {
|
||||
const { formatMessage } = useIntl();
|
||||
const { showNotification } = useNotifications();
|
||||
const { error } = useNotifications();
|
||||
const [searchQuery, setSearchQuery] = useState('');
|
||||
|
||||
const {
|
||||
@@ -204,8 +202,8 @@ export function CliSettingsList({
|
||||
if (confirm(confirmMessage)) {
|
||||
try {
|
||||
await deleteCliSettings(endpointId);
|
||||
} catch (error) {
|
||||
showNotification('error', formatMessage({ id: 'apiSettings.cliSettings.deleteError' }));
|
||||
} catch (err) {
|
||||
error(formatMessage({ id: 'apiSettings.cliSettings.deleteError' }));
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -213,8 +211,8 @@ export function CliSettingsList({
|
||||
const handleToggleEnabled = async (endpointId: string, enabled: boolean) => {
|
||||
try {
|
||||
await toggleCliSettings(endpointId, enabled);
|
||||
} catch (error) {
|
||||
showNotification('error', formatMessage({ id: 'apiSettings.cliSettings.toggleError' }));
|
||||
} catch (err) {
|
||||
error(formatMessage({ id: 'apiSettings.cliSettings.toggleError' }));
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ type ModeType = 'provider-based' | 'direct';
|
||||
|
||||
export function CliSettingsModal({ open, onClose, cliSettings }: CliSettingsModalProps) {
|
||||
const { formatMessage } = useIntl();
|
||||
const { showNotification } = useNotifications();
|
||||
const { error } = useNotifications();
|
||||
const isEditing = !!cliSettings;
|
||||
|
||||
// Mutations
|
||||
@@ -213,8 +213,8 @@ export function CliSettingsModal({ open, onClose, cliSettings }: CliSettingsModa
|
||||
}
|
||||
|
||||
onClose();
|
||||
} catch (error) {
|
||||
showNotification('error', formatMessage({ id: 'apiSettings.cliSettings.saveError' }));
|
||||
} catch (err) {
|
||||
error(formatMessage({ id: 'apiSettings.cliSettings.saveError' }));
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -139,7 +139,7 @@ export function EndpointList({
|
||||
onEditEndpoint,
|
||||
}: EndpointListProps) {
|
||||
const { formatMessage } = useIntl();
|
||||
const { showNotification } = useNotifications();
|
||||
const { error } = useNotifications();
|
||||
const [searchQuery, setSearchQuery] = useState('');
|
||||
const [showDisabledOnly, setShowDisabledOnly] = useState(false);
|
||||
const [showCachedOnly, setShowCachedOnly] = useState(false);
|
||||
@@ -176,8 +176,8 @@ export function EndpointList({
|
||||
if (window.confirm(confirmMessage)) {
|
||||
try {
|
||||
await deleteEndpoint(endpointId);
|
||||
} catch (error) {
|
||||
showNotification('error', formatMessage({ id: 'apiSettings.endpoints.deleteError' }));
|
||||
} catch (err) {
|
||||
error(formatMessage({ id: 'apiSettings.endpoints.deleteError' }));
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -185,8 +185,8 @@ export function EndpointList({
|
||||
const handleToggleEnabled = async (endpointId: string, enabled: boolean) => {
|
||||
try {
|
||||
await updateEndpoint(endpointId, { enabled });
|
||||
} catch (error) {
|
||||
showNotification('error', formatMessage({ id: 'apiSettings.endpoints.toggleError' }));
|
||||
} catch (err) {
|
||||
error(formatMessage({ id: 'apiSettings.endpoints.toggleError' }));
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -105,7 +105,7 @@ function FilePatternInput({ value, onChange, placeholder }: FilePatternInputProp
|
||||
|
||||
export function EndpointModal({ open, onClose, endpoint }: EndpointModalProps) {
|
||||
const { formatMessage } = useIntl();
|
||||
const { showNotification } = useNotifications();
|
||||
const { error } = useNotifications();
|
||||
const isEditing = !!endpoint;
|
||||
|
||||
// Mutations
|
||||
@@ -213,8 +213,8 @@ export function EndpointModal({ open, onClose, endpoint }: EndpointModalProps) {
|
||||
}
|
||||
|
||||
onClose();
|
||||
} catch (error) {
|
||||
showNotification('error', formatMessage({ id: 'apiSettings.endpoints.saveError' }));
|
||||
} catch (err) {
|
||||
error(formatMessage({ id: 'apiSettings.endpoints.saveError' }));
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -29,7 +29,6 @@ import { Collapsible, CollapsibleContent, CollapsibleTrigger } from '@/component
|
||||
import { Badge } from '@/components/ui/Badge';
|
||||
import { useProviders, useUpdateProvider } from '@/hooks/useApiSettings';
|
||||
import { useNotifications } from '@/hooks/useNotifications';
|
||||
import type { ModelDefinition } from '@/lib/api';
|
||||
|
||||
// ========== Types ==========
|
||||
|
||||
@@ -164,7 +163,7 @@ function ModelEntryRow({
|
||||
|
||||
export function ManageModelsModal({ open, onClose, providerId }: ManageModelsModalProps) {
|
||||
const { formatMessage } = useIntl();
|
||||
const { showNotification } = useNotifications();
|
||||
const { success, error } = useNotifications();
|
||||
const { providers } = useProviders();
|
||||
const { updateProvider, isUpdating } = useUpdateProvider();
|
||||
|
||||
@@ -259,10 +258,10 @@ export function ManageModelsModal({ open, onClose, providerId }: ManageModelsMod
|
||||
})),
|
||||
});
|
||||
|
||||
showNotification('success', formatMessage({ id: 'apiSettings.providers.actions.save' }) + ' success');
|
||||
success(formatMessage({ id: 'apiSettings.providers.actions.save' }));
|
||||
onClose();
|
||||
} catch (error) {
|
||||
showNotification('error', formatMessage({ id: 'apiSettings.providers.saveError' }));
|
||||
} catch (err) {
|
||||
error(formatMessage({ id: 'apiSettings.providers.saveError' }));
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -46,13 +46,6 @@ interface ApiKeyFormEntry {
|
||||
enabled: boolean;
|
||||
}
|
||||
|
||||
interface HealthCheckSettings {
|
||||
enabled: boolean;
|
||||
intervalSeconds: number;
|
||||
cooldownSeconds: number;
|
||||
failureThreshold: number;
|
||||
}
|
||||
|
||||
// ========== Helper Components ==========
|
||||
|
||||
interface ApiKeyEntryRowProps {
|
||||
@@ -147,7 +140,7 @@ function ApiKeyEntryRow({
|
||||
|
||||
export function MultiKeySettingsModal({ open, onClose, providerId }: MultiKeySettingsModalProps) {
|
||||
const { formatMessage } = useIntl();
|
||||
const { showNotification } = useNotifications();
|
||||
const { success, error } = useNotifications();
|
||||
const { providers } = useProviders();
|
||||
const { updateProvider, isUpdating } = useUpdateProvider();
|
||||
|
||||
@@ -256,10 +249,10 @@ export function MultiKeySettingsModal({ open, onClose, providerId }: MultiKeySet
|
||||
} : undefined,
|
||||
});
|
||||
|
||||
showNotification('success', formatMessage({ id: 'apiSettings.providers.actions.save' }) + ' success');
|
||||
success(formatMessage({ id: 'apiSettings.providers.actions.save' }));
|
||||
onClose();
|
||||
} catch (error) {
|
||||
showNotification('error', formatMessage({ id: 'apiSettings.providers.saveError' }));
|
||||
} catch (err) {
|
||||
error(formatMessage({ id: 'apiSettings.providers.saveError' }));
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -189,7 +189,7 @@ export function ProviderList({
|
||||
onManageModels,
|
||||
}: ProviderListProps) {
|
||||
const { formatMessage } = useIntl();
|
||||
const { showNotification } = useNotifications();
|
||||
const { error } = useNotifications();
|
||||
const [searchQuery, setSearchQuery] = useState('');
|
||||
const [showDisabledOnly, setShowDisabledOnly] = useState(false);
|
||||
|
||||
@@ -224,8 +224,8 @@ export function ProviderList({
|
||||
if (window.confirm(confirmMessage)) {
|
||||
try {
|
||||
await deleteProvider(providerId);
|
||||
} catch (error) {
|
||||
showNotification('error', formatMessage({ id: 'apiSettings.providers.deleteError' }));
|
||||
} catch (err) {
|
||||
error(formatMessage({ id: 'apiSettings.providers.deleteError' }));
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -233,8 +233,8 @@ export function ProviderList({
|
||||
const handleToggleEnabled = async (providerId: string, enabled: boolean) => {
|
||||
try {
|
||||
await updateProvider(providerId, { enabled });
|
||||
} catch (error) {
|
||||
showNotification('error', formatMessage({ id: 'apiSettings.providers.toggleError' }));
|
||||
} catch (err) {
|
||||
error(formatMessage({ id: 'apiSettings.providers.toggleError' }));
|
||||
}
|
||||
};
|
||||
|
||||
@@ -245,8 +245,8 @@ export function ProviderList({
|
||||
// Trigger health check refresh
|
||||
await triggerHealthCheck(providerId);
|
||||
}
|
||||
} catch (error) {
|
||||
showNotification('error', formatMessage({ id: 'apiSettings.providers.testError' }));
|
||||
} catch (err) {
|
||||
error(formatMessage({ id: 'apiSettings.providers.testError' }));
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -151,7 +151,7 @@ function ApiKeyEntryRow({
|
||||
|
||||
export function ProviderModal({ open, onClose, provider }: ProviderModalProps) {
|
||||
const { formatMessage } = useIntl();
|
||||
const { showNotification } = useNotifications();
|
||||
const { error } = useNotifications();
|
||||
const isEditing = !!provider;
|
||||
|
||||
// Mutations
|
||||
@@ -420,8 +420,8 @@ export function ProviderModal({ open, onClose, provider }: ProviderModalProps) {
|
||||
}
|
||||
|
||||
onClose();
|
||||
} catch (error) {
|
||||
showNotification('error', formatMessage({ id: 'apiSettings.providers.saveError' }));
|
||||
} catch (err) {
|
||||
error(formatMessage({ id: 'apiSettings.providers.saveError' }));
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user