Replace state blob with resource-oriented API endpoints
Split /api/v1/state into dedicated resource endpoints: - /api/v1/operator, /api/v1/central-domain - /api/v1/ddns/config, /api/v1/dns/settings - /api/v1/dhcp/config (moved from /dnsmasq/dhcp/) - /api/v1/nftables/config, /api/v1/haproxy/routes Each page now talks to its own resource instead of deep-merging a blob. Removes useConfig hook, CentralState type, and legacy config methods.
This commit is contained in:
@@ -144,15 +144,15 @@ export interface DhcpStaticLease {
|
||||
|
||||
export const dhcpApi = {
|
||||
async getLeases(): Promise<{ leases: DhcpLease[] }> {
|
||||
return apiClient.get('/api/v1/dnsmasq/dhcp/leases');
|
||||
return apiClient.get('/api/v1/dhcp/leases');
|
||||
},
|
||||
|
||||
async addStatic(lease: DhcpStaticLease): Promise<{ message: string }> {
|
||||
return apiClient.post('/api/v1/dnsmasq/dhcp/static', lease);
|
||||
return apiClient.post('/api/v1/dhcp/static', lease);
|
||||
},
|
||||
|
||||
async deleteStatic(mac: string): Promise<{ message: string }> {
|
||||
return apiClient.delete(`/api/v1/dnsmasq/dhcp/static/${encodeURIComponent(mac)}`);
|
||||
return apiClient.delete(`/api/v1/dhcp/static/${encodeURIComponent(mac)}`);
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user