Skip to content

Commit

Permalink
fix: Hide AI routes in the route list (#407)
Browse files Browse the repository at this point in the history
  • Loading branch information
CH3CHO authored Jan 16, 2025
1 parent c5143ab commit b29bca0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
4 changes: 4 additions & 0 deletions frontend/src/pages/route/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import {
} from '@/interfaces/route';
import { addGatewayRoute, deleteGatewayRoute, getGatewayRoutes, updateGatewayRoute } from '@/services';
import store from '@/store';
import switches from '@/switches';
import { isInternalResource } from '@/utils';
import { ExclamationCircleOutlined, RedoOutlined } from '@ant-design/icons';
import { PageContainer } from '@ant-design/pro-layout';
Expand Down Expand Up @@ -121,6 +122,9 @@ const RouteList: React.FC = () => {
i.key || (i.key = i.id ? `${i.id}` : i.name);
i.internal = isInternalResource(i.name);
});
if (!switches.SHOW_INTERNAL_ROUTES) {
result = result.filter(r => !r.internal);
}
result.sort((i1, i2) => {
if (i1.internal !== i2.internal) {
return i1.internal ? 1 : -1
Expand Down
3 changes: 3 additions & 0 deletions frontend/src/switches.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export default {
SHOW_INTERNAL_ROUTES: false,
};

0 comments on commit b29bca0

Please sign in to comment.