wu981526092 commited on
Commit
2f3d73d
Β·
1 Parent(s): 70cb2cf

Fix Model Catalog navigation in Playground

Browse files

οΏ½ Fix Navigation Issue:
- Replace HTML anchor tag with React Router Link component
- Prevents page refresh and direct API call to /models endpoint
- Ensures proper SPA navigation to Model Catalog page

Before: <a href='/models'> β†’ Page refresh β†’ JSON response
After: <Link to='/models'> β†’ SPA navigation β†’ Model Catalog UI

βœ… Now clicking 'View Model Catalog' in Playground properly navigates to the Models page

frontend/src/pages/Playground.tsx CHANGED
@@ -1,4 +1,5 @@
1
  import { useState, useEffect } from 'react'
 
2
  import { Button } from '@/components/ui/button'
3
  import { Card, CardHeader, CardTitle, CardContent } from '@/components/ui/card'
4
  import { Slider } from '@/components/ui/slider'
@@ -658,10 +659,10 @@ export function Playground() {
658
  {/* Model Catalog Link */}
659
  <div className="pt-2 border-t">
660
  <Button variant="outline" size="sm" className="w-full" asChild>
661
- <a href="/models" className="flex items-center gap-2">
662
  <BookOpen className="h-4 w-4" />
663
  View Model Catalog
664
- </a>
665
  </Button>
666
  </div>
667
  </CardContent>
 
1
  import { useState, useEffect } from 'react'
2
+ import { Link } from 'react-router-dom'
3
  import { Button } from '@/components/ui/button'
4
  import { Card, CardHeader, CardTitle, CardContent } from '@/components/ui/card'
5
  import { Slider } from '@/components/ui/slider'
 
659
  {/* Model Catalog Link */}
660
  <div className="pt-2 border-t">
661
  <Button variant="outline" size="sm" className="w-full" asChild>
662
+ <Link to="/models" className="flex items-center gap-2">
663
  <BookOpen className="h-4 w-4" />
664
  View Model Catalog
665
+ </Link>
666
  </Button>
667
  </div>
668
  </CardContent>
static/assets/index-144414e6.js ADDED
The diff for this file is too large to render. See raw diff
 
static/assets/index-144414e6.js.map ADDED
The diff for this file is too large to render. See raw diff
 
static/index.html CHANGED
@@ -5,7 +5,7 @@
5
  <link rel="icon" type="image/svg+xml" href="/vite.svg" />
6
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
7
  <title>Edge LLM</title>
8
- <script type="module" crossorigin src="/assets/index-08e6e33b.js"></script>
9
  <link rel="stylesheet" href="/assets/index-2a660e81.css">
10
  </head>
11
  <body>
 
5
  <link rel="icon" type="image/svg+xml" href="/vite.svg" />
6
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
7
  <title>Edge LLM</title>
8
+ <script type="module" crossorigin src="/assets/index-144414e6.js"></script>
9
  <link rel="stylesheet" href="/assets/index-2a660e81.css">
10
  </head>
11
  <body>