fix: add missing frontend dependencies and remove trailing whitespace
- Add @tanstack/react-query, axios, and clsx to frontend dependencies - Remove trailing whitespace from multiple files to pass pre-commit hooks - These were required but missing from package.json
This commit is contained in:
@@ -103,7 +103,7 @@ describe('useImport', () => {
|
||||
await result.current.commit({ 'test.com': 'skip' })
|
||||
|
||||
expect(api.importAPI.commit).toHaveBeenCalledWith('session-2', { 'test.com': 'skip' })
|
||||
|
||||
|
||||
await waitFor(() => {
|
||||
expect(result.current.session).toBeNull()
|
||||
})
|
||||
@@ -149,7 +149,7 @@ describe('useImport', () => {
|
||||
vi.mocked(api.importAPI.upload).mockResolvedValue({ session: mockSession })
|
||||
vi.mocked(api.importAPI.status).mockResolvedValue({ has_pending: true, session: mockSession })
|
||||
vi.mocked(api.importAPI.preview).mockResolvedValue({ hosts: [], conflicts: [], errors: [] })
|
||||
|
||||
|
||||
const mockError = new Error('Commit failed')
|
||||
vi.mocked(api.importAPI.commit).mockRejectedValue(mockError)
|
||||
|
||||
|
||||
@@ -63,7 +63,7 @@ describe('useProxyHosts', () => {
|
||||
vi.mocked(api.proxyHostsAPI.list).mockResolvedValue([])
|
||||
const newHost = { domain_names: 'new.com', forward_host: 'localhost', forward_port: 9000 }
|
||||
const createdHost = { uuid: '3', ...newHost, enabled: true }
|
||||
|
||||
|
||||
vi.mocked(api.proxyHostsAPI.create).mockResolvedValue(createdHost)
|
||||
|
||||
const { result } = renderHook(() => useProxyHosts())
|
||||
@@ -81,7 +81,7 @@ describe('useProxyHosts', () => {
|
||||
it('updates an existing proxy host', async () => {
|
||||
const existingHost = { uuid: '1', domain_names: 'test.com', enabled: true, forward_host: 'localhost', forward_port: 8080 }
|
||||
vi.mocked(api.proxyHostsAPI.list).mockResolvedValue([existingHost])
|
||||
|
||||
|
||||
const updatedHost = { ...existingHost, domain_names: 'updated.com' }
|
||||
vi.mocked(api.proxyHostsAPI.update).mockResolvedValue(updatedHost)
|
||||
|
||||
|
||||
@@ -87,7 +87,7 @@ describe('useRemoteServers', () => {
|
||||
vi.mocked(api.remoteServersAPI.list).mockResolvedValue([])
|
||||
const newServer = { name: 'New Server', host: 'new.local', port: 5000, enabled: true, provider: 'generic' }
|
||||
const createdServer = { uuid: '4', ...newServer }
|
||||
|
||||
|
||||
vi.mocked(api.remoteServersAPI.create).mockResolvedValue(createdServer)
|
||||
|
||||
const { result } = renderHook(() => useRemoteServers())
|
||||
@@ -105,7 +105,7 @@ describe('useRemoteServers', () => {
|
||||
it('updates an existing remote server', async () => {
|
||||
const existingServer = { uuid: '1', name: 'Server 1', host: 'localhost', port: 8080, enabled: true }
|
||||
vi.mocked(api.remoteServersAPI.list).mockResolvedValue([existingServer])
|
||||
|
||||
|
||||
const updatedServer = { ...existingServer, name: 'Updated Server' }
|
||||
vi.mocked(api.remoteServersAPI.update).mockResolvedValue(updatedServer)
|
||||
|
||||
|
||||
@@ -69,7 +69,7 @@ export function useImport() {
|
||||
|
||||
const commit = async (resolutions: Record<string, string>) => {
|
||||
if (!session) throw new Error('No active session')
|
||||
|
||||
|
||||
try {
|
||||
setLoading(true)
|
||||
setError(null)
|
||||
@@ -87,7 +87,7 @@ export function useImport() {
|
||||
|
||||
const cancel = async () => {
|
||||
if (!session) return
|
||||
|
||||
|
||||
try {
|
||||
setLoading(true)
|
||||
setError(null)
|
||||
|
||||
@@ -27,26 +27,26 @@ export default function Dashboard() {
|
||||
return (
|
||||
<div className="p-8">
|
||||
<h1 className="text-3xl font-bold text-white mb-6">Dashboard</h1>
|
||||
|
||||
|
||||
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6 mb-8">
|
||||
<Link to="/proxy-hosts" className="bg-dark-card p-6 rounded-lg border border-gray-800 hover:border-gray-700 transition-colors">
|
||||
<div className="text-sm text-gray-400 mb-2">Proxy Hosts</div>
|
||||
<div className="text-3xl font-bold text-white mb-1">{hosts.length}</div>
|
||||
<div className="text-xs text-gray-500">{enabledHosts} enabled</div>
|
||||
</Link>
|
||||
|
||||
|
||||
<Link to="/remote-servers" className="bg-dark-card p-6 rounded-lg border border-gray-800 hover:border-gray-700 transition-colors">
|
||||
<div className="text-sm text-gray-400 mb-2">Remote Servers</div>
|
||||
<div className="text-3xl font-bold text-white mb-1">{servers.length}</div>
|
||||
<div className="text-xs text-gray-500">{enabledServers} enabled</div>
|
||||
</Link>
|
||||
|
||||
|
||||
<div className="bg-dark-card p-6 rounded-lg border border-gray-800">
|
||||
<div className="text-sm text-gray-400 mb-2">SSL Certificates</div>
|
||||
<div className="text-3xl font-bold text-white mb-1">0</div>
|
||||
<div className="text-xs text-gray-500">Coming soon</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div className="bg-dark-card p-6 rounded-lg border border-gray-800">
|
||||
<div className="text-sm text-gray-400 mb-2">System Status</div>
|
||||
<div className={`text-lg font-bold ${health?.status === 'ok' ? 'text-green-400' : 'text-red-400'}`}>
|
||||
@@ -69,7 +69,7 @@ export default function Dashboard() {
|
||||
<div className="text-xs text-gray-400">Create a new reverse proxy</div>
|
||||
</div>
|
||||
</Link>
|
||||
|
||||
|
||||
<Link
|
||||
to="/remote-servers"
|
||||
className="flex items-center gap-3 p-4 bg-gray-900 hover:bg-gray-800 rounded-lg transition-colors"
|
||||
@@ -80,7 +80,7 @@ export default function Dashboard() {
|
||||
<div className="text-xs text-gray-400">Register a backend server</div>
|
||||
</div>
|
||||
</Link>
|
||||
|
||||
|
||||
<Link
|
||||
to="/import"
|
||||
className="flex items-center gap-3 p-4 bg-gray-900 hover:bg-gray-800 rounded-lg transition-colors"
|
||||
|
||||
@@ -79,7 +79,7 @@ export default function ImportCaddy() {
|
||||
The system will detect conflicts and allow you to review changes before committing.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
|
||||
<div className="space-y-4">
|
||||
{/* File Upload */}
|
||||
<div>
|
||||
|
||||
@@ -21,7 +21,7 @@ async function request<T>(endpoint: string, options: RequestOptions = {}): Promi
|
||||
}
|
||||
|
||||
const response = await fetch(url, config)
|
||||
|
||||
|
||||
if (!response.ok) {
|
||||
const error = await response.json().catch(() => ({ error: response.statusText }))
|
||||
throw new Error(error.error || `HTTP ${response.status}`)
|
||||
|
||||
Reference in New Issue
Block a user