# Network Devices - Unified Page Design
**Date:** 2025-10-23
**Approach:** Single "Network Devices" page showing all infrastructure with filtering
**Files Required:** 4 files total
---
## Concept: One Page to Rule Them All
Instead of separate pages per device type, create a unified **Network Devices** page that shows:
- Servers
- Switches
- 📹 Cameras
- Access Points (if you add them later)
- IDFs (Intermediate Distribution Frames)
**User Experience:**
- Click "Network Devices" → See ALL devices in one table
- Filter by type using tabs/dropdown
- Click any device → Detail page (works for all types)
- "Add Device" button → Select type, then add
---
## Page Architecture
### Main Pages (4 files)
```
network_devices.asp → List all devices with type filter
network_device_detail.asp?type=server&id=5 → View/edit any device
add_network_device.asp?type=server → Add new device (any type)
save_network_device.asp → Universal save endpoint
```
### Navigation
```
Main Menu:
└─ Network Devices (single menu item)
└─ Opens network_devices.asp with tabs for filtering
```
---
## File 1: network_devices.asp (Main List View)
### Features
- **Tabs/Filter:** All | Servers | Switches | Cameras | Access Points | IDFs
- **Unified Table:** Shows all device types in one view
- **Device Type Badge:** Visual indicator (Server, Switch, Camera, etc.)
- **Search:** Filter by vendor, model, IP, serial number
- **Actions:** View/Edit/Delete per device
### UI Mockup
```
┌─────────────────────────────────────────────────────────────┐
│ Network Devices [+ Add Device] │
├─────────────────────────────────────────────────────────────┤
│ [ All ] [ Servers ] [ Switches ] [ Cameras ] [ More ▼ ] │
├─────────────────────────────────────────────────────────────┤
│ Type | Vendor | Model | Serial | IP │
├─────────────────────────────────────────────────────────────┤
│ [Server] | Dell | PowerEdge | ABC123 | 10.0.1.5 │
│ [Switch] | Cisco | Catalyst 2960| XYZ789 | 10.0.1.1 │
│ [Camera] | Hikvision | DS-2CD2142FWD| CAM001 | 10.0.2.10 │
│ [Server] | HP | ProLiant | SRV456 | 10.0.1.6 │
└─────────────────────────────────────────────────────────────┘
```
### Code Structure
```vbscript
<%
' Get filter parameter (default = all)
Dim filterType
filterType = Request.QueryString("filter")
If filterType = "" Then filterType = "all"
' Build query using vw_network_devices view
Dim strSQL
If filterType = "all" Then
strSQL = "SELECT * FROM vw_network_devices WHERE isactive = 1 ORDER BY device_type, device_id DESC"
Else
' Filter by specific type (server, switch, camera)
strSQL = "SELECT * FROM vw_network_devices WHERE device_type = '" & filterType & "' AND isactive = 1 ORDER BY device_id DESC"
End If
Set rs = objConn.Execute(strSQL)
%>
Add Network Device
Select the type of device you want to add:
Cancel
<%
Response.End
End If
' Type is selected, show form
Dim displayName
Select Case deviceType
Case "server": displayName = "Server"
Case "switch": displayName = "Switch"
Case "camera": displayName = "Camera"
End Select
%>