Skip to content

Commit b29bca0

Browse files
authored
fix: Hide AI routes in the route list (higress-group#407)
1 parent c5143ab commit b29bca0

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

frontend/src/pages/route/index.tsx

+4
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import {
88
} from '@/interfaces/route';
99
import { addGatewayRoute, deleteGatewayRoute, getGatewayRoutes, updateGatewayRoute } from '@/services';
1010
import store from '@/store';
11+
import switches from '@/switches';
1112
import { isInternalResource } from '@/utils';
1213
import { ExclamationCircleOutlined, RedoOutlined } from '@ant-design/icons';
1314
import { PageContainer } from '@ant-design/pro-layout';
@@ -121,6 +122,9 @@ const RouteList: React.FC = () => {
121122
i.key || (i.key = i.id ? `${i.id}` : i.name);
122123
i.internal = isInternalResource(i.name);
123124
});
125+
if (!switches.SHOW_INTERNAL_ROUTES) {
126+
result = result.filter(r => !r.internal);
127+
}
124128
result.sort((i1, i2) => {
125129
if (i1.internal !== i2.internal) {
126130
return i1.internal ? 1 : -1

frontend/src/switches.ts

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
export default {
2+
SHOW_INTERNAL_ROUTES: false,
3+
};

0 commit comments

Comments
 (0)