- Add API specification documentation - Add system specification document - Add UI mockups and documentation - Add utility modules (wifi)
419 lines
13 KiB
HTML
419 lines
13 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>LED Driver - Device Management</title>
|
|
<style>
|
|
* {
|
|
margin: 0;
|
|
padding: 0;
|
|
box-sizing: border-box;
|
|
}
|
|
|
|
body {
|
|
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
|
|
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
|
|
min-height: 100vh;
|
|
padding: 20px;
|
|
}
|
|
|
|
.container {
|
|
max-width: 1200px;
|
|
margin: 0 auto;
|
|
}
|
|
|
|
.header {
|
|
background: white;
|
|
border-radius: 12px;
|
|
padding: 24px;
|
|
margin-bottom: 24px;
|
|
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
|
|
display: flex;
|
|
justify-content: space-between;
|
|
align-items: center;
|
|
}
|
|
|
|
.header h1 {
|
|
color: #667eea;
|
|
}
|
|
|
|
.btn {
|
|
padding: 12px 24px;
|
|
border: none;
|
|
border-radius: 8px;
|
|
font-size: 1rem;
|
|
font-weight: 600;
|
|
cursor: pointer;
|
|
transition: all 0.2s;
|
|
}
|
|
|
|
.btn-primary {
|
|
background: #667eea;
|
|
color: white;
|
|
}
|
|
|
|
.btn-primary:hover {
|
|
background: #5568d3;
|
|
}
|
|
|
|
.tabs {
|
|
display: flex;
|
|
gap: 8px;
|
|
margin-bottom: 24px;
|
|
background: white;
|
|
padding: 8px;
|
|
border-radius: 12px;
|
|
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
|
|
}
|
|
|
|
.tab {
|
|
flex: 1;
|
|
padding: 12px 24px;
|
|
border: none;
|
|
background: transparent;
|
|
border-radius: 8px;
|
|
cursor: pointer;
|
|
font-weight: 500;
|
|
transition: all 0.2s;
|
|
}
|
|
|
|
.tab.active {
|
|
background: #667eea;
|
|
color: white;
|
|
}
|
|
|
|
.tab-content {
|
|
display: none;
|
|
}
|
|
|
|
.tab-content.active {
|
|
display: block;
|
|
}
|
|
|
|
.card {
|
|
background: white;
|
|
border-radius: 12px;
|
|
padding: 24px;
|
|
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
|
|
margin-bottom: 24px;
|
|
}
|
|
|
|
.card h2 {
|
|
color: #667eea;
|
|
margin-bottom: 20px;
|
|
}
|
|
|
|
.device-item, .group-item {
|
|
border: 1px solid #e0e0e0;
|
|
border-radius: 8px;
|
|
padding: 16px;
|
|
margin-bottom: 12px;
|
|
display: flex;
|
|
justify-content: space-between;
|
|
align-items: center;
|
|
transition: all 0.2s;
|
|
}
|
|
|
|
.device-item:hover, .group-item:hover {
|
|
border-color: #667eea;
|
|
box-shadow: 0 2px 8px rgba(102, 126, 234, 0.2);
|
|
}
|
|
|
|
.device-info, .group-info {
|
|
flex: 1;
|
|
}
|
|
|
|
.device-name, .group-name {
|
|
font-weight: 600;
|
|
font-size: 1.125rem;
|
|
margin-bottom: 4px;
|
|
}
|
|
|
|
.device-details, .group-details {
|
|
font-size: 0.875rem;
|
|
color: #666;
|
|
}
|
|
|
|
.status-badge {
|
|
display: inline-block;
|
|
padding: 4px 12px;
|
|
border-radius: 12px;
|
|
font-size: 0.75rem;
|
|
font-weight: 600;
|
|
margin-right: 12px;
|
|
}
|
|
|
|
.status-online {
|
|
background: #d4edda;
|
|
color: #155724;
|
|
}
|
|
|
|
.status-offline {
|
|
background: #f8d7da;
|
|
color: #721c24;
|
|
}
|
|
|
|
.status-indicator {
|
|
width: 12px;
|
|
height: 12px;
|
|
border-radius: 50%;
|
|
background: #4caf50;
|
|
margin-right: 8px;
|
|
}
|
|
|
|
.status-indicator.offline {
|
|
background: #f44336;
|
|
}
|
|
|
|
.device-actions, .group-actions {
|
|
display: flex;
|
|
gap: 8px;
|
|
}
|
|
|
|
.btn-icon {
|
|
padding: 8px 12px;
|
|
border: 1px solid #e0e0e0;
|
|
background: white;
|
|
border-radius: 6px;
|
|
cursor: pointer;
|
|
transition: all 0.2s;
|
|
}
|
|
|
|
.btn-icon:hover {
|
|
border-color: #667eea;
|
|
color: #667eea;
|
|
}
|
|
|
|
.form-group {
|
|
margin-bottom: 20px;
|
|
}
|
|
|
|
.form-group label {
|
|
display: block;
|
|
margin-bottom: 8px;
|
|
font-weight: 500;
|
|
color: #333;
|
|
}
|
|
|
|
.form-group input, .form-group select {
|
|
width: 100%;
|
|
padding: 12px;
|
|
border: 1px solid #e0e0e0;
|
|
border-radius: 8px;
|
|
font-size: 1rem;
|
|
}
|
|
|
|
.form-group input:focus, .form-group select:focus {
|
|
outline: none;
|
|
border-color: #667eea;
|
|
}
|
|
|
|
.form-actions {
|
|
display: flex;
|
|
gap: 12px;
|
|
margin-top: 24px;
|
|
}
|
|
|
|
.btn-secondary {
|
|
background: #e0e0e0;
|
|
color: #333;
|
|
}
|
|
|
|
.btn-secondary:hover {
|
|
background: #d0d0d0;
|
|
}
|
|
|
|
.group-devices {
|
|
margin-top: 12px;
|
|
padding-top: 12px;
|
|
border-top: 1px solid #e0e0e0;
|
|
}
|
|
|
|
.group-device-tag {
|
|
display: inline-block;
|
|
padding: 4px 8px;
|
|
background: #f0f0f0;
|
|
border-radius: 4px;
|
|
font-size: 0.75rem;
|
|
margin-right: 8px;
|
|
margin-top: 8px;
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<div class="container">
|
|
<div class="header">
|
|
<h1>Device & Group Management</h1>
|
|
<button class="btn btn-primary" onclick="showAddDeviceModal()">+ Add Device</button>
|
|
</div>
|
|
|
|
<div class="tabs">
|
|
<button class="tab active" onclick="switchTab('devices')">Devices</button>
|
|
<button class="tab" onclick="switchTab('groups')">Groups</button>
|
|
</div>
|
|
|
|
<!-- Devices Tab -->
|
|
<div id="devices-tab" class="tab-content active">
|
|
<div class="card">
|
|
<h2>Connected Devices</h2>
|
|
<div class="device-item">
|
|
<div class="device-info">
|
|
<div class="device-name">
|
|
<span class="status-indicator"></span>
|
|
led-device1
|
|
</div>
|
|
<div class="device-details">
|
|
<span class="status-badge status-online">Online</span>
|
|
MAC: AA:BB:CC:DD:EE:01 | Group: group1 | Pattern: Rainbow
|
|
</div>
|
|
</div>
|
|
<div class="device-actions">
|
|
<button class="btn-icon" title="Edit">✏️</button>
|
|
<button class="btn-icon" title="Settings">⚙️</button>
|
|
<button class="btn-icon" title="Remove">🗑️</button>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="device-item">
|
|
<div class="device-info">
|
|
<div class="device-name">
|
|
<span class="status-indicator"></span>
|
|
led-device2
|
|
</div>
|
|
<div class="device-details">
|
|
<span class="status-badge status-online">Online</span>
|
|
MAC: AA:BB:CC:DD:EE:02 | Group: group2 | Pattern: Chase
|
|
</div>
|
|
</div>
|
|
<div class="device-actions">
|
|
<button class="btn-icon" title="Edit">✏️</button>
|
|
<button class="btn-icon" title="Settings">⚙️</button>
|
|
<button class="btn-icon" title="Remove">🗑️</button>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="device-item">
|
|
<div class="device-info">
|
|
<div class="device-name">
|
|
<span class="status-indicator offline"></span>
|
|
led-device3
|
|
</div>
|
|
<div class="device-details">
|
|
<span class="status-badge status-offline">Offline</span>
|
|
MAC: AA:BB:CC:DD:EE:03 | No group | Pattern: On
|
|
</div>
|
|
</div>
|
|
<div class="device-actions">
|
|
<button class="btn-icon" title="Edit">✏️</button>
|
|
<button class="btn-icon" title="Settings">⚙️</button>
|
|
<button class="btn-icon" title="Remove">🗑️</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Groups Tab -->
|
|
<div id="groups-tab" class="tab-content">
|
|
<div class="card">
|
|
<div style="display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px;">
|
|
<h2>Groups</h2>
|
|
<button class="btn btn-primary" onclick="showAddGroupModal()">+ Create Group</button>
|
|
</div>
|
|
|
|
<div class="group-item">
|
|
<div class="group-info">
|
|
<div class="group-name">group1</div>
|
|
<div class="group-details">
|
|
Pattern: On | Brightness: 100% | Delay: 100ms
|
|
</div>
|
|
<div class="group-devices">
|
|
<span class="group-device-tag">led-device1</span>
|
|
</div>
|
|
</div>
|
|
<div class="group-actions">
|
|
<button class="btn-icon" title="Edit">✏️</button>
|
|
<button class="btn-icon" title="Apply">▶️</button>
|
|
<button class="btn-icon" title="Delete">🗑️</button>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="group-item">
|
|
<div class="group-info">
|
|
<div class="group-name">group2</div>
|
|
<div class="group-details">
|
|
Pattern: Chase | Brightness: 75% | Delay: 200ms
|
|
</div>
|
|
<div class="group-devices">
|
|
<span class="group-device-tag">led-device2</span>
|
|
</div>
|
|
</div>
|
|
<div class="group-actions">
|
|
<button class="btn-icon" title="Edit">✏️</button>
|
|
<button class="btn-icon" title="Apply">▶️</button>
|
|
<button class="btn-icon" title="Delete">🗑️</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Modal (simplified) -->
|
|
<div id="modal" style="display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.5); z-index: 1000; align-items: center; justify-content: center;">
|
|
<div class="card" style="max-width: 500px; margin: 20px;">
|
|
<h2 id="modal-title">Add Device</h2>
|
|
<div class="form-group">
|
|
<label>Device Name</label>
|
|
<input type="text" id="device-name" placeholder="led-device4">
|
|
</div>
|
|
<div class="form-group">
|
|
<label>MAC Address</label>
|
|
<input type="text" id="device-mac" placeholder="AA:BB:CC:DD:EE:04">
|
|
</div>
|
|
<div class="form-group">
|
|
<label>Group</label>
|
|
<select id="device-group">
|
|
<option value="">No group</option>
|
|
<option value="group1">group1</option>
|
|
<option value="group2">group2</option>
|
|
</select>
|
|
</div>
|
|
<div class="form-actions">
|
|
<button class="btn btn-secondary" onclick="closeModal()">Cancel</button>
|
|
<button class="btn btn-primary" onclick="saveDevice()">Save</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<script>
|
|
function switchTab(tab) {
|
|
document.querySelectorAll('.tab').forEach(t => t.classList.remove('active'));
|
|
document.querySelectorAll('.tab-content').forEach(c => c.classList.remove('active'));
|
|
|
|
event.target.classList.add('active');
|
|
document.getElementById(tab + '-tab').classList.add('active');
|
|
}
|
|
|
|
function showAddDeviceModal() {
|
|
document.getElementById('modal').style.display = 'flex';
|
|
document.getElementById('modal-title').textContent = 'Add Device';
|
|
}
|
|
|
|
function showAddGroupModal() {
|
|
document.getElementById('modal').style.display = 'flex';
|
|
document.getElementById('modal-title').textContent = 'Create Group';
|
|
}
|
|
|
|
function closeModal() {
|
|
document.getElementById('modal').style.display = 'none';
|
|
}
|
|
|
|
function saveDevice() {
|
|
alert('Device saved! (This is a mockup)');
|
|
closeModal();
|
|
}
|
|
</script>
|
|
</body>
|
|
</html>
|
|
|