auto-git:
[add] dist/assets/index-BlgdGsnZ.js [add] dist/assets/index-D21amC2P.css [change] dist/index.html [change] src/App.jsx [change] src/styles.css [unlink] dist/assets/index-Cl_WYrJF.css [unlink] dist/assets/index-u1-aH6b-.js
This commit is contained in:
73
dist/assets/index-BlgdGsnZ.js
vendored
Normal file
73
dist/assets/index-BlgdGsnZ.js
vendored
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
73
dist/assets/index-u1-aH6b-.js
vendored
73
dist/assets/index-u1-aH6b-.js
vendored
File diff suppressed because one or more lines are too long
4
dist/index.html
vendored
4
dist/index.html
vendored
@@ -5,8 +5,8 @@
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>LLM Desktop</title>
|
||||
<script type="module" crossorigin src="/assets/index-u1-aH6b-.js"></script>
|
||||
<link rel="stylesheet" crossorigin href="/assets/index-Cl_WYrJF.css">
|
||||
<script type="module" crossorigin src="/assets/index-BlgdGsnZ.js"></script>
|
||||
<link rel="stylesheet" crossorigin href="/assets/index-D21amC2P.css">
|
||||
</head>
|
||||
<body>
|
||||
<div id="root"></div>
|
||||
|
||||
19
src/App.jsx
19
src/App.jsx
@@ -178,6 +178,7 @@ export default function App() {
|
||||
const [colorScheme, setColorScheme] = useState('Default'); // State for color scheme
|
||||
const [streamOutput, setStreamOutput] = useState(false);
|
||||
const [startupTaskMessage, setStartupTaskMessage] = useState('');
|
||||
const [startupTaskBusy, setStartupTaskBusy] = useState(false);
|
||||
const [searxUrl, setSearxUrl] = useState(() => migrateLegacySearxUrl(localStorage.getItem(WEBSEARCH_URL_KEY)));
|
||||
const [searxEngines, setSearxEngines] = useState(() => {
|
||||
try {
|
||||
@@ -752,12 +753,11 @@ async function regenerateFromIndex(index, overrideUserText = null) {
|
||||
}, [activeSidebarMode]);
|
||||
|
||||
useEffect(() => {
|
||||
if (!settingsLoaded || !backendApiUrl || startupOllamaCheckRanRef.current) return
|
||||
if (!settingsLoaded || loading || !backendApiUrl || startupOllamaCheckRanRef.current) return
|
||||
startupOllamaCheckRanRef.current = true
|
||||
|
||||
let cancelled = false
|
||||
|
||||
;(async () => {
|
||||
const timerId = window.setTimeout(() => { ;(async () => {
|
||||
let actionStarted = false
|
||||
try {
|
||||
let status = await fetchStartupOllamaStatus()
|
||||
@@ -770,6 +770,7 @@ async function regenerateFromIndex(index, overrideUserText = null) {
|
||||
if (cancelled) return
|
||||
if (confirmed) {
|
||||
actionStarted = true
|
||||
setStartupTaskBusy(true)
|
||||
setStartupTaskMessage('Starting Ollama in the background...')
|
||||
const response = await fetch(`${backendApiUrl}/ollama/start`, { method: 'POST' })
|
||||
status = await expectBackendJson(response)
|
||||
@@ -784,7 +785,8 @@ async function regenerateFromIndex(index, overrideUserText = null) {
|
||||
if (cancelled) return
|
||||
if (confirmed) {
|
||||
actionStarted = true
|
||||
setStartupTaskMessage(`Pulling ${status.selected_embed_model} in Ollama...`)
|
||||
setStartupTaskBusy(true)
|
||||
setStartupTaskMessage(`Downloading ${status.selected_embed_model} from Ollama. This can take a while on first install.`)
|
||||
const response = await fetch(`${backendApiUrl}/ollama/pull`, {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
@@ -803,15 +805,17 @@ async function regenerateFromIndex(index, overrideUserText = null) {
|
||||
}
|
||||
} finally {
|
||||
if (!cancelled) {
|
||||
setStartupTaskBusy(false)
|
||||
setStartupTaskMessage('')
|
||||
}
|
||||
}
|
||||
})()
|
||||
})() }, 1200)
|
||||
|
||||
return () => {
|
||||
cancelled = true
|
||||
window.clearTimeout(timerId)
|
||||
}
|
||||
}, [backendApiUrl, settingsLoaded]);
|
||||
}, [backendApiUrl, loading, settingsLoaded]);
|
||||
|
||||
// Apply color scheme whenever it changes
|
||||
useEffect(() => {
|
||||
@@ -1876,7 +1880,8 @@ async function createNewChat() {
|
||||
<div className="main-content">
|
||||
{startupTaskMessage && (
|
||||
<div className="startup-task-banner" role="status" aria-live="polite">
|
||||
{startupTaskMessage}
|
||||
{startupTaskBusy && <div className="spinner startup-task-banner__spinner"></div>}
|
||||
<div className="startup-task-banner__text">{startupTaskMessage}</div>
|
||||
</div>
|
||||
)}
|
||||
{activeSidebarMode === 'chats' && (
|
||||
|
||||
@@ -835,13 +835,34 @@ input:checked + .slider:before {
|
||||
}
|
||||
|
||||
.startup-task-banner {
|
||||
margin: 16px 16px 0;
|
||||
position: fixed;
|
||||
top: 16px;
|
||||
right: 16px;
|
||||
z-index: 50;
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
gap: 12px;
|
||||
max-width: min(420px, calc(100vw - 32px));
|
||||
padding: 12px 14px;
|
||||
border: 1px solid var(--border);
|
||||
border-radius: 10px;
|
||||
background: var(--panel);
|
||||
color: var(--text);
|
||||
line-height: 1.5;
|
||||
box-shadow: 0 12px 32px rgba(0, 0, 0, 0.24);
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.startup-task-banner__spinner {
|
||||
width: 18px;
|
||||
height: 18px;
|
||||
margin: 2px 0 0;
|
||||
border-width: 2px;
|
||||
flex: 0 0 auto;
|
||||
}
|
||||
|
||||
.startup-task-banner__text {
|
||||
flex: 1 1 auto;
|
||||
}
|
||||
|
||||
/* Spinner Styles */
|
||||
|
||||
Reference in New Issue
Block a user