From ff0a0c8e9a09e78b105374ba6a9aa947f0013389 Mon Sep 17 00:00:00 2001 From: Agnik Misra Date: Sat, 9 Aug 2025 01:18:18 +0530 Subject: [PATCH] feat(webui) refined all pages added border radius fix spacing issues and text alignment issues in home page --- .../[namespace]/clusters/[cluster]/page.tsx | 93 +++++-- .../shards/[shard]/nodes/[node]/page.tsx | 56 +++-- .../[cluster]/shards/[shard]/page.tsx | 95 ++++++-- webui/src/app/namespaces/[namespace]/page.tsx | 211 +++++++++++----- webui/src/app/namespaces/page.tsx | 226 +++++++++++++----- webui/src/app/page.tsx | 146 +++++++---- webui/src/app/ui/formDialog.tsx | 29 ++- 7 files changed, 615 insertions(+), 241 deletions(-) diff --git a/webui/src/app/namespaces/[namespace]/clusters/[cluster]/page.tsx b/webui/src/app/namespaces/[namespace]/clusters/[cluster]/page.tsx index 05175176..2231ff39 100644 --- a/webui/src/app/namespaces/[namespace]/clusters/[cluster]/page.tsx +++ b/webui/src/app/namespaces/[namespace]/clusters/[cluster]/page.tsx @@ -267,7 +267,10 @@ export default function Cluster({ params }: { params: { namespace: string; clust
-
+
setSearchTerm(e.target.value)} /> @@ -301,10 +305,11 @@ export default function Cluster({ params }: { params: { namespace: string; clust @@ -317,10 +322,11 @@ export default function Cluster({ params }: { params: { namespace: string; clust @@ -334,10 +340,14 @@ export default function Cluster({ params }: { params: { namespace: string; clust
-
+
@@ -362,10 +372,14 @@ export default function Cluster({ params }: { params: { namespace: string; clust
-
+
@@ -390,10 +404,14 @@ export default function Cluster({ params }: { params: { namespace: string; clust
-
+
@@ -418,10 +436,14 @@ export default function Cluster({ params }: { params: { namespace: string; clust
-
+
@@ -447,7 +469,8 @@ export default function Cluster({ params }: { params: { namespace: string; clust
@@ -463,7 +486,8 @@ export default function Cluster({ params }: { params: { namespace: string; clust size="small" onClick={handleFilterClick} aria-describedby={filterId} - className="rounded-full bg-gray-50 text-gray-500 hover:bg-gray-100 dark:bg-gray-800 dark:text-gray-400 dark:hover:bg-gray-700" + className="bg-gray-50 text-gray-500 hover:bg-gray-100 dark:bg-gray-800 dark:text-gray-400 dark:hover:bg-gray-700" + style={{ borderRadius: "16px" }} > @@ -473,7 +497,8 @@ export default function Cluster({ params }: { params: { namespace: string; clust size="small" onClick={handleSortClick} aria-describedby={sortId} - className="rounded-full bg-gray-50 text-gray-500 hover:bg-gray-100 dark:bg-gray-800 dark:text-gray-400 dark:hover:bg-gray-700" + className="bg-gray-50 text-gray-500 hover:bg-gray-100 dark:bg-gray-800 dark:text-gray-400 dark:hover:bg-gray-700" + style={{ borderRadius: "16px" }} > @@ -742,7 +767,8 @@ export default function Cluster({ params }: { params: { namespace: string; clust variant="text" size="small" onClick={handleFilterClose} - className="rounded-lg px-3 py-1 text-xs" + className="px-3 py-1 text-xs" + style={{ borderRadius: "12px" }} > Close @@ -914,7 +940,8 @@ export default function Cluster({ params }: { params: { namespace: string; clust variant="text" size="small" onClick={handleSortClose} - className="rounded-lg px-3 py-1 text-xs" + className="px-3 py-1 text-xs" + style={{ borderRadius: "12px" }} > Close @@ -931,10 +958,14 @@ export default function Cluster({ params }: { params: { namespace: string; clust >
-
+
@@ -954,7 +985,13 @@ export default function Cluster({ params }: { params: { namespace: string; clust {shard.hasMigration && shard.migratingSlot >= 0 && ( -
+
Migrating{" "} @@ -967,7 +1004,13 @@ export default function Cluster({ params }: { params: { namespace: string; clust {!shard.hasMigration && !shard.hasImporting && ( -
+
Stable @@ -977,7 +1020,13 @@ export default function Cluster({ params }: { params: { namespace: string; clust {shard.hasImporting && shard.importingSlot >= 0 && ( -
+
Importing{" "} diff --git a/webui/src/app/namespaces/[namespace]/clusters/[cluster]/shards/[shard]/nodes/[node]/page.tsx b/webui/src/app/namespaces/[namespace]/clusters/[cluster]/shards/[shard]/nodes/[node]/page.tsx index 3b8ea07c..549053d6 100644 --- a/webui/src/app/namespaces/[namespace]/clusters/[cluster]/shards/[shard]/nodes/[node]/page.tsx +++ b/webui/src/app/namespaces/[namespace]/clusters/[cluster]/shards/[shard]/nodes/[node]/page.tsx @@ -131,12 +131,16 @@ export default function Node({ variant="h4" className="flex items-center font-medium text-gray-900 dark:text-white" > -
+
Node {parseInt(node) + 1}
{roleStyles.icon} @@ -157,7 +161,8 @@ export default function Node({ {/* Node Details Section */}
-
+
copyToClipboard(currentNode.id, "id") } - className="ml-3 rounded-full bg-gray-100 p-2 text-gray-500 transition-all hover:bg-gray-200 hover:text-primary dark:bg-gray-700 dark:text-gray-400 dark:hover:bg-gray-600 dark:hover:text-primary-light" + className="ml-3 bg-gray-100 p-2 text-gray-500 transition-all hover:bg-gray-200 hover:text-primary dark:bg-gray-700 dark:text-gray-400 dark:hover:bg-gray-600 dark:hover:text-primary-light" title="Copy ID" + style={{ borderRadius: "16px" }} > {copied === "id" ? (
-
+
copyToClipboard(currentNode.addr, "addr") } - className="ml-3 rounded-full bg-gray-100 p-2 text-gray-500 transition-all hover:bg-gray-200 hover:text-primary dark:bg-gray-700 dark:text-gray-400 dark:hover:bg-gray-600 dark:hover:text-primary-light" + className="ml-3 bg-gray-100 p-2 text-gray-500 transition-all hover:bg-gray-200 hover:text-primary dark:bg-gray-700 dark:text-gray-400 dark:hover:bg-gray-600 dark:hover:text-primary-light" title="Copy Address" + style={{ borderRadius: "16px" }} > {copied === "addr" ? (
{roleStyles.icon} Created At -
+
{copied === "pwd" ? (
-
+
-
+
-
+
-
+
setSearchTerm(e.target.value)} /> @@ -211,7 +215,8 @@ export default function Shard({
@@ -240,7 +246,8 @@ export default function Shard({ size="small" onClick={(e) => setFilterAnchorEl(e.currentTarget)} aria-describedby={filterId} - className="rounded-full bg-gray-50 text-gray-500 hover:bg-gray-100 dark:bg-gray-800 dark:text-gray-400 dark:hover:bg-gray-700" + className="bg-gray-50 text-gray-500 hover:bg-gray-100 dark:bg-gray-800 dark:text-gray-400 dark:hover:bg-gray-700" + style={{ borderRadius: "16px" }} > @@ -250,7 +257,8 @@ export default function Shard({ size="small" onClick={(e) => setSortAnchorEl(e.currentTarget)} aria-describedby={sortId} - className="rounded-full bg-gray-50 text-gray-500 hover:bg-gray-100 dark:bg-gray-800 dark:text-gray-400 dark:hover:bg-gray-700" + className="bg-gray-50 text-gray-500 hover:bg-gray-100 dark:bg-gray-800 dark:text-gray-400 dark:hover:bg-gray-700" + style={{ borderRadius: "16px" }} > @@ -267,10 +275,9 @@ export default function Shard({ transformOrigin={{ vertical: "top", horizontal: "right" }} TransitionComponent={Fade} PaperProps={{ - className: - "rounded-xl shadow-xl border border-gray-100 dark:border-gray-700", + className: "shadow-xl border border-gray-100 dark:border-gray-700", elevation: 3, - sx: { width: 220 }, + sx: { width: 220, borderRadius: "20px" }, }} >
@@ -284,7 +291,10 @@ export default function Shard({ onChange={(e) => setFilterOption(e.target.value)} >
-
+
-
+
-
+
setFilterAnchorEl(null)} - className="rounded-lg px-3 py-1 text-xs" + className="px-3 py-1 text-xs" + style={{ borderRadius: "12px" }} > Close @@ -379,10 +396,9 @@ export default function Shard({ transformOrigin={{ vertical: "top", horizontal: "right" }} TransitionComponent={Fade} PaperProps={{ - className: - "rounded-xl shadow-xl border border-gray-100 dark:border-gray-700", + className: "shadow-xl border border-gray-100 dark:border-gray-700", elevation: 3, - sx: { width: 220 }, + sx: { width: 220, borderRadius: "20px" }, }} >
@@ -396,7 +412,10 @@ export default function Shard({ onChange={(e) => setSortOption(e.target.value)} >
-
+
-
+
-
+
-
+
setSortAnchorEl(null)} - className="rounded-lg px-3 py-1 text-xs" + className="px-3 py-1 text-xs" + style={{ borderRadius: "12px" }} > Close @@ -517,10 +546,14 @@ export default function Shard({ >
-
+
@@ -537,14 +570,26 @@ export default function Shard({ Node {index + 1} {node.role === "master" ? ( -
+
Master
) : ( -
+
Replica diff --git a/webui/src/app/namespaces/[namespace]/page.tsx b/webui/src/app/namespaces/[namespace]/page.tsx index dfc336d6..f9b1de06 100644 --- a/webui/src/app/namespaces/[namespace]/page.tsx +++ b/webui/src/app/namespaces/[namespace]/page.tsx @@ -315,7 +315,10 @@ export default function Namespace({ params }: { params: { namespace: string } })
-
+
setSearchTerm(e.target.value)} /> @@ -337,7 +341,7 @@ export default function Namespace({ params }: { params: { namespace: string } }) )} -
+
@@ -345,10 +349,11 @@ export default function Namespace({ params }: { params: { namespace: string } }) @@ -357,10 +362,11 @@ export default function Namespace({ params }: { params: { namespace: string } }) @@ -374,12 +380,16 @@ export default function Namespace({ params }: { params: { namespace: string } })
-
+ -
+
-
+ -
+
-
+ -
+
-
+ -
+
@@ -503,7 +526,8 @@ export default function Namespace({ params }: { params: { namespace: string } }) size="small" onClick={handleFilterClick} aria-describedby={filterId} - className="rounded-full bg-gray-50 text-gray-500 hover:bg-gray-100 dark:bg-gray-800 dark:text-gray-400 dark:hover:bg-gray-700" + className="bg-gray-50 text-gray-500 hover:bg-gray-100 dark:bg-gray-800 dark:text-gray-400 dark:hover:bg-gray-700" + sx={{ borderRadius: "16px" }} > @@ -513,7 +537,8 @@ export default function Namespace({ params }: { params: { namespace: string } }) size="small" onClick={handleSortClick} aria-describedby={sortId} - className="rounded-full bg-gray-50 text-gray-500 hover:bg-gray-100 dark:bg-gray-800 dark:text-gray-400 dark:hover:bg-gray-700" + className="bg-gray-50 text-gray-500 hover:bg-gray-100 dark:bg-gray-800 dark:text-gray-400 dark:hover:bg-gray-700" + sx={{ borderRadius: "16px" }} > @@ -537,10 +562,9 @@ export default function Namespace({ params }: { params: { namespace: string } }) }} TransitionComponent={Fade} PaperProps={{ - className: - "rounded-xl shadow-xl border border-gray-100 dark:border-gray-700", + className: "shadow-xl border border-gray-100 dark:border-gray-700", elevation: 3, - sx: { width: 280 }, + sx: { width: 280, borderRadius: "20px" }, }} >
@@ -557,7 +581,10 @@ export default function Namespace({ params }: { params: { namespace: string } }) } >
-
+ -
+ -
+ -
+ -
+ -
+ -
+ -
+ -
+ -
+ -
+ -
+
@@ -785,7 +827,8 @@ export default function Namespace({ params }: { params: { namespace: string } }) variant="text" size="small" onClick={handleFilterClose} - className="rounded-lg px-3 py-1 text-xs" + className="px-3 py-1 text-xs" + sx={{ borderRadius: "12px" }} > Close @@ -808,10 +851,9 @@ export default function Namespace({ params }: { params: { namespace: string } }) }} TransitionComponent={Fade} PaperProps={{ - className: - "rounded-xl shadow-xl border border-gray-100 dark:border-gray-700", + className: "shadow-xl border border-gray-100 dark:border-gray-700", elevation: 3, - sx: { width: 280 }, + sx: { width: 280, borderRadius: "20px" }, }} >
@@ -826,7 +868,10 @@ export default function Namespace({ params }: { params: { namespace: string } }) onChange={(e) => setSortOption(e.target.value as SortOption)} >
-
+ -
+ -
+ -
+ -
+ -
+ -
+ -
+
@@ -957,7 +1011,8 @@ export default function Namespace({ params }: { params: { namespace: string } }) variant="text" size="small" onClick={handleSortClose} - className="rounded-lg px-3 py-1 text-xs" + className="px-3 py-1 text-xs" + sx={{ borderRadius: "12px" }} > Close @@ -974,12 +1029,16 @@ export default function Namespace({ params }: { params: { namespace: string } }) >
-
+ -
+
@@ -997,7 +1056,13 @@ export default function Namespace({ params }: { params: { namespace: string } }) {cluster.hasMigration && cluster.migratingSlot >= 0 && ( -
+
Migrating{" "} @@ -1005,23 +1070,34 @@ export default function Namespace({ params }: { params: { namespace: string } }) cluster.migratingSlot } -
+ )} {(!cluster.hasMigration || cluster.migratingSlot === -1) && ( -
+
Stable -
+ )} {cluster.hasImporting && cluster.importingSlot >= 0 && ( -
+
Importing{" "} @@ -1029,7 +1105,7 @@ export default function Namespace({ params }: { params: { namespace: string } }) cluster.importingSlot } -
+ )}
@@ -1067,6 +1143,7 @@ export default function Namespace({ params }: { params: { namespace: string } }) color="secondary" variant="outlined" className="whitespace-nowrap" + sx={{ borderRadius: "12px" }} /> {!cluster.hasSlots && ( @@ -1088,6 +1166,7 @@ export default function Namespace({ params }: { params: { namespace: string } }) color="info" variant="outlined" className="whitespace-nowrap" + sx={{ borderRadius: "12px" }} /> )} @@ -1098,12 +1177,16 @@ export default function Namespace({ params }: { params: { namespace: string } }) color="primary" variant="outlined" className="whitespace-nowrap" + sx={{ borderRadius: "12px" }} /> )}
-
+ {cluster.shardCount} -
+ -
+ {cluster.nodeCount} -
+
diff --git a/webui/src/app/namespaces/page.tsx b/webui/src/app/namespaces/page.tsx index da98120a..93384713 100644 --- a/webui/src/app/namespaces/page.tsx +++ b/webui/src/app/namespaces/page.tsx @@ -265,7 +265,10 @@ export default function Namespace() {
-
+
setSearchTerm(e.target.value)} /> @@ -295,10 +299,11 @@ export default function Namespace() { @@ -312,10 +317,14 @@ export default function Namespace() {
-
+
@@ -333,17 +342,24 @@ export default function Namespace() {
-
+
-
+
@@ -361,17 +377,24 @@ export default function Namespace() {
-
+
-
+
@@ -389,17 +412,24 @@ export default function Namespace() {
-
+
-
+
@@ -417,7 +447,10 @@ export default function Namespace() {
-
+
@@ -425,7 +458,8 @@ export default function Namespace() {
@@ -441,7 +475,8 @@ export default function Namespace() { size="small" onClick={handleFilterClick} aria-describedby={filterId} - className="rounded-full bg-gray-50 text-gray-500 hover:bg-gray-100 dark:bg-gray-800 dark:text-gray-400 dark:hover:bg-gray-700" + className="bg-gray-50 text-gray-500 hover:bg-gray-100 dark:bg-gray-800 dark:text-gray-400 dark:hover:bg-gray-700" + style={{ borderRadius: "16px" }} > @@ -451,7 +486,8 @@ export default function Namespace() { size="small" onClick={handleSortClick} aria-describedby={sortId} - className="rounded-full bg-gray-50 text-gray-500 hover:bg-gray-100 dark:bg-gray-800 dark:text-gray-400 dark:hover:bg-gray-700" + className="bg-gray-50 text-gray-500 hover:bg-gray-100 dark:bg-gray-800 dark:text-gray-400 dark:hover:bg-gray-700" + style={{ borderRadius: "16px" }} > @@ -475,10 +511,9 @@ export default function Namespace() { }} TransitionComponent={Fade} PaperProps={{ - className: - "rounded-xl shadow-xl border border-gray-100 dark:border-gray-700", + className: "shadow-xl border border-gray-100 dark:border-gray-700", elevation: 3, - sx: { width: 280 }, + sx: { width: 280, borderRadius: "20px" }, }} >
@@ -495,7 +530,10 @@ export default function Namespace() { } >
-
+ +
@@ -526,9 +567,12 @@ export default function Namespace() { } className="m-0 w-full" /> -
+
-
+
+
@@ -565,7 +612,10 @@ export default function Namespace() { />
-
+ +
@@ -600,7 +653,7 @@ export default function Namespace() { } className="m-0 w-full" /> -
+
@@ -609,7 +662,8 @@ export default function Namespace() { variant="text" size="small" onClick={handleFilterClose} - className="rounded-lg px-3 py-1 text-xs" + className="px-3 py-1 text-xs" + style={{ borderRadius: "12px" }} > Close @@ -632,10 +686,9 @@ export default function Namespace() { }} TransitionComponent={Fade} PaperProps={{ - className: - "rounded-xl shadow-xl border border-gray-100 dark:border-gray-700", + className: "shadow-xl border border-gray-100 dark:border-gray-700", elevation: 3, - sx: { width: 280 }, + sx: { width: 280, borderRadius: "20px" }, }} >
@@ -654,7 +707,10 @@ export default function Namespace() { Name
-
+ +
@@ -683,8 +742,11 @@ export default function Namespace() { } className="m-0 w-full" /> -
-
+ + +
@@ -713,14 +778,17 @@ export default function Namespace() { } className="m-0 w-full" /> -
+
Clusters
-
+ +
@@ -749,8 +820,11 @@ export default function Namespace() { } className="m-0 w-full" /> -
-
+ + +
@@ -779,14 +856,17 @@ export default function Namespace() { } className="m-0 w-full" /> -
+
Nodes
-
+ +
@@ -815,8 +898,11 @@ export default function Namespace() { } className="m-0 w-full" /> -
-
+ + +
@@ -845,7 +934,7 @@ export default function Namespace() { } className="m-0 w-full" /> -
+
@@ -855,7 +944,8 @@ export default function Namespace() { variant="text" size="small" onClick={handleSortClose} - className="rounded-lg px-3 py-1 text-xs" + className="px-3 py-1 text-xs" + style={{ borderRadius: "12px" }} > Close @@ -872,10 +962,14 @@ export default function Namespace() { >
-
+
@@ -912,6 +1006,7 @@ export default function Namespace() { color="primary" variant="outlined" className="whitespace-nowrap" + style={{ borderRadius: "12px" }} />
-
+
-
+
-
+
diff --git a/webui/src/app/page.tsx b/webui/src/app/page.tsx index 93923a80..cc049e41 100644 --- a/webui/src/app/page.tsx +++ b/webui/src/app/page.tsx @@ -268,7 +268,10 @@ export default function Home() { style={heroParallax} > -
+
Apache Software Foundation @@ -305,9 +308,10 @@ export default function Home() { @@ -315,10 +319,11 @@ export default function Home() { @@ -350,7 +355,10 @@ export default function Home() {
-
+
@@ -438,25 +446,33 @@ export default function Home() { -
+
Powerful Features
Why Choose Kvrocks? - - Apache Kvrocks offers powerful capabilities that make it an excellent - choice for your database needs - +
+ + Apache Kvrocks offers powerful capabilities that make it an + excellent choice for your database needs + +
@@ -464,8 +480,9 @@ export default function Home() {
{feature.icon}
@@ -523,14 +543,20 @@ export default function Home() { -
+
Powerful Management
About Kvrocks Controller @@ -538,7 +564,8 @@ export default function Home() { @@ -546,28 +573,35 @@ export default function Home() { Simplified Management +
+ Kvrocks Controller provides a web management interface for Apache Kvrocks clusters, enabling efficient distribution, monitoring, and maintenance of your Redis compatible database infrastructure. +
{benefits.map((benefit, index) => (
-
+
{benefit.icon}
@@ -595,6 +629,7 @@ export default function Home() { xs={12} md={6} className="bg-gradient-to-br from-gray-900 to-gray-800 text-white dark:from-gray-900 dark:to-gray-800" + style={{ borderRadius: "20px" }} >
@@ -609,7 +644,10 @@ export default function Home() {
-
+
$ redis-cli -p 6666 @@ -665,6 +703,7 @@ export default function Home() { size="small" color="success" className="bg-success/80 transition-colors hover:bg-success" + style={{ borderRadius: "12px" }} />
@@ -684,19 +723,24 @@ export default function Home() { Resources - - Explore documentation and source code to get the most out of Kvrocks - Controller - +
+ + Explore documentation and source code to get the most out of Kvrocks + Controller + +
@@ -710,15 +754,19 @@ export default function Home() { >
{React.cloneElement(resource.icon, { @@ -763,7 +811,8 @@ export default function Home() { - - Start managing your distributed database infrastructure with our - intuitive and powerful controller interface. - +
+ + Start managing your distributed database infrastructure with our + intuitive and powerful controller interface. + +
diff --git a/webui/src/app/ui/formDialog.tsx b/webui/src/app/ui/formDialog.tsx index 10a47bc9..8114513b 100644 --- a/webui/src/app/ui/formDialog.tsx +++ b/webui/src/app/ui/formDialog.tsx @@ -109,11 +109,12 @@ const FormDialog: React.FC = ({