Spaces:
Sleeping
Sleeping
dylanglenister
commited on
Commit
·
bca4900
1
Parent(s):
9b9a7e2
Updating system page to match styling
Browse files- static/css/system.css +155 -39
- static/js/system.js +7 -7
- static/system.html +38 -13
static/css/system.css
CHANGED
|
@@ -1,85 +1,201 @@
|
|
| 1 |
body {
|
| 2 |
-
font-family:
|
| 3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 |
}
|
| 5 |
|
| 6 |
.tab-bar {
|
| 7 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8 |
}
|
| 9 |
|
| 10 |
.tab-button {
|
| 11 |
-
padding:
|
| 12 |
-
|
| 13 |
-
|
|
|
|
|
|
|
|
|
|
| 14 |
cursor: pointer;
|
| 15 |
-
|
| 16 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 17 |
}
|
| 18 |
|
| 19 |
.tab-button.active {
|
| 20 |
-
background:
|
| 21 |
color: white;
|
|
|
|
| 22 |
}
|
| 23 |
|
| 24 |
.tab-content {
|
| 25 |
display: none;
|
|
|
|
|
|
|
|
|
|
| 26 |
}
|
| 27 |
|
| 28 |
.tab-content.active {
|
| 29 |
display: block;
|
| 30 |
}
|
| 31 |
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
|
|
|
| 35 |
}
|
| 36 |
|
| 37 |
-
.status-
|
| 38 |
-
|
|
|
|
| 39 |
}
|
| 40 |
|
| 41 |
.component {
|
| 42 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 43 |
}
|
| 44 |
|
| 45 |
-
/* Database status styles */
|
| 46 |
.collection {
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
border
|
| 51 |
}
|
| 52 |
|
| 53 |
.collection h2 {
|
| 54 |
-
|
| 55 |
-
|
|
|
|
| 56 |
}
|
| 57 |
|
| 58 |
-
.stats {
|
| 59 |
-
color:
|
|
|
|
|
|
|
| 60 |
}
|
| 61 |
|
| 62 |
-
.
|
| 63 |
-
|
| 64 |
-
|
|
|
|
| 65 |
}
|
| 66 |
|
| 67 |
-
.fields {
|
| 68 |
-
|
|
|
|
|
|
|
| 69 |
}
|
| 70 |
|
| 71 |
-
.fields
|
| 72 |
-
|
| 73 |
-
|
|
|
|
|
|
|
|
|
|
| 74 |
}
|
| 75 |
|
| 76 |
-
.fields
|
| 77 |
-
|
| 78 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 79 |
}
|
| 80 |
|
| 81 |
-
|
| 82 |
-
|
| 83 |
-
|
| 84 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 85 |
}
|
|
|
|
| 1 |
body {
|
| 2 |
+
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
|
| 3 |
+
background-color: var(--bg-primary);
|
| 4 |
+
color: var(--text-primary);
|
| 5 |
+
margin: 0;
|
| 6 |
+
min-height: 100vh;
|
| 7 |
+
}
|
| 8 |
+
|
| 9 |
+
.system-page {
|
| 10 |
+
padding: var(--spacing-xl);
|
| 11 |
+
max-width: 1200px;
|
| 12 |
+
margin: 0 auto;
|
| 13 |
+
}
|
| 14 |
+
|
| 15 |
+
.system-header {
|
| 16 |
+
margin-bottom: var(--spacing-xl);
|
| 17 |
+
}
|
| 18 |
+
|
| 19 |
+
.system-header h1 {
|
| 20 |
+
font-size: 1.8rem;
|
| 21 |
+
color: var(--text-primary);
|
| 22 |
+
margin-top: var(--spacing-md);
|
| 23 |
+
}
|
| 24 |
+
|
| 25 |
+
.back-link {
|
| 26 |
+
display: inline-flex;
|
| 27 |
+
align-items: center;
|
| 28 |
+
gap: var(--spacing-sm);
|
| 29 |
+
color: var(--primary-color);
|
| 30 |
+
text-decoration: none;
|
| 31 |
+
font-size: 0.9rem;
|
| 32 |
+
}
|
| 33 |
+
|
| 34 |
+
.back-link:hover {
|
| 35 |
+
text-decoration: underline;
|
| 36 |
+
}
|
| 37 |
+
|
| 38 |
+
.tab-container {
|
| 39 |
+
background: var(--bg-secondary);
|
| 40 |
+
border-radius: 12px;
|
| 41 |
+
border: 1px solid var(--border-color);
|
| 42 |
+
overflow: hidden;
|
| 43 |
+
display: flex;
|
| 44 |
+
flex-direction: column;
|
| 45 |
+
height: calc(100vh - 160px); /* Account for header space */
|
| 46 |
}
|
| 47 |
|
| 48 |
.tab-bar {
|
| 49 |
+
display: flex;
|
| 50 |
+
gap: 2px;
|
| 51 |
+
padding: var(--spacing-md);
|
| 52 |
+
background: var(--bg-tertiary);
|
| 53 |
+
border-bottom: 1px solid var(--border-color);
|
| 54 |
+
flex-shrink: 0;
|
| 55 |
}
|
| 56 |
|
| 57 |
.tab-button {
|
| 58 |
+
padding: var(--spacing-md) var(--spacing-lg);
|
| 59 |
+
background: var(--bg-primary);
|
| 60 |
+
border: 1px solid var(--border-color);
|
| 61 |
+
border-radius: 8px;
|
| 62 |
+
color: var(--text-secondary);
|
| 63 |
+
font-size: 0.9rem;
|
| 64 |
cursor: pointer;
|
| 65 |
+
display: flex;
|
| 66 |
+
align-items: center;
|
| 67 |
+
gap: var(--spacing-sm);
|
| 68 |
+
transition: all var(--transition-fast);
|
| 69 |
+
}
|
| 70 |
+
|
| 71 |
+
.tab-button:hover {
|
| 72 |
+
background: var(--bg-secondary);
|
| 73 |
}
|
| 74 |
|
| 75 |
.tab-button.active {
|
| 76 |
+
background: var(--primary-color);
|
| 77 |
color: white;
|
| 78 |
+
border-color: var(--primary-color);
|
| 79 |
}
|
| 80 |
|
| 81 |
.tab-content {
|
| 82 |
display: none;
|
| 83 |
+
padding: var(--spacing-lg);
|
| 84 |
+
overflow-y: auto;
|
| 85 |
+
flex: 1;
|
| 86 |
}
|
| 87 |
|
| 88 |
.tab-content.active {
|
| 89 |
display: block;
|
| 90 |
}
|
| 91 |
|
| 92 |
+
.status-card {
|
| 93 |
+
background: var(--bg-primary);
|
| 94 |
+
border-radius: 8px;
|
| 95 |
+
padding: var(--spacing-lg);
|
| 96 |
}
|
| 97 |
|
| 98 |
+
.status-content {
|
| 99 |
+
display: grid;
|
| 100 |
+
gap: var(--spacing-md);
|
| 101 |
}
|
| 102 |
|
| 103 |
.component {
|
| 104 |
+
display: flex;
|
| 105 |
+
align-items: center;
|
| 106 |
+
justify-content: space-between;
|
| 107 |
+
padding: var(--spacing-md);
|
| 108 |
+
background: var(--bg-secondary);
|
| 109 |
+
border-radius: 6px;
|
| 110 |
+
border: 1px solid var(--border-color);
|
| 111 |
+
}
|
| 112 |
+
|
| 113 |
+
.collections-grid {
|
| 114 |
+
display: grid;
|
| 115 |
+
gap: var(--spacing-lg);
|
| 116 |
+
margin-bottom: var(--spacing-lg);
|
| 117 |
}
|
| 118 |
|
|
|
|
| 119 |
.collection {
|
| 120 |
+
background: var(--bg-secondary);
|
| 121 |
+
border-radius: 8px;
|
| 122 |
+
padding: var(--spacing-lg);
|
| 123 |
+
border: 1px solid var(--border-color);
|
| 124 |
}
|
| 125 |
|
| 126 |
.collection h2 {
|
| 127 |
+
color: var(--text-primary);
|
| 128 |
+
font-size: 1.2rem;
|
| 129 |
+
margin-bottom: var(--spacing-md);
|
| 130 |
}
|
| 131 |
|
| 132 |
+
.collection .stats {
|
| 133 |
+
color: var(--text-secondary);
|
| 134 |
+
font-size: 0.9rem;
|
| 135 |
+
margin-bottom: var(--spacing-md);
|
| 136 |
}
|
| 137 |
|
| 138 |
+
.collection .fields {
|
| 139 |
+
background: var(--bg-tertiary);
|
| 140 |
+
border-radius: 6px;
|
| 141 |
+
padding: var(--spacing-md);
|
| 142 |
}
|
| 143 |
|
| 144 |
+
.collection .fields h3 {
|
| 145 |
+
color: var(--text-secondary);
|
| 146 |
+
font-size: 0.9rem;
|
| 147 |
+
margin-bottom: var(--spacing-sm);
|
| 148 |
}
|
| 149 |
|
| 150 |
+
.collection .fields ul {
|
| 151 |
+
list-style: none;
|
| 152 |
+
padding: 0;
|
| 153 |
+
margin: 0;
|
| 154 |
+
display: grid;
|
| 155 |
+
gap: 4px;
|
| 156 |
}
|
| 157 |
|
| 158 |
+
.collection .fields li {
|
| 159 |
+
color: var(--text-primary);
|
| 160 |
+
font-size: 0.85rem;
|
| 161 |
+
font-family: monospace;
|
| 162 |
+
display: flex;
|
| 163 |
+
align-items: center;
|
| 164 |
+
gap: var(--spacing-sm);
|
| 165 |
}
|
| 166 |
|
| 167 |
+
@media (max-width: 768px) {
|
| 168 |
+
.system-page {
|
| 169 |
+
padding: var(--spacing-md);
|
| 170 |
+
}
|
| 171 |
+
|
| 172 |
+
.tab-container {
|
| 173 |
+
height: calc(100vh - 140px);
|
| 174 |
+
}
|
| 175 |
+
|
| 176 |
+
.tab-bar {
|
| 177 |
+
flex-direction: column;
|
| 178 |
+
}
|
| 179 |
+
|
| 180 |
+
.collection {
|
| 181 |
+
padding: var(--spacing-md);
|
| 182 |
+
}
|
| 183 |
+
}
|
| 184 |
+
|
| 185 |
+
/* Scrollbar styling to match main theme */
|
| 186 |
+
.tab-content::-webkit-scrollbar {
|
| 187 |
+
width: 6px;
|
| 188 |
+
}
|
| 189 |
+
|
| 190 |
+
.tab-content::-webkit-scrollbar-track {
|
| 191 |
+
background: var(--bg-secondary);
|
| 192 |
+
}
|
| 193 |
+
|
| 194 |
+
.tab-content::-webkit-scrollbar-thumb {
|
| 195 |
+
background: var(--border-color);
|
| 196 |
+
border-radius: 3px;
|
| 197 |
+
}
|
| 198 |
+
|
| 199 |
+
.tab-content::-webkit-scrollbar-thumb:hover {
|
| 200 |
+
background: var(--border-hover);
|
| 201 |
}
|
static/js/system.js
CHANGED
|
@@ -50,19 +50,19 @@ async function updateDatabase() {
|
|
| 50 |
}
|
| 51 |
|
| 52 |
function displayDatabaseStatus(data) {
|
| 53 |
-
document.getElementById('db-timestamp').textContent = `Last updated: ${data.timestamp}`;
|
| 54 |
|
| 55 |
const collectionsDiv = document.getElementById('collections');
|
| 56 |
collectionsDiv.innerHTML = '';
|
| 57 |
|
| 58 |
Object.entries(data.collections).forEach(([name, info]) => {
|
| 59 |
const collectionDiv = document.createElement('div');
|
| 60 |
-
collectionDiv.className = 'collection';
|
| 61 |
|
| 62 |
const html = `
|
| 63 |
<h2>${name}</h2>
|
| 64 |
<div class="stats">
|
| 65 |
-
<p>Document count: ${info.document_count}</p>
|
| 66 |
</div>
|
| 67 |
<div class="fields">
|
| 68 |
<h3>Document Fields:</h3>
|
|
@@ -71,10 +71,10 @@ function displayDatabaseStatus(data) {
|
|
| 71 |
const indexInfo = info.indexes.find(idx =>
|
| 72 |
idx.keys.some(([key]) => key === field)
|
| 73 |
);
|
| 74 |
-
const
|
| 75 |
-
|
| 76 |
-
|
| 77 |
-
return `<li>${
|
| 78 |
}).join('')}
|
| 79 |
</ul>
|
| 80 |
</div>
|
|
|
|
| 50 |
}
|
| 51 |
|
| 52 |
function displayDatabaseStatus(data) {
|
| 53 |
+
document.getElementById('db-timestamp').textContent = `Last updated: ${new Date(data.timestamp).toLocaleString()}`;
|
| 54 |
|
| 55 |
const collectionsDiv = document.getElementById('collections');
|
| 56 |
collectionsDiv.innerHTML = '';
|
| 57 |
|
| 58 |
Object.entries(data.collections).forEach(([name, info]) => {
|
| 59 |
const collectionDiv = document.createElement('div');
|
| 60 |
+
collectionDiv.className = 'collection fade-in';
|
| 61 |
|
| 62 |
const html = `
|
| 63 |
<h2>${name}</h2>
|
| 64 |
<div class="stats">
|
| 65 |
+
<p><i class="fas fa-file-alt"></i> Document count: ${info.document_count}</p>
|
| 66 |
</div>
|
| 67 |
<div class="fields">
|
| 68 |
<h3>Document Fields:</h3>
|
|
|
|
| 71 |
const indexInfo = info.indexes.find(idx =>
|
| 72 |
idx.keys.some(([key]) => key === field)
|
| 73 |
);
|
| 74 |
+
const indexIcon = indexInfo ?
|
| 75 |
+
`<i class="fas fa-bolt" title="Indexed"></i>` :
|
| 76 |
+
`<i class="fas fa-minus" title="Not indexed"></i>`;
|
| 77 |
+
return `<li>${indexIcon} ${field}</li>`;
|
| 78 |
}).join('')}
|
| 79 |
</ul>
|
| 80 |
</div>
|
static/system.html
CHANGED
|
@@ -1,23 +1,48 @@
|
|
| 1 |
<!DOCTYPE html>
|
| 2 |
-
<html>
|
| 3 |
<head>
|
| 4 |
-
<
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5 |
<link rel="stylesheet" href="/static/css/system.css">
|
|
|
|
| 6 |
</head>
|
| 7 |
<body>
|
| 8 |
-
<
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
|
|
|
| 13 |
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 17 |
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 21 |
</div>
|
| 22 |
|
| 23 |
<script src="/static/js/system.js"></script>
|
|
|
|
| 1 |
<!DOCTYPE html>
|
| 2 |
+
<html lang="en">
|
| 3 |
<head>
|
| 4 |
+
<meta charset="UTF-8">
|
| 5 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 6 |
+
<title>System Status - Medical AI Assistant</title>
|
| 7 |
+
<link rel="icon" type="image/svg+xml" href="/static/icon.svg">
|
| 8 |
+
<link rel="stylesheet" href="/static/css/styles.css">
|
| 9 |
<link rel="stylesheet" href="/static/css/system.css">
|
| 10 |
+
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css" rel="stylesheet">
|
| 11 |
</head>
|
| 12 |
<body>
|
| 13 |
+
<div class="app-container">
|
| 14 |
+
<div class="main-content system-page">
|
| 15 |
+
<div class="system-header">
|
| 16 |
+
<a href="/" class="back-link"><i class="fas fa-arrow-left"></i> Back to Chat</a>
|
| 17 |
+
<h1>System Status</h1>
|
| 18 |
+
</div>
|
| 19 |
|
| 20 |
+
<div class="tab-container">
|
| 21 |
+
<div class="tab-bar">
|
| 22 |
+
<button class="tab-button active" data-tab="health">
|
| 23 |
+
<i class="fas fa-heartbeat"></i>
|
| 24 |
+
Health Status
|
| 25 |
+
</button>
|
| 26 |
+
<button class="tab-button" data-tab="database">
|
| 27 |
+
<i class="fas fa-database"></i>
|
| 28 |
+
Database Status
|
| 29 |
+
</button>
|
| 30 |
+
</div>
|
| 31 |
+
|
| 32 |
+
<div id="health" class="tab-content active">
|
| 33 |
+
<div class="status-card">
|
| 34 |
+
<div id="health-status" class="status-content"></div>
|
| 35 |
+
</div>
|
| 36 |
+
</div>
|
| 37 |
|
| 38 |
+
<div id="database" class="tab-content">
|
| 39 |
+
<div class="status-card">
|
| 40 |
+
<div id="db-timestamp" class="timestamp"></div>
|
| 41 |
+
<div id="collections" class="collections-grid"></div>
|
| 42 |
+
</div>
|
| 43 |
+
</div>
|
| 44 |
+
</div>
|
| 45 |
+
</div>
|
| 46 |
</div>
|
| 47 |
|
| 48 |
<script src="/static/js/system.js"></script>
|