feat: build OpenVPN operations dashboard and VPS management UI

This commit is contained in:
litoral05
2026-05-06 12:32:37 +01:00
parent 69540cb4c4
commit 523ce02b03
15 changed files with 2471 additions and 155 deletions
+743 -45
View File
@@ -2,6 +2,15 @@
box-sizing: border-box;
}
body,
html,
#root {
width: 100%;
height: 100%;
overflow: hidden;
}
body {
margin: 0;
font-family: Inter, system-ui, sans-serif;
@@ -20,9 +29,11 @@ button {
}
.app {
min-height: 100vh;
height: 100vh;
width: 100vw;
min-width: 1280px;
display: flex;
overflow: hidden;
background: #f2f2f2;
}
@@ -125,21 +136,40 @@ nav button:hover {
}
.dot {
width: 9px;
height: 9px;
background: #22c55e;
width: 8px;
height: 8px;
border-radius: 999px;
display: inline-block;
border-radius: 50%;
margin-right: 8px;
}
.dot.online {
background: #22c55e;
box-shadow: 0 0 12px rgba(34, 197, 94, 0.7);
}
.dot.degraded {
background: #f59e0b;
box-shadow: 0 0 12px rgba(245, 158, 11, 0.7);
}
.dot.offline {
background: #ef4444;
box-shadow: 0 0 12px rgba(239, 68, 68, 0.7);
}
.dot.checking {
background: #64748b;
}
/* MAIN */
.content {
flex: 1;
height: 100vh;
padding: 30px;
overflow-x: auto;
overflow-y: auto;
overflow-x: hidden;
}
.page-header {
@@ -191,6 +221,16 @@ nav button:hover {
.primary {
background: #b7e236;
color: #0d0d0d;
min-height: 42px;
}
.primary,
.secondary,
.health {
display: inline-flex;
align-items: center;
justify-content: center;
gap: 8px;
}
.secondary {
@@ -240,47 +280,79 @@ nav button:hover {
/* TABLE */
.panel {
padding: 0;
overflow: visible;
}
/* TABLE */
.panel table {
.panel {
background: white;
border: 1px solid #edf1f7;
border-radius: 24px;
overflow: hidden;
box-shadow:
0 10px 30px rgba(15, 23, 42, 0.04),
0 2px 6px rgba(15, 23, 42, 0.03);
}
table {
width: 100%;
border-collapse: collapse;
background: white;
border-collapse: separate;
border-spacing: 0 10px;
padding: 0 14px 14px;
}
th,
td {
thead th {
text-align: left;
padding: 15px 18px;
border-bottom: 1px solid #edf0f3;
font-size: 14px;
}
th {
color: #6b7280;
padding: 0 18px 12px;
border: none;
color: #94a3b8;
font-size: 12px;
font-weight: 800;
background: #fbfbfc;
background: transparent;
}
td {
color: #374151;
tbody tr {
background: #fbfcfe;
transition:
transform 0.15s ease,
box-shadow 0.15s ease,
background 0.15s ease;
}
tbody tr:hover {
background: #ffffff;
transform: translateY(-1px);
box-shadow:
0 8px 24px rgba(15, 23, 42, 0.06),
0 2px 8px rgba(15, 23, 42, 0.04);
}
tbody td {
padding: 18px;
border-top: 1px solid #edf1f7;
border-bottom: 1px solid #edf1f7;
background: inherit;
font-size: 14px;
font-weight: 600;
color: #374151;
}
tbody td:first-child {
border-left: 1px solid #edf1f7;
border-top-left-radius: 16px;
border-bottom-left-radius: 16px;
}
tbody td:last-child {
border-right: 1px solid #edf1f7;
border-top-right-radius: 16px;
border-bottom-right-radius: 16px;
}
.badge {
padding: 6px 10px;
padding: 7px 12px;
border-radius: 999px;
font-size: 12px;
font-weight: 800;
background: #e5e7eb;
border: none;
display: inline-flex;
align-items: center;
gap: 6px;
@@ -437,16 +509,21 @@ td {
.custom-select-button {
width: 100%;
height: 40px;
border: 1px solid #dfe3e8;
border-radius: 8px;
padding: 0 12px;
background: #fbfbfc;
height: 46px;
border: 1px solid #edf1f7;
border-radius: 16px;
padding: 0 14px;
background: #f8fafc;
color: #111827;
display: flex;
align-items: center;
justify-content: space-between;
font-weight: 700;
transition: all 0.15s ease;
}
.custom-select-button:hover {
background: white;
}
.custom-select-menu {
@@ -545,17 +622,23 @@ td {
}
.small-action {
height: 34px;
border: 0;
border-radius: 10px;
padding: 0 12px;
height: 36px;
border: 1px solid #edf1f7;
border-radius: 12px;
padding: 0 13px;
display: inline-flex;
align-items: center;
gap: 7px;
background: #f3f4f6;
background: white;
color: #374151;
font-weight: 800;
font-size: 13px;
transition: all 0.15s ease;
}
.small-action:hover {
transform: translateY(-1px);
background: #f8fafc;
}
.primary-action {
@@ -632,24 +715,30 @@ td {
display: flex;
justify-content: space-between;
gap: 14px;
padding: 16px;
border-bottom: 1px solid #edf0f3;
padding: 18px;
background: white;
position: relative;
z-index: 20;
}
.search-box {
height: 40px;
height: 46px;
min-width: 320px;
display: flex;
align-items: center;
gap: 9px;
background: #fbfbfc;
border: 1px solid #dfe3e8;
border-radius: 10px;
padding: 0 12px;
gap: 10px;
background: #f8fafc;
border: 1px solid #edf1f7;
border-radius: 16px;
padding: 0 14px;
color: #64748b;
transition: all 0.15s ease;
}
.search-box:focus-within {
background: white;
border-color: #dbe5f0;
box-shadow: 0 0 0 4px rgba(93, 168, 255, 0.08);
}
.search-box input {
@@ -678,4 +767,613 @@ td {
.chevron.open {
transform: rotate(180deg);
}
td .small-action {
white-space: nowrap;
}
.page-stack {
display: grid;
gap: 24px;
}
.toolbar-filters {
display: flex;
align-items: center;
gap: 12px;
}
.dashboard-page {
display: flex;
flex-direction: column;
gap: 22px;
}
.page-header {
display: flex;
align-items: center;
justify-content: space-between;
}
.page-header h1 {
margin: 0;
font-size: 28px;
}
.page-header p {
margin: 6px 0 0;
color: #64748b;
}
.system-pill {
display: inline-flex;
align-items: center;
gap: 8px;
padding: 10px 14px;
border-radius: 999px;
background: white;
border: 1px solid #e5e7eb;
font-weight: 700;
font-size: 13px;
}
.metric-grid {
display: grid;
grid-template-columns: repeat(4, 1fr);
gap: 16px;
}
.metric-card {
display: flex;
gap: 16px;
align-items: center;
padding: 22px;
border-radius: 18px;
background: white;
border: 1px solid #e5e7eb;
box-shadow: 0 12px 30px rgba(15, 23, 42, 0.06);
}
.metric-icon {
width: 48px;
height: 48px;
border-radius: 16px;
display: grid;
place-items: center;
background: #5da8ff;
color: white;
}
.metric-card p {
margin: 0;
color: #64748b;
font-size: 13px;
font-weight: 700;
}
.metric-card strong {
display: block;
margin-top: 4px;
font-size: 30px;
}
.metric-card span {
color: #94a3b8;
font-size: 12px;
}
.dashboard-grid {
display: grid;
grid-template-columns: 2fr 1fr;
gap: 16px;
}
.dashboard-card {
background: white;
border: 1px solid #e5e7eb;
border-radius: 18px;
padding: 20px;
box-shadow: 0 12px 30px rgba(15, 23, 42, 0.06);
}
.dashboard-card.wide {
min-height: 260px;
}
.card-header {
display: flex;
justify-content: space-between;
margin-bottom: 18px;
}
.card-header h2 {
margin: 0;
font-size: 17px;
}
.card-header p {
margin: 5px 0 0;
color: #64748b;
font-size: 13px;
}
.activity-chart-placeholder {
height: 190px;
border-radius: 16px;
border: 1px dashed #cbd5e1;
background: linear-gradient(180deg, #f8fbff, #ffffff);
display: grid;
place-items: center;
color: #64748b;
gap: 8px;
}
.health-stack {
display: flex;
flex-direction: column;
gap: 14px;
}
.health-row {
display: flex;
align-items: center;
justify-content: space-between;
padding: 14px;
border-radius: 14px;
background: #f8fafc;
}
.health-row div {
display: flex;
align-items: center;
font-weight: 700;
gap: 8px;
}
.health-row strong {
font-size: 13px;
}
.dashboard-table {
width: 100%;
border-collapse: collapse;
}
.dashboard-table th,
.dashboard-table td {
padding: 14px 10px;
text-align: left;
border-bottom: 1px solid #eef2f7;
font-size: 13px;
}
.dashboard-table th {
color: #64748b;
font-weight: 800;
}
.table-status {
display: inline-flex;
align-items: center;
gap: 6px;
font-weight: 800;
}
.table-status.success {
color: #16a34a;
}
.table-status.failed {
color: #ef4444;
}
.empty-cell {
color: #94a3b8;
text-align: center !important;
}
.quick-actions {
display: flex;
flex-direction: column;
gap: 10px;
}
.quick-actions button {
border: 1px solid #e5e7eb;
background: #f8fafc;
border-radius: 12px;
padding: 12px 14px;
font-weight: 800;
cursor: pointer;
text-align: left;
}
.quick-actions button:hover {
background: #eef6ff;
}
.activity-chart {
width: 100%;
height: 220px;
}
.vps-hero-card {
background: white;
border: 1px solid #edf1f7;
border-radius: 24px;
padding: 24px;
box-shadow:
0 10px 30px rgba(15, 23, 42, 0.04),
0 2px 6px rgba(15, 23, 42, 0.03);
display: grid;
gap: 24px;
}
.vps-hero-main {
display: flex;
align-items: center;
gap: 18px;
}
.vps-server-icon {
width: 64px;
height: 64px;
border-radius: 20px;
display: grid;
place-items: center;
background: #f3f4f6;
color: #64748b;
}
.vps-server-icon.online {
background: #dcfce7;
color: #16a34a;
}
.vps-server-icon.degraded {
background: #fef9c3;
color: #ca8a04;
}
.vps-server-icon.offline {
background: #fee2e2;
color: #dc2626;
}
.vps-server-icon.checking {
background: #e5e7eb;
color: #64748b;
}
.vps-title-row {
display: flex;
align-items: center;
gap: 12px;
}
.vps-title-row h2 {
margin: 0;
font-size: 22px;
}
.vps-hero-main p {
margin: 6px 0 0;
color: #64748b;
}
.vps-health-summary {
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: 14px;
}
.health-mini-card {
display: flex;
align-items: center;
gap: 12px;
background: #f8fafc;
border: 1px solid #edf1f7;
border-radius: 18px;
padding: 16px;
}
.health-mini-icon {
width: 38px;
height: 38px;
border-radius: 14px;
display: grid;
place-items: center;
background: #e5e7eb;
color: #64748b;
}
.health-mini-icon.online {
background: #dcfce7;
color: #16a34a;
}
.health-mini-icon.degraded {
background: #fef9c3;
color: #ca8a04;
}
.health-mini-icon.offline {
background: #fee2e2;
color: #dc2626;
}
.health-mini-icon.checking {
background: #e5e7eb;
color: #64748b;
}
.health-mini-card span {
display: block;
color: #64748b;
font-size: 12px;
font-weight: 700;
}
.health-mini-card strong {
display: block;
margin-top: 3px;
color: #111827;
font-size: 14px;
}
.vps-grid {
display: grid;
grid-template-columns: 1.3fr 1fr;
gap: 16px;
}
.wide-panel {
min-height: auto;
}
.service-check-list {
display: grid;
gap: 12px;
}
.service-check {
display: flex;
gap: 12px;
align-items: flex-start;
background: #f8fafc;
border: 1px solid #edf1f7;
border-radius: 16px;
padding: 14px;
}
.service-check-icon {
width: 34px;
height: 34px;
border-radius: 12px;
display: grid;
place-items: center;
background: #e5e7eb;
color: #64748b;
flex-shrink: 0;
}
.service-check-icon.online {
background: #dcfce7;
color: #16a34a;
}
.service-check-icon.degraded {
background: #fef9c3;
color: #ca8a04;
}
.service-check-icon.offline {
background: #fee2e2;
color: #dc2626;
}
.service-check-icon.checking {
background: #e5e7eb;
color: #64748b;
}
.service-check strong {
display: block;
color: #111827;
}
.service-check span {
display: block;
margin-top: 3px;
color: #64748b;
font-size: 13px;
}
.detail-list {
display: grid;
gap: 10px;
}
.detail-row {
display: flex;
justify-content: space-between;
gap: 12px;
padding: 13px 0;
border-bottom: 1px solid #edf1f7;
}
.detail-row:last-child {
border-bottom: 0;
}
.detail-row span {
color: #64748b;
font-weight: 700;
}
.detail-row strong {
color: #111827;
}
.vps-actions-grid {
display: grid;
gap: 12px;
}
.vps-action-card {
width: 100%;
border: 1px solid #edf1f7;
background: #f8fafc;
border-radius: 16px;
padding: 16px;
display: flex;
align-items: flex-start;
gap: 12px;
text-align: left;
transition: all 0.15s ease;
}
.vps-action-card:hover:not(:disabled) {
background: white;
transform: translateY(-1px);
box-shadow:
0 8px 24px rgba(15, 23, 42, 0.06),
0 2px 8px rgba(15, 23, 42, 0.04);
}
.vps-action-card:disabled {
opacity: 0.55;
cursor: not-allowed;
}
.vps-action-card strong {
display: block;
color: #111827;
}
.vps-action-card span {
display: block;
margin-top: 4px;
color: #64748b;
font-size: 13px;
}
.status-note {
display: flex;
gap: 12px;
align-items: flex-start;
background: #f8fafc;
border: 1px solid #edf1f7;
border-radius: 16px;
padding: 16px;
color: #64748b;
line-height: 1.5;
}
.status-note p {
margin: 0;
}
.settings-grid {
display: grid;
grid-template-columns: repeat(2, minmax(0, 1fr));
gap: 18px;
}
.settings-card {
background: white;
border: 1px solid #edf1f7;
border-radius: 24px;
padding: 22px;
box-shadow:
0 10px 30px rgba(15, 23, 42, 0.04),
0 2px 6px rgba(15, 23, 42, 0.03);
}
.settings-card-header {
display: flex;
align-items: flex-start;
gap: 14px;
margin-bottom: 20px;
}
.settings-card-icon {
width: 44px;
height: 44px;
border-radius: 16px;
display: grid;
place-items: center;
background: #eef6ff;
color: #5da8ff;
flex-shrink: 0;
}
.settings-card h2 {
margin: 0;
font-size: 18px;
color: #111827;
}
.settings-card p {
margin: 5px 0 0;
color: #64748b;
font-size: 13px;
}
.settings-list {
display: grid;
gap: 10px;
}
.setting-row {
display: flex;
align-items: center;
justify-content: space-between;
gap: 16px;
padding: 13px 0;
border-bottom: 1px solid #edf1f7;
}
.setting-row:last-child {
border-bottom: 0;
}
.setting-row span {
color: #64748b;
font-weight: 700;
font-size: 14px;
}
.setting-row strong {
display: inline-flex;
align-items: center;
color: #111827;
font-size: 14px;
font-weight: 800;
text-align: right;
}
.settings-actions {
display: flex;
gap: 10px;
padding-top: 10px;
}
.settings-actions button {
border: 1px solid #edf1f7;
background: #f8fafc;
border-radius: 14px;
padding: 10px 13px;
display: inline-flex;
align-items: center;
gap: 8px;
font-weight: 800;
color: #374151;
transition: all 0.15s ease;
}
.settings-actions button:hover {
background: white;
transform: translateY(-1px);
}