diff --git a/app/newpage/layout.tsx b/app/newpage/layout.tsx new file mode 100644 index 0000000..30e72fa --- /dev/null +++ b/app/newpage/layout.tsx @@ -0,0 +1,19 @@ +import '@/app/ui/global.css'; + + +export const metadata = { + title: 'cratespro', + description: 'Generated by Next.js', +} + +export default function RootLayout({ + children, +}: { + children: React.ReactNode +}) { + return ( + + {children} + + ) +} diff --git a/app/newpage/page.tsx b/app/newpage/page.tsx new file mode 100644 index 0000000..0e61643 --- /dev/null +++ b/app/newpage/page.tsx @@ -0,0 +1,95 @@ +import React from 'react'; +import '@/app/ui/global.css'; + + +const HomePage = () => { + return ( + //紫色渐变 + //
+ // {/* 头部和搜索部分 */} + //
+ //
+ //
open/source/insights
+ // + //
+ //
+ //

Understand your dependencies

+ //

Your software and your users rely not only on the code you write, but also on the code your code depends on, the code that code depends on, and so on.

+ //
+ // + // + //
+ //
+ //
+ + + //绿色渐变 + < div className="min-h-screen bg-gray-900 text-white" > +
+
open/source/insights
+ +
+ {/* 搜索部分 */} +
+

Understand your dependencies

+

Your software and your users rely not only on the code you write, but also on the code your code depends on, the code that code depends on, and so on.

+
+ + +
+
+ + + {/* 分割线部分 */} +
+ + {/* 一些介绍 */} +
+
+

New features in the deps.dev API

+

The deps.dev API, which provides free access to the data that powers this website, now has experimental batch and pull support, as well as a new version that comes with a stability guarantee and deprecation policy.

+ +

Learn more about the new features on our blog, or get started with the API documentation, and code examples.

+ +
+ +
+

Seeing the big picture can be difficult—but it shouldn't be

+

The Open Source Insights page for each package shows the full dependency graph and updates it every day. The information provided can help you make informed decisions about using, building, and maintaining your software.

+ +

With Open Source Insights, you can actually see the dependency graph for a package, then isolate the paths to a particular dependency. Or see whether a vulnerability in a dependency might affect your code. Or compare two versions of a package to see how the dependencies have changed in a new release.

+ +
+ +
+

How it works

+ +

The service repeatedly examines sites such as github.com, npmjs.com, and pkg.go.dev to find up-to-date information about open source software packages. Using that information, it builds for each package the full dependency graph from scratch—not just from package lock files—connecting it to the packages it depends on and to those that depend on it. This transitive dependency graph allows problems in any package to be made visible to the owners and users of any software they affect.

+ +
+
+
+ ); +} + +export default HomePage; diff --git a/app/newpage/search/page.tsx b/app/newpage/search/page.tsx new file mode 100644 index 0000000..267b632 --- /dev/null +++ b/app/newpage/search/page.tsx @@ -0,0 +1,74 @@ +"use client"; + +import { useState } from 'react'; + +export default function Home() { + //const [query,] = useState(''); //const [query, setQuery] = useState(''); + // 使用假数据进行测试,const [results, setResults] = useState([ + const [results,] = useState([ + { crate_name: "tokio", version: "1.41.1", date: "2023-01-01" }, + { crate_name: "tokio", version: "0.1.2", date: "2023-02-01" }, + ]); + + // const search = async () => { + // // 待替换api + // const apiUrl = 'api'; + + // try { + // const response = await fetch(apiUrl, { + // method: 'POST', + // headers: { + // 'Content-Type': 'application/json', + // }, + // body: JSON.stringify({ query }), + // }); + + // const data = await response.json(); + // setResults(data.results); + // } catch (error) { + // console.error('Error fetching data:', error); + // } + // }; + + return ( + //页面顶部和搜索框 +
+
+
+
+ open + / + source + / + insights +
+
+ + +
+
+
+ + {/*搜索数据展示 */} +
+
+ {results.map((item, index) => ( +
+ {item.crate_name} +
Crate {item.version}Published {item.date}
+
+ ))} +
+
+
+ ); +} \ No newline at end of file diff --git a/app/newpage/styles.css b/app/newpage/styles.css new file mode 100644 index 0000000..e69de29