File tree Expand file tree Collapse file tree 4 files changed +15
-5
lines changed
Expand file tree Collapse file tree 4 files changed +15
-5
lines changed Original file line number Diff line number Diff line change @@ -45,11 +45,11 @@ export function AppSidebar() {
4545 < div className = "mt-10 flex flex-col items-stretch w-full" >
4646 < ul className = "space-y-2" >
4747 { [
48- // Always show connect
49- { to : "/connect" , title : "Connections" , icon : HousePlug } ,
50- // Rest of the menu items only if connected
5148 ...( isConnected
5249 ? [
50+ { to : ( clusterId ? `/${ clusterId } /${ id } /connect` : `${ id } /connect` ) ,
51+ title : "Connections" ,
52+ icon : HousePlug } ,
5353 {
5454 to : ( clusterId ? `/${ clusterId } /${ id } /dashboard` : `${ id } /dashboard` ) ,
5555 title : "Dashboard" ,
@@ -75,7 +75,7 @@ export function AppSidebar() {
7575 : [ ] ) ,
7676
7777 ]
78- : [ ] ) ,
78+ : [ { to : "/connect" , title : "Connections" , icon : HousePlug } ] ) ,
7979 ] . map ( ( { to, title, icon : Icon } ) => (
8080 < li key = { to } >
8181 < Link
Original file line number Diff line number Diff line change @@ -40,6 +40,7 @@ const AppWithHistory = () => {
4040
4141 { /* Routes with clusterId */ }
4242 < Route element = { < RequireConnection /> } >
43+ < Route element = { < Connection /> } path = "/:clusterId/:id/connect" />
4344 < Route element = { < Dashboard /> } path = "/:clusterId/:id/dashboard" />
4445 < Route element = { < SendCommand /> } path = "/:clusterId/:id/sendcommand" />
4546 < Route element = { < KeyBrowser /> } path = "/:clusterId/:id/browse" />
@@ -49,6 +50,7 @@ const AppWithHistory = () => {
4950 { /* Routes without clusterId */ }
5051 < Route element = { < RequireConnection /> } >
5152 < Route element = { < ValkeyReconnect /> } path = "/:id/valkey-reconnect" />
53+ < Route element = { < Connection /> } path = "/:id/connect" />
5254 < Route element = { < Dashboard /> } path = "/:id/dashboard" />
5355 < Route element = { < SendCommand /> } path = "/:id/sendcommand" />
5456 < Route element = { < KeyBrowser /> } path = "/:id/browse" />
Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ import { setData } from "../valkey-features/info/infoSlice"
1111import { action$ , select } from "../middleware/rxjsMiddleware/rxjsMiddlware"
1212import { setClusterData } from "../valkey-features/cluster/clusterSlice"
1313import { connectFulfilled as wsConnectFulfilled } from "../wsconnection/wsConnectionSlice"
14+ import history from "../../history.ts"
1415import type { Store } from "@reduxjs/toolkit"
1516import { atId } from "@/state/valkey-features/connection/connectionSelectors.ts"
1617
@@ -190,7 +191,14 @@ export const setDataEpic = () =>
190191 tap ( ( action ) => {
191192 const socket = getSocket ( )
192193 const { clusterId, connectionId } = action . payload
193- if ( clusterId ) socket . next ( { type : setClusterData . type , payload : { clusterId, connectionId } } )
194+ if ( clusterId ) {
195+ socket . next ( { type : setClusterData . type , payload : { clusterId, connectionId } } )
196+ }
194197 socket . next ( { type : setData . type , payload : { connectionId } } )
198+ const dashboardPath = clusterId
199+ ? `/${ clusterId } /${ connectionId } /dashboard`
200+ : `/${ connectionId } /dashboard`
201+
202+ history . navigate ( dashboardPath )
195203 } ) ,
196204 )
You can’t perform that action at this time.
0 commit comments