File tree 3 files changed +23
-5
lines changed
3 files changed +23
-5
lines changed Original file line number Diff line number Diff line change @@ -16,6 +16,7 @@ import {
16
16
Group ,
17
17
ScrollArea ,
18
18
Stack ,
19
+ Switch ,
19
20
Title ,
20
21
} from "@mantine/core" ;
21
22
import { useLocalStorage } from "@mantine/hooks" ;
@@ -43,6 +44,11 @@ export default function Home() {
43
44
44
45
const mode = useGetMode ( ) ;
45
46
47
+ const [ showMailboxes , setShowMailboxes ] = useLocalStorage < boolean > ( {
48
+ key : "byzzbench/showMailboxes" ,
49
+ defaultValue : true ,
50
+ } ) ;
51
+
46
52
if ( mode . data ?. data === "RUNNING" ) {
47
53
return (
48
54
< Container fluid p = "xl" >
@@ -63,6 +69,13 @@ export default function Home() {
63
69
< Group wrap = "nowrap" gap = "xs" align = "center" >
64
70
< Title order = { 3 } > { schedule ?. data . scenarioId } </ Title >
65
71
< PredicateList />
72
+ < Switch
73
+ label = "Show mailboxes"
74
+ checked = { showMailboxes }
75
+ onChange = { ( event ) => {
76
+ setShowMailboxes ( event . currentTarget . checked ) ;
77
+ } }
78
+ />
66
79
</ Group >
67
80
< Accordion . Item key = "clients" value = "clients" >
68
81
< Accordion . Control > Clients</ Accordion . Control >
@@ -73,7 +86,7 @@ export default function Home() {
73
86
< Accordion . Item key = "nodes" value = "nodes" >
74
87
< Accordion . Control > Nodes</ Accordion . Control >
75
88
< Accordion . Panel >
76
- < NodeList />
89
+ < NodeList showMailboxes = { showMailboxes } />
77
90
</ Accordion . Panel >
78
91
</ Accordion . Item >
79
92
{ /*<Accordion.Item key="adob" value="adob">
Original file line number Diff line number Diff line change @@ -21,9 +21,10 @@ import React from "react";
21
21
22
22
export type NodeCardProps = {
23
23
nodeId : string ;
24
+ showMailboxes ?: boolean ;
24
25
} ;
25
26
26
- export const NodeCard = ( { nodeId } : NodeCardProps ) => {
27
+ export const NodeCard = ( { nodeId, showMailboxes = true } : NodeCardProps ) => {
27
28
const { data, isLoading } = useGetNode ( nodeId ) ;
28
29
const faultyReplicasQuery = useGetFaultyReplicas ( ) ;
29
30
const partitionsQuery = useGetPartitions ( ) ;
@@ -69,7 +70,7 @@ export const NodeCard = ({ nodeId }: NodeCardProps) => {
69
70
/>
70
71
) }
71
72
< Space h = "xs" />
72
- < NodeMailbox nodeId = { nodeId } />
73
+ { showMailboxes && < NodeMailbox nodeId = { nodeId } /> }
73
74
</ Card >
74
75
) ;
75
76
} ;
Original file line number Diff line number Diff line change @@ -5,7 +5,11 @@ import { Grid, Loader } from "@mantine/core";
5
5
import React from "react" ;
6
6
import { NodeCard } from "./NodeCard" ;
7
7
8
- export const NodeList = ( ) => {
8
+ export type NodeListProps = {
9
+ showMailboxes ?: boolean ;
10
+ } ;
11
+
12
+ export const NodeList = ( { showMailboxes = true } : NodeListProps ) => {
9
13
const { data : nodeIds , isLoading } = useGetReplicas ( {
10
14
query : { retry : true } ,
11
15
} ) ;
@@ -18,7 +22,7 @@ export const NodeList = () => {
18
22
< Grid gutter = "md" >
19
23
{ nodeIds ?. data . map ( ( nodeId ) => (
20
24
< Grid . Col span = "content" key = { nodeId } >
21
- < NodeCard nodeId = { nodeId } />
25
+ < NodeCard nodeId = { nodeId } showMailboxes = { showMailboxes } />
22
26
</ Grid . Col >
23
27
) ) }
24
28
</ Grid >
You can’t perform that action at this time.
0 commit comments