interface update

This commit is contained in:
2025-02-08 00:32:25 -05:00
parent 9f92ac5c1a
commit 004c97f492
5 changed files with 93 additions and 30 deletions

View File

@ -21,6 +21,13 @@ function updateDeviceStatus() {
});
}
function toggleInterfaces(header) {
const list = header.nextElementSibling;
const icon = header.querySelector('.expand-icon');
list.classList.toggle('collapsed');
icon.style.transform = list.classList.contains('collapsed') ? 'rotate(-90deg)' : 'rotate(0deg)';
}
function updateInterfaceStatus(deviceName, interfaces) {
const interfaceList = document.querySelector(`.interface-group[data-device-name="${deviceName}"] .interface-list`);
if (interfaceList && interfaces) {
@ -30,7 +37,7 @@ function updateInterfaceStatus(deviceName, interfaces) {
<div class="interface-item">
<span class="port-name">${portName}</span>
<span class="port-speed">${port.speed.current}/${port.speed.max} Mbps</span>
<span class="port-status ${port.state.toLowerCase()}">${port.state}</span>
<span class="port-status ${port.state}">${port.state}</span>
</div>
`;
});

View File

@ -125,19 +125,45 @@ body {
.value {
font-family: monospace;
}
.interface-item {
.interface-header {
display: flex;
justify-content: space-between;
align-items: center;
padding: 10px;
cursor: pointer;
background: rgba(0,111,255,0.05);
border-radius: 8px;
margin-bottom: 5px;
}
.interface-header:hover {
background: rgba(0,111,255,0.1);
}
.interface-list {
max-height: 500px;
overflow-y: auto;
transition: max-height 0.3s ease-out;
}
.interface-list.collapsed {
max-height: 0;
overflow: hidden;
}
.interface-item {
display: grid;
grid-template-columns: 1fr 1fr auto;
padding: 8px;
border-bottom: 1px solid #eee;
align-items: center;
}
.port-status {
padding: 4px 8px;
border-radius: 4px;
font-size: 0.8em;
font-weight: 500;
}
.port-status.up {
@ -150,6 +176,18 @@ body {
color: white;
}
.expand-icon {
transition: transform 0.3s ease;
}
.collapsed + .expand-icon {
transform: rotate(-90deg);
}
.port-speed {
font-family: monospace;
color: var(--secondary-color);
}
.metrics-list {
display: grid;
grid-template-columns: repeat(3, 1fr);