diff --git a/web/app/(commonLayout)/plugins/test/card/page.tsx b/web/app/(commonLayout)/plugins/test/card/page.tsx
index a916606dfc..2a2add60c6 100644
--- a/web/app/(commonLayout)/plugins/test/card/page.tsx
+++ b/web/app/(commonLayout)/plugins/test/card/page.tsx
@@ -20,6 +20,7 @@ const PluginList = async () => {
Installed
diff --git a/web/app/components/base/badge.tsx b/web/app/components/base/badge.tsx
index c3300a1e67..c520fe02c9 100644
--- a/web/app/components/base/badge.tsx
+++ b/web/app/components/base/badge.tsx
@@ -5,22 +5,28 @@ type BadgeProps = {
className?: string
text: string
uppercase?: boolean
+ hasRedCornerMark?: boolean
}
const Badge = ({
className,
text,
uppercase = true,
+ hasRedCornerMark,
}: BadgeProps) => {
return (
{text}
+ {hasRedCornerMark && (
+
+
+ )}
)
}
diff --git a/web/app/components/plugins/card/base/org-info.tsx b/web/app/components/plugins/card/base/org-info.tsx
index 972b871375..65cfb1cb68 100644
--- a/web/app/components/plugins/card/base/org-info.tsx
+++ b/web/app/components/plugins/card/base/org-info.tsx
@@ -1,18 +1,21 @@
import cn from '@/utils/classnames'
+type Props = {
+ className?: string
+ orgName: string
+ packageName: string
+ packageNameClassName?: string
+}
const OrgInfo = ({
className,
orgName,
packageName,
-}: {
- className?: string
- orgName: string
- packageName: string
-}) => {
+ packageNameClassName,
+}: Props) => {
return
- {orgName}
+ {orgName}
/
- {packageName}
+ {packageName}
}
diff --git a/web/app/components/plugins/card/card-mock.ts b/web/app/components/plugins/card/card-mock.ts
index a3e75a3573..6718c50740 100644
--- a/web/app/components/plugins/card/card-mock.ts
+++ b/web/app/components/plugins/card/card-mock.ts
@@ -4,7 +4,8 @@ export const toolNotion = {
type: PluginType.tool,
org: 'Notion',
name: 'notion page search',
- latest_version: '1.0.0',
+ version: '1.2.0',
+ latest_version: '1.3.0',
icon: 'https://via.placeholder.com/150',
label: {
'en-US': 'Notion Page Search',
@@ -20,7 +21,8 @@ export const extensionDallE = {
type: PluginType.extension,
org: 'OpenAI',
name: 'DALL-E',
- latest_version: '1.0.0',
+ version: '1.1.0',
+ latest_version: '1.2.0',
icon: 'https://via.placeholder.com/150',
label: {
'en-US': 'DALL-E',
@@ -36,6 +38,7 @@ export const modelGPT4 = {
type: PluginType.model,
org: 'OpenAI',
name: 'GPT-4',
+ version: '1.0.0',
latest_version: '1.0.0',
icon: 'https://via.placeholder.com/150',
label: {
diff --git a/web/app/components/plugins/card/index.tsx b/web/app/components/plugins/card/index.tsx
index 1cec64491e..64fe273ef3 100644
--- a/web/app/components/plugins/card/index.tsx
+++ b/web/app/components/plugins/card/index.tsx
@@ -1,6 +1,7 @@
import React from 'react'
import { RiVerifiedBadgeLine } from '@remixicon/react'
import type { Plugin } from '../types'
+import Badge from '../../base/badge'
import CornerMark from './base/corner-mark'
import Icon from './base/icon'
import Title from './base/title'
@@ -12,6 +13,7 @@ import { getLocaleOnServer } from '@/i18n/server'
type Props = {
className?: string
payload: Plugin
+ showVersion?: boolean
installed?: boolean
descriptionLineRows?: number
footer?: React.ReactNode
@@ -20,13 +22,14 @@ type Props = {
const Card = ({
className,
payload,
+ showVersion,
installed,
descriptionLineRows = 2,
footer,
}: Props) => {
const locale = getLocaleOnServer()
-
const { type, name, org, label } = payload
+
return (
@@ -37,6 +40,9 @@ const Card = ({
+ {
+ showVersion &&
+ }
= ({
}) => {
const locale = getLocaleOnServer()
const { type, name, org, label } = payload
+ const hasNewVersion = payload.latest_version !== payload.version
return (
@@ -31,24 +33,29 @@ const PluginItem: FC
= ({
{/* Header */}
-
+
ยท
-
2 sets of endpoints enabled
+
+
+ 2 sets of endpoints enabled
+
diff --git a/web/app/components/plugins/types.ts b/web/app/components/plugins/types.ts
index f9b1add725..3b8fdd12f2 100644
--- a/web/app/components/plugins/types.ts
+++ b/web/app/components/plugins/types.ts
@@ -11,6 +11,7 @@ export type Plugin = {
'type': PluginType
'org': string
'name': string
+ 'version': string
'latest_version': string
'icon': string
'label': Record