Add navigation and fix layouts
This commit is contained in:
parent
e2a65d9922
commit
d7de43cfc7
@ -1,5 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="d-flex">
|
<div class="app-container">
|
||||||
<!-- Sidebar -->
|
<!-- Sidebar -->
|
||||||
<div class="sidebar bg-dark" :class="{ 'collapsed': sidebarCollapsed }">
|
<div class="sidebar bg-dark" :class="{ 'collapsed': sidebarCollapsed }">
|
||||||
<div class="sidebar-header">
|
<div class="sidebar-header">
|
||||||
@ -9,7 +9,12 @@
|
|||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<div class="sidebar-content">
|
<div class="sidebar-content">
|
||||||
<!-- Future navigation items can go here -->
|
<nav class="nav-menu">
|
||||||
|
<router-link to="/" class="nav-item active">
|
||||||
|
<i class="fas fa-home"></i>
|
||||||
|
<span class="nav-text">Overview</span>
|
||||||
|
</router-link>
|
||||||
|
</nav>
|
||||||
</div>
|
</div>
|
||||||
<div class="sidebar-footer">
|
<div class="sidebar-footer">
|
||||||
<button class="btn btn-outline-light w-100" @click="toggleConfig">
|
<button class="btn btn-outline-light w-100" @click="toggleConfig">
|
||||||
@ -171,32 +176,78 @@ onUnmounted(() => {
|
|||||||
@import 'bootstrap/dist/css/bootstrap.min.css';
|
@import 'bootstrap/dist/css/bootstrap.min.css';
|
||||||
@import '@fortawesome/fontawesome-free/css/all.min.css';
|
@import '@fortawesome/fontawesome-free/css/all.min.css';
|
||||||
|
|
||||||
|
.app-container {
|
||||||
|
display: flex;
|
||||||
|
min-height: 100vh;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
.sidebar {
|
.sidebar {
|
||||||
width: 250px;
|
width: 250px;
|
||||||
height: 100vh;
|
height: 100vh;
|
||||||
position: fixed;
|
position: fixed;
|
||||||
left: 0;
|
left: 0;
|
||||||
top: 0;
|
top: 0;
|
||||||
padding: 1rem;
|
padding: 0.75rem 0.5rem;
|
||||||
transition: all 0.3s ease;
|
transition: all 0.3s ease;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
|
z-index: 1000;
|
||||||
}
|
}
|
||||||
|
|
||||||
.sidebar.collapsed {
|
.sidebar.collapsed {
|
||||||
width: 60px;
|
width: 60px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Collapsed sidebar styles */
|
||||||
.sidebar.collapsed .sidebar-header h5,
|
.sidebar.collapsed .sidebar-header h5,
|
||||||
.sidebar.collapsed .sidebar-content,
|
.sidebar.collapsed .config-text,
|
||||||
.sidebar.collapsed .config-text {
|
.sidebar.collapsed .nav-text {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.sidebar.collapsed .nav-menu {
|
||||||
|
padding: 0.5rem 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.sidebar.collapsed .nav-item {
|
||||||
|
padding: 0.75rem 0.25rem;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.sidebar.collapsed .nav-item i {
|
||||||
|
margin-right: 0;
|
||||||
|
font-size: 1.1rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.sidebar.collapsed .sidebar-footer .btn {
|
||||||
|
padding: 0.375rem;
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.main-content {
|
||||||
|
flex: 1;
|
||||||
|
padding-left: 262px;
|
||||||
|
padding-right: 0.5rem;
|
||||||
|
padding-top: 0.5rem;
|
||||||
|
padding-bottom: 0.5rem;
|
||||||
|
transition: padding-left 0.3s ease;
|
||||||
|
min-height: 100vh;
|
||||||
|
width: 100%;
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
|
||||||
|
.main-content.expanded {
|
||||||
|
padding-left: 72px;
|
||||||
|
}
|
||||||
|
|
||||||
.sidebar-header {
|
.sidebar-header {
|
||||||
padding-bottom: 1rem;
|
padding-left: 0.25rem;
|
||||||
|
padding-right: 0.25rem;
|
||||||
|
padding-bottom: 0.75rem;
|
||||||
border-bottom: 1px solid rgba(255,255,255,0.1);
|
border-bottom: 1px solid rgba(255,255,255,0.1);
|
||||||
margin-bottom: 1rem;
|
margin-bottom: 0.75rem;
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
@ -217,29 +268,18 @@ onUnmounted(() => {
|
|||||||
|
|
||||||
.sidebar-footer {
|
.sidebar-footer {
|
||||||
margin-top: auto;
|
margin-top: auto;
|
||||||
padding-top: 1rem;
|
padding-left: 0.25rem;
|
||||||
|
padding-right: 0.25rem;
|
||||||
|
padding-top: 0.75rem;
|
||||||
border-top: 1px solid rgba(255,255,255,0.1);
|
border-top: 1px solid rgba(255,255,255,0.1);
|
||||||
}
|
}
|
||||||
|
|
||||||
.sidebar.collapsed .sidebar-footer .btn {
|
.sidebar.collapsed .sidebar-footer .btn {
|
||||||
padding: 0.375rem;
|
padding: 0.375rem 0.5rem;
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
.main-content {
|
|
||||||
margin-left: 250px;
|
|
||||||
padding: 0.5rem;
|
|
||||||
width: calc(100% - 250px);
|
|
||||||
min-height: 100vh;
|
|
||||||
transition: all 0.3s ease;
|
|
||||||
}
|
|
||||||
|
|
||||||
.main-content.expanded {
|
|
||||||
margin-left: 60px;
|
|
||||||
width: calc(100% - 60px);
|
|
||||||
}
|
|
||||||
|
|
||||||
.content-grid {
|
.content-grid {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
@ -253,4 +293,60 @@ onUnmounted(() => {
|
|||||||
.status-healthy { color: #28a745; }
|
.status-healthy { color: #28a745; }
|
||||||
.status-warning { color: #ffc107; }
|
.status-warning { color: #ffc107; }
|
||||||
.status-error { color: #dc3545; }
|
.status-error { color: #dc3545; }
|
||||||
|
|
||||||
|
.nav-menu {
|
||||||
|
padding: 0.5rem 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.nav-item {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
padding: 0.75rem 0.5rem;
|
||||||
|
color: rgba(255, 255, 255, 0.8);
|
||||||
|
text-decoration: none;
|
||||||
|
transition: all 0.2s;
|
||||||
|
border-left: 3px solid transparent;
|
||||||
|
}
|
||||||
|
|
||||||
|
.nav-item:hover {
|
||||||
|
color: white;
|
||||||
|
background: rgba(255, 255, 255, 0.1);
|
||||||
|
}
|
||||||
|
|
||||||
|
.nav-item.active {
|
||||||
|
color: white;
|
||||||
|
background: rgba(255, 255, 255, 0.05);
|
||||||
|
border-left-color: #0d6efd;
|
||||||
|
}
|
||||||
|
|
||||||
|
.nav-item i {
|
||||||
|
width: 1.25rem;
|
||||||
|
text-align: center;
|
||||||
|
margin-right: 1rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.nav-text {
|
||||||
|
white-space: nowrap;
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
}
|
||||||
|
|
||||||
|
.sidebar.collapsed .nav-text {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.sidebar.collapsed .nav-item {
|
||||||
|
padding: 0.75rem 0.25rem;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.sidebar.collapsed .nav-item i {
|
||||||
|
margin-right: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.sidebar.collapsed .sidebar-footer .btn {
|
||||||
|
padding: 0.375rem 0.5rem;
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
@ -163,9 +163,11 @@
|
|||||||
{{ metricsData.cpu.data[metricsData.cpu.data.length - 1] || 0 }}%
|
{{ metricsData.cpu.data[metricsData.cpu.data.length - 1] || 0 }}%
|
||||||
</h4>
|
</h4>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="chart-wrapper">
|
||||||
<Line :data="cpuChartData" :options="chartOptions" />
|
<Line :data="cpuChartData" :options="chartOptions" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
<!-- Memory Chart -->
|
<!-- Memory Chart -->
|
||||||
<div class="metric-card">
|
<div class="metric-card">
|
||||||
<div class="card-header">
|
<div class="card-header">
|
||||||
@ -359,6 +361,8 @@ const healthChartOptions = {
|
|||||||
responsive: true,
|
responsive: true,
|
||||||
maintainAspectRatio: false,
|
maintainAspectRatio: false,
|
||||||
clip: false,
|
clip: false,
|
||||||
|
resizeDelay: 0,
|
||||||
|
responsiveAnimationDuration: 0, /* Disable resize animation */
|
||||||
plugins: {
|
plugins: {
|
||||||
legend: {
|
legend: {
|
||||||
display: false
|
display: false
|
||||||
@ -408,6 +412,9 @@ const healthChartOptions = {
|
|||||||
enabled: true,
|
enabled: true,
|
||||||
mode: 'nearest',
|
mode: 'nearest',
|
||||||
intersect: false
|
intersect: false
|
||||||
|
},
|
||||||
|
onResize: (chart, size) => {
|
||||||
|
chart.resize(); /* Force resize on container change */
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -469,6 +476,8 @@ const chartOptions = {
|
|||||||
responsive: true,
|
responsive: true,
|
||||||
maintainAspectRatio: false,
|
maintainAspectRatio: false,
|
||||||
clip: false,
|
clip: false,
|
||||||
|
resizeDelay: 0,
|
||||||
|
responsiveAnimationDuration: 0, /* Disable resize animation */
|
||||||
plugins: {
|
plugins: {
|
||||||
legend: {
|
legend: {
|
||||||
display: false
|
display: false
|
||||||
@ -500,6 +509,9 @@ const chartOptions = {
|
|||||||
enabled: true,
|
enabled: true,
|
||||||
mode: 'nearest',
|
mode: 'nearest',
|
||||||
intersect: false
|
intersect: false
|
||||||
|
},
|
||||||
|
onResize: (chart, size) => {
|
||||||
|
chart.resize(); /* Force resize on container change */
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
@ -509,18 +521,21 @@ const chartOptions = {
|
|||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
gap: 0.5rem;
|
gap: 0.5rem;
|
||||||
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.graphs-row {
|
.graphs-row {
|
||||||
display: grid;
|
display: grid;
|
||||||
grid-template-columns: repeat(4, 1fr);
|
grid-template-columns: repeat(4, 1fr);
|
||||||
gap: 0.5rem;
|
gap: 0.5rem;
|
||||||
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.metrics-row {
|
.metrics-row {
|
||||||
display: grid;
|
display: grid;
|
||||||
grid-template-columns: repeat(8, 1fr);
|
grid-template-columns: 1fr minmax(auto, 1.2fr) repeat(6, 1fr); /* Version card (2nd) gets more space */
|
||||||
gap: 0.5rem;
|
gap: 0.5rem;
|
||||||
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.health-card {
|
.health-card {
|
||||||
@ -528,6 +543,7 @@ const chartOptions = {
|
|||||||
border: 1px solid rgba(0,0,0,0.125);
|
border: 1px solid rgba(0,0,0,0.125);
|
||||||
border-radius: 0.25rem;
|
border-radius: 0.25rem;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.health-content-wrapper {
|
.health-content-wrapper {
|
||||||
@ -544,6 +560,8 @@ const chartOptions = {
|
|||||||
min-height: 0;
|
min-height: 0;
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
width: 100%;
|
||||||
|
overflow: hidden; /* Ensure graph doesn't overflow */
|
||||||
}
|
}
|
||||||
|
|
||||||
.health-percentage {
|
.health-percentage {
|
||||||
@ -692,22 +710,12 @@ const chartOptions = {
|
|||||||
height: 100%;
|
height: 100%;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
|
min-width: 0;
|
||||||
|
width: 100%; /* Take full width of grid cell */
|
||||||
}
|
}
|
||||||
|
|
||||||
.metric-card .card-body {
|
.metric-card .card-header {
|
||||||
flex: 1;
|
text-align: left;
|
||||||
padding: 0.5rem;
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
position: relative;
|
|
||||||
}
|
|
||||||
|
|
||||||
.metric-card .metric-value {
|
|
||||||
font-size: 1.25rem; /* Return to original size for metric cards */
|
|
||||||
font-weight: bold;
|
|
||||||
color: #333;
|
|
||||||
line-height: 1;
|
|
||||||
margin: 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.card-header h6 {
|
.card-header h6 {
|
||||||
@ -718,6 +726,29 @@ const chartOptions = {
|
|||||||
align-items: center;
|
align-items: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.metric-card .card-body {
|
||||||
|
flex: 1;
|
||||||
|
padding: 0.5rem;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
position: relative;
|
||||||
|
width: 100%;
|
||||||
|
overflow: visible;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.metric-card .metric-value {
|
||||||
|
font-size: 1.25rem;
|
||||||
|
font-weight: bold;
|
||||||
|
color: #333;
|
||||||
|
line-height: 1;
|
||||||
|
margin: 0;
|
||||||
|
text-align: center;
|
||||||
|
white-space: nowrap; /* Prevent text wrapping */
|
||||||
|
min-width: fit-content; /* Allow text to determine minimum width */
|
||||||
|
}
|
||||||
|
|
||||||
.metric-label {
|
.metric-label {
|
||||||
color: #666;
|
color: #666;
|
||||||
}
|
}
|
||||||
@ -745,26 +776,20 @@ const chartOptions = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@media (max-width: 1400px) {
|
@media (max-width: 1400px) {
|
||||||
.graphs-row {
|
|
||||||
grid-template-columns: 1fr 1fr;
|
|
||||||
}
|
|
||||||
.metrics-row {
|
.metrics-row {
|
||||||
grid-template-columns: repeat(4, 1fr);
|
grid-template-columns: 1fr minmax(auto, 1.2fr) repeat(2, 1fr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@media (max-width: 992px) {
|
@media (max-width: 992px) {
|
||||||
.metrics-row {
|
.metrics-row {
|
||||||
grid-template-columns: repeat(3, 1fr);
|
grid-template-columns: 1fr minmax(auto, 1.2fr) 1fr;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@media (max-width: 576px) {
|
@media (max-width: 576px) {
|
||||||
.graphs-row {
|
|
||||||
grid-template-columns: 1fr;
|
|
||||||
}
|
|
||||||
.metrics-row {
|
.metrics-row {
|
||||||
grid-template-columns: repeat(2, 1fr);
|
grid-template-columns: 1fr minmax(auto, 1.2fr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -802,4 +827,12 @@ const chartOptions = {
|
|||||||
outline: none;
|
outline: none;
|
||||||
box-shadow: none;
|
box-shadow: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Add a wrapper for the chart to ensure proper sizing */
|
||||||
|
.chart-wrapper {
|
||||||
|
position: relative;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
min-width: 0;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user