mirror of
https://github.com/mudler/LocalAI.git
synced 2026-09-08 20:24:52 -04:00
Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
26d326b592 |
No files matched your search
@@ -38,4 +38,13 @@ test.describe('Agents page', () => {
|
||||
// when the render won, swinging total UI coverage ~1pp run-to-run.
|
||||
await expect(page.getByRole('heading', { name: 'Create Agent' })).toBeVisible()
|
||||
})
|
||||
|
||||
test('opens agent status without leaving an active chat', async ({ page }) => {
|
||||
await page.goto('/app/agents/demo/chat?user_id=test-user')
|
||||
|
||||
const status = page.getByRole('link', { name: 'Status' })
|
||||
await expect(status).toHaveAttribute('href', '/app/agents/demo/status?user_id=test-user')
|
||||
await expect(status).toHaveAttribute('target', '_blank')
|
||||
await expect(page).toHaveURL(/\/app\/agents\/demo\/chat\?user_id=test-user$/)
|
||||
})
|
||||
})
|
||||
@@ -1,5 +1,5 @@
|
||||
import { useState, useEffect, useRef, useCallback, useMemo } from 'react'
|
||||
import { useParams, useNavigate, useOutletContext, useSearchParams } from 'react-router-dom'
|
||||
import { useParams, useOutletContext, useSearchParams } from 'react-router-dom'
|
||||
import { agentsApi } from '../utils/api'
|
||||
import { apiUrl } from '../utils/basePath'
|
||||
import { renderMarkdown, highlightAll, enhanceCodeBlocks } from '../utils/markdown'
|
||||
@@ -72,7 +72,6 @@ function AgentActivityGroup({ items }) {
|
||||
|
||||
export default function AgentChat() {
|
||||
const { name } = useParams()
|
||||
const navigate = useNavigate()
|
||||
const { addToast } = useOutletContext()
|
||||
const [searchParams] = useSearchParams()
|
||||
const userId = searchParams.get('user_id') || undefined
|
||||
@@ -600,9 +599,15 @@ export default function AgentChat() {
|
||||
<i className="fas fa-layer-group" /> {artifacts.length}
|
||||
</button>
|
||||
)}
|
||||
<button className="btn btn-secondary btn-sm" onClick={() => navigate(`/app/agents/${encodeURIComponent(name)}/status${userId ? `?user_id=${encodeURIComponent(userId)}` : ''}`)} title="View status & observables">
|
||||
<a
|
||||
className="btn btn-secondary btn-sm"
|
||||
href={`/app/agents/${encodeURIComponent(name)}/status${userId ? `?user_id=${encodeURIComponent(userId)}` : ''}`}
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
title="View status & observables in a new tab"
|
||||
>
|
||||
<i className="fas fa-chart-bar" /> Status
|
||||
</button>
|
||||
</a>
|
||||
<button className="btn btn-secondary btn-sm" onClick={() => clearMessages()} disabled={messages.length === 0} title="Clear chat history">
|
||||
<i className="fas fa-eraser" /> Clear
|
||||
</button>
|
||||
|
||||
Reference in new issue
Block a user