Skip to content

Commit c2f6ec4

Browse files
PoulphunterPoulphunter
authored andcommitted
feat(header): Add encryption key indicator button using BASE_URL and ENCRYPT_KEY from config
This commit introduces a new button in the header to display the base URL when an encryption key is present, enhancing user awareness of security settings and application context.
1 parent f161ca8 commit c2f6ec4

File tree

1 file changed

+18
-3
lines changed

1 file changed

+18
-3
lines changed

src/components/Header.tsx

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@ import StorageUtils from '../utils/storage';
33
import { useAppContext } from '../utils/app.context';
44
import { classNames } from '../utils/misc';
55
import daisyuiThemes from 'daisyui/src/theming/themes';
6-
import { THEMES } from '../Config';
6+
import { BASE_URL, ENCRYPT_KEY, THEMES } from '../Config';
77
import { useTranslation } from 'react-i18next';
88
import i18next from 'i18next';
99
import { ConversationListButton } from './ConversationList.tsx';
1010
import { IoLanguage, IoSettingsOutline } from 'react-icons/io5';
11-
import { BiPalette } from 'react-icons/bi';
11+
import { BiLock, BiPalette } from 'react-icons/bi';
1212

1313
export function HeaderThemeBlock({ id }: Readonly<{ id: string }>) {
1414
const { t } = useTranslation();
@@ -115,7 +115,22 @@ export default function Header() {
115115
return (
116116
<div className="flex flex-row items-center pt-6 pb-6 sticky top-0 z-10 bg-base-100">
117117
<ConversationListButton />
118-
<div className="grow text-2xl font-bold ml-2 text-center">llama.cpp</div>
118+
<div className="grow text-2xl font-bold ml-2 text-center">
119+
{ENCRYPT_KEY.length > 0 ? (
120+
<button
121+
className="tooltip tooltip-bottom z-100"
122+
aria-label={BASE_URL}
123+
data-tip={BASE_URL}
124+
>
125+
<div className="btn m-1">
126+
<BiLock className="w-6 h-6" />
127+
</div>
128+
</button>
129+
) : (
130+
<></>
131+
)}
132+
llama.cpp
133+
</div>
119134
{/* action buttons (top right) */}
120135
<div className="flex items-center">
121136
<button

0 commit comments

Comments
 (0)