feat(ui): Add React based UI for the vibes at /app
This adds a completely separate frontend based on React because I found that code gen works better with React once the application gets bigger. In particular it was getting very hard to move past add connectors and actions. The idea is to replace the standard UI with this once it has been tested. But for now it is available at /app in addition to the original at / Signed-off-by: Richard Palethorpe <io@richiejp.com>
This commit is contained in:
52
webui/react-ui/src/router.jsx
Normal file
52
webui/react-ui/src/router.jsx
Normal file
@@ -0,0 +1,52 @@
|
||||
import { createBrowserRouter } from 'react-router-dom';
|
||||
import App from './App';
|
||||
import Home from './pages/Home';
|
||||
import AgentSettings from './pages/AgentSettings';
|
||||
import AgentsList from './pages/AgentsList';
|
||||
import CreateAgent from './pages/CreateAgent';
|
||||
import Chat from './pages/Chat';
|
||||
import ActionsPlayground from './pages/ActionsPlayground';
|
||||
import GroupCreate from './pages/GroupCreate';
|
||||
|
||||
// Get the base URL from Vite's environment variables or default to '/app/'
|
||||
const BASE_URL = import.meta.env.BASE_URL || '/app';
|
||||
|
||||
// Create a router with the base URL
|
||||
export const router = createBrowserRouter([
|
||||
{
|
||||
path: '/',
|
||||
element: <App />,
|
||||
children: [
|
||||
{
|
||||
index: true,
|
||||
element: <Home />
|
||||
},
|
||||
{
|
||||
path: 'agents',
|
||||
element: <AgentsList />
|
||||
},
|
||||
{
|
||||
path: 'create',
|
||||
element: <CreateAgent />
|
||||
},
|
||||
{
|
||||
path: 'settings/:name',
|
||||
element: <AgentSettings />
|
||||
},
|
||||
{
|
||||
path: 'talk/:name',
|
||||
element: <Chat />
|
||||
},
|
||||
{
|
||||
path: 'actions-playground',
|
||||
element: <ActionsPlayground />
|
||||
},
|
||||
{
|
||||
path: 'group-create',
|
||||
element: <GroupCreate />
|
||||
}
|
||||
]
|
||||
}
|
||||
], {
|
||||
basename: BASE_URL // Set the base URL for all routes
|
||||
});
|
||||
Reference in New Issue
Block a user