feat: Add Wild Central web app (Central-only UI)
Extract Central pages from the wild-cloud web app into a standalone React app for Wild Central. Includes: - Central overview, DNS, DHCP, Firewall, VPN, Ingress, CrowdSec pages - Simplified sidebar with Central-only navigation - Branding updated to "Wild Central" - All Cloud-specific pages, components, hooks, and API services removed - TypeScript type-check and production build pass Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
176
web/src/types/index.ts
Normal file
176
web/src/types/index.ts
Normal file
@@ -0,0 +1,176 @@
|
||||
export interface Status {
|
||||
status: string;
|
||||
version: string;
|
||||
uptime: string;
|
||||
timestamp: string;
|
||||
}
|
||||
|
||||
// ========================================
|
||||
// Global Config Types (Wild Central level)
|
||||
// Endpoint: /api/v1/config
|
||||
// File: {dataDir}/config.yaml
|
||||
// ========================================
|
||||
|
||||
export interface HAProxyCustomRoute {
|
||||
name: string;
|
||||
port: number;
|
||||
backend: string;
|
||||
}
|
||||
|
||||
export interface GlobalConfig {
|
||||
operator?: {
|
||||
email?: string;
|
||||
};
|
||||
cloud?: {
|
||||
central?: {
|
||||
domain?: string;
|
||||
};
|
||||
router?: {
|
||||
ip?: string;
|
||||
dynamicDns?: string;
|
||||
};
|
||||
dnsmasq?: {
|
||||
ip?: string;
|
||||
interface?: string;
|
||||
dhcp?: {
|
||||
enabled?: boolean;
|
||||
rangeStart?: string;
|
||||
rangeEnd?: string;
|
||||
leaseTime?: string;
|
||||
gateway?: string;
|
||||
};
|
||||
};
|
||||
haproxy?: {
|
||||
defaultInstance?: string;
|
||||
customRoutes?: HAProxyCustomRoute[];
|
||||
};
|
||||
nftables?: {
|
||||
enabled?: boolean;
|
||||
wanInterface?: string;
|
||||
extraPorts?: Array<{ port: number; protocol?: string; label?: string }>;
|
||||
};
|
||||
ddns?: {
|
||||
enabled?: boolean;
|
||||
provider?: string;
|
||||
records?: string[];
|
||||
intervalMinutes?: number;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
export interface GlobalConfigResponse {
|
||||
configured: boolean;
|
||||
config?: GlobalConfig;
|
||||
message?: string;
|
||||
}
|
||||
|
||||
// ========================================
|
||||
// Instance Config Types (Wild Cloud instance level)
|
||||
// Endpoint: /api/v1/instances/{name}/config
|
||||
// File: {dataDir}/instances/{name}/config.yaml
|
||||
// ========================================
|
||||
|
||||
export interface NodeConfig {
|
||||
role: string;
|
||||
interface: string;
|
||||
disk: string;
|
||||
currentIp: string;
|
||||
}
|
||||
|
||||
export interface InstanceConfig {
|
||||
operator?: {
|
||||
email?: string;
|
||||
};
|
||||
cloud?: {
|
||||
baseDomain?: string;
|
||||
domain?: string;
|
||||
internalDomain?: string;
|
||||
dhcpRange?: string;
|
||||
nfs?: {
|
||||
host?: string;
|
||||
mediaPath?: string;
|
||||
storageCapacity?: string;
|
||||
};
|
||||
dockerRegistryHost?: string;
|
||||
};
|
||||
cluster?: {
|
||||
name?: string;
|
||||
loadBalancerIp?: string;
|
||||
ipAddressPool?: string;
|
||||
hostnamePrefix?: string;
|
||||
certManager?: {
|
||||
cloudflare?: {
|
||||
domain?: string;
|
||||
};
|
||||
};
|
||||
externalDns?: {
|
||||
ownerId?: string;
|
||||
};
|
||||
internalDns?: {
|
||||
externalResolver?: string;
|
||||
};
|
||||
dockerRegistry?: {
|
||||
storage?: string;
|
||||
};
|
||||
nodes?: {
|
||||
talos?: {
|
||||
version?: string;
|
||||
schematicId?: string;
|
||||
};
|
||||
control?: {
|
||||
vip?: string;
|
||||
};
|
||||
active?: Record<string, NodeConfig>;
|
||||
};
|
||||
};
|
||||
apps?: Record<string, Record<string, unknown>>; // Each app has its own dynamic config
|
||||
}
|
||||
|
||||
export interface InstanceConfigResponse {
|
||||
config?: InstanceConfig;
|
||||
message?: string;
|
||||
}
|
||||
|
||||
export interface Message {
|
||||
message: string;
|
||||
type: 'info' | 'success' | 'error';
|
||||
}
|
||||
|
||||
export interface LoadingState {
|
||||
[key: string]: boolean;
|
||||
}
|
||||
|
||||
export interface Messages {
|
||||
[key: string]: Message;
|
||||
}
|
||||
|
||||
export interface HealthResponse {
|
||||
service: string;
|
||||
status: string;
|
||||
}
|
||||
|
||||
export interface StatusResponse {
|
||||
status: string;
|
||||
message?: string;
|
||||
}
|
||||
|
||||
export interface DnsmasqStatus {
|
||||
status: string;
|
||||
pid: number;
|
||||
ip: string;
|
||||
config_file: string;
|
||||
instances_configured: number;
|
||||
last_restart: string;
|
||||
}
|
||||
|
||||
export interface DnsmasqConfigResponse {
|
||||
config_file: string;
|
||||
content: string;
|
||||
message?: string;
|
||||
config?: string;
|
||||
}
|
||||
|
||||
export interface NetworkInfo {
|
||||
primary_ip: string;
|
||||
primary_interface: string;
|
||||
}
|
||||
Reference in New Issue
Block a user