Skip to content

Commit 5f59aa1

Browse files
committed
fix: ai page
1 parent 0b3bb8f commit 5f59aa1

File tree

4 files changed

+19
-10
lines changed

4 files changed

+19
-10
lines changed

services/webui/.env

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
NODE_ENV=development
22
REACT_APP_RUNTIME_ENVIRONMENT=production
3-
REACT_APP_BASE_URL=http://localhost:8080
4-
REACT_APP_AUTH_BASE_URL=http://localhost:8080
3+
REACT_APP_BASE_URL=https://fly.opensecurity.sh
4+
REACT_APP_AUTH_BASE_URL=https://fly.opensecurity.sh
55
REACT_APP_SHOW_COMPLIANCE=true

services/webui/public/env-config.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

services/webui/src/components/Layout/Sidebar/Utilities/Profile/index.tsx

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,11 @@ export default function Profile({ isCollapsed }: IProfile) {
123123
setLoadingChange(false)
124124
})
125125
}
126+
const truncate = (text: string | undefined, number: number) => {
127+
if (text) {
128+
return text.length > number ? text.substring(0, number) + '...' : text
129+
}
130+
}
126131
useEffect(() => {
127132
if (isPageLoading) {
128133
setIsPageLoading(false)
@@ -256,13 +261,13 @@ export default function Profile({ isCollapsed }: IProfile) {
256261

257262
<Popover className="relative asb z-50 border-0 w-full">
258263
<Popover.Button
259-
className={`p-3 w-full cursor-pointer ${
264+
className={`p-3 w-full cursor-pointer ${
260265
isCollapsed ? '!p-1' : 'border-t border-t-gray-700'
261266
}`}
262267
id="profile"
263268
>
264-
<Flex>
265-
<Flex className="w-fit gap-3">
269+
<Flex className="w-full">
270+
<Flex className="w-full gap-3 ">
266271
{user?.picture && (
267272
<img
268273
className={`${
@@ -275,12 +280,16 @@ export default function Profile({ isCollapsed }: IProfile) {
275280
/>
276281
)}
277282
{!isCollapsed && (
278-
<Flex flexDirection="col" alignItems="start">
283+
<Flex
284+
flexDirection="col"
285+
alignItems="start"
286+
className=""
287+
>
279288
<Text className="text-gray-200">
280-
{user?.name}
289+
{truncate(user?.name,15)}
281290
</Text>
282291
<Text className="text-gray-400">
283-
{user?.email}
292+
{truncate(user?.email,15)}
284293
</Text>
285294
</Flex>
286295
)}

services/webui/src/pages/AI/chat/AIChat.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ function AIChat({ setOpen, }: any) {
1111
const [message, setMessage] = useState('')
1212
const agent = JSON.parse(localStorage.getItem('agent') as string)
1313
const [chats, setChats] = useState<ChatList>(
14-
agent.id == 'identity_access' ? IDENTITY : DEVOPS
14+
agent?.id == 'devop' ? DEVOPS : IDENTITY
1515
)
1616

1717
const lastMessageRef = useRef(null)

0 commit comments

Comments
 (0)