@mcp-shark/mcp-shark 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +85 -0
- package/README.md +724 -0
- package/bin/mcp-shark.js +93 -0
- package/mcp-server/.editorconfig +15 -0
- package/mcp-server/.prettierignore +11 -0
- package/mcp-server/.prettierrc +12 -0
- package/mcp-server/README.md +280 -0
- package/mcp-server/commitlint.config.cjs +42 -0
- package/mcp-server/eslint.config.js +131 -0
- package/mcp-server/lib/auditor/audit.js +228 -0
- package/mcp-server/lib/common/error.js +15 -0
- package/mcp-server/lib/server/external/all.js +32 -0
- package/mcp-server/lib/server/external/config.js +59 -0
- package/mcp-server/lib/server/external/kv.js +102 -0
- package/mcp-server/lib/server/external/single/client.js +35 -0
- package/mcp-server/lib/server/external/single/request.js +49 -0
- package/mcp-server/lib/server/external/single/run.js +75 -0
- package/mcp-server/lib/server/external/single/transport.js +57 -0
- package/mcp-server/lib/server/internal/handlers/common.js +20 -0
- package/mcp-server/lib/server/internal/handlers/error.js +7 -0
- package/mcp-server/lib/server/internal/handlers/prompts-get.js +22 -0
- package/mcp-server/lib/server/internal/handlers/prompts-list.js +12 -0
- package/mcp-server/lib/server/internal/handlers/resources-list.js +12 -0
- package/mcp-server/lib/server/internal/handlers/resources-read.js +19 -0
- package/mcp-server/lib/server/internal/handlers/tools-call.js +37 -0
- package/mcp-server/lib/server/internal/handlers/tools-list.js +14 -0
- package/mcp-server/lib/server/internal/run.js +49 -0
- package/mcp-server/lib/server/internal/server.js +63 -0
- package/mcp-server/lib/server/internal/session.js +39 -0
- package/mcp-server/mcp-shark.js +72 -0
- package/mcp-server/package-lock.json +4784 -0
- package/mcp-server/package.json +30 -0
- package/package.json +103 -0
- package/ui/README.md +212 -0
- package/ui/index.html +16 -0
- package/ui/package-lock.json +3574 -0
- package/ui/package.json +12 -0
- package/ui/paths.js +282 -0
- package/ui/public/og-image.png +0 -0
- package/ui/server/routes/backups.js +251 -0
- package/ui/server/routes/composite.js +244 -0
- package/ui/server/routes/config.js +175 -0
- package/ui/server/routes/conversations.js +25 -0
- package/ui/server/routes/help.js +43 -0
- package/ui/server/routes/logs.js +32 -0
- package/ui/server/routes/playground.js +152 -0
- package/ui/server/routes/requests.js +235 -0
- package/ui/server/routes/sessions.js +27 -0
- package/ui/server/routes/smartscan/discover.js +117 -0
- package/ui/server/routes/smartscan/scans/clearCache.js +22 -0
- package/ui/server/routes/smartscan/scans/createBatchScans.js +123 -0
- package/ui/server/routes/smartscan/scans/createScan.js +42 -0
- package/ui/server/routes/smartscan/scans/getCachedResults.js +51 -0
- package/ui/server/routes/smartscan/scans/getScan.js +41 -0
- package/ui/server/routes/smartscan/scans/listScans.js +24 -0
- package/ui/server/routes/smartscan/scans.js +13 -0
- package/ui/server/routes/smartscan/token.js +56 -0
- package/ui/server/routes/smartscan/transport.js +53 -0
- package/ui/server/routes/smartscan.js +24 -0
- package/ui/server/routes/statistics.js +83 -0
- package/ui/server/utils/config-update.js +212 -0
- package/ui/server/utils/config.js +98 -0
- package/ui/server/utils/paths.js +23 -0
- package/ui/server/utils/port.js +28 -0
- package/ui/server/utils/process.js +80 -0
- package/ui/server/utils/scan-cache/all-results.js +180 -0
- package/ui/server/utils/scan-cache/directory.js +35 -0
- package/ui/server/utils/scan-cache/file-operations.js +104 -0
- package/ui/server/utils/scan-cache/hash.js +47 -0
- package/ui/server/utils/scan-cache/server-operations.js +80 -0
- package/ui/server/utils/scan-cache.js +12 -0
- package/ui/server/utils/serialization.js +13 -0
- package/ui/server/utils/smartscan-token.js +42 -0
- package/ui/server.js +199 -0
- package/ui/src/App.jsx +153 -0
- package/ui/src/CompositeLogs.jsx +164 -0
- package/ui/src/CompositeSetup.jsx +285 -0
- package/ui/src/HelpGuide/HelpGuideContent.jsx +118 -0
- package/ui/src/HelpGuide/HelpGuideFooter.jsx +58 -0
- package/ui/src/HelpGuide/HelpGuideHeader.jsx +56 -0
- package/ui/src/HelpGuide.jsx +65 -0
- package/ui/src/IntroTour.jsx +140 -0
- package/ui/src/LogDetail.jsx +122 -0
- package/ui/src/LogTable.jsx +242 -0
- package/ui/src/PacketDetail.jsx +190 -0
- package/ui/src/PacketFilters.jsx +222 -0
- package/ui/src/PacketList.jsx +183 -0
- package/ui/src/SmartScan.jsx +178 -0
- package/ui/src/TabNavigation.jsx +143 -0
- package/ui/src/components/App/HelpButton.jsx +64 -0
- package/ui/src/components/App/TrafficTab.jsx +69 -0
- package/ui/src/components/App/useAppState.js +163 -0
- package/ui/src/components/BackupList.jsx +192 -0
- package/ui/src/components/CollapsibleSection.jsx +82 -0
- package/ui/src/components/ConfigFileSection.jsx +84 -0
- package/ui/src/components/ConfigViewerModal.jsx +141 -0
- package/ui/src/components/ConfirmationModal.jsx +129 -0
- package/ui/src/components/DetailsTab/BodySection.jsx +27 -0
- package/ui/src/components/DetailsTab/CollapsibleRequestResponse.jsx +70 -0
- package/ui/src/components/DetailsTab/HeadersSection.jsx +25 -0
- package/ui/src/components/DetailsTab/InfoSection.jsx +28 -0
- package/ui/src/components/DetailsTab/NetworkInfoSection.jsx +63 -0
- package/ui/src/components/DetailsTab/ProtocolInfoSection.jsx +75 -0
- package/ui/src/components/DetailsTab/RequestDetailsSection.jsx +46 -0
- package/ui/src/components/DetailsTab/ResponseDetailsSection.jsx +66 -0
- package/ui/src/components/DetailsTab.jsx +31 -0
- package/ui/src/components/DetectedPathsList.jsx +171 -0
- package/ui/src/components/FileInput.jsx +144 -0
- package/ui/src/components/GroupHeader.jsx +76 -0
- package/ui/src/components/GroupedByMcpView.jsx +103 -0
- package/ui/src/components/GroupedByServerView.jsx +134 -0
- package/ui/src/components/GroupedBySessionView.jsx +127 -0
- package/ui/src/components/GroupedViews.jsx +2 -0
- package/ui/src/components/HexTab.jsx +188 -0
- package/ui/src/components/LogsDisplay.jsx +93 -0
- package/ui/src/components/LogsToolbar.jsx +193 -0
- package/ui/src/components/McpPlayground/LoadingModal.jsx +113 -0
- package/ui/src/components/McpPlayground/PromptsSection/PromptCallPanel.jsx +125 -0
- package/ui/src/components/McpPlayground/PromptsSection/PromptItem.jsx +48 -0
- package/ui/src/components/McpPlayground/PromptsSection/PromptsList.jsx +45 -0
- package/ui/src/components/McpPlayground/PromptsSection.jsx +106 -0
- package/ui/src/components/McpPlayground/ResourcesSection/ResourceCallPanel.jsx +89 -0
- package/ui/src/components/McpPlayground/ResourcesSection/ResourceItem.jsx +59 -0
- package/ui/src/components/McpPlayground/ResourcesSection/ResourcesList.jsx +45 -0
- package/ui/src/components/McpPlayground/ResourcesSection.jsx +91 -0
- package/ui/src/components/McpPlayground/ToolsSection/ToolCallPanel.jsx +125 -0
- package/ui/src/components/McpPlayground/ToolsSection/ToolItem.jsx +48 -0
- package/ui/src/components/McpPlayground/ToolsSection/ToolsList.jsx +45 -0
- package/ui/src/components/McpPlayground/ToolsSection.jsx +107 -0
- package/ui/src/components/McpPlayground/common/EmptyState.jsx +17 -0
- package/ui/src/components/McpPlayground/common/ErrorState.jsx +17 -0
- package/ui/src/components/McpPlayground/common/LoadingState.jsx +17 -0
- package/ui/src/components/McpPlayground/useMcpPlayground.js +280 -0
- package/ui/src/components/McpPlayground.jsx +171 -0
- package/ui/src/components/MessageDisplay.jsx +28 -0
- package/ui/src/components/PacketDetailHeader.jsx +88 -0
- package/ui/src/components/PacketFilters/ExportControls.jsx +126 -0
- package/ui/src/components/PacketFilters/FilterInput.jsx +59 -0
- package/ui/src/components/RawTab.jsx +142 -0
- package/ui/src/components/RequestRow/OrphanedResponseRow.jsx +155 -0
- package/ui/src/components/RequestRow/RequestRowMain.jsx +240 -0
- package/ui/src/components/RequestRow/ResponseRow.jsx +158 -0
- package/ui/src/components/RequestRow.jsx +70 -0
- package/ui/src/components/ServerControl.jsx +133 -0
- package/ui/src/components/ServiceSelector.jsx +209 -0
- package/ui/src/components/SetupHeader.jsx +30 -0
- package/ui/src/components/SharkLogo.jsx +21 -0
- package/ui/src/components/SmartScan/AnalysisResult.jsx +64 -0
- package/ui/src/components/SmartScan/BatchResultsDisplay/BatchResultItem.jsx +215 -0
- package/ui/src/components/SmartScan/BatchResultsDisplay/BatchResultsHeader.jsx +94 -0
- package/ui/src/components/SmartScan/BatchResultsDisplay.jsx +26 -0
- package/ui/src/components/SmartScan/DebugInfoSection.jsx +53 -0
- package/ui/src/components/SmartScan/EmptyState.jsx +57 -0
- package/ui/src/components/SmartScan/ErrorDisplay.jsx +48 -0
- package/ui/src/components/SmartScan/ExpandableSection.jsx +93 -0
- package/ui/src/components/SmartScan/FindingsTable.jsx +257 -0
- package/ui/src/components/SmartScan/ListViewContent.jsx +75 -0
- package/ui/src/components/SmartScan/NotablePatternsSection.jsx +75 -0
- package/ui/src/components/SmartScan/OverallSummarySection.jsx +72 -0
- package/ui/src/components/SmartScan/RawDataSection.jsx +52 -0
- package/ui/src/components/SmartScan/RecommendationsSection.jsx +78 -0
- package/ui/src/components/SmartScan/ScanDetailHeader.jsx +92 -0
- package/ui/src/components/SmartScan/ScanDetailView.jsx +141 -0
- package/ui/src/components/SmartScan/ScanListView/ScanListHeader.jsx +49 -0
- package/ui/src/components/SmartScan/ScanListView/ScanListItem.jsx +201 -0
- package/ui/src/components/SmartScan/ScanListView.jsx +73 -0
- package/ui/src/components/SmartScan/ScanOverviewSection.jsx +123 -0
- package/ui/src/components/SmartScan/ScanResultsDisplay.jsx +35 -0
- package/ui/src/components/SmartScan/ScanViewContent.jsx +68 -0
- package/ui/src/components/SmartScan/ScanningProgress.jsx +47 -0
- package/ui/src/components/SmartScan/ServerInfoSection.jsx +43 -0
- package/ui/src/components/SmartScan/ServerSelectionRow.jsx +207 -0
- package/ui/src/components/SmartScan/SingleResultDisplay.jsx +269 -0
- package/ui/src/components/SmartScan/SmartScanControls.jsx +290 -0
- package/ui/src/components/SmartScan/SmartScanHeader.jsx +77 -0
- package/ui/src/components/SmartScan/ViewModeTabs.jsx +57 -0
- package/ui/src/components/SmartScan/hooks/useCacheManagement.js +34 -0
- package/ui/src/components/SmartScan/hooks/useMcpDiscovery.js +121 -0
- package/ui/src/components/SmartScan/hooks/useScanList.js +193 -0
- package/ui/src/components/SmartScan/hooks/useScanOperations.js +87 -0
- package/ui/src/components/SmartScan/hooks/useServerStatus.js +26 -0
- package/ui/src/components/SmartScan/hooks/useTokenManagement.js +53 -0
- package/ui/src/components/SmartScan/scanDataUtils.js +98 -0
- package/ui/src/components/SmartScan/useSmartScan.js +72 -0
- package/ui/src/components/SmartScan/utils.js +19 -0
- package/ui/src/components/SmartScanIcons.jsx +58 -0
- package/ui/src/components/TabNavigation/DesktopTabs.jsx +111 -0
- package/ui/src/components/TabNavigation/MobileDropdown.jsx +140 -0
- package/ui/src/components/TabNavigation.jsx +97 -0
- package/ui/src/components/TabNavigationIcons.jsx +40 -0
- package/ui/src/components/TableHeader.jsx +164 -0
- package/ui/src/components/TourOverlay.jsx +117 -0
- package/ui/src/components/TourTooltip/TourTooltipButtons.jsx +117 -0
- package/ui/src/components/TourTooltip/TourTooltipHeader.jsx +70 -0
- package/ui/src/components/TourTooltip/TourTooltipIcons.jsx +45 -0
- package/ui/src/components/TourTooltip/useTooltipPosition.js +108 -0
- package/ui/src/components/TourTooltip.jsx +83 -0
- package/ui/src/components/ViewModeTabs.jsx +91 -0
- package/ui/src/components/WhatThisDoesSection.jsx +61 -0
- package/ui/src/config/tourSteps.jsx +141 -0
- package/ui/src/hooks/useAnimation.js +92 -0
- package/ui/src/hooks/useConfigManagement.js +124 -0
- package/ui/src/hooks/useServiceExtraction.js +51 -0
- package/ui/src/index.css +42 -0
- package/ui/src/main.jsx +10 -0
- package/ui/src/theme.js +65 -0
- package/ui/src/utils/animations.js +170 -0
- package/ui/src/utils/groupingUtils.js +93 -0
- package/ui/src/utils/hexUtils.js +24 -0
- package/ui/src/utils/mcpGroupingUtils.js +262 -0
- package/ui/src/utils/requestUtils.js +297 -0
- package/ui/vite.config.js +18 -0
|
@@ -0,0 +1,257 @@
|
|
|
1
|
+
import { colors, fonts } from '../../theme';
|
|
2
|
+
import { getRiskLevelColor } from './utils';
|
|
3
|
+
|
|
4
|
+
export default function FindingsTable({ findings, type }) {
|
|
5
|
+
return (
|
|
6
|
+
<div style={{ overflowX: 'auto' }}>
|
|
7
|
+
<table style={{ width: '100%', fontSize: '12px', fontFamily: fonts.body }}>
|
|
8
|
+
<thead>
|
|
9
|
+
<tr
|
|
10
|
+
style={{
|
|
11
|
+
borderBottom: `1px solid ${colors.borderLight}`,
|
|
12
|
+
background: colors.bgTertiary,
|
|
13
|
+
}}
|
|
14
|
+
>
|
|
15
|
+
<th
|
|
16
|
+
style={{
|
|
17
|
+
textAlign: 'left',
|
|
18
|
+
padding: '6px 8px',
|
|
19
|
+
fontSize: '10px',
|
|
20
|
+
fontWeight: '600',
|
|
21
|
+
color: colors.textTertiary,
|
|
22
|
+
textTransform: 'uppercase',
|
|
23
|
+
letterSpacing: '0.05em',
|
|
24
|
+
}}
|
|
25
|
+
>
|
|
26
|
+
Name
|
|
27
|
+
</th>
|
|
28
|
+
<th
|
|
29
|
+
style={{
|
|
30
|
+
textAlign: 'left',
|
|
31
|
+
padding: '6px 8px',
|
|
32
|
+
fontSize: '10px',
|
|
33
|
+
fontWeight: '600',
|
|
34
|
+
color: colors.textTertiary,
|
|
35
|
+
textTransform: 'uppercase',
|
|
36
|
+
letterSpacing: '0.05em',
|
|
37
|
+
}}
|
|
38
|
+
>
|
|
39
|
+
Risk Level
|
|
40
|
+
</th>
|
|
41
|
+
<th
|
|
42
|
+
style={{
|
|
43
|
+
textAlign: 'left',
|
|
44
|
+
padding: '6px 8px',
|
|
45
|
+
fontSize: '10px',
|
|
46
|
+
fontWeight: '600',
|
|
47
|
+
color: colors.textTertiary,
|
|
48
|
+
textTransform: 'uppercase',
|
|
49
|
+
letterSpacing: '0.05em',
|
|
50
|
+
}}
|
|
51
|
+
>
|
|
52
|
+
Risk Score
|
|
53
|
+
</th>
|
|
54
|
+
<th
|
|
55
|
+
style={{
|
|
56
|
+
textAlign: 'left',
|
|
57
|
+
padding: '6px 8px',
|
|
58
|
+
fontSize: '10px',
|
|
59
|
+
fontWeight: '600',
|
|
60
|
+
color: colors.textTertiary,
|
|
61
|
+
textTransform: 'uppercase',
|
|
62
|
+
letterSpacing: '0.05em',
|
|
63
|
+
}}
|
|
64
|
+
>
|
|
65
|
+
Tags
|
|
66
|
+
</th>
|
|
67
|
+
<th
|
|
68
|
+
style={{
|
|
69
|
+
textAlign: 'left',
|
|
70
|
+
padding: '6px 8px',
|
|
71
|
+
fontSize: '10px',
|
|
72
|
+
fontWeight: '600',
|
|
73
|
+
color: colors.textTertiary,
|
|
74
|
+
textTransform: 'uppercase',
|
|
75
|
+
letterSpacing: '0.05em',
|
|
76
|
+
}}
|
|
77
|
+
>
|
|
78
|
+
Reasons
|
|
79
|
+
</th>
|
|
80
|
+
<th
|
|
81
|
+
style={{
|
|
82
|
+
textAlign: 'left',
|
|
83
|
+
padding: '6px 8px',
|
|
84
|
+
fontSize: '10px',
|
|
85
|
+
fontWeight: '600',
|
|
86
|
+
color: colors.textTertiary,
|
|
87
|
+
textTransform: 'uppercase',
|
|
88
|
+
letterSpacing: '0.05em',
|
|
89
|
+
}}
|
|
90
|
+
>
|
|
91
|
+
Safe Use Notes
|
|
92
|
+
</th>
|
|
93
|
+
{type === 'tool' && (
|
|
94
|
+
<th
|
|
95
|
+
style={{
|
|
96
|
+
textAlign: 'left',
|
|
97
|
+
padding: '6px 8px',
|
|
98
|
+
fontSize: '10px',
|
|
99
|
+
fontWeight: '600',
|
|
100
|
+
color: colors.textTertiary,
|
|
101
|
+
textTransform: 'uppercase',
|
|
102
|
+
letterSpacing: '0.05em',
|
|
103
|
+
}}
|
|
104
|
+
>
|
|
105
|
+
Poisoned
|
|
106
|
+
</th>
|
|
107
|
+
)}
|
|
108
|
+
</tr>
|
|
109
|
+
</thead>
|
|
110
|
+
<tbody>
|
|
111
|
+
{findings.map((finding, index) => (
|
|
112
|
+
<tr
|
|
113
|
+
key={index}
|
|
114
|
+
style={{
|
|
115
|
+
borderBottom: `1px solid ${colors.borderLight}`,
|
|
116
|
+
transition: 'background 0.15s',
|
|
117
|
+
}}
|
|
118
|
+
onMouseEnter={(e) => {
|
|
119
|
+
e.currentTarget.style.background = colors.bgTertiary;
|
|
120
|
+
}}
|
|
121
|
+
onMouseLeave={(e) => {
|
|
122
|
+
e.currentTarget.style.background = 'transparent';
|
|
123
|
+
}}
|
|
124
|
+
>
|
|
125
|
+
<td
|
|
126
|
+
style={{
|
|
127
|
+
padding: '8px',
|
|
128
|
+
fontSize: '12px',
|
|
129
|
+
color: colors.textPrimary,
|
|
130
|
+
fontWeight: '500',
|
|
131
|
+
fontFamily: fonts.body,
|
|
132
|
+
}}
|
|
133
|
+
>
|
|
134
|
+
{finding.name}
|
|
135
|
+
</td>
|
|
136
|
+
<td style={{ padding: '8px' }}>
|
|
137
|
+
<span
|
|
138
|
+
style={{
|
|
139
|
+
display: 'inline-flex',
|
|
140
|
+
alignItems: 'center',
|
|
141
|
+
padding: '2px 6px',
|
|
142
|
+
borderRadius: '4px',
|
|
143
|
+
fontSize: '10px',
|
|
144
|
+
fontWeight: '700',
|
|
145
|
+
color: colors.textInverse,
|
|
146
|
+
background: getRiskLevelColor(finding.risk_level),
|
|
147
|
+
fontFamily: fonts.body,
|
|
148
|
+
}}
|
|
149
|
+
>
|
|
150
|
+
{finding.risk_level?.toUpperCase()}
|
|
151
|
+
</span>
|
|
152
|
+
</td>
|
|
153
|
+
<td
|
|
154
|
+
style={{
|
|
155
|
+
padding: '8px',
|
|
156
|
+
fontSize: '12px',
|
|
157
|
+
color: colors.textSecondary,
|
|
158
|
+
fontFamily: fonts.body,
|
|
159
|
+
}}
|
|
160
|
+
>
|
|
161
|
+
{finding.risk_score}
|
|
162
|
+
</td>
|
|
163
|
+
<td style={{ padding: '8px' }}>
|
|
164
|
+
<div style={{ display: 'flex', flexWrap: 'wrap', gap: '2px' }}>
|
|
165
|
+
{finding.risk_tags?.map((tag, tagIndex) => (
|
|
166
|
+
<span
|
|
167
|
+
key={tagIndex}
|
|
168
|
+
style={{
|
|
169
|
+
padding: '2px 6px',
|
|
170
|
+
background: colors.bgCard,
|
|
171
|
+
borderRadius: '4px',
|
|
172
|
+
fontSize: '10px',
|
|
173
|
+
color: colors.textSecondary,
|
|
174
|
+
border: `1px solid ${colors.borderLight}`,
|
|
175
|
+
fontFamily: fonts.body,
|
|
176
|
+
}}
|
|
177
|
+
>
|
|
178
|
+
{tag}
|
|
179
|
+
</span>
|
|
180
|
+
))}
|
|
181
|
+
</div>
|
|
182
|
+
</td>
|
|
183
|
+
<td
|
|
184
|
+
style={{
|
|
185
|
+
padding: '8px',
|
|
186
|
+
fontSize: '12px',
|
|
187
|
+
color: colors.textSecondary,
|
|
188
|
+
fontFamily: fonts.body,
|
|
189
|
+
}}
|
|
190
|
+
>
|
|
191
|
+
<ul
|
|
192
|
+
style={{ listStyle: 'disc', listStylePosition: 'inside', margin: 0, padding: 0 }}
|
|
193
|
+
>
|
|
194
|
+
{finding.reasons?.map((reason, reasonIndex) => (
|
|
195
|
+
<li key={reasonIndex} style={{ fontSize: '10px', marginBottom: '2px' }}>
|
|
196
|
+
{reason}
|
|
197
|
+
</li>
|
|
198
|
+
))}
|
|
199
|
+
</ul>
|
|
200
|
+
</td>
|
|
201
|
+
<td
|
|
202
|
+
style={{
|
|
203
|
+
padding: '8px',
|
|
204
|
+
fontSize: '10px',
|
|
205
|
+
color: colors.textSecondary,
|
|
206
|
+
maxWidth: '200px',
|
|
207
|
+
fontFamily: fonts.body,
|
|
208
|
+
}}
|
|
209
|
+
>
|
|
210
|
+
{finding.safe_use_notes}
|
|
211
|
+
</td>
|
|
212
|
+
{type === 'tool' && finding.hasOwnProperty('is_potentially_poisoned') && (
|
|
213
|
+
<td style={{ padding: '8px' }}>
|
|
214
|
+
{finding.is_potentially_poisoned ? (
|
|
215
|
+
<span
|
|
216
|
+
style={{
|
|
217
|
+
display: 'inline-flex',
|
|
218
|
+
alignItems: 'center',
|
|
219
|
+
padding: '2px 6px',
|
|
220
|
+
fontSize: '10px',
|
|
221
|
+
fontWeight: '500',
|
|
222
|
+
borderRadius: '4px',
|
|
223
|
+
background: colors.error + '20',
|
|
224
|
+
color: colors.error,
|
|
225
|
+
border: `1px solid ${colors.error}40`,
|
|
226
|
+
fontFamily: fonts.body,
|
|
227
|
+
}}
|
|
228
|
+
>
|
|
229
|
+
Yes
|
|
230
|
+
</span>
|
|
231
|
+
) : (
|
|
232
|
+
<span
|
|
233
|
+
style={{
|
|
234
|
+
display: 'inline-flex',
|
|
235
|
+
alignItems: 'center',
|
|
236
|
+
padding: '2px 6px',
|
|
237
|
+
fontSize: '10px',
|
|
238
|
+
fontWeight: '500',
|
|
239
|
+
borderRadius: '4px',
|
|
240
|
+
background: colors.accentGreen + '20',
|
|
241
|
+
color: colors.accentGreen,
|
|
242
|
+
border: `1px solid ${colors.accentGreen}40`,
|
|
243
|
+
fontFamily: fonts.body,
|
|
244
|
+
}}
|
|
245
|
+
>
|
|
246
|
+
No
|
|
247
|
+
</span>
|
|
248
|
+
)}
|
|
249
|
+
</td>
|
|
250
|
+
)}
|
|
251
|
+
</tr>
|
|
252
|
+
))}
|
|
253
|
+
</tbody>
|
|
254
|
+
</table>
|
|
255
|
+
</div>
|
|
256
|
+
);
|
|
257
|
+
}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { colors, fonts } from '../../theme';
|
|
2
|
+
import ScanResultsDisplay from './ScanResultsDisplay';
|
|
3
|
+
import ScanDetailView from './ScanDetailView';
|
|
4
|
+
|
|
5
|
+
export default function ListViewContent({
|
|
6
|
+
error,
|
|
7
|
+
loadingScans,
|
|
8
|
+
selectedScan,
|
|
9
|
+
loadingScanDetail,
|
|
10
|
+
allScans,
|
|
11
|
+
setSelectedScan,
|
|
12
|
+
loadScanDetail,
|
|
13
|
+
onViewScan,
|
|
14
|
+
}) {
|
|
15
|
+
if (loadingScans) {
|
|
16
|
+
return (
|
|
17
|
+
<div
|
|
18
|
+
style={{
|
|
19
|
+
flex: 1,
|
|
20
|
+
display: 'flex',
|
|
21
|
+
alignItems: 'center',
|
|
22
|
+
justifyContent: 'center',
|
|
23
|
+
padding: '24px',
|
|
24
|
+
background: colors.bgPrimary,
|
|
25
|
+
}}
|
|
26
|
+
>
|
|
27
|
+
<p style={{ color: colors.textSecondary, fontFamily: fonts.body }}>
|
|
28
|
+
Loading cached scans...
|
|
29
|
+
</p>
|
|
30
|
+
</div>
|
|
31
|
+
);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
if (selectedScan) {
|
|
35
|
+
return (
|
|
36
|
+
<ScanDetailView
|
|
37
|
+
scan={selectedScan}
|
|
38
|
+
loading={loadingScanDetail}
|
|
39
|
+
onClose={() => {
|
|
40
|
+
setSelectedScan(null);
|
|
41
|
+
loadScanDetail(null);
|
|
42
|
+
}}
|
|
43
|
+
/>
|
|
44
|
+
);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
return (
|
|
48
|
+
<>
|
|
49
|
+
{error && (
|
|
50
|
+
<div
|
|
51
|
+
style={{
|
|
52
|
+
padding: '12px 16px',
|
|
53
|
+
background: colors.error + '20',
|
|
54
|
+
border: `1px solid ${colors.error}`,
|
|
55
|
+
borderRadius: '8px',
|
|
56
|
+
marginBottom: '16px',
|
|
57
|
+
color: colors.error,
|
|
58
|
+
fontSize: '13px',
|
|
59
|
+
fontFamily: fonts.body,
|
|
60
|
+
}}
|
|
61
|
+
>
|
|
62
|
+
{error}
|
|
63
|
+
</div>
|
|
64
|
+
)}
|
|
65
|
+
<ScanResultsDisplay
|
|
66
|
+
error={error}
|
|
67
|
+
scanning={false}
|
|
68
|
+
selectedServers={[]}
|
|
69
|
+
scanResults={allScans}
|
|
70
|
+
scanResult={null}
|
|
71
|
+
onViewScan={onViewScan}
|
|
72
|
+
/>
|
|
73
|
+
</>
|
|
74
|
+
);
|
|
75
|
+
}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { colors, fonts } from '../../theme';
|
|
2
|
+
import ExpandableSection from './ExpandableSection';
|
|
3
|
+
|
|
4
|
+
export default function NotablePatternsSection({ patterns }) {
|
|
5
|
+
if (!patterns || patterns.length === 0) return null;
|
|
6
|
+
|
|
7
|
+
return (
|
|
8
|
+
<ExpandableSection title="Notable Patterns" count={patterns.length} defaultExpanded={false}>
|
|
9
|
+
<div style={{ display: 'flex', flexDirection: 'column', gap: '8px' }}>
|
|
10
|
+
{patterns.map((pattern, index) => (
|
|
11
|
+
<div
|
|
12
|
+
key={index}
|
|
13
|
+
style={{
|
|
14
|
+
display: 'flex',
|
|
15
|
+
alignItems: 'flex-start',
|
|
16
|
+
gap: '8px',
|
|
17
|
+
padding: '8px',
|
|
18
|
+
background: colors.accentOrange + '10',
|
|
19
|
+
borderRadius: '6px',
|
|
20
|
+
border: `1px solid ${colors.accentOrange}20`,
|
|
21
|
+
transition: 'all 0.15s',
|
|
22
|
+
}}
|
|
23
|
+
onMouseEnter={(e) => {
|
|
24
|
+
e.currentTarget.style.background = colors.accentOrange + '15';
|
|
25
|
+
e.currentTarget.style.borderColor = colors.accentOrange + '40';
|
|
26
|
+
}}
|
|
27
|
+
onMouseLeave={(e) => {
|
|
28
|
+
e.currentTarget.style.background = colors.accentOrange + '10';
|
|
29
|
+
e.currentTarget.style.borderColor = colors.accentOrange + '20';
|
|
30
|
+
}}
|
|
31
|
+
>
|
|
32
|
+
<div
|
|
33
|
+
style={{
|
|
34
|
+
flexShrink: 0,
|
|
35
|
+
marginTop: '2px',
|
|
36
|
+
width: '16px',
|
|
37
|
+
height: '16px',
|
|
38
|
+
borderRadius: '50%',
|
|
39
|
+
background: colors.accentOrange + '30',
|
|
40
|
+
border: `1px solid ${colors.accentOrange}60`,
|
|
41
|
+
display: 'flex',
|
|
42
|
+
alignItems: 'center',
|
|
43
|
+
justifyContent: 'center',
|
|
44
|
+
}}
|
|
45
|
+
>
|
|
46
|
+
<svg
|
|
47
|
+
style={{ width: '10px', height: '10px', color: colors.accentOrange }}
|
|
48
|
+
fill="currentColor"
|
|
49
|
+
viewBox="0 0 20 20"
|
|
50
|
+
>
|
|
51
|
+
<path
|
|
52
|
+
fillRule="evenodd"
|
|
53
|
+
d="M8.257 3.099c.765-1.36 2.722-1.36 3.486 0l5.58 9.92c.75 1.334-.213 2.98-1.742 2.98H4.42c-1.53 0-2.493-1.646-1.743-2.98l5.58-9.92zM11 13a1 1 0 11-2 0 1 1 0 012 0zm-1-8a1 1 0 00-1 1v3a1 1 0 002 0V6a1 1 0 00-1-1z"
|
|
54
|
+
clipRule="evenodd"
|
|
55
|
+
/>
|
|
56
|
+
</svg>
|
|
57
|
+
</div>
|
|
58
|
+
<p
|
|
59
|
+
style={{
|
|
60
|
+
fontSize: '12px',
|
|
61
|
+
color: colors.textPrimary,
|
|
62
|
+
lineHeight: '1.5',
|
|
63
|
+
flex: 1,
|
|
64
|
+
margin: 0,
|
|
65
|
+
fontFamily: fonts.body,
|
|
66
|
+
}}
|
|
67
|
+
>
|
|
68
|
+
{pattern}
|
|
69
|
+
</p>
|
|
70
|
+
</div>
|
|
71
|
+
))}
|
|
72
|
+
</div>
|
|
73
|
+
</ExpandableSection>
|
|
74
|
+
);
|
|
75
|
+
}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { colors, fonts } from '../../theme';
|
|
2
|
+
import { getRiskLevelColor } from './utils';
|
|
3
|
+
import ExpandableSection from './ExpandableSection';
|
|
4
|
+
|
|
5
|
+
export default function OverallSummarySection({ overallRiskLevel, overallReason }) {
|
|
6
|
+
if (!overallRiskLevel) return null;
|
|
7
|
+
|
|
8
|
+
return (
|
|
9
|
+
<ExpandableSection title="Overall Summary" count={overallReason ? 1 : 0} defaultExpanded={true}>
|
|
10
|
+
<div style={{ display: 'flex', flexDirection: 'column', gap: '8px' }}>
|
|
11
|
+
<div style={{ display: 'flex', alignItems: 'center', gap: '8px' }}>
|
|
12
|
+
<span
|
|
13
|
+
style={{
|
|
14
|
+
fontSize: '12px',
|
|
15
|
+
fontWeight: '600',
|
|
16
|
+
color: colors.textPrimary,
|
|
17
|
+
fontFamily: fonts.body,
|
|
18
|
+
}}
|
|
19
|
+
>
|
|
20
|
+
Overall Risk Level:
|
|
21
|
+
</span>
|
|
22
|
+
<span
|
|
23
|
+
style={{
|
|
24
|
+
display: 'inline-flex',
|
|
25
|
+
alignItems: 'center',
|
|
26
|
+
padding: '2px 8px',
|
|
27
|
+
borderRadius: '4px',
|
|
28
|
+
fontSize: '10px',
|
|
29
|
+
fontWeight: '700',
|
|
30
|
+
color: colors.textInverse,
|
|
31
|
+
background: getRiskLevelColor(overallRiskLevel),
|
|
32
|
+
fontFamily: fonts.body,
|
|
33
|
+
}}
|
|
34
|
+
>
|
|
35
|
+
{overallRiskLevel.toUpperCase()}
|
|
36
|
+
</span>
|
|
37
|
+
</div>
|
|
38
|
+
{overallReason && (
|
|
39
|
+
<div style={{ fontSize: '12px', color: colors.textSecondary, fontFamily: fonts.body }}>
|
|
40
|
+
{(() => {
|
|
41
|
+
const separator = overallReason.includes('\n')
|
|
42
|
+
? '\n'
|
|
43
|
+
: overallReason.includes(' | ')
|
|
44
|
+
? ' | '
|
|
45
|
+
: null;
|
|
46
|
+
|
|
47
|
+
if (separator) {
|
|
48
|
+
return (
|
|
49
|
+
<ul
|
|
50
|
+
style={{
|
|
51
|
+
listStyle: 'disc',
|
|
52
|
+
listStylePosition: 'inside',
|
|
53
|
+
margin: 0,
|
|
54
|
+
paddingLeft: '8px',
|
|
55
|
+
}}
|
|
56
|
+
>
|
|
57
|
+
{overallReason.split(separator).map((item, index) => (
|
|
58
|
+
<li key={index} style={{ fontSize: '12px', marginBottom: '2px' }}>
|
|
59
|
+
{item.trim()}
|
|
60
|
+
</li>
|
|
61
|
+
))}
|
|
62
|
+
</ul>
|
|
63
|
+
);
|
|
64
|
+
}
|
|
65
|
+
return <p style={{ fontSize: '12px' }}>{overallReason}</p>;
|
|
66
|
+
})()}
|
|
67
|
+
</div>
|
|
68
|
+
)}
|
|
69
|
+
</div>
|
|
70
|
+
</ExpandableSection>
|
|
71
|
+
);
|
|
72
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { colors, fonts } from '../../theme';
|
|
2
|
+
|
|
3
|
+
export default function RawDataSection({ scan }) {
|
|
4
|
+
return (
|
|
5
|
+
<div style={{ marginBottom: '24px' }}>
|
|
6
|
+
<h3
|
|
7
|
+
style={{
|
|
8
|
+
fontSize: '13px',
|
|
9
|
+
fontWeight: '600',
|
|
10
|
+
color: colors.textPrimary,
|
|
11
|
+
fontFamily: fonts.body,
|
|
12
|
+
marginBottom: '12px',
|
|
13
|
+
paddingBottom: '8px',
|
|
14
|
+
borderBottom: `1px solid ${colors.borderLight}`,
|
|
15
|
+
}}
|
|
16
|
+
>
|
|
17
|
+
Raw Data
|
|
18
|
+
</h3>
|
|
19
|
+
<details>
|
|
20
|
+
<summary
|
|
21
|
+
style={{
|
|
22
|
+
cursor: 'pointer',
|
|
23
|
+
padding: '8px',
|
|
24
|
+
background: colors.bgTertiary,
|
|
25
|
+
borderRadius: '4px',
|
|
26
|
+
fontSize: '11px',
|
|
27
|
+
color: colors.textSecondary,
|
|
28
|
+
fontFamily: fonts.body,
|
|
29
|
+
marginBottom: '8px',
|
|
30
|
+
}}
|
|
31
|
+
>
|
|
32
|
+
Click to view raw JSON data
|
|
33
|
+
</summary>
|
|
34
|
+
<pre
|
|
35
|
+
style={{
|
|
36
|
+
padding: '12px',
|
|
37
|
+
background: colors.bgTertiary,
|
|
38
|
+
borderRadius: '6px',
|
|
39
|
+
fontSize: '11px',
|
|
40
|
+
fontFamily: 'monospace',
|
|
41
|
+
color: colors.textPrimary,
|
|
42
|
+
overflow: 'auto',
|
|
43
|
+
maxHeight: '400px',
|
|
44
|
+
margin: 0,
|
|
45
|
+
}}
|
|
46
|
+
>
|
|
47
|
+
{JSON.stringify(scan, null, 2)}
|
|
48
|
+
</pre>
|
|
49
|
+
</details>
|
|
50
|
+
</div>
|
|
51
|
+
);
|
|
52
|
+
}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { colors, fonts } from '../../theme';
|
|
2
|
+
import ExpandableSection from './ExpandableSection';
|
|
3
|
+
|
|
4
|
+
export default function RecommendationsSection({ recommendations }) {
|
|
5
|
+
if (!recommendations || recommendations.length === 0) return null;
|
|
6
|
+
|
|
7
|
+
return (
|
|
8
|
+
<ExpandableSection
|
|
9
|
+
title="Recommendations"
|
|
10
|
+
count={recommendations.length}
|
|
11
|
+
defaultExpanded={false}
|
|
12
|
+
>
|
|
13
|
+
<div style={{ display: 'flex', flexDirection: 'column', gap: '8px' }}>
|
|
14
|
+
{recommendations.map((recommendation, index) => (
|
|
15
|
+
<div
|
|
16
|
+
key={index}
|
|
17
|
+
style={{
|
|
18
|
+
display: 'flex',
|
|
19
|
+
alignItems: 'flex-start',
|
|
20
|
+
gap: '8px',
|
|
21
|
+
padding: '8px',
|
|
22
|
+
background: colors.accentBlue + '10',
|
|
23
|
+
borderRadius: '6px',
|
|
24
|
+
border: `1px solid ${colors.accentBlue}20`,
|
|
25
|
+
transition: 'all 0.15s',
|
|
26
|
+
}}
|
|
27
|
+
onMouseEnter={(e) => {
|
|
28
|
+
e.currentTarget.style.background = colors.accentBlue + '15';
|
|
29
|
+
e.currentTarget.style.borderColor = colors.accentBlue + '40';
|
|
30
|
+
}}
|
|
31
|
+
onMouseLeave={(e) => {
|
|
32
|
+
e.currentTarget.style.background = colors.accentBlue + '10';
|
|
33
|
+
e.currentTarget.style.borderColor = colors.accentBlue + '20';
|
|
34
|
+
}}
|
|
35
|
+
>
|
|
36
|
+
<div
|
|
37
|
+
style={{
|
|
38
|
+
flexShrink: 0,
|
|
39
|
+
marginTop: '2px',
|
|
40
|
+
width: '16px',
|
|
41
|
+
height: '16px',
|
|
42
|
+
borderRadius: '50%',
|
|
43
|
+
background: colors.accentBlue + '30',
|
|
44
|
+
border: `1px solid ${colors.accentBlue}60`,
|
|
45
|
+
display: 'flex',
|
|
46
|
+
alignItems: 'center',
|
|
47
|
+
justifyContent: 'center',
|
|
48
|
+
}}
|
|
49
|
+
>
|
|
50
|
+
<span
|
|
51
|
+
style={{
|
|
52
|
+
fontSize: '10px',
|
|
53
|
+
fontWeight: '600',
|
|
54
|
+
color: colors.accentBlue,
|
|
55
|
+
fontFamily: fonts.body,
|
|
56
|
+
}}
|
|
57
|
+
>
|
|
58
|
+
{index + 1}
|
|
59
|
+
</span>
|
|
60
|
+
</div>
|
|
61
|
+
<p
|
|
62
|
+
style={{
|
|
63
|
+
fontSize: '12px',
|
|
64
|
+
color: colors.textPrimary,
|
|
65
|
+
lineHeight: '1.5',
|
|
66
|
+
flex: 1,
|
|
67
|
+
margin: 0,
|
|
68
|
+
fontFamily: fonts.body,
|
|
69
|
+
}}
|
|
70
|
+
>
|
|
71
|
+
{recommendation}
|
|
72
|
+
</p>
|
|
73
|
+
</div>
|
|
74
|
+
))}
|
|
75
|
+
</div>
|
|
76
|
+
</ExpandableSection>
|
|
77
|
+
);
|
|
78
|
+
}
|