Show a modal before deleting a network. If the network has hosts,
display a warning with the exact count since they will be cascade-deleted.
Host count comes from the existing NetworkWithCounts data (no extra query).
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Adds NetworkWithCounts presentation model and get_networks_with_counts()
server function using a single SQL query with correlated subqueries.
Networks table now shows host count, application count, and has the
Actions column header properly right-aligned to match the Delete button.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Add src/api/ module with server functions for networks, hosts, applications
- Each server function retrieves the pool via use_context::<AnyPool>()
- Pool is injected via provide_context in two places in main.rs:
* leptos_routes_with_context: for SSR renders and inline server fn calls
* handle_server_fns_with_context on /api/*fn_name: for WASM client calls
- create_host validates IP against network CIDR before inserting
- create_network validates CIDR format before inserting
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>