Skip to content

Commit

Permalink
Feat: Set style of Similarity badge infiniflow#3221
Browse files Browse the repository at this point in the history
  • Loading branch information
cike8899 committed Feb 8, 2025
1 parent 003c6a4 commit 1520580
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 19 deletions.
38 changes: 19 additions & 19 deletions web/src/pages/dataset/testing/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,20 @@ const list = new Array(15).fill({
content: `Lorem ipsum odor amet, consectetuer adipiscing elit. Ullamcorper vulputate id laoreet malesuada commodo molestie. Lectus convallis class euismod; consequat in curabitur. Ablandit praesent inceptos nibh placerat lectus fringilla finibus. Hac vivamus id scelerisque et gravida nec ligula et non. Consectetur eu himenaeos eget felis quis habitant tellus. Tellus commodo inceptos litora habitant per himenaeos faucibus pretium. Gravida velit pretium amet purus rhoncus taciti. `,
});

const SimilarityList = [
{ label: '混合相似度', value: 45.88 },
{ label: '关键词似度', value: 45.88 },
{ label: '向量相似度', value: 45.88 },
];

export default function RetrievalTesting() {
return (
<section className="flex divide-x h-full">
<div className="p-4">
<TestingForm></TestingForm>
</div>
<div className="p-4 flex-1 ">
<h2 className="text-3xl font-bold mb-8 px-[10%]">
<h2 className="text-4xl font-bold mb-8 px-[10%]">
15 Results from 3 files
</h2>
<section className="flex flex-col gap-4 overflow-auto h-[83vh] px-[10%]">
Expand All @@ -25,24 +31,18 @@ export default function RetrievalTesting() {
<CardHeader>
<CardTitle>
<div className="flex gap-2 flex-wrap">
<Badge
variant="outline"
className="bg-colors-background-inverse-strong p-2 rounded-xl text-base"
>
混合相似度 45.88
</Badge>
<Badge
variant="outline"
className="bg-colors-background-inverse-strong p-2 rounded-xl text-base"
>
关键词似度 45.88
</Badge>
<Badge
variant="outline"
className="bg-colors-background-inverse-strong p-2 rounded-xl text-base"
>
向量相似度 45.88
</Badge>
{SimilarityList.map((x, idx) => (
<Badge
key={idx}
variant="outline"
className="bg-colors-background-inverse-strong p-1.5 rounded-xl text-colors-text-inverse-weak text-base"
>
{x.label}
<span className="text-colors-text-inverse-strong ml-1 text-lg leading-none">
{x.value}
</span>
</Badge>
))}
</div>
</CardTitle>
</CardHeader>
Expand Down
1 change: 1 addition & 0 deletions web/tailwind.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ module.exports = {
'colors-text-functional-danger': 'var(--colors-text-functional-danger)',
'colors-text-inverse-strong': 'var(--colors-text-inverse-strong)',
'colors-text-persist-light': 'var(--colors-text-persist-light)',
'colors-text-inverse-weak': 'var(--colors-text-inverse-weak)',

primary: {
DEFAULT: 'hsl(var(--primary))',
Expand Down
2 changes: 2 additions & 0 deletions web/tailwind.css
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
--colors-text-functional-danger: rgba(255, 81, 81, 1);
--colors-text-inverse-strong: rgba(255, 255, 255, 1);
--colors-text-persist-light: rgba(255, 255, 255, 1);
--colors-text-inverse-weak: rgba(184, 181, 203, 1);
}

.dark {
Expand Down Expand Up @@ -138,6 +139,7 @@
--colors-text-functional-danger: rgba(255, 81, 81, 1);
--colors-text-inverse-strong: rgba(17, 16, 23, 1);
--colors-text-persist-light: rgba(255, 255, 255, 1);
--colors-text-inverse-weak: rgba(84, 80, 106, 1);
}
}

Expand Down

0 comments on commit 1520580

Please sign in to comment.