Skip to content

Commit 7020854

Browse files
committed
webui: update ServerInfo
1 parent dd1bbd9 commit 7020854

File tree

2 files changed

+36
-40
lines changed

2 files changed

+36
-40
lines changed

tools/server/webui/src/App.tsx

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ function AppLayout() {
3737
>
3838
<Header />
3939
<Outlet />
40+
<ServerInfo />
4041
</main>
4142
{
4243
<SettingDialog
@@ -49,4 +50,37 @@ function AppLayout() {
4950
);
5051
}
5152

53+
function ServerInfo() {
54+
const { serverProps } = useAppContext();
55+
const modalities = [];
56+
if (serverProps?.modalities?.audio) {
57+
modalities.push('audio');
58+
}
59+
if (serverProps?.modalities?.vision) {
60+
modalities.push('vision');
61+
}
62+
return (
63+
<div
64+
className="sticky bottom-0 w-full pb-1 text-base-content/70 text-xs text-center"
65+
tabIndex={0}
66+
aria-description="Server information"
67+
>
68+
<span>
69+
<b>Llama.cpp</b> {serverProps?.build_info}
70+
</span>
71+
72+
<span className="sm:ml-2">
73+
{modalities.length > 0 ? (
74+
<>
75+
<br className="sm:hidden" />
76+
<b>Supported modalities:</b> {modalities.join(', ')}
77+
</>
78+
) : (
79+
''
80+
)}
81+
</span>
82+
</div>
83+
);
84+
}
85+
5286
export default App;

tools/server/webui/src/components/ChatScreen.tsx

Lines changed: 2 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -238,10 +238,7 @@ export default function ChatScreen() {
238238
{viewingChat ? (
239239
''
240240
) : (
241-
<>
242-
<div className="mb-4">Send a message to start</div>
243-
<ServerInfo />
244-
</>
241+
<div className="mb-4">Send a message to start</div>
245242
)}
246243
</div>
247244
{[...messages, ...pendingMsgDisplay].map((msg) => (
@@ -276,41 +273,6 @@ export default function ChatScreen() {
276273
);
277274
}
278275

279-
function ServerInfo() {
280-
const { serverProps } = useAppContext();
281-
const modalities = [];
282-
if (serverProps?.modalities?.audio) {
283-
modalities.push('audio');
284-
}
285-
if (serverProps?.modalities?.vision) {
286-
modalities.push('vision');
287-
}
288-
return (
289-
<div
290-
className="card card-sm shadow-sm border-1 border-base-content/20 text-base-content/70 mb-6"
291-
tabIndex={0}
292-
aria-description="Server information"
293-
>
294-
<div className="card-body">
295-
<b>Server Info</b>
296-
<p>
297-
<b>Model</b>: {serverProps?.model_path?.split(/(\\|\/)/).pop()}
298-
<br />
299-
<b>Build</b>: {serverProps?.build_info}
300-
<br />
301-
{modalities.length > 0 ? (
302-
<>
303-
<b>Supported modalities:</b> {modalities.join(', ')}
304-
</>
305-
) : (
306-
''
307-
)}
308-
</p>
309-
</div>
310-
</div>
311-
);
312-
}
313-
314276
function ChatInput({
315277
textarea,
316278
extraContext,
@@ -332,7 +294,7 @@ function ChatInput({
332294
role="group"
333295
aria-label="Chat input"
334296
className={classNames({
335-
'flex items-end pt-8 pb-6 sticky bottom-0 bg-base-100': true,
297+
'flex items-end pt-8 pb-1 sticky bottom-0 bg-base-100': true,
336298
'opacity-50': isDrag, // simply visual feedback to inform user that the file will be accepted
337299
})}
338300
>

0 commit comments

Comments
 (0)