Skip to content

Commit 16313cf

Browse files
committed
Update Header
1 parent 2141d5a commit 16313cf

File tree

1 file changed

+22
-6
lines changed

1 file changed

+22
-6
lines changed

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

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import {
1212

1313
export default function Header() {
1414
const [selectedTheme, setSelectedTheme] = useState(StorageUtils.getTheme());
15-
const { setShowSettings } = useAppContext();
15+
const { serverProps, setShowSettings } = useAppContext();
1616

1717
const setTheme = (theme: string) => {
1818
StorageUtils.setTheme(theme);
@@ -28,13 +28,25 @@ export default function Header() {
2828
}, [selectedTheme]);
2929

3030
return (
31-
<div className="flex flex-row items-center pt-6 pb-6 sticky top-0 z-10 bg-base-100">
31+
<div className="flex flex-row items-center pt-2 pb-2 sticky top-0 z-10 bg-base-100 border-b border-base-content/10">
3232
{/* open sidebar button */}
33-
<label htmlFor="toggle-drawer" className="btn btn-ghost lg:hidden">
33+
<label
34+
htmlFor="toggle-drawer"
35+
className="btn btn-ghost w-8 h-8 p-0 lg:hidden"
36+
>
3437
<Bars3Icon className="h-5 w-5" />
3538
</label>
3639

37-
<div className="grow text-2xl font-bold ml-2">llama.cpp</div>
40+
{/* model information*/}
41+
<div className="grow ml-2 px-1 sm:px-4 py-0 sm:py-2">
42+
<b>
43+
{serverProps?.model_alias ||
44+
serverProps?.model_path
45+
?.split(/(\\|\/)/)
46+
.pop()
47+
?.replace(/\.\w+$/, '')}
48+
</b>
49+
</div>
3850

3951
{/* action buttons (top right) */}
4052
<div className="flex items-center">
@@ -43,7 +55,7 @@ export default function Header() {
4355
data-tip="Settings"
4456
onClick={() => setShowSettings(true)}
4557
>
46-
<button className="btn" aria-hidden={true}>
58+
<button className="btn w-8 h-8 p-0 rounded-full" aria-hidden={true}>
4759
{/* settings button */}
4860
<Cog8ToothIcon className="w-5 h-5" />
4961
</button>
@@ -52,7 +64,11 @@ export default function Header() {
5264
{/* theme controller is copied from https://daisyui.com/components/theme-controller/ */}
5365
<div className="tooltip tooltip-bottom" data-tip="Themes">
5466
<div className="dropdown dropdown-end dropdown-bottom">
55-
<div tabIndex={0} role="button" className="btn m-1">
67+
<div
68+
tabIndex={0}
69+
role="button"
70+
className="btn m-1 w-8 h-8 p-0 rounded-full"
71+
>
5672
<MoonIcon className="w-5 h-5" />
5773
</div>
5874
<ul

0 commit comments

Comments
 (0)