@@ -2,7 +2,7 @@ import * as React from 'react';
22
33import type { Location } from 'history' ;
44import isEmpty from 'lodash/isEmpty' ;
5- import { compile } from 'path-to-regexp' ;
5+ import { compile , match } from 'path-to-regexp' ;
66import qs from 'qs' ;
77import type { QueryParamConfig } from 'use-query-params' ;
88import { StringParam } from 'use-query-params' ;
@@ -26,7 +26,7 @@ export const TABLET = 'tablet';
2626const routes = {
2727 clusters : `/${ CLUSTERS } ` ,
2828 cluster : `/:environment?/${ CLUSTER } /:activeTab?` ,
29- tenant : `/${ TENANT } ` ,
29+ tenant : `/:environment?/ ${ TENANT } ` ,
3030 node : `/:environment?/${ NODE } /:id/:activeTab?` ,
3131 pDisk : `/:environment?/${ PDISK } ` ,
3232 vDisk : `/:environment?/${ VDISK } ` ,
@@ -210,9 +210,11 @@ export function useTabletPagePath() {
210210}
211211
212212export function checkIsClustersPage ( pathname : string ) {
213- return pathname . endsWith ( routes . clusters ) ;
213+ const matchFn = match ( routes . clusters ) ;
214+ return Boolean ( matchFn ( pathname ) ) ;
214215}
215216
216217export function checkIsTenantPage ( pathname : string ) {
217- return pathname . endsWith ( routes . tenant ) ;
218+ const matchFn = match ( routes . tenant ) ;
219+ return Boolean ( matchFn ( pathname ) ) ;
218220}
0 commit comments