1+ import React from 'react' ;
2+ import Link from 'next/link' ;
3+ const CratePage = ( ) => {
4+ // Other code
5+
6+ return (
7+ < div >
8+ { /* Existing header and search */ }
9+ < header className = "bg-white shadow p-4" >
10+ < div className = "flex justify-between items-center" >
11+ < div className = "text-xl font-bold flex flex-col items-start space-y-1" >
12+ < div className = "flex items-center space-x-1" >
13+ < span > open</ span >
14+ < span className = "text-green-500" > /</ span >
15+ < span > source</ span >
16+ < span className = "text-green-500" > /</ span >
17+ < span > insights</ span >
18+ </ div >
19+ < div className = "flex items-center space-x-2 mt-15" >
20+ < span > tokio</ span >
21+ < div className = "relative" >
22+ < button className = "flex items-center px-4 py-2 border border-gray-300 rounded hover:bg-gray-100" >
23+ 1.41.1
24+ < svg
25+ className = "ml-2 w-4 h-4"
26+ viewBox = "0 0 20 20"
27+ fill = "currentColor"
28+ >
29+ < path
30+ fillRule = "evenodd"
31+ d = "M5 10a1 1 0 011-1h8a1 1 0 110 2H6a1 1 0 01-1-1z"
32+ clipRule = "evenodd"
33+ />
34+ </ svg >
35+ </ button >
36+ { /* 这里可以添加版本选择的下拉菜单 */ }
37+ </ div >
38+ </ div >
39+ </ div >
40+ < div className = "flex items-center space-x-4" >
41+ < input
42+ type = "text"
43+ className = "p-2 border border-gray-300 rounded-l-md focus:outline-none focus:ring-2 focus:ring-blue-500"
44+ placeholder = "Search..."
45+ />
46+ < button className = "bg-blue-600 text-white px-4 py-2 rounded-r-md hover:bg-blue-700" >
47+ Search
48+ </ button >
49+ </ div >
50+ </ div >
51+
52+ < nav className = "mt-4" >
53+ < ul className = "flex space-x-4 text-gray-500 relative" >
54+ < li className = "cursor-pointer relative" >
55+ < Link href = "/homepage/search/ad" >
56+ < div className = "block py-2 relative z-10" > Overview</ div >
57+ </ Link >
58+
59+ < div className = "absolute bottom-0 left-0 w-full h-1 bg-blue-500" > </ div >
60+ </ li >
61+ < li className = "cursor-pointer relative" >
62+ < Link href = "/homepage/search/ad/dependencies" >
63+ < div className = "block py-2 relative z-10" > Dependencies</ div >
64+ </ Link >
65+
66+ </ li >
67+ < li className = "cursor-pointer relative" >
68+ < a href = "#" className = "block py-2 relative z-10" > Dependents</ a >
69+ </ li >
70+ < li className = "cursor-pointer relative" >
71+ < a href = "#" className = "block py-2 relative z-10" > Compare</ a >
72+ </ li >
73+ < li className = "cursor-pointer relative" >
74+ < a href = "#" className = "block py-2 relative z-10" > Versions</ a >
75+ </ li >
76+ </ ul >
77+ </ nav >
78+ </ header >
79+
80+ { /* cve */ }
81+ < div className = "container mx-auto my-8 grid grid-cols-1 lg:grid-cols-2 gap-6" >
82+ < div className = "space-y-6" >
83+ { /* Security Advisories */ }
84+ < div className = "bg-white shadow rounded-lg p-4" >
85+ < h2 className = "text-lg font-bold mb-2" > Security Advisories</ h2 >
86+ < p > No advisories detected.</ p >
87+ </ div >
88+ { /* Licenses */ }
89+ < div className = "bg-white shadow rounded-lg p-4" >
90+ < h2 className = "text-lg font-bold mb-2" > Licenses</ h2 >
91+ < div className = "mb-2" >
92+ < span className = "font-bold" > LICENSES:</ span > MIT
93+ </ div >
94+ < div className = "mb-2" >
95+ < span className = "font-bold" > DEPENDENCY LICENSES:</ span >
96+ < ul className = "list-disc pl-6" >
97+ < li > Apache-2.0 OR MIT (116)</ li >
98+ < li > MIT (27)</ li >
99+ < li > MIT OR Uniclicense (7)</ li >
100+ { /* Add more dependency licenses */ }
101+ </ ul >
102+ </ div >
103+ </ div >
104+ { /* Dependencies */ }
105+ < div className = "bg-white shadow rounded-lg p-4" >
106+ < h2 className = "text-lg font-bold mb-2" > Dependencies</ h2 >
107+ < div className = "mb-2" >
108+ < span className = "font-bold" > Direct:</ span > 23
109+ </ div >
110+ < div className = "mb-2" >
111+ < span className = "font-bold" > Indirect:</ span > 139
112+ </ div >
113+ < a href = "#" className = "text-blue-500 hover:underline" >
114+ View all dependencies
115+ </ a >
116+ </ div >
117+ { /* Dependents */ }
118+ < div className = "bg-white shadow rounded-lg p-4" >
119+ < h2 className = "text-lg font-bold mb-2" > Dependents</ h2 >
120+ < div className = "mb-2" >
121+ < span className = "font-bold" > Direct:</ span > 23
122+ </ div >
123+ < div className = "mb-2" >
124+ < span className = "font-bold" > Indirect:</ span > 139
125+ </ div >
126+ < a href = "#" className = "text-blue-500 hover:underline" >
127+ View all dependencies
128+ </ a >
129+ </ div >
130+ </ div >
131+ < div className = "bg-white shadow rounded-lg p-4" >
132+ < h2 className = "text-lg font-bold mb-2" > OpenSSF scorecard</ h2 >
133+ < p > The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.</ p >
134+ < a href = "#" className = "text-blue-500 hover:underline" >
135+ View information about checks and how to fix failures.
136+ </ a >
137+ < div className = "flex items-center justify-between mt-4" >
138+ < div className = "text-3xl font-bold" > 8.3/10</ div >
139+ < div className = "text-sm text-gray-500" > Scorecard as of November 11, 2024.</ div >
140+ </ div >
141+ < div className = "mt-4 space-y-2" >
142+ < div className = "flex justify-between" >
143+ < span > Code-Review</ span >
144+ < span > 10/10</ span >
145+ </ div >
146+ < div className = "flex justify-between" >
147+ < span > Maintained</ span >
148+ < span > 10/10</ span >
149+ </ div >
150+ < div className = "flex justify-between" >
151+ < span > CI/Best-Practices</ span >
152+ < span > 0/10</ span >
153+ </ div >
154+ < div className = "flex justify-between" >
155+ < span > License</ span >
156+ < span > 10/10</ span >
157+ </ div >
158+ < div className = "flex justify-between" >
159+ < span > Dangerous-Workflow</ span >
160+ < span > 10/10</ span >
161+ </ div >
162+ < div className = "flex justify-between" >
163+ < span > Security-Policy</ span >
164+ < span > 10/10</ span >
165+ </ div >
166+ < div className = "flex justify-between" >
167+ < span > Token-Permissions</ span >
168+ < span > 10/10</ span >
169+ </ div >
170+ < div className = "flex justify-between" >
171+ < span > Binary-Artifacts</ span >
172+ < span > 10/10</ span >
173+ </ div >
174+ < div className = "flex justify-between" >
175+ < span > Pinned-Dependencies</ span >
176+ < span > 0/10</ span >
177+ </ div >
178+ </ div >
179+ </ div >
180+ </ div >
181+ </ div >
182+ ) ;
183+ } ;
184+
185+ export default CratePage ;
0 commit comments