docs: comprehensive documentation polish & CI/CD automation
Major Updates: - Rewrote all docs in beginner-friendly 'ELI5' language - Created docs index with user journey navigation - Added complete getting-started guide for novice users - Set up GitHub Container Registry (GHCR) automation - Configured GitHub Pages deployment for documentation Documentation: - docs/index.md - Central navigation hub - docs/getting-started.md - Step-by-step beginner guide - docs/github-setup.md - CI/CD setup instructions - README.md - Complete rewrite in accessible language - CONTRIBUTING.md - Contributor guidelines - Multiple comprehensive API and schema docs CI/CD Workflows: - .github/workflows/docker-build.yml - Multi-platform builds to GHCR - .github/workflows/docs.yml - Automated docs deployment to Pages - Supports main (latest), development (dev), and version tags - Automated testing of built images - Beautiful documentation site with dark theme Benefits: - Zero barrier to entry for new users - Automated Docker builds (AMD64 + ARM64) - Professional documentation site - No Docker Hub account needed (uses GHCR) - Complete CI/CD pipeline All 7 implementation phases complete - project is production ready!
This commit is contained in:
84
frontend/src/hooks/useProxyHosts.ts
Normal file
84
frontend/src/hooks/useProxyHosts.ts
Normal file
@@ -0,0 +1,84 @@
|
||||
import { useState, useEffect } from 'react'
|
||||
import { proxyHostsAPI } from '../services/api'
|
||||
|
||||
export interface ProxyHost {
|
||||
uuid: string
|
||||
domain_names: string
|
||||
forward_scheme: string
|
||||
forward_host: string
|
||||
forward_port: number
|
||||
access_list_id?: string
|
||||
certificate_id?: string
|
||||
ssl_forced: boolean
|
||||
http2_support: boolean
|
||||
hsts_enabled: boolean
|
||||
hsts_subdomains: boolean
|
||||
block_exploits: boolean
|
||||
websocket_support: boolean
|
||||
advanced_config?: string
|
||||
enabled: boolean
|
||||
created_at: string
|
||||
updated_at: string
|
||||
}
|
||||
|
||||
export function useProxyHosts() {
|
||||
const [hosts, setHosts] = useState<ProxyHost[]>([])
|
||||
const [loading, setLoading] = useState(true)
|
||||
const [error, setError] = useState<string | null>(null)
|
||||
|
||||
const fetchHosts = async () => {
|
||||
try {
|
||||
setLoading(true)
|
||||
setError(null)
|
||||
const data = await proxyHostsAPI.list()
|
||||
setHosts(data)
|
||||
} catch (err) {
|
||||
setError(err instanceof Error ? err.message : 'Failed to fetch proxy hosts')
|
||||
} finally {
|
||||
setLoading(false)
|
||||
}
|
||||
}
|
||||
|
||||
useEffect(() => {
|
||||
fetchHosts()
|
||||
}, [])
|
||||
|
||||
const createHost = async (data: Partial<ProxyHost>) => {
|
||||
try {
|
||||
const newHost = await proxyHostsAPI.create(data)
|
||||
setHosts([...hosts, newHost])
|
||||
return newHost
|
||||
} catch (err) {
|
||||
throw new Error(err instanceof Error ? err.message : 'Failed to create proxy host')
|
||||
}
|
||||
}
|
||||
|
||||
const updateHost = async (uuid: string, data: Partial<ProxyHost>) => {
|
||||
try {
|
||||
const updatedHost = await proxyHostsAPI.update(uuid, data)
|
||||
setHosts(hosts.map(h => h.uuid === uuid ? updatedHost : h))
|
||||
return updatedHost
|
||||
} catch (err) {
|
||||
throw new Error(err instanceof Error ? err.message : 'Failed to update proxy host')
|
||||
}
|
||||
}
|
||||
|
||||
const deleteHost = async (uuid: string) => {
|
||||
try {
|
||||
await proxyHostsAPI.delete(uuid)
|
||||
setHosts(hosts.filter(h => h.uuid !== uuid))
|
||||
} catch (err) {
|
||||
throw new Error(err instanceof Error ? err.message : 'Failed to delete proxy host')
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
hosts,
|
||||
loading,
|
||||
error,
|
||||
refresh: fetchHosts,
|
||||
createHost,
|
||||
updateHost,
|
||||
deleteHost,
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user