File tree 2 files changed +12
-0
lines changed
2 files changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -140,6 +140,17 @@ export function useClusterGroup(): string[] {
140
140
return clusterGroup ;
141
141
}
142
142
143
+ /**
144
+ * Use the cluster name from the URL query parameters if it's there.
145
+ *
146
+ * @returns the cluster name from the URL. If no cluster is defined in the URL, undefined is returned.
147
+ */
148
+ export function useClusterFromURLVar ( ) : string | undefined {
149
+ const location = useLocation ( ) ;
150
+ const searchParams = new URLSearchParams ( location . search ) ;
151
+ return searchParams . get ( 'cluster' ) || undefined ;
152
+ }
153
+
143
154
export function getVersion ( clusterName : string = '' ) : Promise < StringDict > {
144
155
return clusterRequest ( '/version' , { cluster : clusterName || getCluster ( ) } ) ;
145
156
}
Original file line number Diff line number Diff line change 363
363
"default": [Function],
364
364
},
365
365
"useCluster": [Function],
366
+ "useClusterFromURLVar": [Function],
366
367
"useClusterGroup": [Function],
367
368
"useClustersConf": [Function],
368
369
"useClustersVersion": [Function],
You can’t perform that action at this time.
0 commit comments