Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

release prod #503

Merged
merged 6 commits into from
Aug 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions apps/frontend/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ search labelu in [Test Pypi](https://test.pypi.org/), to find the right version

```bash
# change version '0.1.220' to the version you need.
pip install -i https://test.pypi.org/simple/ labelu==0.1.220
pip install -i https://test.pypi.org/simple/ labelu==1.0.6a5
labelu --help
labelu --port 8000
```
Expand All @@ -24,4 +24,4 @@ vim vite.config.js
npm run start

open http://localhost:3000/
```
```
12 changes: 6 additions & 6 deletions apps/frontend/package.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
{
"name": "@labelu/frontend",
"version": "5.2.1",
"version": "5.3.0-alpha.1",
"private": true,
"dependencies": {
"@ant-design/icons": "^4.6.2",
"@labelu/audio-annotator-react": "1.5.2",
"@labelu/components-react": "1.4.2",
"@labelu/audio-annotator-react": "1.5.3-alpha.1",
"@labelu/components-react": "1.4.3-alpha.1",
"@labelu/image": "1.1.0",
"@labelu/formatter": "1.0.2",
"@labelu/image-annotator-react": "2.1.1",
"@labelu/image-annotator-react": "2.1.2-alpha.1",
"@labelu/interface": "1.3.1",
"@labelu/video-annotator-react": "1.3.4",
"@labelu/video-react": "1.3.3",
"@labelu/video-annotator-react": "1.3.5-alpha.1",
"@labelu/video-react": "1.3.4-alpha.1",
"@tanstack/react-query": "^5.0.0",
"antd": "5.10.1",
"axios": "^1.3.4",
Expand Down
11 changes: 11 additions & 0 deletions apps/frontend/src/assets/svg/labelllm.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
36 changes: 36 additions & 0 deletions apps/frontend/src/assets/svg/mineru.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 12 additions & 0 deletions apps/frontend/src/assets/svg/opendatalab.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions apps/frontend/src/assets/svg/toolbox.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
111 changes: 111 additions & 0 deletions apps/frontend/src/components/AppPanel/index.module.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
.panel {
display: flex;
flex-wrap: wrap;
width: 40rem;
min-height: 10rem;
}

.title {
font-size: 20px;
font-weight: 600;
margin: 0.5rem 0 0.5rem 1rem;
}

.appWrapper {
flex-basis: 50%;
border-radius: 0.25rem;
transition: all 0.2s ease-in-out;
overflow: hidden;

&:hover {
background-color: rgba(244, 245, 249, 1);

.links {
opacity: 1;
}

.appContainer {
animation: wrapperSlideIn 0.2s ease-in-out forwards;
}
}

&:not(:hover) {
.links {
opacity: 0;
}

.appContainer {
animation: wrapperSlideOut 0.2s ease-in-out forwards;
}
}
}

.appContainer {
display: flex;
padding: 0 1rem 1rem;
flex-direction: column;
align-items: start;
justify-content: center;
}

.avatar {
flex-shrink: 0;
}

.header {
display: flex;
align-items: center;
gap: 0.5rem;
cursor: pointer;
}

.description {
color: var(--color-text-tertiary);
font-size: 0.75rem;
}

.links {
display: flex;
gap: 1rem;
padding: 0.5rem 0;
align-items: center;
opacity: 0;
transition: all 0.2s ease-in-out;
}

.link {
display: flex;
justify-items: center;
gap: 0.25rem;
color: var(--color-text);

&:hover {
color: var(--color-primary);

.arrow {
transform: translateX(0.25rem);
}
}
}

.arrow {
transition: transform 0.2s ease-in-out;
}

@keyframes wrapperSlideIn {
from {
transform: translateY(28px);
}
to {
transform: translateY(12px);
}
}

@keyframes wrapperSlideOut {
from {
transform: translateY(12px);
}
to {
transform: translateY(28px);
}
}
88 changes: 88 additions & 0 deletions apps/frontend/src/components/AppPanel/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
import { ArrowRightOutlined } from '@ant-design/icons';
import { Avatar } from 'antd';
import _ from 'lodash';

import { ReactComponent as LabelLLM } from '@/assets/svg/labelllm.svg';
import { ReactComponent as MinerU } from '@/assets/svg/mineru.svg';
import { ReactComponent as OpenDataLab } from '@/assets/svg/opendatalab.svg';

import styles from './index.module.css';

interface AppLink {
name: string;
title: string;
links: {
name: string;
link: string;
}[];
icon: JSX.Element;
description: string;
}

const apps = [
{
name: 'OpenDataLab',
links: [{ name: '立即前往', link: 'https://opendatalab.com' }],
icon: <OpenDataLab />,
description: '一个引领 AI 大模型时代的开放数据平台,提供了海量的、多模态的优质数据集,助力 AI 开发落地',
},
{
name: 'LabelLLM',
links: [
{
name: 'Github',
link: 'https://github.com/opendatalab/LabelLLM?tab=readme-ov-file#labelllm-the-open-source-data-annotation-platform',
},
],
icon: <LabelLLM />,
description: '专业致力于 LLM 对话标注,通过灵活的工具配置与多种数据模态的广泛兼容,为大模型打造高质量数据',
},
{
name: 'MinerU',
links: [
{ name: 'Github', link: 'https://github.com/opendatalab/MinerU' },
{ name: '在线体验', link: 'https://opendatalab.com/OpenSourceTools/Extractor/PDF' },
],
icon: <MinerU />,
description: '一站式开源高质量数据提取工具,支持多格式(PDF/网页/电子书),智能萃取,生成高质量语料',
},
];

export default function AppPanel() {
const handleGoApp = (app: AppLink) => {
window.open(app.links[0].link, '_blank');
};

return (
<div>
<div className={styles.title}>欢迎使用 OpenDataLab 开源工具 🎉</div>
<div className={styles.panel}>
{_.map(apps, (app) => {
return (
<div key={app.name} className={styles.appWrapper}>
<div className={styles.appContainer}>
<div className={styles.header} onClick={() => handleGoApp(app)}>
<Avatar shape="square" className={styles.avatar} src={app.icon} />
<div className={styles.appInfo}>
{app.name}
<div className={styles.description}>{app.description}</div>
</div>
</div>
<div className={styles.links}>
{_.map(app.links, (link) => {
return (
<a href={link.link} key={link.name} target="_blank" rel="noreferrer" className={styles.link}>
{link.name}
<ArrowRightOutlined className={styles.arrow} />
</a>
);
})}
</div>
</div>
</div>
);
})}
</div>
</div>
);
}
19 changes: 15 additions & 4 deletions apps/frontend/src/components/Navigate/index.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
import { Button, Divider, Dropdown, Tag } from 'antd';
import { Link, useMatch, useNavigate } from 'react-router-dom';
import Icon, { BellOutlined, PoweroffOutlined } from '@ant-design/icons';
import { FlexLayout } from '@labelu/components-react';
import { Button, Divider, Dropdown, Popover, Tag } from 'antd';
import { Link, useMatch, useNavigate } from 'react-router-dom';

import { ReactComponent as ProfileIcon } from '@/assets/svg/personal.svg';
import { ReactComponent as LocalDeploy } from '@/assets/svg/local-deploy.svg';
import { ReactComponent as ProfileIcon } from '@/assets/svg/personal.svg';
import { ReactComponent as ToolboxSvg } from '@/assets/svg/toolbox.svg';
import { goLogin } from '@/utils/sso';

import TaskTip from './TaskTip';
import AppPanel from '../AppPanel';
import Breadcrumb from '../Breadcrumb';
import { LabeluLogo, NavigationWrapper } from './style';
import TaskTip from './TaskTip';

const Homepage = () => {
const username = localStorage.getItem('username');
Expand Down Expand Up @@ -50,6 +52,15 @@ const Homepage = () => {
</FlexLayout.Item>
<FlexLayout.Item flex gap="1rem">
<TaskTip visible={Boolean(isSampleDetail)} />
<Popover title={null} content={<AppPanel />}>
<Button
type="link"
icon={<ToolboxSvg />}
style={{ color: 'rgba(0, 0, 0, 0.85)', display: 'flex', alignItems: 'center' }}
>
开源工具箱
</Button>
</Popover>
{window.IS_ONLINE && (
<a data-wiz="local-deploy-top-right" href="https://opendatalab.github.io/labelU/#/guide/install">
<Button type="link" style={{ color: 'rgba(0, 0, 0, 0.85)' }} icon={<Icon component={LocalDeploy} />}>
Expand Down
2 changes: 1 addition & 1 deletion apps/frontend/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export default defineConfig({
host: '0.0.0.0',
proxy: {
'/api': {
target: isOnline ? 'https://labelu.shlab.tech' : 'http://127.0.0.1:8000',
target: 'https://labelu.shlab.tech',
changeOrigin: true,
},
},
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"packages/*",
"apps/*"
],
"version": "5.2.1",
"version": "5.3.0-alpha.1",
"scripts": {
"prepare": "husky install",
"build": "pnpm --filter @labelu/utils --filter @labelu/interface --filter @labelu/formatter --filter @labelu/image --filter @labelu/components-react --filter @labelu/image-annotator-react --filter @labelu/audio-react --filter @labelu/video-react --filter @labelu/audio-annotator-react --filter @labelu/video-annotator-react build",
Expand Down Expand Up @@ -44,7 +44,7 @@
"devDependencies": {
"@commitlint/cli": "8.3.5",
"@commitlint/config-conventional": "8.3.4",
"@manypkg/get-packages": "^2.1.0",
"@manypkg/get-packages": "^2.2.2",
"@octokit/rest": "^19.0.7",
"@semantic-release/commit-analyzer": "^9.0.2",
"@semantic-release/git": "^10.0.1",
Expand Down
6 changes: 3 additions & 3 deletions packages/audio-annotator-react/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@labelu/audio-annotator-react",
"version": "1.5.2",
"version": "1.5.3-alpha.1",
"description": "audio annotator for react",
"main": "./dist/index.mjs",
"module": "./dist/index.mjs",
Expand Down Expand Up @@ -29,9 +29,9 @@
],
"dependencies": {
"lodash.clonedeep": "^4.5.0",
"@labelu/components-react": "1.4.2",
"@labelu/components-react": "1.4.3-alpha.1",
"@labelu/interface": "1.3.1",
"@labelu/audio-react": "1.3.3",
"@labelu/audio-react": "1.3.4-alpha.1",
"polished": "^4.2.2",
"react-hotkeys-hook": "^4.4.1",
"styled-components": "^5.3.6"
Expand Down
Loading
Loading