diff --git a/web/app/(commonLayout)/app/(appDetailLayout)/[appId]/annotations/page.tsx b/web/app/(commonLayout)/app/(appDetailLayout)/[appId]/annotations/page.tsx new file mode 100644 index 0000000000..998184c0ee --- /dev/null +++ b/web/app/(commonLayout)/app/(appDetailLayout)/[appId]/annotations/page.tsx @@ -0,0 +1,17 @@ +import React from 'react' +import Main from '@/app/components/app/log-annotation' +import { PageType } from '@/app/components/app/configuration/toolbox/annotation/type' + +export type IProps = { + params: { appId: string } +} + +const Logs = async ({ + params: { appId }, +}: IProps) => { + return ( +
+ ) +} + +export default Logs diff --git a/web/app/(commonLayout)/app/(appDetailLayout)/[appId]/logs/page.tsx b/web/app/(commonLayout)/app/(appDetailLayout)/[appId]/logs/page.tsx index 6c17986ce6..d23e690dc5 100644 --- a/web/app/(commonLayout)/app/(appDetailLayout)/[appId]/logs/page.tsx +++ b/web/app/(commonLayout)/app/(appDetailLayout)/[appId]/logs/page.tsx @@ -1,5 +1,6 @@ import React from 'react' -import Main from '@/app/components/app/log' +import Main from '@/app/components/app/log-annotation' +import { PageType } from '@/app/components/app/configuration/toolbox/annotation/type' export type IProps = { params: { appId: string } @@ -9,7 +10,7 @@ const Logs = async ({ params: { appId }, }: IProps) => { return ( -
+
) } diff --git a/web/app/components/app-sidebar/navLink.tsx b/web/app/components/app-sidebar/navLink.tsx index c7d79fb503..4cfec7e848 100644 --- a/web/app/components/app-sidebar/navLink.tsx +++ b/web/app/components/app-sidebar/navLink.tsx @@ -28,7 +28,15 @@ export default function NavLink({ mode = 'expand', }: NavLinkProps) { const segment = useSelectedLayoutSegment() - const isActive = href.toLowerCase().split('/')?.pop() === segment?.toLowerCase() + const formattedSegment = (() => { + let res = segment?.toLowerCase() + // logs and annotations use the same nav + if (res === 'annotations') + res = 'logs' + + return res + })() + const isActive = href.toLowerCase().split('/')?.pop() === formattedSegment const NavIcon = isActive ? iconMap.selected : iconMap.normal return ( diff --git a/web/app/components/app/annotation/add-annotation-modal/edit-item/index.tsx b/web/app/components/app/annotation/add-annotation-modal/edit-item/index.tsx new file mode 100644 index 0000000000..4da6b7cac4 --- /dev/null +++ b/web/app/components/app/annotation/add-annotation-modal/edit-item/index.tsx @@ -0,0 +1,47 @@ +'use client' +import type { FC } from 'react' +import React from 'react' +import { useTranslation } from 'react-i18next' +import Textarea from 'rc-textarea' +import { Robot, User } from '@/app/components/base/icons/src/public/avatar' + +export enum EditItemType { + Query = 'query', + Answer = 'answer', +} +type Props = { + type: EditItemType + content: string + onChange: (content: string) => void +} + +const EditItem: FC = ({ + type, + content, + onChange, +}) => { + const { t } = useTranslation() + const avatar = type === EditItemType.Query ? : + const name = type === EditItemType.Query ? t('appAnnotation.addModal.queryName') : t('appAnnotation.addModal.answerName') + const placeholder = type === EditItemType.Query ? t('appAnnotation.addModal.queryPlaceholder') : t('appAnnotation.addModal.answerPlaceholder') + + return ( +
e.stopPropagation()}> +
+ {avatar} +
+
+
{name}
+