diff --git a/moon/apps/web/pages/[org]/rust/index.tsx b/moon/apps/web/pages/[org]/rust/index.tsx index cd2f546a9..149640b99 100644 --- a/moon/apps/web/pages/[org]/rust/index.tsx +++ b/moon/apps/web/pages/[org]/rust/index.tsx @@ -51,10 +51,15 @@ const CratesproPage: PageWithLayout = () => { const handleCardClick = (key: string) => { if (key === 'news') { - // 在新标签页打开 rust-news 页面 + // 在当前标签页跳转 rust-news 页面,保留侧边栏 const org = router.query.org ? `/${router.query.org}` : '' - window.open(`${org}/rust/rust-news`, '_blank') + router.push(`${org}/rust/rust-news`) + } else if (key === 'ecosystem') { + // 跳转到 rust-ecosystem 页面 + const org = router.query.org ? `/${router.query.org}` : '' + + router.push(`${org}/rust/rust-ecosystem`) } else { // 其它卡片逻辑 router.push(`/cratespro/${key}`) diff --git a/moon/apps/web/pages/[org]/rust/rust-ecosystem/index.tsx b/moon/apps/web/pages/[org]/rust/rust-ecosystem/index.tsx new file mode 100644 index 000000000..6b853d2b9 --- /dev/null +++ b/moon/apps/web/pages/[org]/rust/rust-ecosystem/index.tsx @@ -0,0 +1,391 @@ +import Head from 'next/head' +import Image from 'next/image' +import { AppLayout } from '@/components/Layout/AppLayout' +import AuthAppProviders from '@/components/Providers/AuthAppProviders' +import { useState } from 'react' +import { MagnifyingGlassIcon } from '@heroicons/react/24/outline' + +export default function RustEcosystemPage() { + const [search, setSearch] = useState('') + + const [expandedIdx, setExpandedIdx] = useState(null) + + + const cveList = [ + { + id: 107, + title: 'CVE-2023-12345:示例漏洞描述', + tag: { text: '由国际安全组织报告', color: 'blue' }, + detail: '该漏洞由国际安全组织披露,建议关注官方通告。', + }, + + + { + id: 100, + title: 'CVE-2023-12345:示例漏洞描述', + tag: { text: '修复补丁已发布', color: 'green' }, + detail: '该漏洞的修复补丁已发布,建议尽快升级。', + }, + { + id: 101, + title: 'CVE-2023-12345:示例漏洞描述', + tag: { text: '远程更新可用', color: 'green' }, + detail: '这是CVE-2023-12345的详细内容。此漏洞可能导致用户数据被曝光,并影响应用程序的性能', + }, + { + id: 102, + title: 'CVE-2023-12345:示例漏洞描述', + tag: null, + detail: '暂无更多详情。', + }, + + { + id: 104, + title: 'CVE-2023-12345:示例漏洞描述', + tag: { text: '修复补丁已发布', color: 'green' }, + detail: '该漏洞的修复补丁已发布,建议尽快升级。', + }, + { + id: 105, + title: 'CVE-2023-12345:示例漏洞描述', + tag: null, + detail: '暂无更多详情。', + }, + + { + id: 107, + title: 'CVE-2023-12345:示例漏洞描述', + tag: { text: '由国际安全组织报告', color: 'blue' }, + detail: '该漏洞由国际安全组织披露,建议关注官方通告。', + }, + { + id: 107, + title: 'CVE-2023-12345:示例漏洞描述', + tag: { text: '由国际安全组织报告', color: 'blue' }, + detail: '该漏洞由国际安全组织披露,建议关注官方通告。', + }, + ] + + return ( + <> + + Crate Ecosystem + +
+ {/* 顶部搜索区,带背景图 */} +
+
+ +
+
+
+ +
+ setSearch(e.target.value)} + /> + +
+
+
+
+ + {/* 四个组件卡片区 */} +
+ {/* crate 卡片 */} +
+ crate + + Crate + +
+ {/* cve 卡片 */} +
+ cve + + CVE + +
+ {/* rust 卡片 */} +
+ cve + + Rust + +
+ {/* code 卡片 */} +
+ cve + + Code + +
+
+ + {/* CVE 信息区 */} +
+
+ {/* 标题区 */} +
+
+ CVE Information +
+
+ CVE信息 +
+
+ {/* 信息列表卡片 */} +
+
+ {/* 静态CVE列表 */} +
+ {cveList.map((item, idx) => ( +
+
+
+ {item.title} + {item.tag && ( + + {item.tag.text} + + )} +
+ +
+ {expandedIdx === idx && ( +
{/* 这里也同步缩小padding */} +
+ {item.detail} +
+
+ +
+
+ )} + {/* 分割线,放到 .px-8 外面 */} +
+
+ ))} +
+ {/* More 按钮 */} +
+ +
+
+
+
+
+
+ + ) +} + +RustEcosystemPage.getProviders = (page: any, pageProps: any) => { + return ( + + {page} + + ) +} diff --git a/moon/apps/web/pages/[org]/rust/rust-news/index.tsx b/moon/apps/web/pages/[org]/rust/rust-news/index.tsx index 11aee8660..d0044b045 100644 --- a/moon/apps/web/pages/[org]/rust/rust-news/index.tsx +++ b/moon/apps/web/pages/[org]/rust/rust-news/index.tsx @@ -2,6 +2,9 @@ import Head from 'next/head' import { useState } from 'react' import { IndexSearchInput } from '@/components/IndexPages/components' import Image from 'next/image' +import { AppLayout } from '@/components/Layout/AppLayout' +import AuthAppProviders from '@/components/Providers/AuthAppProviders' + const newsList = [ { @@ -262,7 +265,7 @@ export default function RustNewsPage() { }} style={{ position: 'fixed', - right: 350, + right: 130, bottom: 40, zIndex: 50, background: 'none', @@ -277,4 +280,12 @@ export default function RustNewsPage() {
) +} + +RustNewsPage.getProviders = (page: any, pageProps: any) => { + return ( + + {page} + + ) } \ No newline at end of file diff --git a/moon/apps/web/pages/_document.tsx b/moon/apps/web/pages/_document.tsx index 7bd1807eb..d612e9563 100644 --- a/moon/apps/web/pages/_document.tsx +++ b/moon/apps/web/pages/_document.tsx @@ -13,7 +13,7 @@ class MyDocument extends Document { render() { return ( - + @@ -23,10 +23,7 @@ class MyDocument extends Document { diff --git a/moon/apps/web/public/rust/rust-ecosystem/Frame 166.png b/moon/apps/web/public/rust/rust-ecosystem/Frame 166.png new file mode 100644 index 000000000..5eb5b0c14 Binary files /dev/null and b/moon/apps/web/public/rust/rust-ecosystem/Frame 166.png differ diff --git a/moon/apps/web/public/rust/rust-ecosystem/Objects - magnifying-glass.png b/moon/apps/web/public/rust/rust-ecosystem/Objects - magnifying-glass.png new file mode 100644 index 000000000..c6cef3669 Binary files /dev/null and b/moon/apps/web/public/rust/rust-ecosystem/Objects - magnifying-glass.png differ diff --git a/moon/apps/web/public/rust/rust-ecosystem/code.png b/moon/apps/web/public/rust/rust-ecosystem/code.png new file mode 100644 index 000000000..a1f212968 Binary files /dev/null and b/moon/apps/web/public/rust/rust-ecosystem/code.png differ diff --git a/moon/apps/web/public/rust/rust-ecosystem/crate.png b/moon/apps/web/public/rust/rust-ecosystem/crate.png new file mode 100644 index 000000000..6fb0289cb Binary files /dev/null and b/moon/apps/web/public/rust/rust-ecosystem/crate.png differ diff --git a/moon/apps/web/public/rust/rust-ecosystem/cve.png b/moon/apps/web/public/rust/rust-ecosystem/cve.png new file mode 100644 index 000000000..671d7c3b0 Binary files /dev/null and b/moon/apps/web/public/rust/rust-ecosystem/cve.png differ diff --git a/moon/apps/web/public/rust/rust-ecosystem/down.png b/moon/apps/web/public/rust/rust-ecosystem/down.png new file mode 100644 index 000000000..25e615203 Binary files /dev/null and b/moon/apps/web/public/rust/rust-ecosystem/down.png differ diff --git a/moon/apps/web/public/rust/rust-ecosystem/homepage.png b/moon/apps/web/public/rust/rust-ecosystem/homepage.png new file mode 100644 index 000000000..7f993d683 Binary files /dev/null and b/moon/apps/web/public/rust/rust-ecosystem/homepage.png differ diff --git a/moon/apps/web/public/rust/rust-ecosystem/rust.png b/moon/apps/web/public/rust/rust-ecosystem/rust.png new file mode 100644 index 000000000..4161aa9b3 Binary files /dev/null and b/moon/apps/web/public/rust/rust-ecosystem/rust.png differ diff --git a/moon/apps/web/public/rust/rust-ecosystem/search-bg.png b/moon/apps/web/public/rust/rust-ecosystem/search-bg.png new file mode 100644 index 000000000..d2ec8f44e Binary files /dev/null and b/moon/apps/web/public/rust/rust-ecosystem/search-bg.png differ diff --git "a/moon/apps/web/public/rust/rust-ecosystem/\344\270\212\347\256\255\345\244\264-\345\270\270\346\200\201.png" "b/moon/apps/web/public/rust/rust-ecosystem/\344\270\212\347\256\255\345\244\264-\345\270\270\346\200\201.png" new file mode 100644 index 000000000..35873dd43 Binary files /dev/null and "b/moon/apps/web/public/rust/rust-ecosystem/\344\270\212\347\256\255\345\244\264-\345\270\270\346\200\201.png" differ diff --git "a/moon/apps/web/public/rust/rust-ecosystem/\344\270\213\347\256\255\345\244\264-hover(1).png" "b/moon/apps/web/public/rust/rust-ecosystem/\344\270\213\347\256\255\345\244\264-hover(1).png" new file mode 100644 index 000000000..3fb86d339 Binary files /dev/null and "b/moon/apps/web/public/rust/rust-ecosystem/\344\270\213\347\256\255\345\244\264-hover(1).png" differ diff --git "a/moon/apps/web/public/rust/rust-ecosystem/\344\270\213\347\256\255\345\244\264-hover.png" "b/moon/apps/web/public/rust/rust-ecosystem/\344\270\213\347\256\255\345\244\264-hover.png" new file mode 100644 index 000000000..1021484a5 Binary files /dev/null and "b/moon/apps/web/public/rust/rust-ecosystem/\344\270\213\347\256\255\345\244\264-hover.png" differ diff --git a/moon/apps/web/styles/global.css b/moon/apps/web/styles/global.css index 2e8b07d7a..aab13dd6c 100644 --- a/moon/apps/web/styles/global.css +++ b/moon/apps/web/styles/global.css @@ -15,7 +15,8 @@ } #__next { - @apply isolate flex h-full min-h-[100svh] flex-1 flex-col overflow-auto; + /* @apply isolate flex h-full min-h-[100svh] flex-1 flex-col overflow-auto; */ + @apply isolate flex min-h-[100svh] flex-1 flex-col overflow-auto; -webkit-app-region: no-drag; }