Skip to content

ServerKit is a lightweight, modern server control panel for managing web applications, databases, and services on your VPS or dedicated server. Built with Python/Flask backend and React frontend.

feat(ui): Databases parity pass 2 - flush console + semantic tints (S8.1)

Juan Denisa97f8a42152d
diff --git a/frontend/src/components/databases/ConsoleTab.jsx b/frontend/src/components/databases/ConsoleTab.jsx
index 15718d74..0024902c 100644
--- a/frontend/src/components/databases/ConsoleTab.jsx
+++ b/frontend/src/components/databases/ConsoleTab.jsx
@@ -212,7 +212,7 @@ export default function ConsoleTab({ conn, tabId, active, isAdmin, initialQuery
{results && !error && (
<div className="dbx-results-head">
<span className="dbx-results-count">
- {results.row_count} row{results.row_count === 1 ? '' : 's'}
+ <strong>{results.row_count}</strong> row{results.row_count === 1 ? '' : 's'}
{results.truncated && ` · truncated from ${results.total_rows}`}
</span>
<span className="dbx-results-time">{results.execution_time}s</span>
diff --git a/frontend/src/components/databases/ResultsGrid.jsx b/frontend/src/components/databases/ResultsGrid.jsx
index e4ef7e81..ddabbe42 100644
--- a/frontend/src/components/databases/ResultsGrid.jsx
+++ b/frontend/src/components/databases/ResultsGrid.jsx
@@ -2,6 +2,21 @@ import { useMemo, useState } from 'react';
import { ChevronUp, ChevronDown, Database } from 'lucide-react';
import EmptyState from '../EmptyState';
+// Semantic cell tints (prototype `cellEl`): emails/URLs read as string values,
+// positive/negative status words get green/amber.
+const STRING_VALUE = /@|^https?:|\.dev$|\.local$|\.com$/;
+const POSITIVE_VALUE = /^(publish|running|open|instock|yes|active|true|1)$/i;
+const NEGATIVE_VALUE = /^(draft|pending|spam|auto-draft|exited|stopped|closed|no|false|0)$/i;
+
+function cellClass(cell) {
+ if (cell === null) return 'is-null';
+ const s = String(cell);
+ if (STRING_VALUE.test(s)) return 'is-strv';
+ if (POSITIVE_VALUE.test(s)) return 'is-pos';
+ if (NEGATIVE_VALUE.test(s)) return 'is-neg';
+ return undefined;
+}
+
// Renders a query/data result set: columns + row arrays. Sorting is client-side
// over the rows already returned (a page), matching the old QueryRunner.
export default function ResultsGrid({ columns, rows, loading, error, emptyTitle = 'No rows', emptyDescription }) {
@@ -90,7 +105,7 @@ export default function ResultsGrid({ columns, rows, loading, error, emptyTitle
<tr key={rowIdx}>
<td className="dbx-grid-rownum">{rowIdx + 1}</td>
{row.map((cell, cellIdx) => (
- <td key={cellIdx} className={cell === null ? 'is-null' : undefined} title={cell === null ? 'NULL' : String(cell)}>
+ <td key={cellIdx} className={cellClass(cell)} title={cell === null ? 'NULL' : String(cell)}>
{cell === null ? 'NULL' : String(cell)}
</td>
))}
diff --git a/frontend/src/pages/Databases.jsx b/frontend/src/pages/Databases.jsx
index 0e324689..1fb17ed4 100644
--- a/frontend/src/pages/Databases.jsx
+++ b/frontend/src/pages/Databases.jsx
@@ -502,6 +502,16 @@ export default function Databases() {
</button>
</div>
))}
+ <button
+ type="button"
+ className="dbx-tab dbx-tab-new"
+ disabled={!newConsoleConn}
+ onClick={() => { if (newConsoleConn) openConsole(newConsoleConn, selectedNode.engine); }}
+ title={newConsoleConn ? 'New SQL console' : 'Select a database to open a console'}
+ aria-label="New SQL console"
+ >
+ <Plus size={14} aria-hidden="true" />
+ </button>
</div>
)}
diff --git a/frontend/src/styles/pages/_databases.scss b/frontend/src/styles/pages/_databases.scss
index e2f36c6c..afd193e3 100644
--- a/frontend/src/styles/pages/_databases.scss
+++ b/frontend/src/styles/pages/_databases.scss
@@ -18,8 +18,10 @@ $dbx-sqlite: #3d8fd1;
width: 100%;
max-width: none;
margin: 0;
- padding: $space-3;
- gap: $space-2;
+ // flush full-height console (demo `.db-layout`): panes join on 1px borders,
+ // no outer padding / gaps / card radii
+ padding: 0;
+ gap: 0;
box-sizing: border-box;
overflow: hidden;
@@ -92,10 +94,10 @@ $dbx-sqlite: #3d8fd1;
align-items: center;
justify-content: space-between;
gap: $space-3;
+ min-height: 54px;
padding: $space-2 $space-3;
background: $bg-card;
- border: 1px solid $border-default;
- border-radius: $radius-lg;
+ border-bottom: 1px solid $border-default;
flex-shrink: 0;
}
@@ -169,7 +171,7 @@ $dbx-sqlite: #3d8fd1;
.dbx-body {
display: grid;
grid-template-columns: 280px 1fr;
- gap: $space-2;
+ gap: 0;
flex: 1;
min-height: 0;
overflow: hidden;
@@ -189,9 +191,13 @@ $dbx-sqlite: #3d8fd1;
flex-direction: column;
min-height: 0;
background: $bg-card;
- border: 1px solid $border-default;
- border-radius: $radius-lg;
+ border-right: 1px solid $border-default;
overflow: hidden;
+
+ @media (max-width: $breakpoint-md) {
+ border-right: none;
+ border-bottom: 1px solid $border-default;
+ }
}
.dbx-tree-search {
@@ -380,8 +386,6 @@ $dbx-sqlite: #3d8fd1;
min-width: 0;
min-height: 0;
background: $bg-card;
- border: 1px solid $border-default;
- border-radius: $radius-lg;
overflow: hidden;
}
@@ -438,6 +442,17 @@ $dbx-sqlite: #3d8fd1;
.dbx-tab-title { @include dbx-trunc; }
+ // demo's `+` new-tab pill at the end of the strip
+ .dbx-tab-new {
+ padding: $space-2;
+ align-self: center;
+ border-radius: $radius-md;
+ color: $text-tertiary;
+
+ &:disabled { opacity: 0.4; cursor: not-allowed; }
+ &:hover:not(:disabled) { background: $bg-hover; color: $text-primary; }
+ }
+
.dbx-tab-close {
display: flex;
align-items: center;
@@ -772,6 +787,9 @@ $dbx-sqlite: #3d8fd1;
@include dbx-trunc;
&:last-child { border-right: none; }
&.is-null { color: $text-tertiary; font-style: italic; }
+ &.is-strv { color: $success; }
+ &.is-pos { color: $success; }
+ &.is-neg { color: $warning; }
}
tbody tr:hover td { background: $bg-hover; }
@@ -855,10 +873,10 @@ $dbx-sqlite: #3d8fd1;
align-items: center;
justify-content: space-between;
gap: $space-3;
+ min-height: 32px;
padding: $space-1 $space-3;
background: $bg-card;
- border: 1px solid $border-default;
- border-radius: $radius-lg;
+ border-top: 1px solid $border-default;
flex-shrink: 0;
flex-wrap: wrap;
}