1+ import React from 'react' ;
2+ import { Link , useLocation } from 'react-router-dom' ;
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+ < a href = "/homepage/search/ad" className = "block py-2 relative z-10" > Overview</ a >
56+ < div className = "absolute bottom-0 left-0 w-full h-1 bg-blue-500" > </ div >
57+ </ li >
58+ < li className = "cursor-pointer relative" >
59+ < a href = "/homepage/search/ad/dependencies" className = "block py-2 relative z-10" > Dependencies</ a >
60+ </ li >
61+ < li className = "cursor-pointer relative" >
62+ < a href = "#" className = "block py-2 relative z-10" > Dependents</ a >
63+ </ li >
64+ < li className = "cursor-pointer relative" >
65+ < a href = "#" className = "block py-2 relative z-10" > Compare</ a >
66+ </ li >
67+ < li className = "cursor-pointer relative" >
68+ < a href = "#" className = "block py-2 relative z-10" > Versions</ a >
69+ </ li >
70+ </ ul >
71+ </ nav >
72+ </ header >
73+
74+ { /* cve */ }
75+ < div className = "container mx-auto my-8 grid grid-cols-1 lg:grid-cols-2 gap-6" >
76+ < div className = "space-y-6" >
77+ { /* Security Advisories */ }
78+ < div className = "bg-white shadow rounded-lg p-4" >
79+ < h2 className = "text-lg font-bold mb-2" > Security Advisories</ h2 >
80+ < p > No advisories detected.</ p >
81+ </ div >
82+ { /* Licenses */ }
83+ < div className = "bg-white shadow rounded-lg p-4" >
84+ < h2 className = "text-lg font-bold mb-2" > Licenses</ h2 >
85+ < div className = "mb-2" >
86+ < span className = "font-bold" > LICENSES:</ span > MIT
87+ </ div >
88+ < div className = "mb-2" >
89+ < span className = "font-bold" > DEPENDENCY LICENSES:</ span >
90+ < ul className = "list-disc pl-6" >
91+ < li > Apache-2.0 OR MIT (116)</ li >
92+ < li > MIT (27)</ li >
93+ < li > MIT OR Uniclicense (7)</ li >
94+ { /* Add more dependency licenses */ }
95+ </ ul >
96+ </ div >
97+ </ div >
98+ { /* Dependencies */ }
99+ < div className = "bg-white shadow rounded-lg p-4" >
100+ < h2 className = "text-lg font-bold mb-2" > Dependencies</ h2 >
101+ < div className = "mb-2" >
102+ < span className = "font-bold" > Direct:</ span > 23
103+ </ div >
104+ < div className = "mb-2" >
105+ < span className = "font-bold" > Indirect:</ span > 139
106+ </ div >
107+ < a href = "#" className = "text-blue-500 hover:underline" >
108+ View all dependencies
109+ </ a >
110+ </ div >
111+ { /* Dependents */ }
112+ < div className = "bg-white shadow rounded-lg p-4" >
113+ < h2 className = "text-lg font-bold mb-2" > Dependents</ h2 >
114+ < div className = "mb-2" >
115+ < span className = "font-bold" > Direct:</ span > 23
116+ </ div >
117+ < div className = "mb-2" >
118+ < span className = "font-bold" > Indirect:</ span > 139
119+ </ div >
120+ < a href = "#" className = "text-blue-500 hover:underline" >
121+ View all dependencies
122+ </ a >
123+ </ div >
124+ </ div >
125+ < div className = "bg-white shadow rounded-lg p-4" >
126+ < h2 className = "text-lg font-bold mb-2" > OpenSSF scorecard</ h2 >
127+ < 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 >
128+ < a href = "#" className = "text-blue-500 hover:underline" >
129+ View information about checks and how to fix failures.
130+ </ a >
131+ < div className = "flex items-center justify-between mt-4" >
132+ < div className = "text-3xl font-bold" > 8.3/10</ div >
133+ < div className = "text-sm text-gray-500" > Scorecard as of November 11, 2024.</ div >
134+ </ div >
135+ < div className = "mt-4 space-y-2" >
136+ < div className = "flex justify-between" >
137+ < span > Code-Review</ span >
138+ < span > 10/10</ span >
139+ </ div >
140+ < div className = "flex justify-between" >
141+ < span > Maintained</ span >
142+ < span > 10/10</ span >
143+ </ div >
144+ < div className = "flex justify-between" >
145+ < span > CI/Best-Practices</ span >
146+ < span > 0/10</ span >
147+ </ div >
148+ < div className = "flex justify-between" >
149+ < span > License</ span >
150+ < span > 10/10</ span >
151+ </ div >
152+ < div className = "flex justify-between" >
153+ < span > Dangerous-Workflow</ span >
154+ < span > 10/10</ span >
155+ </ div >
156+ < div className = "flex justify-between" >
157+ < span > Security-Policy</ span >
158+ < span > 10/10</ span >
159+ </ div >
160+ < div className = "flex justify-between" >
161+ < span > Token-Permissions</ span >
162+ < span > 10/10</ span >
163+ </ div >
164+ < div className = "flex justify-between" >
165+ < span > Binary-Artifacts</ span >
166+ < span > 10/10</ span >
167+ </ div >
168+ < div className = "flex justify-between" >
169+ < span > Pinned-Dependencies</ span >
170+ < span > 0/10</ span >
171+ </ div >
172+ </ div >
173+ </ div >
174+ </ div >
175+ </ div >
176+ ) ;
177+ } ;
178+
179+ export default CratePage ;
0 commit comments