@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,92 @@
|
|
|
1
|
+
import { colors, fonts } from '../../theme';
|
|
2
|
+
import { IconX, IconExternalLink } from '@tabler/icons-react';
|
|
3
|
+
|
|
4
|
+
export default function ScanDetailHeader({ scanId, serverName, onClose }) {
|
|
5
|
+
return (
|
|
6
|
+
<div
|
|
7
|
+
style={{
|
|
8
|
+
display: 'flex',
|
|
9
|
+
justifyContent: 'space-between',
|
|
10
|
+
alignItems: 'center',
|
|
11
|
+
marginBottom: '20px',
|
|
12
|
+
}}
|
|
13
|
+
>
|
|
14
|
+
<div>
|
|
15
|
+
<h2
|
|
16
|
+
style={{
|
|
17
|
+
fontSize: '16px',
|
|
18
|
+
fontWeight: '600',
|
|
19
|
+
color: colors.textPrimary,
|
|
20
|
+
fontFamily: fonts.body,
|
|
21
|
+
margin: 0,
|
|
22
|
+
marginBottom: '8px',
|
|
23
|
+
}}
|
|
24
|
+
>
|
|
25
|
+
{serverName}
|
|
26
|
+
</h2>
|
|
27
|
+
{scanId && (
|
|
28
|
+
<div
|
|
29
|
+
style={{
|
|
30
|
+
fontSize: '12px',
|
|
31
|
+
color: colors.textTertiary,
|
|
32
|
+
fontFamily: fonts.body,
|
|
33
|
+
}}
|
|
34
|
+
>
|
|
35
|
+
ID: {scanId}
|
|
36
|
+
</div>
|
|
37
|
+
)}
|
|
38
|
+
</div>
|
|
39
|
+
<div style={{ display: 'flex', alignItems: 'center', gap: '12px' }}>
|
|
40
|
+
{scanId && (
|
|
41
|
+
<a
|
|
42
|
+
href={`https://smart.mcpshark.sh/scan-results?id=${scanId}`}
|
|
43
|
+
target="_blank"
|
|
44
|
+
rel="noopener noreferrer"
|
|
45
|
+
style={{
|
|
46
|
+
padding: '6px 12px',
|
|
47
|
+
background: colors.buttonPrimary,
|
|
48
|
+
border: 'none',
|
|
49
|
+
color: colors.textInverse,
|
|
50
|
+
borderRadius: '6px',
|
|
51
|
+
fontSize: '12px',
|
|
52
|
+
fontFamily: fonts.body,
|
|
53
|
+
fontWeight: '500',
|
|
54
|
+
textDecoration: 'none',
|
|
55
|
+
cursor: 'pointer',
|
|
56
|
+
display: 'flex',
|
|
57
|
+
alignItems: 'center',
|
|
58
|
+
gap: '6px',
|
|
59
|
+
}}
|
|
60
|
+
>
|
|
61
|
+
<IconExternalLink size={14} stroke={1.5} />
|
|
62
|
+
View on Smart Scan
|
|
63
|
+
</a>
|
|
64
|
+
)}
|
|
65
|
+
<button
|
|
66
|
+
onClick={onClose}
|
|
67
|
+
style={{
|
|
68
|
+
padding: '6px',
|
|
69
|
+
background: 'transparent',
|
|
70
|
+
border: 'none',
|
|
71
|
+
color: colors.textSecondary,
|
|
72
|
+
cursor: 'pointer',
|
|
73
|
+
borderRadius: '4px',
|
|
74
|
+
display: 'flex',
|
|
75
|
+
alignItems: 'center',
|
|
76
|
+
justifyContent: 'center',
|
|
77
|
+
}}
|
|
78
|
+
onMouseEnter={(e) => {
|
|
79
|
+
e.currentTarget.style.background = colors.bgTertiary;
|
|
80
|
+
e.currentTarget.style.color = colors.textPrimary;
|
|
81
|
+
}}
|
|
82
|
+
onMouseLeave={(e) => {
|
|
83
|
+
e.currentTarget.style.background = 'transparent';
|
|
84
|
+
e.currentTarget.style.color = colors.textSecondary;
|
|
85
|
+
}}
|
|
86
|
+
>
|
|
87
|
+
<IconX size={20} stroke={1.5} />
|
|
88
|
+
</button>
|
|
89
|
+
</div>
|
|
90
|
+
</div>
|
|
91
|
+
);
|
|
92
|
+
}
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
import { colors, fonts } from '../../theme';
|
|
2
|
+
import AnalysisResult from './AnalysisResult';
|
|
3
|
+
import { normalizeScanData } from './scanDataUtils';
|
|
4
|
+
import ScanDetailHeader from './ScanDetailHeader';
|
|
5
|
+
import DebugInfoSection from './DebugInfoSection';
|
|
6
|
+
import ScanOverviewSection from './ScanOverviewSection';
|
|
7
|
+
import ServerInfoSection from './ServerInfoSection';
|
|
8
|
+
import RawDataSection from './RawDataSection';
|
|
9
|
+
|
|
10
|
+
export default function ScanDetailView({ scan, loading, onClose }) {
|
|
11
|
+
if (loading) {
|
|
12
|
+
return (
|
|
13
|
+
<div
|
|
14
|
+
style={{
|
|
15
|
+
background: colors.bgCard,
|
|
16
|
+
border: `1px solid ${colors.borderLight}`,
|
|
17
|
+
borderRadius: '8px',
|
|
18
|
+
padding: '24px',
|
|
19
|
+
textAlign: 'center',
|
|
20
|
+
}}
|
|
21
|
+
>
|
|
22
|
+
<p style={{ color: colors.textSecondary, fontFamily: fonts.body }}>
|
|
23
|
+
Loading scan details...
|
|
24
|
+
</p>
|
|
25
|
+
</div>
|
|
26
|
+
);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
if (!scan) {
|
|
30
|
+
return (
|
|
31
|
+
<div
|
|
32
|
+
style={{
|
|
33
|
+
background: colors.bgCard,
|
|
34
|
+
border: `1px solid ${colors.borderLight}`,
|
|
35
|
+
borderRadius: '8px',
|
|
36
|
+
padding: '24px',
|
|
37
|
+
textAlign: 'center',
|
|
38
|
+
}}
|
|
39
|
+
>
|
|
40
|
+
<p style={{ color: colors.textSecondary, fontFamily: fonts.body }}>
|
|
41
|
+
No scan data available
|
|
42
|
+
</p>
|
|
43
|
+
</div>
|
|
44
|
+
);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
const {
|
|
48
|
+
scanId,
|
|
49
|
+
serverName,
|
|
50
|
+
status,
|
|
51
|
+
overallRiskLevel,
|
|
52
|
+
createdAt,
|
|
53
|
+
updatedAt,
|
|
54
|
+
analysisResult,
|
|
55
|
+
serverData,
|
|
56
|
+
} = normalizeScanData(scan);
|
|
57
|
+
|
|
58
|
+
return (
|
|
59
|
+
<div
|
|
60
|
+
style={{
|
|
61
|
+
background: colors.bgCard,
|
|
62
|
+
border: `1px solid ${colors.borderLight}`,
|
|
63
|
+
borderRadius: '8px',
|
|
64
|
+
padding: '24px',
|
|
65
|
+
boxShadow: `0 1px 3px ${colors.shadowSm}`,
|
|
66
|
+
position: 'relative',
|
|
67
|
+
}}
|
|
68
|
+
>
|
|
69
|
+
<ScanDetailHeader scanId={scanId} serverName={serverName} onClose={onClose} />
|
|
70
|
+
|
|
71
|
+
<div style={{ display: 'flex', flexDirection: 'column', gap: '16px' }}>
|
|
72
|
+
<DebugInfoSection
|
|
73
|
+
scan={scan}
|
|
74
|
+
scanId={scanId}
|
|
75
|
+
serverName={serverName}
|
|
76
|
+
analysisResult={analysisResult}
|
|
77
|
+
/>
|
|
78
|
+
|
|
79
|
+
<ScanOverviewSection
|
|
80
|
+
status={status}
|
|
81
|
+
overallRiskLevel={overallRiskLevel}
|
|
82
|
+
createdAt={createdAt}
|
|
83
|
+
updatedAt={updatedAt}
|
|
84
|
+
/>
|
|
85
|
+
|
|
86
|
+
<ServerInfoSection serverData={serverData} />
|
|
87
|
+
|
|
88
|
+
{analysisResult ? (
|
|
89
|
+
<div style={{ marginBottom: '24px' }}>
|
|
90
|
+
<h3
|
|
91
|
+
style={{
|
|
92
|
+
fontSize: '13px',
|
|
93
|
+
fontWeight: '600',
|
|
94
|
+
color: colors.textPrimary,
|
|
95
|
+
fontFamily: fonts.body,
|
|
96
|
+
marginBottom: '12px',
|
|
97
|
+
paddingBottom: '8px',
|
|
98
|
+
borderBottom: `1px solid ${colors.borderLight}`,
|
|
99
|
+
}}
|
|
100
|
+
>
|
|
101
|
+
Analysis Result
|
|
102
|
+
</h3>
|
|
103
|
+
<AnalysisResult analysis={analysisResult} />
|
|
104
|
+
</div>
|
|
105
|
+
) : (
|
|
106
|
+
<div style={{ marginBottom: '24px' }}>
|
|
107
|
+
<h3
|
|
108
|
+
style={{
|
|
109
|
+
fontSize: '13px',
|
|
110
|
+
fontWeight: '600',
|
|
111
|
+
color: colors.textPrimary,
|
|
112
|
+
fontFamily: fonts.body,
|
|
113
|
+
marginBottom: '12px',
|
|
114
|
+
paddingBottom: '8px',
|
|
115
|
+
borderBottom: `1px solid ${colors.borderLight}`,
|
|
116
|
+
}}
|
|
117
|
+
>
|
|
118
|
+
Analysis Result
|
|
119
|
+
</h3>
|
|
120
|
+
<div
|
|
121
|
+
style={{
|
|
122
|
+
padding: '12px',
|
|
123
|
+
background: colors.bgTertiary + '80',
|
|
124
|
+
borderRadius: '6px',
|
|
125
|
+
border: `1px solid ${colors.borderLight}`,
|
|
126
|
+
fontSize: '12px',
|
|
127
|
+
color: colors.textSecondary,
|
|
128
|
+
fontFamily: fonts.body,
|
|
129
|
+
}}
|
|
130
|
+
>
|
|
131
|
+
No analysis result available for this scan. Check the Raw Data section below to see
|
|
132
|
+
the scan structure.
|
|
133
|
+
</div>
|
|
134
|
+
</div>
|
|
135
|
+
)}
|
|
136
|
+
|
|
137
|
+
<RawDataSection scan={scan} />
|
|
138
|
+
</div>
|
|
139
|
+
</div>
|
|
140
|
+
);
|
|
141
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { colors, fonts } from '../../../theme';
|
|
2
|
+
import { IconRefresh } from '@tabler/icons-react';
|
|
3
|
+
|
|
4
|
+
export default function ScanListHeader({ scanCount, loading, onRefresh }) {
|
|
5
|
+
return (
|
|
6
|
+
<div
|
|
7
|
+
style={{
|
|
8
|
+
display: 'flex',
|
|
9
|
+
justifyContent: 'space-between',
|
|
10
|
+
alignItems: 'center',
|
|
11
|
+
marginBottom: '16px',
|
|
12
|
+
}}
|
|
13
|
+
>
|
|
14
|
+
<h2
|
|
15
|
+
style={{
|
|
16
|
+
fontSize: '14px',
|
|
17
|
+
fontWeight: '600',
|
|
18
|
+
color: colors.textPrimary,
|
|
19
|
+
fontFamily: fonts.body,
|
|
20
|
+
margin: 0,
|
|
21
|
+
}}
|
|
22
|
+
>
|
|
23
|
+
All Scans ({scanCount})
|
|
24
|
+
</h2>
|
|
25
|
+
<button
|
|
26
|
+
onClick={onRefresh}
|
|
27
|
+
disabled={loading}
|
|
28
|
+
style={{
|
|
29
|
+
padding: '6px 12px',
|
|
30
|
+
background: colors.buttonSecondary,
|
|
31
|
+
border: `1px solid ${colors.borderLight}`,
|
|
32
|
+
color: colors.textPrimary,
|
|
33
|
+
borderRadius: '6px',
|
|
34
|
+
fontSize: '12px',
|
|
35
|
+
fontFamily: fonts.body,
|
|
36
|
+
fontWeight: '500',
|
|
37
|
+
cursor: loading ? 'not-allowed' : 'pointer',
|
|
38
|
+
display: 'flex',
|
|
39
|
+
alignItems: 'center',
|
|
40
|
+
gap: '6px',
|
|
41
|
+
opacity: loading ? 0.5 : 1,
|
|
42
|
+
}}
|
|
43
|
+
>
|
|
44
|
+
<IconRefresh size={14} stroke={1.5} />
|
|
45
|
+
Refresh
|
|
46
|
+
</button>
|
|
47
|
+
</div>
|
|
48
|
+
);
|
|
49
|
+
}
|
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
import { useState } from 'react';
|
|
2
|
+
import { colors, fonts } from '../../../theme';
|
|
3
|
+
import { IconChevronRight, IconEye, IconExternalLink } from '@tabler/icons-react';
|
|
4
|
+
import { getRiskLevelColor } from '../utils';
|
|
5
|
+
|
|
6
|
+
export default function ScanListItem({ scan, onSelectScan }) {
|
|
7
|
+
const [isExpanded, setIsExpanded] = useState(false);
|
|
8
|
+
|
|
9
|
+
return (
|
|
10
|
+
<div
|
|
11
|
+
style={{
|
|
12
|
+
background: colors.bgTertiary,
|
|
13
|
+
border: `1px solid ${colors.borderLight}`,
|
|
14
|
+
borderRadius: '8px',
|
|
15
|
+
overflow: 'hidden',
|
|
16
|
+
}}
|
|
17
|
+
>
|
|
18
|
+
<div
|
|
19
|
+
style={{
|
|
20
|
+
padding: '12px 16px',
|
|
21
|
+
display: 'flex',
|
|
22
|
+
alignItems: 'center',
|
|
23
|
+
justifyContent: 'space-between',
|
|
24
|
+
gap: '12px',
|
|
25
|
+
cursor: 'pointer',
|
|
26
|
+
}}
|
|
27
|
+
onClick={() => setIsExpanded(!isExpanded)}
|
|
28
|
+
>
|
|
29
|
+
<div
|
|
30
|
+
style={{
|
|
31
|
+
display: 'flex',
|
|
32
|
+
alignItems: 'center',
|
|
33
|
+
gap: '12px',
|
|
34
|
+
flex: 1,
|
|
35
|
+
minWidth: 0,
|
|
36
|
+
}}
|
|
37
|
+
>
|
|
38
|
+
<IconChevronRight
|
|
39
|
+
size={16}
|
|
40
|
+
stroke={1.5}
|
|
41
|
+
color={colors.textSecondary}
|
|
42
|
+
style={{
|
|
43
|
+
transform: isExpanded ? 'rotate(90deg)' : 'rotate(0deg)',
|
|
44
|
+
transition: 'transform 0.2s',
|
|
45
|
+
}}
|
|
46
|
+
/>
|
|
47
|
+
<div style={{ flex: 1, minWidth: 0 }}>
|
|
48
|
+
<div
|
|
49
|
+
style={{
|
|
50
|
+
fontSize: '13px',
|
|
51
|
+
fontWeight: '600',
|
|
52
|
+
color: colors.textPrimary,
|
|
53
|
+
fontFamily: fonts.body,
|
|
54
|
+
marginBottom: '4px',
|
|
55
|
+
}}
|
|
56
|
+
>
|
|
57
|
+
{scan.server?.name || 'Unknown Server'}
|
|
58
|
+
</div>
|
|
59
|
+
<div
|
|
60
|
+
style={{
|
|
61
|
+
display: 'flex',
|
|
62
|
+
alignItems: 'center',
|
|
63
|
+
gap: '8px',
|
|
64
|
+
flexWrap: 'wrap',
|
|
65
|
+
}}
|
|
66
|
+
>
|
|
67
|
+
{scan.overall_risk_level && (
|
|
68
|
+
<span
|
|
69
|
+
style={{
|
|
70
|
+
padding: '2px 8px',
|
|
71
|
+
borderRadius: '4px',
|
|
72
|
+
fontSize: '10px',
|
|
73
|
+
fontWeight: '700',
|
|
74
|
+
fontFamily: fonts.body,
|
|
75
|
+
background: getRiskLevelColor(scan.overall_risk_level),
|
|
76
|
+
color: colors.textInverse,
|
|
77
|
+
}}
|
|
78
|
+
>
|
|
79
|
+
{scan.overall_risk_level.toLowerCase()}
|
|
80
|
+
</span>
|
|
81
|
+
)}
|
|
82
|
+
{scan.created_at && (
|
|
83
|
+
<span
|
|
84
|
+
style={{
|
|
85
|
+
fontSize: '11px',
|
|
86
|
+
color: colors.textSecondary,
|
|
87
|
+
fontFamily: fonts.body,
|
|
88
|
+
}}
|
|
89
|
+
>
|
|
90
|
+
{new Date(scan.created_at).toLocaleString()}
|
|
91
|
+
</span>
|
|
92
|
+
)}
|
|
93
|
+
</div>
|
|
94
|
+
</div>
|
|
95
|
+
</div>
|
|
96
|
+
<div
|
|
97
|
+
style={{
|
|
98
|
+
display: 'flex',
|
|
99
|
+
alignItems: 'center',
|
|
100
|
+
gap: '8px',
|
|
101
|
+
flexShrink: 0,
|
|
102
|
+
}}
|
|
103
|
+
onClick={(e) => e.stopPropagation()}
|
|
104
|
+
>
|
|
105
|
+
<button
|
|
106
|
+
onClick={() => {
|
|
107
|
+
onSelectScan(scan.id);
|
|
108
|
+
}}
|
|
109
|
+
style={{
|
|
110
|
+
padding: '6px 12px',
|
|
111
|
+
background: colors.buttonPrimary,
|
|
112
|
+
border: 'none',
|
|
113
|
+
color: colors.textInverse,
|
|
114
|
+
borderRadius: '6px',
|
|
115
|
+
fontSize: '11px',
|
|
116
|
+
fontFamily: fonts.body,
|
|
117
|
+
fontWeight: '500',
|
|
118
|
+
cursor: 'pointer',
|
|
119
|
+
display: 'flex',
|
|
120
|
+
alignItems: 'center',
|
|
121
|
+
gap: '6px',
|
|
122
|
+
}}
|
|
123
|
+
>
|
|
124
|
+
<IconEye size={12} stroke={1.5} />
|
|
125
|
+
View
|
|
126
|
+
</button>
|
|
127
|
+
<a
|
|
128
|
+
href={`https://smart.mcpshark.sh/scan-results?id=${scan.id}`}
|
|
129
|
+
target="_blank"
|
|
130
|
+
rel="noopener noreferrer"
|
|
131
|
+
style={{
|
|
132
|
+
padding: '6px 12px',
|
|
133
|
+
background: colors.bgSecondary,
|
|
134
|
+
border: `1px solid ${colors.borderLight}`,
|
|
135
|
+
color: colors.accentBlue,
|
|
136
|
+
borderRadius: '6px',
|
|
137
|
+
fontSize: '11px',
|
|
138
|
+
fontFamily: fonts.body,
|
|
139
|
+
fontWeight: '500',
|
|
140
|
+
textDecoration: 'none',
|
|
141
|
+
cursor: 'pointer',
|
|
142
|
+
display: 'flex',
|
|
143
|
+
alignItems: 'center',
|
|
144
|
+
gap: '6px',
|
|
145
|
+
}}
|
|
146
|
+
>
|
|
147
|
+
<IconExternalLink size={12} stroke={1.5} />
|
|
148
|
+
Open
|
|
149
|
+
</a>
|
|
150
|
+
</div>
|
|
151
|
+
</div>
|
|
152
|
+
|
|
153
|
+
{isExpanded && (
|
|
154
|
+
<div
|
|
155
|
+
style={{
|
|
156
|
+
padding: '12px 16px',
|
|
157
|
+
borderTop: `1px solid ${colors.borderLight}`,
|
|
158
|
+
background: colors.bgSecondary,
|
|
159
|
+
}}
|
|
160
|
+
>
|
|
161
|
+
<div
|
|
162
|
+
style={{
|
|
163
|
+
display: 'grid',
|
|
164
|
+
gridTemplateColumns: 'repeat(auto-fit, minmax(200px, 1fr))',
|
|
165
|
+
gap: '12px',
|
|
166
|
+
fontSize: '12px',
|
|
167
|
+
fontFamily: fonts.body,
|
|
168
|
+
}}
|
|
169
|
+
>
|
|
170
|
+
<div>
|
|
171
|
+
<div style={{ color: colors.textTertiary, marginBottom: '4px' }}>Scan ID</div>
|
|
172
|
+
<div style={{ color: colors.textPrimary, fontWeight: '500' }}>{scan.id}</div>
|
|
173
|
+
</div>
|
|
174
|
+
{scan.server?.name && (
|
|
175
|
+
<div>
|
|
176
|
+
<div style={{ color: colors.textTertiary, marginBottom: '4px' }}>Server</div>
|
|
177
|
+
<div style={{ color: colors.textPrimary, fontWeight: '500' }}>
|
|
178
|
+
{scan.server.name}
|
|
179
|
+
</div>
|
|
180
|
+
</div>
|
|
181
|
+
)}
|
|
182
|
+
{scan.status && (
|
|
183
|
+
<div>
|
|
184
|
+
<div style={{ color: colors.textTertiary, marginBottom: '4px' }}>Status</div>
|
|
185
|
+
<div style={{ color: colors.textPrimary, fontWeight: '500' }}>{scan.status}</div>
|
|
186
|
+
</div>
|
|
187
|
+
)}
|
|
188
|
+
{scan.created_at && (
|
|
189
|
+
<div>
|
|
190
|
+
<div style={{ color: colors.textTertiary, marginBottom: '4px' }}>Created</div>
|
|
191
|
+
<div style={{ color: colors.textPrimary, fontWeight: '500' }}>
|
|
192
|
+
{new Date(scan.created_at).toLocaleString()}
|
|
193
|
+
</div>
|
|
194
|
+
</div>
|
|
195
|
+
)}
|
|
196
|
+
</div>
|
|
197
|
+
</div>
|
|
198
|
+
)}
|
|
199
|
+
</div>
|
|
200
|
+
);
|
|
201
|
+
}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { colors, fonts } from '../../theme';
|
|
2
|
+
import ScanListHeader from './ScanListView/ScanListHeader';
|
|
3
|
+
import ScanListItem from './ScanListView/ScanListItem';
|
|
4
|
+
|
|
5
|
+
export default function ScanListView({ scans, loading, onRefresh, onSelectScan }) {
|
|
6
|
+
if (loading) {
|
|
7
|
+
return (
|
|
8
|
+
<div
|
|
9
|
+
style={{
|
|
10
|
+
background: colors.bgCard,
|
|
11
|
+
border: `1px solid ${colors.borderLight}`,
|
|
12
|
+
borderRadius: '8px',
|
|
13
|
+
padding: '24px',
|
|
14
|
+
textAlign: 'center',
|
|
15
|
+
}}
|
|
16
|
+
>
|
|
17
|
+
<p style={{ color: colors.textSecondary, fontFamily: fonts.body }}>Loading scans...</p>
|
|
18
|
+
</div>
|
|
19
|
+
);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
if (!scans || scans.length === 0) {
|
|
23
|
+
return (
|
|
24
|
+
<div
|
|
25
|
+
style={{
|
|
26
|
+
background: colors.bgCard,
|
|
27
|
+
border: `1px solid ${colors.borderLight}`,
|
|
28
|
+
borderRadius: '8px',
|
|
29
|
+
padding: '24px',
|
|
30
|
+
textAlign: 'center',
|
|
31
|
+
}}
|
|
32
|
+
>
|
|
33
|
+
<p style={{ color: colors.textSecondary, fontFamily: fonts.body }}>
|
|
34
|
+
No scans found. Run a scan to see results here.
|
|
35
|
+
</p>
|
|
36
|
+
</div>
|
|
37
|
+
);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
return (
|
|
41
|
+
<div
|
|
42
|
+
style={{
|
|
43
|
+
background: colors.bgCard,
|
|
44
|
+
border: `1px solid ${colors.borderLight}`,
|
|
45
|
+
borderRadius: '8px',
|
|
46
|
+
padding: '20px',
|
|
47
|
+
boxShadow: `0 1px 3px ${colors.shadowSm}`,
|
|
48
|
+
}}
|
|
49
|
+
>
|
|
50
|
+
<ScanListHeader scanCount={scans.length} loading={loading} onRefresh={onRefresh} />
|
|
51
|
+
<div
|
|
52
|
+
style={{
|
|
53
|
+
padding: '8px 12px',
|
|
54
|
+
background: colors.bgSecondary,
|
|
55
|
+
border: `1px solid ${colors.borderLight}`,
|
|
56
|
+
borderRadius: '6px',
|
|
57
|
+
marginBottom: '16px',
|
|
58
|
+
fontSize: '11px',
|
|
59
|
+
color: colors.textSecondary,
|
|
60
|
+
fontFamily: fonts.body,
|
|
61
|
+
fontStyle: 'italic',
|
|
62
|
+
}}
|
|
63
|
+
>
|
|
64
|
+
ℹ️ These results are from local cache. Run a new scan to see the latest results.
|
|
65
|
+
</div>
|
|
66
|
+
<div style={{ display: 'flex', flexDirection: 'column', gap: '8px' }}>
|
|
67
|
+
{scans.map((scan) => (
|
|
68
|
+
<ScanListItem key={scan.id} scan={scan} onSelectScan={onSelectScan} />
|
|
69
|
+
))}
|
|
70
|
+
</div>
|
|
71
|
+
</div>
|
|
72
|
+
);
|
|
73
|
+
}
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import { colors, fonts } from '../../theme';
|
|
2
|
+
import { getRiskLevelColor } from './utils';
|
|
3
|
+
|
|
4
|
+
export default function ScanOverviewSection({ status, overallRiskLevel, createdAt, updatedAt }) {
|
|
5
|
+
const formatDate = (dateString) => {
|
|
6
|
+
if (!dateString) return 'N/A';
|
|
7
|
+
return new Date(dateString).toLocaleString();
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
return (
|
|
11
|
+
<div
|
|
12
|
+
style={{
|
|
13
|
+
display: 'grid',
|
|
14
|
+
gridTemplateColumns: 'repeat(auto-fit, minmax(200px, 1fr))',
|
|
15
|
+
gap: '16px',
|
|
16
|
+
padding: '16px',
|
|
17
|
+
background: colors.bgTertiary,
|
|
18
|
+
borderRadius: '8px',
|
|
19
|
+
}}
|
|
20
|
+
>
|
|
21
|
+
{status && (
|
|
22
|
+
<div>
|
|
23
|
+
<div
|
|
24
|
+
style={{
|
|
25
|
+
fontSize: '11px',
|
|
26
|
+
color: colors.textTertiary,
|
|
27
|
+
fontFamily: fonts.body,
|
|
28
|
+
marginBottom: '4px',
|
|
29
|
+
}}
|
|
30
|
+
>
|
|
31
|
+
Status
|
|
32
|
+
</div>
|
|
33
|
+
<div
|
|
34
|
+
style={{
|
|
35
|
+
fontSize: '13px',
|
|
36
|
+
color: colors.textPrimary,
|
|
37
|
+
fontFamily: fonts.body,
|
|
38
|
+
fontWeight: '500',
|
|
39
|
+
}}
|
|
40
|
+
>
|
|
41
|
+
{status}
|
|
42
|
+
</div>
|
|
43
|
+
</div>
|
|
44
|
+
)}
|
|
45
|
+
{overallRiskLevel && (
|
|
46
|
+
<div>
|
|
47
|
+
<div
|
|
48
|
+
style={{
|
|
49
|
+
fontSize: '11px',
|
|
50
|
+
color: colors.textTertiary,
|
|
51
|
+
fontFamily: fonts.body,
|
|
52
|
+
marginBottom: '4px',
|
|
53
|
+
}}
|
|
54
|
+
>
|
|
55
|
+
Overall Risk Level
|
|
56
|
+
</div>
|
|
57
|
+
<span
|
|
58
|
+
style={{
|
|
59
|
+
padding: '4px 10px',
|
|
60
|
+
borderRadius: '6px',
|
|
61
|
+
fontSize: '11px',
|
|
62
|
+
fontWeight: '700',
|
|
63
|
+
fontFamily: fonts.body,
|
|
64
|
+
background: getRiskLevelColor(overallRiskLevel),
|
|
65
|
+
color: colors.textInverse,
|
|
66
|
+
display: 'inline-block',
|
|
67
|
+
}}
|
|
68
|
+
>
|
|
69
|
+
{overallRiskLevel.toLowerCase()}
|
|
70
|
+
</span>
|
|
71
|
+
</div>
|
|
72
|
+
)}
|
|
73
|
+
{createdAt && (
|
|
74
|
+
<div>
|
|
75
|
+
<div
|
|
76
|
+
style={{
|
|
77
|
+
fontSize: '11px',
|
|
78
|
+
color: colors.textTertiary,
|
|
79
|
+
fontFamily: fonts.body,
|
|
80
|
+
marginBottom: '4px',
|
|
81
|
+
}}
|
|
82
|
+
>
|
|
83
|
+
Created At
|
|
84
|
+
</div>
|
|
85
|
+
<div
|
|
86
|
+
style={{
|
|
87
|
+
fontSize: '13px',
|
|
88
|
+
color: colors.textPrimary,
|
|
89
|
+
fontFamily: fonts.body,
|
|
90
|
+
fontWeight: '500',
|
|
91
|
+
}}
|
|
92
|
+
>
|
|
93
|
+
{formatDate(createdAt)}
|
|
94
|
+
</div>
|
|
95
|
+
</div>
|
|
96
|
+
)}
|
|
97
|
+
{updatedAt && (
|
|
98
|
+
<div>
|
|
99
|
+
<div
|
|
100
|
+
style={{
|
|
101
|
+
fontSize: '11px',
|
|
102
|
+
color: colors.textTertiary,
|
|
103
|
+
fontFamily: fonts.body,
|
|
104
|
+
marginBottom: '4px',
|
|
105
|
+
}}
|
|
106
|
+
>
|
|
107
|
+
Updated At
|
|
108
|
+
</div>
|
|
109
|
+
<div
|
|
110
|
+
style={{
|
|
111
|
+
fontSize: '13px',
|
|
112
|
+
color: colors.textPrimary,
|
|
113
|
+
fontFamily: fonts.body,
|
|
114
|
+
fontWeight: '500',
|
|
115
|
+
}}
|
|
116
|
+
>
|
|
117
|
+
{formatDate(updatedAt)}
|
|
118
|
+
</div>
|
|
119
|
+
</div>
|
|
120
|
+
)}
|
|
121
|
+
</div>
|
|
122
|
+
);
|
|
123
|
+
}
|