diff --git a/packages/canyon-platform/package.json b/packages/canyon-platform/package.json
index 5b0eb430..336ba955 100644
--- a/packages/canyon-platform/package.json
+++ b/packages/canyon-platform/package.json
@@ -7,7 +7,6 @@
"dev-platform": "vite",
"do-build": "node --max_old_space_size=16384 ./node_modules/vite/bin/vite.js build",
"preview": "vite preview",
- "postinstall": "npm run codegen",
"codegen": "graphql-codegen --config codegen.ts"
},
"dependencies": {
@@ -22,7 +21,7 @@
"antd": "5.14.1",
"axios": "^1.7.2",
"canyon-ui": "0.0.10-alpha.20",
- "canyon-ui-old": "0.0.9",
+ "canyon-ui-old": "workspace:^",
"copy-to-clipboard": "^3.3.3",
"dayjs": "^1.11.11",
"echarts": "^5.5.1",
diff --git a/packages/canyon-platform/vite.config.ts b/packages/canyon-platform/vite.config.ts
index 89d4de5e..f6b32344 100644
--- a/packages/canyon-platform/vite.config.ts
+++ b/packages/canyon-platform/vite.config.ts
@@ -35,6 +35,12 @@ export default defineConfig({
build: {
sourcemap: true,
},
+ resolve: {
+ alias: {
+ 'canyon-ui-old': path.resolve('../canyon-ui-old/src'),
+ // '@': path.resolve(__dirname, './src'),
+ },
+ },
server: {
port: 8000,
host: '0.0.0.0',
diff --git a/packages/canyon-ui-old/.gitignore b/packages/canyon-ui-old/.gitignore
new file mode 100644
index 00000000..ea02b6de
--- /dev/null
+++ b/packages/canyon-ui-old/.gitignore
@@ -0,0 +1,28 @@
+# Logs
+logs
+*.log
+npm-debug.log*
+yarn-debug.log*
+yarn-error.log*
+pnpm-debug.log*
+lerna-debug.log*
+
+node_modules
+dist
+dist-ssr
+*.local
+
+# Editor directories and files
+.vscode/*
+!.vscode/extensions.json
+.idea
+.DS_Store
+*.suo
+*.ntvs*
+*.njsproj
+*.sln
+*.sw?
+
+pnpm-lock.yaml
+
+src/helpers/backend/gen
diff --git a/packages/canyon-ui-old/index.html b/packages/canyon-ui-old/index.html
new file mode 100644
index 00000000..df2a96a1
--- /dev/null
+++ b/packages/canyon-ui-old/index.html
@@ -0,0 +1,18 @@
+
+
+
+
+
+
+
+ Canyon
+
+
+
+
+
+
diff --git a/packages/canyon-ui-old/languages.json b/packages/canyon-ui-old/languages.json
new file mode 100644
index 00000000..20c6b5b3
--- /dev/null
+++ b/packages/canyon-ui-old/languages.json
@@ -0,0 +1,14 @@
+[
+ {
+ "code": "en",
+ "file": "en.json",
+ "iso": "en-US",
+ "name": "English"
+ },
+ {
+ "code": "cn",
+ "file": "cn.json",
+ "iso": "zh-CN",
+ "name": "简体中文"
+ }
+]
diff --git a/packages/canyon-ui-old/locales/cn.json b/packages/canyon-ui-old/locales/cn.json
new file mode 100644
index 00000000..d8c4e7d6
--- /dev/null
+++ b/packages/canyon-ui-old/locales/cn.json
@@ -0,0 +1,72 @@
+{
+ "welcome": {
+ "hello": "你好,",
+ "copywriter": "欢迎来到Canyon。",
+ "desc": "您将被重定向到源代码控制管理系统进行身份验证。",
+ "continue": "继续"
+ },
+ "menus": {
+ "projects": "项目",
+ "settings": "设置",
+ "docs": "文档"
+ },
+ "projects": {
+ "create": "创建项目",
+ "desc": "查看与您的账户相关的所有项目",
+ "name": "名称",
+ "report_times": "次数",
+ "report_time": "上报时间",
+ "max_coverage": "最大覆盖率",
+ "latest_report_time": "最近上报时间",
+ "latest_report_coverage": "最近上报覆盖率",
+ "no_data": "{{msg}}个项目没数据",
+ "total_times": "总次数",
+ "trends_in_coverage": "覆盖率趋势",
+ "records": "记录",
+ "overview": "概览",
+ "branch": "分支",
+ "compare_target": "对比目标",
+ "message": "提交信息",
+ "functions": "函数",
+ "branches": "分支",
+ "statements": "语句",
+ "lines": "行",
+ "newlines": "新增行",
+ "reported_details": "上报细节",
+ "reporter": "上报人",
+ "search_keywords": "按项目 ID 或名称搜索",
+ "overview_search_keywords": "输入 \"Commit Sha \"或 \"分支 \"或 \"比较目标 \"关键词进行搜索",
+ "coverage_details": "覆盖率详情",
+ "report_id": "上报 ID",
+ "coverage_id": "覆盖率 ID",
+ "view_detail": "查看详情",
+ "max_coverage_tooltip": "近30天的最大覆盖率",
+ "statements_tooltip": "语句覆盖率也是总体覆盖率",
+ "newlines_tooltip": "变更代码行覆盖率",
+ "statements_tour_title": "语句覆盖率",
+ "newlines_tour_title": "变更代码行覆盖率",
+ "statements_tour_description": "点击此列中的百分比数字以跳转至全量覆盖详情页面。",
+ "newlines_tour_description": "点击此列中的百分比数字以跳转至变更行覆盖详情页面。"
+ },
+ "settings": {
+ "desc": "设置您的账户信息",
+ "preference": "偏好",
+ "user_auth_tokens": "用户授权令牌",
+ "copied_to_clipboard": "已复制到剪贴板"
+ },
+ "common": {
+ "option": "操作",
+ "detail": "详情",
+ "configure": "配置",
+ "delete": "删除",
+ "language": "语言",
+ "theme": "主题",
+ "light": "光明",
+ "dark": "黑暗",
+ "created_at": "创建时间",
+ "total_items": "共计 {{total}} 项"
+ },
+ "app": {
+ "logout": "退出登录"
+ }
+}
diff --git a/packages/canyon-ui-old/locales/en.json b/packages/canyon-ui-old/locales/en.json
new file mode 100644
index 00000000..f8309c71
--- /dev/null
+++ b/packages/canyon-ui-old/locales/en.json
@@ -0,0 +1,72 @@
+{
+ "welcome": {
+ "hello": "Hello,",
+ "copywriter": "Welcome to Canyon.",
+ "desc": "You will be redirected to the source code control management system for authentication.",
+ "continue": "Continue"
+ },
+ "menus": {
+ "projects": "Projects",
+ "settings": "Settings",
+ "docs": "Docs"
+ },
+ "projects": {
+ "create": "Create a Project",
+ "desc": "View all projects related to your account",
+ "name": "Name",
+ "report_times": "Times",
+ "report_time": "Report Time",
+ "max_coverage": "Max Coverage",
+ "latest_report_time": "Last Reported",
+ "latest_report_coverage": "Latest Report Coverage",
+ "no_data": "{{msg}} projects have no data",
+ "total_times": "Total Times",
+ "trends_in_coverage": "Trends in coverage",
+ "records": "Records",
+ "overview": "Overview",
+ "branch": "Branch",
+ "compare_target": "Compare Target",
+ "message": "Commit Message",
+ "functions": "Functions",
+ "branches": "Branches",
+ "statements": "Statements",
+ "lines": "Lines",
+ "newlines": "New Lines",
+ "reported_details": "Logs",
+ "reporter": "Reporter",
+ "search_keywords": "Search by project id or name",
+ "overview_search_keywords": "Enter the \"Commit Sha\" or \"Branch\" or \"Compare Target\" keyword for search",
+ "coverage_details": "Coverage Details",
+ "report_id": "Report ID",
+ "coverage_id": "Coverage ID",
+ "view_detail": "View Detail",
+ "max_coverage_tooltip": "Maximum coverage for the last 30 days",
+ "statements_tooltip": "Statement coverage is also overall coverage",
+ "newlines_tooltip": "Change code line coverage",
+ "statements_tour_title": "Statement Coverage",
+ "newlines_tour_title": "New Line Coverage",
+ "statements_tour_description": "Click on the percentage number in this column to jump to the full coverage details page.",
+ "newlines_tour_description": "Click on the percentage number in this column to jump to the changed line coverage details page."
+ },
+ "settings": {
+ "desc": "Set up your account information",
+ "preference": "Preferences",
+ "user_auth_tokens": "User Authorization Tokens",
+ "copied_to_clipboard": "Copied to clipboard"
+ },
+ "common": {
+ "option": "Option",
+ "detail": "Detail",
+ "configure": "Configure",
+ "delete": "Delete",
+ "language": "Language",
+ "theme": "Theme",
+ "light": "Light",
+ "dark": "Dark",
+ "created_at": "Created At",
+ "total_items": "Total {{total}} Items"
+ },
+ "app": {
+ "logout": "Logout"
+ }
+}
diff --git a/packages/canyon-ui-old/package.json b/packages/canyon-ui-old/package.json
new file mode 100644
index 00000000..32b308da
--- /dev/null
+++ b/packages/canyon-ui-old/package.json
@@ -0,0 +1,41 @@
+{
+ "name": "canyon-ui-old",
+ "version": "0.0.14",
+ "type": "module",
+ "main": "dist/canyon-ui-old.cjs",
+ "module": "dist/canyon-ui-old.js",
+ "types": "./dist/index.d.ts",
+ "files": [
+ "dist/*"
+ ],
+ "scripts": {
+ "dev-ui": "vite",
+ "build": "vite build"
+ },
+ "dependencies": {
+ "@ant-design/icons": "^5.3.0",
+ "ahooks": "^3.7.10",
+ "antd": "^5.14.1",
+ "axios": "^1.6.7",
+ "i18next": "^23.8.2",
+ "i18next-browser-languagedetector": "^7.2.0",
+ "react": "^18.3.1",
+ "react-dom": "^18.3.1",
+ "react-i18next": "^14.0.5",
+ "swr": "^2.2.5"
+ },
+ "devDependencies": {
+ "@types/react": "^18.2.56",
+ "@types/react-dom": "^18.2.19",
+ "@vitejs/plugin-react": "^4.2.1",
+ "autoprefixer": "^10.4.17",
+ "postcss": "^8.4.35",
+ "react-router-dom": "^6.22.1",
+ "tailwindcss": "^3.4.1",
+ "typescript": "^5.3.3",
+ "vite": "^5.3.2",
+ "vite-plugin-dts": "^3.5.3",
+ "vite-plugin-pages": "^0.32.0",
+ "vite-plugin-svgr": "^4.2.0"
+ }
+}
diff --git a/packages/canyon-ui-old/postcss.config.js b/packages/canyon-ui-old/postcss.config.js
new file mode 100644
index 00000000..2e7af2b7
--- /dev/null
+++ b/packages/canyon-ui-old/postcss.config.js
@@ -0,0 +1,6 @@
+export default {
+ plugins: {
+ tailwindcss: {},
+ autoprefixer: {},
+ },
+}
diff --git a/packages/canyon-ui-old/public/light-logo.svg b/packages/canyon-ui-old/public/light-logo.svg
new file mode 100644
index 00000000..8fca65d1
--- /dev/null
+++ b/packages/canyon-ui-old/public/light-logo.svg
@@ -0,0 +1 @@
+
diff --git a/packages/canyon-ui-old/public/logo.svg b/packages/canyon-ui-old/public/logo.svg
new file mode 100644
index 00000000..3c78311c
--- /dev/null
+++ b/packages/canyon-ui-old/public/logo.svg
@@ -0,0 +1 @@
+
diff --git a/packages/canyon-ui-old/public/welcome-bg.svg b/packages/canyon-ui-old/public/welcome-bg.svg
new file mode 100644
index 00000000..cf73914e
--- /dev/null
+++ b/packages/canyon-ui-old/public/welcome-bg.svg
@@ -0,0 +1,25 @@
+
diff --git a/packages/canyon-ui-old/src/assets/icons/EpTopRight.tsx b/packages/canyon-ui-old/src/assets/icons/EpTopRight.tsx
new file mode 100644
index 00000000..231975b1
--- /dev/null
+++ b/packages/canyon-ui-old/src/assets/icons/EpTopRight.tsx
@@ -0,0 +1,6 @@
+// import React from 'react';
+import type { SVGProps } from 'react';
+
+export function EpTopRight(props: SVGProps) {
+ return ();
+}
diff --git a/packages/canyon-ui-old/src/assets/img/github.svg b/packages/canyon-ui-old/src/assets/img/github.svg
new file mode 100644
index 00000000..6eeeace6
--- /dev/null
+++ b/packages/canyon-ui-old/src/assets/img/github.svg
@@ -0,0 +1 @@
+
diff --git a/packages/canyon-ui-old/src/assets/img/gitlab.svg b/packages/canyon-ui-old/src/assets/img/gitlab.svg
new file mode 100644
index 00000000..f5556c4b
--- /dev/null
+++ b/packages/canyon-ui-old/src/assets/img/gitlab.svg
@@ -0,0 +1 @@
+
diff --git a/packages/canyon-ui-old/src/assets/img/google.svg b/packages/canyon-ui-old/src/assets/img/google.svg
new file mode 100644
index 00000000..6f895153
--- /dev/null
+++ b/packages/canyon-ui-old/src/assets/img/google.svg
@@ -0,0 +1 @@
+
diff --git a/packages/canyon-ui-old/src/assets/img/img.png b/packages/canyon-ui-old/src/assets/img/img.png
new file mode 100644
index 00000000..fc5292a6
Binary files /dev/null and b/packages/canyon-ui-old/src/assets/img/img.png differ
diff --git a/packages/canyon-ui-old/src/components/card/Primary.tsx b/packages/canyon-ui-old/src/components/card/Primary.tsx
new file mode 100644
index 00000000..37576f1f
--- /dev/null
+++ b/packages/canyon-ui-old/src/components/card/Primary.tsx
@@ -0,0 +1,26 @@
+// import { CanyonCardPrimary } from './index.ts';
+import { StockOutlined } from '@ant-design/icons';
+import { Button, Col, Divider, Row, Space, Statistic, theme, Typography } from 'antd';
+import { FC } from 'react';
+const { useToken } = theme;
+const { Title } = Typography;
+const CanyonCardPrimary: FC<{
+ theme?: any;
+ language?: any;
+ children: any;
+}> = ({ theme, language, children }) => {
+ const { token } = useToken();
+ return (
+
+ {children}
+
+ );
+};
+
+export default CanyonCardPrimary;
diff --git a/packages/canyon-ui-old/src/components/card/index.ts b/packages/canyon-ui-old/src/components/card/index.ts
new file mode 100644
index 00000000..b1274f7d
--- /dev/null
+++ b/packages/canyon-ui-old/src/components/card/index.ts
@@ -0,0 +1 @@
+export { default as CanyonCardPrimary } from './Primary';
diff --git a/packages/canyon-ui-old/src/components/index.ts b/packages/canyon-ui-old/src/components/index.ts
new file mode 100644
index 00000000..cb9d0c90
--- /dev/null
+++ b/packages/canyon-ui-old/src/components/index.ts
@@ -0,0 +1,4 @@
+export * from './card';
+export * from './layout';
+export * from './modal';
+export * from './page';
diff --git a/packages/canyon-ui-old/src/components/layout/Base.tsx b/packages/canyon-ui-old/src/components/layout/Base.tsx
new file mode 100644
index 00000000..26c33b16
--- /dev/null
+++ b/packages/canyon-ui-old/src/components/layout/Base.tsx
@@ -0,0 +1,205 @@
+// import { ArrowRightOutlined, MoreOutlined } from '@ant-design/icons';
+// import { Avatar, Breadcrumb, Dropdown, Menu, Tooltip } from 'antd';
+// import { Outlet } from 'react-router-dom';
+
+import {
+ ArrowRightOutlined,
+ FolderOutlined,
+ MoreOutlined,
+ SearchOutlined,
+ SettingOutlined,
+} from '@ant-design/icons';
+import {
+ Avatar,
+ Button,
+ Dropdown,
+ Menu,
+ MenuProps,
+ Select,
+ theme,
+ Tooltip,
+ Typography,
+} from 'antd';
+import { FC, ReactNode } from 'react';
+
+import { CanyonCardPrimary } from '../card';
+import Footer from './footer.tsx';
+import ScrollBasedLayout from './ScrollBasedLayout.tsx';
+const { useToken } = theme;
+const { Text, Title } = Typography;
+interface CanyonLayoutBaseProps {
+ title?: string;
+ logo?: ReactNode;
+ mainTitleRightNode?: ReactNode;
+ menuSelectedKey?: string;
+ onSelectMenu?: (selectInfo: { key: string }) => void;
+ menuItems: MenuProps['items'];
+ renderMainContent?: ReactNode;
+ onClickGlobalSearch?: () => void;
+ MeData: any;
+ itemsDropdown: any;
+ search: any;
+ account: any;
+ breadcrumb: any;
+ footerName?: string;
+}
+const CanyonLayoutBase: FC = ({
+ title = 'Canyon',
+ logo,
+ mainTitleRightNode,
+ menuSelectedKey = '',
+ onSelectMenu,
+ menuItems,
+ renderMainContent,
+ onClickGlobalSearch,
+ MeData,
+ itemsDropdown,
+ search,
+ account,
+ breadcrumb,
+ footerName = 'CANYON',
+}) => {
+ const { token } = useToken();
+
+ return (
+
+ <>
+
+
+
+
{
+ window.location.href = '/';
+ }}
+ >
+ {logo}
+
+ {title}
+
+
+
+
{mainTitleRightNode}
+
+
+ {search && (
+
+
+
+
+
+ )}
+
+ {account && (
+
+
+ Account
+
+
+
+
+
+ )}
+
+
+
+
+ }
+ mainContent={
+
+
{breadcrumb}
+
{renderMainContent}
+
+ }
+ footer={}
+ />
+ >
+
+ );
+};
+
+export default CanyonLayoutBase;
diff --git a/packages/canyon-ui-old/src/components/layout/ScrollBasedLayout.tsx b/packages/canyon-ui-old/src/components/layout/ScrollBasedLayout.tsx
new file mode 100644
index 00000000..f8d33252
--- /dev/null
+++ b/packages/canyon-ui-old/src/components/layout/ScrollBasedLayout.tsx
@@ -0,0 +1,69 @@
+import { theme } from 'antd';
+import { FC, ReactNode, useEffect, useState } from 'react';
+const { useToken } = theme;
+
+const ScrollBasedLayout: FC<{
+ sideBar: ReactNode;
+ mainContent: ReactNode;
+ footer: ReactNode;
+}> = ({ sideBar, mainContent, footer }) => {
+ const { token } = useToken();
+ const [isScrolled, setIsScrolled] = useState(false);
+
+ useEffect(() => {
+ const handleScroll = () => {
+ const scrollY = window.scrollY || document.documentElement.scrollTop;
+ const footer = document.getElementById('footer');
+
+ // 检查滚动是否超过100vh
+ setIsScrolled(scrollY + window.innerHeight > footer.offsetTop);
+ };
+
+ // 添加滚动事件监听器
+ window.addEventListener('scroll', handleScroll);
+
+ setTimeout(() => {
+ document.documentElement.scrollTop += 0.5;
+ }, 1000);
+
+ // 在组件卸载时移除监听器,以防止内存泄漏
+ return () => {
+ window.removeEventListener('scroll', handleScroll);
+ };
+ }, []); // 仅在组件挂载和卸载时运行
+
+ return (
+
+
+
+
+
+ {mainContent}
+
+
+
+
+ );
+};
+
+export default ScrollBasedLayout;
diff --git a/packages/canyon-ui-old/src/components/layout/app.json b/packages/canyon-ui-old/src/components/layout/app.json
new file mode 100644
index 00000000..ba5f244b
--- /dev/null
+++ b/packages/canyon-ui-old/src/components/layout/app.json
@@ -0,0 +1,56 @@
+{
+ "footer": [
+ {
+ "title": "Product",
+ "children": [
+ {
+ "label": "Canyon on GitHub",
+ "link": "https://github.com/canyon-project/canyon"
+ },
+ {
+ "label": "Star Us on GitHub",
+ "link": "https://github.com/canyon-project/canyon"
+ }
+ ]
+ },
+ {
+ "title": "Resources",
+ "children": [
+ {
+ "label": "Docs",
+ "link": "https://github.com/canyon-project/canyon"
+ },
+ {
+ "label": "Changelog",
+ "link": "https://github.com/canyon-project/canyon"
+ }
+ ]
+ },
+ {
+ "title": "Company",
+ "children": [
+ {
+ "label": "Home",
+ "link": "https://github.com/canyon-project/canyon"
+ },
+ {
+ "label": "Pricing",
+ "link": "https://github.com/canyon-project/canyon"
+ }
+ ]
+ },
+ {
+ "title": "Legal",
+ "children": [
+ {
+ "label": "Terms of service",
+ "link": "https://github.com/canyon-project/canyon"
+ },
+ {
+ "label": "Guidelines",
+ "link": "https://github.com/canyon-project/canyon"
+ }
+ ]
+ }
+ ]
+}
diff --git a/packages/canyon-ui-old/src/components/layout/footer.tsx b/packages/canyon-ui-old/src/components/layout/footer.tsx
new file mode 100644
index 00000000..f64c42e9
--- /dev/null
+++ b/packages/canyon-ui-old/src/components/layout/footer.tsx
@@ -0,0 +1,14 @@
+import { Typography } from 'antd';
+const { Text } = Typography;
+import app from './app.json';
+const AppFooter = ({name,corp}) => {
+ const lists = app.footer;
+ return (
+
+ );
+};
+
+export default AppFooter;
diff --git a/packages/canyon-ui-old/src/components/layout/index.ts b/packages/canyon-ui-old/src/components/layout/index.ts
new file mode 100644
index 00000000..96562f5c
--- /dev/null
+++ b/packages/canyon-ui-old/src/components/layout/index.ts
@@ -0,0 +1 @@
+export { default as CanyonLayoutBase } from './Base.tsx';
diff --git a/packages/canyon-ui-old/src/components/modal/GlobalSearch.tsx b/packages/canyon-ui-old/src/components/modal/GlobalSearch.tsx
new file mode 100644
index 00000000..dc1b6449
--- /dev/null
+++ b/packages/canyon-ui-old/src/components/modal/GlobalSearch.tsx
@@ -0,0 +1,37 @@
+// import { CanyonCardPrimary } from './index.ts';
+import { StockOutlined } from '@ant-design/icons';
+import { Button, Col, Divider, Modal, Row, Space, Statistic, theme, Typography,Input } from 'antd';
+import { forwardRef, useImperativeHandle, useState } from 'react';
+const { useToken } = theme;
+const { Title } = Typography;
+const { Search } = Input;
+const CanyonModalGlobalSearch = (props, ref) => {
+ // useRef
+ // const { token } = useToken();
+ const [open, setOpen] = useState(false);
+
+ useImperativeHandle(ref, () => ({
+ report: () => {
+ setOpen(true);
+ },
+ }));
+
+ return (
+ {
+ setOpen(false);
+ }}
+ onOk={() => {
+ setOpen(false);
+ }}
+ footer={false}
+ >
+
+
+ );
+};
+
+export default forwardRef(CanyonModalGlobalSearch);
diff --git a/packages/canyon-ui-old/src/components/modal/index.ts b/packages/canyon-ui-old/src/components/modal/index.ts
new file mode 100644
index 00000000..d182edeb
--- /dev/null
+++ b/packages/canyon-ui-old/src/components/modal/index.ts
@@ -0,0 +1 @@
+export { default as CanyonModalGlobalSearch } from './GlobalSearch.tsx';
diff --git a/packages/canyon-ui-old/src/components/page/BillingCollapse.tsx b/packages/canyon-ui-old/src/components/page/BillingCollapse.tsx
new file mode 100644
index 00000000..889b1c7d
--- /dev/null
+++ b/packages/canyon-ui-old/src/components/page/BillingCollapse.tsx
@@ -0,0 +1,107 @@
+import { RightOutlined } from '@ant-design/icons';
+import { Collapse, CollapseProps, Descriptions, DescriptionsProps, Typography } from 'antd';
+import { CSSProperties } from 'react';
+const { Title, Text } = Typography;
+const items: DescriptionsProps['items'] = [
+ {
+ key: '1',
+ label: 'UserName',
+ children: 'Zhou Maomao',
+ },
+ {
+ key: '2',
+ label: 'Telephone',
+ children: '1810000000',
+ },
+ {
+ key: '3',
+ label: 'Live',
+ children: 'Hangzhou, Zhejiang',
+ },
+ {
+ key: '4',
+ label: 'Remark',
+ children: 'empty',
+ },
+ {
+ key: '5',
+ label: 'Address',
+ children: 'No. 18, Wantang Road, Xihu District, Hangzhou, Zhejiang, China',
+ },
+];
+const CanyonBillingCollapse = ({ kuozhan, c }) => {
+ const panelStyle: React.CSSProperties = {
+ marginBottom: 24,
+ // backgroundColor: '#f8f9fa',
+ // background: token.colorFillAlter,
+ borderRadius: 'none',
+ border: 'none',
+ };
+ const text = `
+ A dog is a type of domesticated animal.
+ Known for its loyalty and faithfulness,
+ it can be found as a welcome guest in many households across the world.
+`;
+ const getItems: (panelStyle: CSSProperties) => CollapseProps['items'] = (panelStyle) => [
+ {
+ key: '1',
+ label: (
+
+
+
+ {c.title}
+
+ {c.desc}
+
+ {kuozhan}
+
+ ),
+ children: (
+
+
+ {c.details.map((d) => {
+ return (
+
+
+ {d.title}
+
+
+ {d.items.map((i) => {
+ return (
+
+
+ {i.key}
+
+
+ {i.value}
+
+
+ );
+ })}
+
+ {/*
{JSON.stringify(d.items)}
*/}
+
+ );
+ })}
+
+
+ ),
+ style: panelStyle,
+ },
+ ];
+
+ return (
+
+ }
+ // style={{ background: token.colorBgContainer }}
+ items={getItems(panelStyle)}
+ />
+
+ );
+};
+
+export default CanyonBillingCollapse;
diff --git a/packages/canyon-ui-old/src/components/page/BillingRadio.tsx b/packages/canyon-ui-old/src/components/page/BillingRadio.tsx
new file mode 100644
index 00000000..91d164d4
--- /dev/null
+++ b/packages/canyon-ui-old/src/components/page/BillingRadio.tsx
@@ -0,0 +1,42 @@
+import { CheckCircleFilled } from '@ant-design/icons';
+import { Button, ConfigProvider, theme } from 'antd';
+import { useState } from 'react';
+const { useToken } = theme;
+const CanyonBillingRadio = ({ isAciti, onSelect }) => {
+ const { token } = useToken();
+ // const [count, setCount] = useState(0);
+
+ return (
+
+
+
+ );
+};
+
+export default CanyonBillingRadio;
diff --git a/packages/canyon-ui-old/src/components/page/BillingUpdateCard.tsx b/packages/canyon-ui-old/src/components/page/BillingUpdateCard.tsx
new file mode 100644
index 00000000..0ab181bf
--- /dev/null
+++ b/packages/canyon-ui-old/src/components/page/BillingUpdateCard.tsx
@@ -0,0 +1,41 @@
+import {Button, Typography} from 'antd';
+// import {Text} from "echarts/types/src/util/graphic";
+const { Title, Text } = Typography;
+const CanyonBillingUpdateCard = () => {
+ return (
+
+
订阅用户可以获得更快速的支持
+
+ 订阅 Arex 计划,利用 Arex 生产和 Arex 企业的这些附加功能改进您的工作流程。
+
+
+
+
+
+
+
+ {[1, 2].map((i) => {
+ return (
+
+
Arex Production
+
适用于任何需要生产级服务的项目。
+
+ - Everything from the Free plan
+ - Priority builds
+ - 2 concurrent builds
+
+
+
+
+
+
+ );
+ })}
+
+
+ );
+};
+
+export default CanyonBillingUpdateCard;
diff --git a/packages/canyon-ui-old/src/components/page/Oauth.tsx b/packages/canyon-ui-old/src/components/page/Oauth.tsx
new file mode 100644
index 00000000..1a2752a4
--- /dev/null
+++ b/packages/canyon-ui-old/src/components/page/Oauth.tsx
@@ -0,0 +1,42 @@
+import { message, Spin } from 'antd';
+import { useEffect, useState } from 'react';
+// import { useNavigate, useSearchParams } from 'react-router-dom';
+// import useSWR from 'swr';
+const CanyonPageOauth = ({ URLSearchParams, onOauthFail }) => {
+ // const nav = useNavigate();
+ // const [URLSearchParams] = useSearchParams();
+ const fetcher = (url: string) =>
+ fetch(url, {
+ method: 'POST',
+ headers: {
+ 'Content-Type': 'application/json',
+ },
+ body: JSON.stringify({
+ code: URLSearchParams.get('code'),
+ redirectUri: location.origin + '/oauth',
+ }),
+ })
+ .then((res) => res.json())
+ .then((res) => {
+ if (res.statusCode >= 400) {
+ message.error(res.message);
+ localStorage.clear();
+ // nav('/welcome');
+ onOauthFail();
+ } else {
+ localStorage.setItem('token', res.token);
+ window.location.href = localStorage.getItem('callback') || '/';
+ }
+ });
+ // const { isLoading } = useSWR('/api/oauth/token', fetcher);
+
+ // const [isLoading,setIsLoading] = useState(true)
+
+ useEffect(() => {
+ fetcher('/api/oauth/token');
+ }, []);
+
+ return logging in...;
+};
+
+export default CanyonPageOauth;
diff --git a/packages/canyon-ui-old/src/components/page/index.ts b/packages/canyon-ui-old/src/components/page/index.ts
new file mode 100644
index 00000000..96c6b793
--- /dev/null
+++ b/packages/canyon-ui-old/src/components/page/index.ts
@@ -0,0 +1,5 @@
+export { default as CanyonBillingCollapse } from './BillingCollapse.tsx';
+export { default as CanyonBillingRadio } from './BillingRadio.tsx';
+export { default as CanyonBillingUpdateCard } from './BillingUpdateCard.tsx';
+export { default as CanyonPageLogin } from './login/index.tsx';
+export { default as CanyonPageOauth } from './Oauth.tsx';
diff --git a/packages/canyon-ui-old/src/components/page/login/LoginBtn.tsx b/packages/canyon-ui-old/src/components/page/login/LoginBtn.tsx
new file mode 100644
index 00000000..ec49fd42
--- /dev/null
+++ b/packages/canyon-ui-old/src/components/page/login/LoginBtn.tsx
@@ -0,0 +1,35 @@
+import { Button } from 'antd';
+import { FC } from 'react';
+
+import github from '../../../assets/img/github.svg';
+import gitlab from '../../../assets/img/gitlab.svg';
+import google from '../../../assets/img/google.svg';
+// import img from '../../../assets/img/img.png';
+
+const LoginBtn: FC<{
+ oauthUrl: { google?: string; github?: string; gitlab?: string };
+}> = ({ oauthUrl }) => {
+ return (
+
+
+
+
+
+
+ );
+};
+export default LoginBtn;
diff --git a/packages/canyon-ui-old/src/components/page/login/LoginForm.tsx b/packages/canyon-ui-old/src/components/page/login/LoginForm.tsx
new file mode 100644
index 00000000..ad81e573
--- /dev/null
+++ b/packages/canyon-ui-old/src/components/page/login/LoginForm.tsx
@@ -0,0 +1,94 @@
+import { useRequest } from 'ahooks';
+import { Button, Form, Input, message } from 'antd';
+import { FC } from 'react';
+const onFinishFailed = (errorInfo: any) => {
+ console.log('Failed:', errorInfo);
+};
+
+type FieldType = {
+ companyname?: string;
+ username?: string;
+ password?: string;
+};
+
+const LoginForm: FC<{
+ onLoginSuccess: () => void;
+}> = ({ onLoginSuccess }) => {
+ const { run } = useRequest(
+ ({ username, password, companyname }) =>
+ fetch(`/api/login`, {
+ method: 'POST',
+ headers: {
+ 'Content-Type': 'application/json',
+ },
+ body: JSON.stringify({
+ username: username,
+ password: password,
+ companyname: companyname,
+ }),
+ })
+ .then((res) => res.json())
+ .then((res) => {
+ if (res.statusCode >= 400) {
+ return Promise.reject(res);
+ } else {
+ return res;
+ }
+ }),
+ {
+ onSuccess: (data) => {
+ message.success('登录成功');
+ onLoginSuccess();
+ localStorage.setItem('token', data.token);
+ },
+ onError: (error) => {
+ console.log(error);
+ message.error(error.message);
+ },
+ manual: true,
+ },
+ );
+ const [form] = Form.useForm();
+ const onFinish = (values: any) => {
+ console.log('Success:', values);
+ run({
+ companyname: String(values.companyname),
+ username: String(values.username),
+ password: String(values.password),
+ });
+ };
+ return (
+
+ label='Username'
+ name='username'
+ rules={[{ required: true, message: 'Please input your username!' }]}
+ >
+
+
+
+
+ label='Password'
+ name='password'
+ rules={[{ required: true, message: 'Please input your password!' }]}
+ >
+
+
+
+
+
+
+
+ );
+};
+
+export default LoginForm;
diff --git a/packages/canyon-ui-old/src/components/page/login/index.tsx b/packages/canyon-ui-old/src/components/page/login/index.tsx
new file mode 100644
index 00000000..8c9647b8
--- /dev/null
+++ b/packages/canyon-ui-old/src/components/page/login/index.tsx
@@ -0,0 +1,77 @@
+import Icon from '@ant-design/icons';
+import { Divider, Tabs, Typography } from 'antd';
+import { FC } from 'react';
+
+import { EpTopRight } from '../../../assets/icons/EpTopRight.tsx';
+import img from '../../../assets/img/img.png';
+import { CanyonCardPrimary } from '../../card';
+import LoginBtn from './LoginBtn.tsx';
+import LoginForm from './LoginForm.tsx';
+
+const { Title } = Typography;
+
+const CanyonPageLogin: FC<{
+ onLoginSuccess: () => void;
+ oauthUrl: { gitlab: string };
+ logo: React.ReactNode;
+ register?: string;
+}> = ({ onLoginSuccess, oauthUrl, logo, register }) => {
+ return (
+
+
+
+
+
+
+ {logo}
+
+
+
+
+ )
+ }
+ items={[
+ {
+ label: 'Sign In',
+ key: 'login',
+ children: (
+
+ ),
+ },
+ ]}
+ />
+
+
+
+
+
+
+
+ );
+};
+
+export default CanyonPageLogin;
diff --git a/packages/canyon-ui-old/src/index.ts b/packages/canyon-ui-old/src/index.ts
new file mode 100644
index 00000000..07635cbb
--- /dev/null
+++ b/packages/canyon-ui-old/src/index.ts
@@ -0,0 +1 @@
+export * from './components';
diff --git a/packages/canyon-ui-old/src/vite-env.d.ts b/packages/canyon-ui-old/src/vite-env.d.ts
new file mode 100644
index 00000000..26064990
--- /dev/null
+++ b/packages/canyon-ui-old/src/vite-env.d.ts
@@ -0,0 +1,2 @@
+///
+// vite-env.d.ts
diff --git a/packages/canyon-ui-old/tailwind.config.js b/packages/canyon-ui-old/tailwind.config.js
new file mode 100644
index 00000000..65490f9b
--- /dev/null
+++ b/packages/canyon-ui-old/tailwind.config.js
@@ -0,0 +1,12 @@
+/** @type {import('tailwindcss').Config} */
+export default {
+ darkMode: 'class',
+ content: ['./index.html', './src/**/*.{js,ts,jsx,tsx}'],
+ theme: {
+ extend: {},
+ },
+ plugins: [],
+ corePlugins: {
+ preflight: false,
+ },
+};
diff --git a/packages/canyon-ui-old/tsconfig.node.json b/packages/canyon-ui-old/tsconfig.node.json
new file mode 100644
index 00000000..42872c59
--- /dev/null
+++ b/packages/canyon-ui-old/tsconfig.node.json
@@ -0,0 +1,10 @@
+{
+ "compilerOptions": {
+ "composite": true,
+ "skipLibCheck": true,
+ "module": "ESNext",
+ "moduleResolution": "bundler",
+ "allowSyntheticDefaultImports": true
+ },
+ "include": ["vite.config.ts"]
+}
diff --git a/packages/canyon-ui-old/vite.config.ts b/packages/canyon-ui-old/vite.config.ts
new file mode 100644
index 00000000..8995c42d
--- /dev/null
+++ b/packages/canyon-ui-old/vite.config.ts
@@ -0,0 +1,22 @@
+import { resolve } from 'path';
+import { defineConfig } from 'vite';
+import dts from 'vite-plugin-dts';
+import Pages from 'vite-plugin-pages';
+export default defineConfig({
+ plugins: [
+ Pages({
+ exclude: ['**/helper/**'],
+ }),
+ dts(),
+ ],
+ build: {
+ outDir: './dist',
+ emptyOutDir: true,
+ commonjsOptions: {},
+ lib: {
+ entry: resolve(__dirname, 'src/index.ts'),
+ fileName: 'canyon-ui-old',
+ name: 'CanyonUiOld',
+ }
+ },
+});