Files
op-packages/luci-app-aw-bpf/htdocs/luci-static/resources/view/aw-bpf.css
T

571 lines
13 KiB
CSS

/* Theme tokens: follow LuCI bootstrap vars, Argon, or JS-set data-aw-theme */
.l7-view-container,
.display-view-container {
--aw-card-bg: var(--background-color-medium, var(--background-color, #f9f9f9));
--aw-card-border: var(--border-color-medium, #e0e0e0);
--aw-chart-bg: var(--background-color-high, #ffffff);
--aw-text: var(--text-color-highest, var(--text-color-high, #333333));
--aw-text-muted: var(--text-color-medium, #666666);
--aw-accent: var(--primary-color-high, var(--primary, #3771c8));
--aw-hover: var(--background-color-low, #f0f0f0);
--aw-error-bg: #ffefef;
--aw-error-fg: #c62828;
--aw-dl: #28a745;
--aw-ul: #007bff;
--aw-vol-dl: #17a2b8;
--aw-vol-ul: #6610f2;
--aw-pkt: #6c757d;
}
@media (prefers-color-scheme: dark) {
.l7-view-container:not([data-aw-theme="light"]),
.display-view-container:not([data-aw-theme="light"]) {
--aw-card-bg: #2a2a2a;
--aw-card-border: #3c3c3c;
--aw-chart-bg: #252526;
--aw-text: #cccccc;
--aw-text-muted: #adb5bd;
--aw-accent: #a5b2ff;
--aw-hover: #333333;
--aw-error-bg: #3a1f1f;
--aw-error-fg: #ff8a80;
--aw-dl: #5dd879;
--aw-ul: #6eb6ff;
--aw-vol-dl: #4ecbd8;
--aw-vol-ul: #b794f6;
--aw-pkt: #adb5bd;
}
}
[data-darkmode="true"] .l7-view-container,
[data-darkmode="true"] .display-view-container,
.l7-view-container[data-aw-theme="dark"],
.display-view-container[data-aw-theme="dark"] {
--aw-card-bg: #2a2a2a;
--aw-card-border: #3c3c3c;
--aw-chart-bg: #252526;
--aw-text: #cccccc;
--aw-text-muted: #adb5bd;
--aw-accent: #a5b2ff;
--aw-hover: #333333;
--aw-error-bg: #3a1f1f;
--aw-error-fg: #ff8a80;
--aw-dl: #5dd879;
--aw-ul: #6eb6ff;
--aw-vol-dl: #4ecbd8;
--aw-vol-ul: #b794f6;
--aw-pkt: #adb5bd;
}
[data-darkmode="false"] .l7-view-container,
[data-darkmode="false"] .display-view-container,
.l7-view-container[data-aw-theme="light"],
.display-view-container[data-aw-theme="light"] {
--aw-card-bg: #f9f9f9;
--aw-card-border: #e0e0e0;
--aw-chart-bg: #ffffff;
--aw-text: #333333;
--aw-text-muted: #666666;
--aw-accent: #3771c8;
--aw-hover: #f0f0f0;
--aw-error-bg: #ffefef;
--aw-error-fg: #c62828;
--aw-dl: #28a745;
--aw-ul: #007bff;
--aw-vol-dl: #17a2b8;
--aw-vol-ul: #6610f2;
--aw-pkt: #6c757d;
}
.aw-inner-tabs {
margin-top: 4px;
}
.aw-inner-tabs > .cbi-tabmenu {
margin-bottom: 12px;
}
.pie label {
font-weight: bold;
font-size: 14px;
display: block;
margin-bottom: 10px;
text-align: center;
}
.kpi ul {
list-style: none;
}
.kpi li {
margin: 10px;
display: none;
}
.kpi big {
font-weight: bold;
}
.head {
text-align: center;
position: relative;
display: flex;
flex-wrap: wrap;
white-space: normal;
}
.head .pie {
/* min-width: 200px; */
padding: 5px;
flex: 1 1 30%;
}
.cbi-tooltip .head .pie {
min-width: 100px;
}
.head .kpi {
padding: 5px;
font-size: smaller;
text-align: left;
align-self: center;
flex: 1 0 33%;
min-width: 150px;
display: flex;
justify-content: center;
}
.head .kpi ul {
margin: 0;
}
.td.double > span {
display: block;
}
.cbi-tooltip {
box-shadow: 0 0 5px #000;
}
@media screen and (max-width: 992px) {
.td.hide-xs {
display: none;
}
.td.double:not(.hide-xs) > span {
white-space: nowrap;
text-align: left;
}
.td.double:not(.hide-xs) > span:first-child::before {
content: "IPv4: ";
font-weight: bold;
}
.td.double:not(.hide-xs) > span:last-child::before {
content: "IPv6: ";
font-weight: bold;
}
}
.form-group {
display: flex;
align-items: center; /* 垂直居中 */
margin-bottom: 15px; /* 项间距 */
gap: 10px; /* Label 和 Input 间距 */
}
/* 标签固定最小宽度 + 右对齐 */
.form-label {
flex: 0 0 120px; /* 不伸缩、不收缩、基础宽度120px */
text-align: right;
font-weight: bold;
color: var(--aw-text, #333);
}
.th-sort-asc::after {
content: " ▲";
}
.th-sort-desc::after {
content: " ▼";
}
.table .th {
cursor: pointer;
}
.table .th:hover {
background-color: var(--aw-hover, #f0f0f0);
}
/* L7 View Specific Styles */
.l7-view-container #l7-error-message { color: var(--aw-error-fg, red); background-color: var(--aw-error-bg, #ffefef); border: 1px solid var(--aw-error-fg, red); padding: 10px; margin-bottom: 10px; display: none; }
.l7-view-container .dashboard-container { display: flex; flex-direction: column; gap: 20px; margin-bottom: 20px; }
.l7-view-container .line-chart-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(400px, 1fr)); gap: 20px; }
.l7-view-container .kpi-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 20px; }
.l7-view-container .kpi-card { background-color: var(--aw-card-bg, #f9f9f9); border-radius: 8px; padding: 15px; text-align: center; border: 1px solid var(--aw-card-border, #e0e0e0); }
.l7-view-container .kpi-card big { display: block; font-size: 1.8em; font-weight: bold; color: var(--aw-accent, #3771c8); }
.l7-view-container .kpi-card-label { font-size: 0.9em; color: var(--aw-text-muted, #666); }
.l7-view-container .chart-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; }
.l7-view-container .chart-card { background-color: var(--aw-chart-bg, #ffffff); border-radius: 8px; padding: 20px; border: 1px solid var(--aw-card-border, #e0e0e0); }
.l7-view-container .chart-card h4 { margin-top: 0; margin-bottom: 15px; text-align: center; font-size: 1.1em; color: var(--aw-text, inherit); }
.l7-view-container .l7-controls {
display: flex;
justify-content: space-between;
align-items: center;
margin-top: 20px;
padding: 15px 20px;
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
border-radius: 8px;
box-shadow: 0 4px 6px rgba(0,0,0,0.1);
color: white;
}
.l7-view-container .l7-controls-left, .l7-view-container .l7-controls-right {
display: flex;
align-items: center;
gap: 15px;
}
/* Display View Specific Styles */
.display-view-container .dashboard-container { display: flex; flex-direction: column; gap: 20px; margin-bottom: 20px; }
.display-view-container .kpi-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 20px; }
.display-view-container .kpi-card { background-color: var(--aw-card-bg, #f9f9f9); border-radius: 8px; padding: 15px; text-align: center; border: 1px solid var(--aw-card-border, #e0e0e0); }
.display-view-container .kpi-card big { display: block; font-size: 1.8em; font-weight: bold; color: var(--aw-accent, #3771c8); }
.display-view-container .kpi-card-label { font-size: 0.9em; color: var(--aw-text-muted, #666); }
.display-view-container .chart-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; }
.display-view-container .chart-card { background-color: var(--aw-chart-bg, #ffffff); border-radius: 8px; padding: 20px; border: 1px solid var(--aw-card-border, #e0e0e0); }
.display-view-container .chart-card h4 { margin-top: 0; margin-bottom: 15px; text-align: center; font-size: 1.1em; color: var(--aw-text, inherit); }
.display-view-container .display-controls {
display: flex;
justify-content: space-between;
align-items: center;
padding: 15px 20px;
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
border-radius: 8px;
box-shadow: 0 4px 6px rgba(0,0,0,0.1);
margin-top: 20px;
}
/* Control Groups */
.control-group {
display: flex;
align-items: center;
gap: 8px;
padding: 8px 12px;
background-color: rgba(255, 255, 255, 0.15);
border-radius: 6px;
backdrop-filter: blur(10px);
}
.control-icon {
font-size: 1.2em;
display: inline-block;
}
.control-label {
font-weight: 500;
color: white;
margin: 0;
white-space: nowrap;
}
.control-input {
border-radius: 4px;
border: 1px solid rgba(255, 255, 255, 0.3);
background-color: rgba(255, 255, 255, 0.9);
padding: 6px 12px;
transition: all 0.3s ease;
}
.control-input:focus {
background-color: white;
border-color: #667eea;
box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
outline: none;
}
.control-buttons {
display: flex;
align-items: center;
gap: 10px;
}
.status-group {
background-color: rgba(255, 255, 255, 0.2);
}
.last-updated-text {
color: rgba(255, 255, 255, 0.95);
font-size: 0.9em;
font-weight: 500;
}
/* Enhanced Select Styling */
.cbi-input-select {
padding: 6px 30px 6px 12px;
border-radius: 4px;
border: 1px solid rgba(255, 255, 255, 0.3);
background-color: rgba(255, 255, 255, 0.9);
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23667eea' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
background-repeat: no-repeat;
background-position: right 8px center;
background-size: 12px;
appearance: none;
cursor: pointer;
transition: all 0.3s ease;
font-weight: 500;
}
.cbi-input-select:hover {
background-color: white;
border-color: #667eea;
}
.cbi-input-select:focus {
background-color: white;
border-color: #667eea;
box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
outline: none;
}
/* Button Enhancements for Controls */
.l7-controls .cbi-button,
.display-controls .cbi-button {
padding: 8px 16px;
border-radius: 6px;
font-weight: 500;
transition: all 0.3s ease;
border: 2px solid transparent;
}
.cbi-button-action {
background: rgba(255, 193, 7, 0.9);
color: #333;
border-color: rgba(255, 193, 7, 0.3);
}
.cbi-button-action:hover {
background: #ffc107;
transform: translateY(-2px);
box-shadow: 0 4px 8px rgba(255, 193, 7, 0.4);
}
.cbi-button-positive {
background: rgba(40, 167, 69, 0.9);
color: white;
border-color: rgba(40, 167, 69, 0.3);
}
.cbi-button-positive:hover {
background: #28a745;
transform: translateY(-2px);
box-shadow: 0 4px 8px rgba(40, 167, 69, 0.4);
}
/* Responsive Controls */
@media screen and (max-width: 768px) {
.l7-controls,
.display-controls {
flex-direction: column;
gap: 15px;
}
.l7-controls-left,
.l7-controls-right,
.control-buttons {
width: 100%;
justify-content: center;
}
.control-group {
justify-content: center;
}
}
/* Table Cell Icon Styles */
.activity-indicator {
font-size: 12px;
display: inline-block;
margin-right: 2px;
}
.icon, .btn-icon, .th-icon {
display: inline-block;
font-style: normal;
margin-right: 4px;
}
.th-icon {
opacity: 0.7;
}
/* Cell Specific Styles */
.sid-cell, .id-cell, .host-cell, .hostname-cell, .protocol-cell {
display: inline-flex;
align-items: center;
gap: 4px;
}
.speed-cell {
display: inline-flex;
align-items: center;
justify-content: flex-end;
gap: 4px;
font-weight: 500;
min-width: 100px;
}
.speed-cell.download {
color: var(--aw-dl, #28a745);
}
.speed-cell.upload {
color: var(--aw-ul, #007bff);
}
.volume-cell {
display: inline-flex;
align-items: center;
justify-content: flex-end;
gap: 4px;
min-width: 90px;
}
.volume-cell.download {
color: var(--aw-vol-dl, #17a2b8);
}
.volume-cell.upload {
color: var(--aw-vol-ul, #6610f2);
}
.packet-cell {
display: inline-flex;
align-items: center;
justify-content: flex-end;
gap: 4px;
color: var(--aw-pkt, #6c757d);
min-width: 80px;
}
/* Data value with monospace font for better alignment */
.data-value {
font-family: 'Courier New', Consolas, monospace;
font-size: 0.95em;
letter-spacing: 0.5px;
}
/* Table header enhancements */
.table .th {
font-weight: 600;
padding: 10px 8px;
white-space: nowrap;
}
.table .td {
padding: 8px;
vertical-align: middle;
}
.protocol-icon.l7::before {
content: '';
display: inline-block;
width: 8px;
height: 8px;
border-radius: 50%;
background-color: #5470c6;
margin-right: 4px;
}
.protocol-icon.domain::before {
content: '';
display: inline-block;
width: 8px;
height: 8px;
border-radius: 50%;
background-color: #91cc75;
margin-right: 4px;
}
/* Button Enhancements */
.cbi-button {
display: inline-flex;
align-items: center;
gap: 4px;
transition: all 0.2s ease;
}
.cbi-button:hover {
transform: translateY(-1px);
box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
.cbi-button-edit {
background-color: #ffc107;
border-color: #ffc107;
}
.cbi-button-edit:hover {
background-color: #e0a800;
border-color: #e0a800;
}
.cbi-button-remove {
background-color: #dc3545;
border-color: #dc3545;
color: white;
}
.cbi-button-remove:hover {
background-color: #c82333;
border-color: #bd2130;
}
.cbi-button-add {
background-color: #28a745;
border-color: #28a745;
color: white;
}
.cbi-button-add:hover:not(:disabled) {
background-color: #218838;
border-color: #1e7e34;
}
.cbi-button-add:disabled {
opacity: 0.5;
cursor: not-allowed;
}
/* Table Row Hover Effects */
.table .tr:not(.table-titles):not(.placeholder):hover {
background-color: var(--aw-hover, #f8f9fa);
transition: background-color 0.2s ease;
}
/* Active/Inactive Status Styles */
.activity-indicator[title*="Active"] {
animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
0%, 100% { opacity: 1; }
50% { opacity: 0.5; }
}
/* Responsive Icon Handling */
@media screen and (max-width: 768px) {
.icon, .btn-icon {
margin-right: 2px;
}
.btn-icon + span {
display: none;
}
.th-icon {
margin-right: 0;
}
}