@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.
Files changed (212) hide show
  1. package/LICENSE +85 -0
  2. package/README.md +724 -0
  3. package/bin/mcp-shark.js +93 -0
  4. package/mcp-server/.editorconfig +15 -0
  5. package/mcp-server/.prettierignore +11 -0
  6. package/mcp-server/.prettierrc +12 -0
  7. package/mcp-server/README.md +280 -0
  8. package/mcp-server/commitlint.config.cjs +42 -0
  9. package/mcp-server/eslint.config.js +131 -0
  10. package/mcp-server/lib/auditor/audit.js +228 -0
  11. package/mcp-server/lib/common/error.js +15 -0
  12. package/mcp-server/lib/server/external/all.js +32 -0
  13. package/mcp-server/lib/server/external/config.js +59 -0
  14. package/mcp-server/lib/server/external/kv.js +102 -0
  15. package/mcp-server/lib/server/external/single/client.js +35 -0
  16. package/mcp-server/lib/server/external/single/request.js +49 -0
  17. package/mcp-server/lib/server/external/single/run.js +75 -0
  18. package/mcp-server/lib/server/external/single/transport.js +57 -0
  19. package/mcp-server/lib/server/internal/handlers/common.js +20 -0
  20. package/mcp-server/lib/server/internal/handlers/error.js +7 -0
  21. package/mcp-server/lib/server/internal/handlers/prompts-get.js +22 -0
  22. package/mcp-server/lib/server/internal/handlers/prompts-list.js +12 -0
  23. package/mcp-server/lib/server/internal/handlers/resources-list.js +12 -0
  24. package/mcp-server/lib/server/internal/handlers/resources-read.js +19 -0
  25. package/mcp-server/lib/server/internal/handlers/tools-call.js +37 -0
  26. package/mcp-server/lib/server/internal/handlers/tools-list.js +14 -0
  27. package/mcp-server/lib/server/internal/run.js +49 -0
  28. package/mcp-server/lib/server/internal/server.js +63 -0
  29. package/mcp-server/lib/server/internal/session.js +39 -0
  30. package/mcp-server/mcp-shark.js +72 -0
  31. package/mcp-server/package-lock.json +4784 -0
  32. package/mcp-server/package.json +30 -0
  33. package/package.json +103 -0
  34. package/ui/README.md +212 -0
  35. package/ui/index.html +16 -0
  36. package/ui/package-lock.json +3574 -0
  37. package/ui/package.json +12 -0
  38. package/ui/paths.js +282 -0
  39. package/ui/public/og-image.png +0 -0
  40. package/ui/server/routes/backups.js +251 -0
  41. package/ui/server/routes/composite.js +244 -0
  42. package/ui/server/routes/config.js +175 -0
  43. package/ui/server/routes/conversations.js +25 -0
  44. package/ui/server/routes/help.js +43 -0
  45. package/ui/server/routes/logs.js +32 -0
  46. package/ui/server/routes/playground.js +152 -0
  47. package/ui/server/routes/requests.js +235 -0
  48. package/ui/server/routes/sessions.js +27 -0
  49. package/ui/server/routes/smartscan/discover.js +117 -0
  50. package/ui/server/routes/smartscan/scans/clearCache.js +22 -0
  51. package/ui/server/routes/smartscan/scans/createBatchScans.js +123 -0
  52. package/ui/server/routes/smartscan/scans/createScan.js +42 -0
  53. package/ui/server/routes/smartscan/scans/getCachedResults.js +51 -0
  54. package/ui/server/routes/smartscan/scans/getScan.js +41 -0
  55. package/ui/server/routes/smartscan/scans/listScans.js +24 -0
  56. package/ui/server/routes/smartscan/scans.js +13 -0
  57. package/ui/server/routes/smartscan/token.js +56 -0
  58. package/ui/server/routes/smartscan/transport.js +53 -0
  59. package/ui/server/routes/smartscan.js +24 -0
  60. package/ui/server/routes/statistics.js +83 -0
  61. package/ui/server/utils/config-update.js +212 -0
  62. package/ui/server/utils/config.js +98 -0
  63. package/ui/server/utils/paths.js +23 -0
  64. package/ui/server/utils/port.js +28 -0
  65. package/ui/server/utils/process.js +80 -0
  66. package/ui/server/utils/scan-cache/all-results.js +180 -0
  67. package/ui/server/utils/scan-cache/directory.js +35 -0
  68. package/ui/server/utils/scan-cache/file-operations.js +104 -0
  69. package/ui/server/utils/scan-cache/hash.js +47 -0
  70. package/ui/server/utils/scan-cache/server-operations.js +80 -0
  71. package/ui/server/utils/scan-cache.js +12 -0
  72. package/ui/server/utils/serialization.js +13 -0
  73. package/ui/server/utils/smartscan-token.js +42 -0
  74. package/ui/server.js +199 -0
  75. package/ui/src/App.jsx +153 -0
  76. package/ui/src/CompositeLogs.jsx +164 -0
  77. package/ui/src/CompositeSetup.jsx +285 -0
  78. package/ui/src/HelpGuide/HelpGuideContent.jsx +118 -0
  79. package/ui/src/HelpGuide/HelpGuideFooter.jsx +58 -0
  80. package/ui/src/HelpGuide/HelpGuideHeader.jsx +56 -0
  81. package/ui/src/HelpGuide.jsx +65 -0
  82. package/ui/src/IntroTour.jsx +140 -0
  83. package/ui/src/LogDetail.jsx +122 -0
  84. package/ui/src/LogTable.jsx +242 -0
  85. package/ui/src/PacketDetail.jsx +190 -0
  86. package/ui/src/PacketFilters.jsx +222 -0
  87. package/ui/src/PacketList.jsx +183 -0
  88. package/ui/src/SmartScan.jsx +178 -0
  89. package/ui/src/TabNavigation.jsx +143 -0
  90. package/ui/src/components/App/HelpButton.jsx +64 -0
  91. package/ui/src/components/App/TrafficTab.jsx +69 -0
  92. package/ui/src/components/App/useAppState.js +163 -0
  93. package/ui/src/components/BackupList.jsx +192 -0
  94. package/ui/src/components/CollapsibleSection.jsx +82 -0
  95. package/ui/src/components/ConfigFileSection.jsx +84 -0
  96. package/ui/src/components/ConfigViewerModal.jsx +141 -0
  97. package/ui/src/components/ConfirmationModal.jsx +129 -0
  98. package/ui/src/components/DetailsTab/BodySection.jsx +27 -0
  99. package/ui/src/components/DetailsTab/CollapsibleRequestResponse.jsx +70 -0
  100. package/ui/src/components/DetailsTab/HeadersSection.jsx +25 -0
  101. package/ui/src/components/DetailsTab/InfoSection.jsx +28 -0
  102. package/ui/src/components/DetailsTab/NetworkInfoSection.jsx +63 -0
  103. package/ui/src/components/DetailsTab/ProtocolInfoSection.jsx +75 -0
  104. package/ui/src/components/DetailsTab/RequestDetailsSection.jsx +46 -0
  105. package/ui/src/components/DetailsTab/ResponseDetailsSection.jsx +66 -0
  106. package/ui/src/components/DetailsTab.jsx +31 -0
  107. package/ui/src/components/DetectedPathsList.jsx +171 -0
  108. package/ui/src/components/FileInput.jsx +144 -0
  109. package/ui/src/components/GroupHeader.jsx +76 -0
  110. package/ui/src/components/GroupedByMcpView.jsx +103 -0
  111. package/ui/src/components/GroupedByServerView.jsx +134 -0
  112. package/ui/src/components/GroupedBySessionView.jsx +127 -0
  113. package/ui/src/components/GroupedViews.jsx +2 -0
  114. package/ui/src/components/HexTab.jsx +188 -0
  115. package/ui/src/components/LogsDisplay.jsx +93 -0
  116. package/ui/src/components/LogsToolbar.jsx +193 -0
  117. package/ui/src/components/McpPlayground/LoadingModal.jsx +113 -0
  118. package/ui/src/components/McpPlayground/PromptsSection/PromptCallPanel.jsx +125 -0
  119. package/ui/src/components/McpPlayground/PromptsSection/PromptItem.jsx +48 -0
  120. package/ui/src/components/McpPlayground/PromptsSection/PromptsList.jsx +45 -0
  121. package/ui/src/components/McpPlayground/PromptsSection.jsx +106 -0
  122. package/ui/src/components/McpPlayground/ResourcesSection/ResourceCallPanel.jsx +89 -0
  123. package/ui/src/components/McpPlayground/ResourcesSection/ResourceItem.jsx +59 -0
  124. package/ui/src/components/McpPlayground/ResourcesSection/ResourcesList.jsx +45 -0
  125. package/ui/src/components/McpPlayground/ResourcesSection.jsx +91 -0
  126. package/ui/src/components/McpPlayground/ToolsSection/ToolCallPanel.jsx +125 -0
  127. package/ui/src/components/McpPlayground/ToolsSection/ToolItem.jsx +48 -0
  128. package/ui/src/components/McpPlayground/ToolsSection/ToolsList.jsx +45 -0
  129. package/ui/src/components/McpPlayground/ToolsSection.jsx +107 -0
  130. package/ui/src/components/McpPlayground/common/EmptyState.jsx +17 -0
  131. package/ui/src/components/McpPlayground/common/ErrorState.jsx +17 -0
  132. package/ui/src/components/McpPlayground/common/LoadingState.jsx +17 -0
  133. package/ui/src/components/McpPlayground/useMcpPlayground.js +280 -0
  134. package/ui/src/components/McpPlayground.jsx +171 -0
  135. package/ui/src/components/MessageDisplay.jsx +28 -0
  136. package/ui/src/components/PacketDetailHeader.jsx +88 -0
  137. package/ui/src/components/PacketFilters/ExportControls.jsx +126 -0
  138. package/ui/src/components/PacketFilters/FilterInput.jsx +59 -0
  139. package/ui/src/components/RawTab.jsx +142 -0
  140. package/ui/src/components/RequestRow/OrphanedResponseRow.jsx +155 -0
  141. package/ui/src/components/RequestRow/RequestRowMain.jsx +240 -0
  142. package/ui/src/components/RequestRow/ResponseRow.jsx +158 -0
  143. package/ui/src/components/RequestRow.jsx +70 -0
  144. package/ui/src/components/ServerControl.jsx +133 -0
  145. package/ui/src/components/ServiceSelector.jsx +209 -0
  146. package/ui/src/components/SetupHeader.jsx +30 -0
  147. package/ui/src/components/SharkLogo.jsx +21 -0
  148. package/ui/src/components/SmartScan/AnalysisResult.jsx +64 -0
  149. package/ui/src/components/SmartScan/BatchResultsDisplay/BatchResultItem.jsx +215 -0
  150. package/ui/src/components/SmartScan/BatchResultsDisplay/BatchResultsHeader.jsx +94 -0
  151. package/ui/src/components/SmartScan/BatchResultsDisplay.jsx +26 -0
  152. package/ui/src/components/SmartScan/DebugInfoSection.jsx +53 -0
  153. package/ui/src/components/SmartScan/EmptyState.jsx +57 -0
  154. package/ui/src/components/SmartScan/ErrorDisplay.jsx +48 -0
  155. package/ui/src/components/SmartScan/ExpandableSection.jsx +93 -0
  156. package/ui/src/components/SmartScan/FindingsTable.jsx +257 -0
  157. package/ui/src/components/SmartScan/ListViewContent.jsx +75 -0
  158. package/ui/src/components/SmartScan/NotablePatternsSection.jsx +75 -0
  159. package/ui/src/components/SmartScan/OverallSummarySection.jsx +72 -0
  160. package/ui/src/components/SmartScan/RawDataSection.jsx +52 -0
  161. package/ui/src/components/SmartScan/RecommendationsSection.jsx +78 -0
  162. package/ui/src/components/SmartScan/ScanDetailHeader.jsx +92 -0
  163. package/ui/src/components/SmartScan/ScanDetailView.jsx +141 -0
  164. package/ui/src/components/SmartScan/ScanListView/ScanListHeader.jsx +49 -0
  165. package/ui/src/components/SmartScan/ScanListView/ScanListItem.jsx +201 -0
  166. package/ui/src/components/SmartScan/ScanListView.jsx +73 -0
  167. package/ui/src/components/SmartScan/ScanOverviewSection.jsx +123 -0
  168. package/ui/src/components/SmartScan/ScanResultsDisplay.jsx +35 -0
  169. package/ui/src/components/SmartScan/ScanViewContent.jsx +68 -0
  170. package/ui/src/components/SmartScan/ScanningProgress.jsx +47 -0
  171. package/ui/src/components/SmartScan/ServerInfoSection.jsx +43 -0
  172. package/ui/src/components/SmartScan/ServerSelectionRow.jsx +207 -0
  173. package/ui/src/components/SmartScan/SingleResultDisplay.jsx +269 -0
  174. package/ui/src/components/SmartScan/SmartScanControls.jsx +290 -0
  175. package/ui/src/components/SmartScan/SmartScanHeader.jsx +77 -0
  176. package/ui/src/components/SmartScan/ViewModeTabs.jsx +57 -0
  177. package/ui/src/components/SmartScan/hooks/useCacheManagement.js +34 -0
  178. package/ui/src/components/SmartScan/hooks/useMcpDiscovery.js +121 -0
  179. package/ui/src/components/SmartScan/hooks/useScanList.js +193 -0
  180. package/ui/src/components/SmartScan/hooks/useScanOperations.js +87 -0
  181. package/ui/src/components/SmartScan/hooks/useServerStatus.js +26 -0
  182. package/ui/src/components/SmartScan/hooks/useTokenManagement.js +53 -0
  183. package/ui/src/components/SmartScan/scanDataUtils.js +98 -0
  184. package/ui/src/components/SmartScan/useSmartScan.js +72 -0
  185. package/ui/src/components/SmartScan/utils.js +19 -0
  186. package/ui/src/components/SmartScanIcons.jsx +58 -0
  187. package/ui/src/components/TabNavigation/DesktopTabs.jsx +111 -0
  188. package/ui/src/components/TabNavigation/MobileDropdown.jsx +140 -0
  189. package/ui/src/components/TabNavigation.jsx +97 -0
  190. package/ui/src/components/TabNavigationIcons.jsx +40 -0
  191. package/ui/src/components/TableHeader.jsx +164 -0
  192. package/ui/src/components/TourOverlay.jsx +117 -0
  193. package/ui/src/components/TourTooltip/TourTooltipButtons.jsx +117 -0
  194. package/ui/src/components/TourTooltip/TourTooltipHeader.jsx +70 -0
  195. package/ui/src/components/TourTooltip/TourTooltipIcons.jsx +45 -0
  196. package/ui/src/components/TourTooltip/useTooltipPosition.js +108 -0
  197. package/ui/src/components/TourTooltip.jsx +83 -0
  198. package/ui/src/components/ViewModeTabs.jsx +91 -0
  199. package/ui/src/components/WhatThisDoesSection.jsx +61 -0
  200. package/ui/src/config/tourSteps.jsx +141 -0
  201. package/ui/src/hooks/useAnimation.js +92 -0
  202. package/ui/src/hooks/useConfigManagement.js +124 -0
  203. package/ui/src/hooks/useServiceExtraction.js +51 -0
  204. package/ui/src/index.css +42 -0
  205. package/ui/src/main.jsx +10 -0
  206. package/ui/src/theme.js +65 -0
  207. package/ui/src/utils/animations.js +170 -0
  208. package/ui/src/utils/groupingUtils.js +93 -0
  209. package/ui/src/utils/hexUtils.js +24 -0
  210. package/ui/src/utils/mcpGroupingUtils.js +262 -0
  211. package/ui/src/utils/requestUtils.js +297 -0
  212. package/ui/vite.config.js +18 -0
@@ -0,0 +1,111 @@
1
+ import { useEffect, useRef } from 'react';
2
+ import { colors, fonts } from '../../theme';
3
+ import anime from 'animejs';
4
+
5
+ export default function DesktopTabs({ tabs, activeTab, onTabChange, tabRefs, indicatorRef }) {
6
+ useEffect(() => {
7
+ const activeTabElement = tabRefs.current[activeTab];
8
+ if (activeTabElement && indicatorRef.current) {
9
+ const { offsetLeft, offsetWidth } = activeTabElement;
10
+ anime({
11
+ targets: indicatorRef.current,
12
+ left: offsetLeft,
13
+ width: offsetWidth,
14
+ duration: 400,
15
+ easing: 'easeOutExpo',
16
+ });
17
+ }
18
+ }, [activeTab, tabRefs, indicatorRef]);
19
+
20
+ return (
21
+ <div style={{ position: 'relative', display: 'flex', flex: 1 }}>
22
+ {tabs.map((tab) => (
23
+ <button
24
+ key={tab.id}
25
+ ref={(el) => (tabRefs.current[tab.id] = el)}
26
+ data-tour={
27
+ tab.id === 'traffic'
28
+ ? 'traffic-tab'
29
+ : tab.id === 'logs'
30
+ ? 'logs-tab'
31
+ : tab.id === 'setup'
32
+ ? 'setup-tab'
33
+ : tab.id === 'playground'
34
+ ? 'playground-tab'
35
+ : 'smart-scan-tab'
36
+ }
37
+ onClick={() => onTabChange(tab.id)}
38
+ style={{
39
+ padding: '14px 24px',
40
+ background: activeTab === tab.id ? colors.bgSecondary : 'transparent',
41
+ border: 'none',
42
+ borderBottom: '3px solid transparent',
43
+ color: activeTab === tab.id ? colors.textPrimary : colors.textSecondary,
44
+ cursor: 'pointer',
45
+ fontSize: '13px',
46
+ fontFamily: fonts.body,
47
+ fontWeight: activeTab === tab.id ? '600' : '400',
48
+ display: 'flex',
49
+ flexDirection: 'column',
50
+ alignItems: 'flex-start',
51
+ gap: '4px',
52
+ position: 'relative',
53
+ borderRadius: '8px 8px 0 0',
54
+ zIndex: 1,
55
+ }}
56
+ onMouseEnter={(e) => {
57
+ if (activeTab !== tab.id) {
58
+ anime({
59
+ targets: e.currentTarget,
60
+ background: colors.bgHover,
61
+ color: colors.textPrimary,
62
+ duration: 200,
63
+ easing: 'easeOutQuad',
64
+ });
65
+ }
66
+ }}
67
+ onMouseLeave={(e) => {
68
+ if (activeTab !== tab.id) {
69
+ anime({
70
+ targets: e.currentTarget,
71
+ background: 'transparent',
72
+ color: colors.textSecondary,
73
+ duration: 200,
74
+ easing: 'easeOutQuad',
75
+ });
76
+ }
77
+ }}
78
+ >
79
+ <div style={{ display: 'flex', alignItems: 'center', gap: '8px' }}>
80
+ <div style={{ display: 'flex', alignItems: 'center', color: 'currentColor' }}>
81
+ <tab.icon size={16} />
82
+ </div>
83
+ <span>{tab.label}</span>
84
+ </div>
85
+ <div
86
+ style={{
87
+ fontSize: '11px',
88
+ color: activeTab === tab.id ? colors.textSecondary : colors.textTertiary,
89
+ fontWeight: '400',
90
+ fontFamily: fonts.body,
91
+ }}
92
+ >
93
+ {tab.description}
94
+ </div>
95
+ </button>
96
+ ))}
97
+ <div
98
+ ref={indicatorRef}
99
+ style={{
100
+ position: 'absolute',
101
+ bottom: 0,
102
+ height: '3px',
103
+ background: colors.accentBlue,
104
+ borderRadius: '3px 3px 0 0',
105
+ zIndex: 2,
106
+ pointerEvents: 'none',
107
+ }}
108
+ />
109
+ </div>
110
+ );
111
+ }
@@ -0,0 +1,140 @@
1
+ import { colors, fonts } from '../../theme';
2
+ import { MenuIcon, ChevronDownIcon } from '../TabNavigationIcons';
3
+
4
+ export default function MobileDropdown({
5
+ tabs,
6
+ activeTab,
7
+ onTabChange,
8
+ isDropdownOpen,
9
+ setIsDropdownOpen,
10
+ dropdownRef,
11
+ }) {
12
+ return (
13
+ <div
14
+ style={{ position: 'relative', flex: 1, display: 'flex', justifyContent: 'flex-end' }}
15
+ ref={dropdownRef}
16
+ >
17
+ <button
18
+ onClick={() => setIsDropdownOpen(!isDropdownOpen)}
19
+ style={{
20
+ display: 'flex',
21
+ alignItems: 'center',
22
+ gap: '8px',
23
+ padding: '10px 16px',
24
+ background: isDropdownOpen ? colors.bgSecondary : 'transparent',
25
+ border: 'none',
26
+ borderRadius: '8px',
27
+ color: colors.textPrimary,
28
+ cursor: 'pointer',
29
+ fontSize: '14px',
30
+ fontFamily: fonts.body,
31
+ fontWeight: '500',
32
+ }}
33
+ onMouseEnter={(e) => {
34
+ if (!isDropdownOpen) {
35
+ e.currentTarget.style.background = colors.bgHover;
36
+ }
37
+ }}
38
+ onMouseLeave={(e) => {
39
+ if (!isDropdownOpen) {
40
+ e.currentTarget.style.background = 'transparent';
41
+ }
42
+ }}
43
+ >
44
+ <MenuIcon size={18} color={colors.textPrimary} />
45
+ <span>{tabs.find((t) => t.id === activeTab)?.label || 'Menu'}</span>
46
+ <div
47
+ style={{
48
+ transform: isDropdownOpen ? 'rotate(180deg)' : 'rotate(0deg)',
49
+ transition: 'transform 0.2s',
50
+ display: 'flex',
51
+ alignItems: 'center',
52
+ }}
53
+ >
54
+ <ChevronDownIcon size={14} color={colors.textPrimary} />
55
+ </div>
56
+ </button>
57
+ {isDropdownOpen && (
58
+ <div
59
+ style={{
60
+ position: 'absolute',
61
+ top: '100%',
62
+ right: 0,
63
+ marginTop: '8px',
64
+ background: colors.bgCard,
65
+ border: `1px solid ${colors.borderLight}`,
66
+ borderRadius: '8px',
67
+ boxShadow: `0 4px 12px ${colors.shadowSm}`,
68
+ minWidth: '280px',
69
+ zIndex: 1000,
70
+ overflow: 'hidden',
71
+ }}
72
+ >
73
+ {tabs.map((tab) => {
74
+ const Icon = tab.icon;
75
+ return (
76
+ <button
77
+ key={tab.id}
78
+ onClick={() => {
79
+ onTabChange(tab.id);
80
+ setIsDropdownOpen(false);
81
+ }}
82
+ style={{
83
+ width: '100%',
84
+ padding: '14px 16px',
85
+ background: activeTab === tab.id ? colors.bgSecondary : 'transparent',
86
+ border: 'none',
87
+ borderLeft:
88
+ activeTab === tab.id
89
+ ? `3px solid ${colors.accentBlue}`
90
+ : '3px solid transparent',
91
+ color: activeTab === tab.id ? colors.textPrimary : colors.textSecondary,
92
+ cursor: 'pointer',
93
+ fontSize: '13px',
94
+ fontFamily: fonts.body,
95
+ fontWeight: activeTab === tab.id ? '600' : '400',
96
+ display: 'flex',
97
+ flexDirection: 'column',
98
+ alignItems: 'flex-start',
99
+ gap: '4px',
100
+ textAlign: 'left',
101
+ transition: 'all 0.2s',
102
+ }}
103
+ onMouseEnter={(e) => {
104
+ if (activeTab !== tab.id) {
105
+ e.currentTarget.style.background = colors.bgHover;
106
+ e.currentTarget.style.color = colors.textPrimary;
107
+ }
108
+ }}
109
+ onMouseLeave={(e) => {
110
+ if (activeTab !== tab.id) {
111
+ e.currentTarget.style.background = 'transparent';
112
+ e.currentTarget.style.color = colors.textSecondary;
113
+ }
114
+ }}
115
+ >
116
+ <div style={{ display: 'flex', alignItems: 'center', gap: '10px', width: '100%' }}>
117
+ <div style={{ display: 'flex', alignItems: 'center', color: 'currentColor' }}>
118
+ <Icon size={16} />
119
+ </div>
120
+ <span style={{ flex: 1 }}>{tab.label}</span>
121
+ </div>
122
+ <div
123
+ style={{
124
+ fontSize: '11px',
125
+ color: activeTab === tab.id ? colors.textSecondary : colors.textTertiary,
126
+ fontWeight: '400',
127
+ fontFamily: fonts.body,
128
+ marginLeft: '26px',
129
+ }}
130
+ >
131
+ {tab.description}
132
+ </div>
133
+ </button>
134
+ );
135
+ })}
136
+ </div>
137
+ )}
138
+ </div>
139
+ );
140
+ }
@@ -0,0 +1,97 @@
1
+ import { useEffect, useRef } from 'react';
2
+ import { colors, fonts } from '../theme';
3
+ import anime from 'animejs';
4
+
5
+ function TabNavigation({ tabs, activeTab, onTabChange }) {
6
+ const tabRefs = useRef({});
7
+ const indicatorRef = useRef(null);
8
+
9
+ useEffect(() => {
10
+ const activeTabElement = tabRefs.current[activeTab];
11
+ if (activeTabElement && indicatorRef.current) {
12
+ const { offsetLeft, offsetWidth } = activeTabElement;
13
+ anime({
14
+ targets: indicatorRef.current,
15
+ left: offsetLeft,
16
+ width: offsetWidth,
17
+ duration: 300,
18
+ easing: 'easeOutExpo',
19
+ });
20
+ }
21
+ }, [activeTab, tabs]);
22
+
23
+ return (
24
+ <div
25
+ style={{
26
+ display: 'flex',
27
+ borderBottom: `1px solid ${colors.borderLight}`,
28
+ background: `${colors.bgCard}CC`, // 80% opacity for backdrop blur effect
29
+ backdropFilter: 'blur(8px)',
30
+ WebkitBackdropFilter: 'blur(8px)',
31
+ position: 'relative',
32
+ boxShadow: `0 1px 3px ${colors.shadowSm}`,
33
+ }}
34
+ >
35
+ {tabs.map((tab) => (
36
+ <button
37
+ key={tab}
38
+ ref={(el) => (tabRefs.current[tab] = el)}
39
+ onClick={() => onTabChange(tab)}
40
+ style={{
41
+ padding: '10px 18px',
42
+ background: activeTab === tab ? colors.bgSecondary : 'transparent',
43
+ border: 'none',
44
+ borderBottom: '2px solid transparent',
45
+ color: activeTab === tab ? colors.textPrimary : colors.textSecondary,
46
+ cursor: 'pointer',
47
+ fontSize: '13px',
48
+ fontFamily: fonts.body,
49
+ fontWeight: activeTab === tab ? '500' : '400',
50
+ textTransform: 'capitalize',
51
+ borderRadius: '8px 8px 0 0',
52
+ transition: 'all 0.2s',
53
+ position: 'relative',
54
+ zIndex: 1,
55
+ }}
56
+ onMouseEnter={(e) => {
57
+ if (activeTab !== tab) {
58
+ anime({
59
+ targets: e.currentTarget,
60
+ background: colors.bgHover,
61
+ color: colors.textPrimary,
62
+ duration: 200,
63
+ easing: 'easeOutQuad',
64
+ });
65
+ }
66
+ }}
67
+ onMouseLeave={(e) => {
68
+ if (activeTab !== tab) {
69
+ anime({
70
+ targets: e.currentTarget,
71
+ background: 'transparent',
72
+ color: colors.textSecondary,
73
+ duration: 200,
74
+ easing: 'easeOutQuad',
75
+ });
76
+ }
77
+ }}
78
+ >
79
+ {tab}
80
+ </button>
81
+ ))}
82
+ <div
83
+ ref={indicatorRef}
84
+ style={{
85
+ position: 'absolute',
86
+ bottom: 0,
87
+ height: '2px',
88
+ background: colors.accentBlue,
89
+ borderRadius: '2px 2px 0 0',
90
+ zIndex: 2,
91
+ }}
92
+ />
93
+ </div>
94
+ );
95
+ }
96
+
97
+ export default TabNavigation;
@@ -0,0 +1,40 @@
1
+ // Tabler Icons for Tab Navigation
2
+ // Using @tabler/icons-react - install with: npm install @tabler/icons-react
3
+ import {
4
+ IconNetwork,
5
+ IconFileText,
6
+ IconSettings,
7
+ IconBrandStackoverflow,
8
+ IconShield,
9
+ IconMenu2,
10
+ IconChevronDown,
11
+ } from '@tabler/icons-react';
12
+
13
+ // Wrapper components to match existing API
14
+ export const NetworkIcon = ({ size = 16, color = 'currentColor' }) => (
15
+ <IconNetwork size={size} stroke={1.5} color={color} />
16
+ );
17
+
18
+ export const LogsIcon = ({ size = 16, color = 'currentColor' }) => (
19
+ <IconFileText size={size} stroke={1.5} color={color} />
20
+ );
21
+
22
+ export const SettingsIcon = ({ size = 16, color = 'currentColor' }) => (
23
+ <IconSettings size={size} stroke={1.5} color={color} />
24
+ );
25
+
26
+ export const PlaygroundIcon = ({ size = 16, color = 'currentColor' }) => (
27
+ <IconBrandStackoverflow size={size} stroke={1.5} color={color} />
28
+ );
29
+
30
+ export const ShieldIcon = ({ size = 16, color = 'currentColor' }) => (
31
+ <IconShield size={size} stroke={1.5} color={color} />
32
+ );
33
+
34
+ export const MenuIcon = ({ size = 16, color = 'currentColor' }) => (
35
+ <IconMenu2 size={size} stroke={1.5} color={color} />
36
+ );
37
+
38
+ export const ChevronDownIcon = ({ size = 16, color = 'currentColor' }) => (
39
+ <IconChevronDown size={size} stroke={1.5} color={color} />
40
+ );
@@ -0,0 +1,164 @@
1
+ import { colors, fonts } from '../theme';
2
+
3
+ function TableHeader({ columnWidths }) {
4
+ return (
5
+ <thead
6
+ style={{
7
+ position: 'sticky',
8
+ top: 0,
9
+ background: colors.bgSecondary,
10
+ zIndex: 10,
11
+ boxShadow: `0 2px 4px ${colors.shadowSm}`,
12
+ }}
13
+ >
14
+ <tr>
15
+ <th
16
+ style={{
17
+ padding: '12px 16px',
18
+ textAlign: 'left',
19
+ borderBottom: `1px solid ${colors.borderLight}`,
20
+ borderRight: `1px solid ${colors.borderLight}`,
21
+ width: `${columnWidths.frame}px`,
22
+ minWidth: `${columnWidths.frame}px`,
23
+ color: colors.textSecondary,
24
+ fontWeight: '600',
25
+ fontFamily: fonts.body,
26
+ fontSize: '11px',
27
+ textTransform: 'uppercase',
28
+ letterSpacing: '0.05em',
29
+ background: colors.bgSecondary,
30
+ }}
31
+ >
32
+ No.
33
+ </th>
34
+ <th
35
+ style={{
36
+ padding: '8px 12px',
37
+ textAlign: 'left',
38
+ borderBottom: `1px solid ${colors.borderLight}`,
39
+ borderRight: `1px solid ${colors.borderLight}`,
40
+ width: `${columnWidths.time}px`,
41
+ minWidth: `${columnWidths.time}px`,
42
+ color: colors.textPrimary,
43
+ fontWeight: '600',
44
+ fontFamily: fonts.body,
45
+ fontSize: '11px',
46
+ }}
47
+ >
48
+ Time
49
+ </th>
50
+ <th
51
+ style={{
52
+ padding: '8px 12px',
53
+ textAlign: 'left',
54
+ borderBottom: `1px solid ${colors.borderLight}`,
55
+ borderRight: `1px solid ${colors.borderLight}`,
56
+ width: `${columnWidths.datetime}px`,
57
+ minWidth: `${columnWidths.datetime}px`,
58
+ color: colors.textPrimary,
59
+ fontWeight: '600',
60
+ fontFamily: fonts.body,
61
+ fontSize: '11px',
62
+ }}
63
+ >
64
+ Date/Time
65
+ </th>
66
+ <th
67
+ style={{
68
+ padding: '8px 12px',
69
+ textAlign: 'left',
70
+ borderBottom: `1px solid ${colors.borderLight}`,
71
+ borderRight: `1px solid ${colors.borderLight}`,
72
+ width: `${columnWidths.source}px`,
73
+ minWidth: `${columnWidths.source}px`,
74
+ color: colors.textPrimary,
75
+ fontWeight: '600',
76
+ fontFamily: fonts.body,
77
+ fontSize: '11px',
78
+ }}
79
+ >
80
+ Source
81
+ </th>
82
+ <th
83
+ style={{
84
+ padding: '8px 12px',
85
+ textAlign: 'left',
86
+ borderBottom: `1px solid ${colors.borderLight}`,
87
+ borderRight: `1px solid ${colors.borderLight}`,
88
+ width: `${columnWidths.destination}px`,
89
+ minWidth: `${columnWidths.destination}px`,
90
+ color: colors.textPrimary,
91
+ fontWeight: '600',
92
+ fontFamily: fonts.body,
93
+ fontSize: '11px',
94
+ }}
95
+ >
96
+ Destination
97
+ </th>
98
+ <th
99
+ style={{
100
+ padding: '8px 12px',
101
+ textAlign: 'left',
102
+ borderBottom: `1px solid ${colors.borderLight}`,
103
+ borderRight: `1px solid ${colors.borderLight}`,
104
+ width: `${columnWidths.protocol}px`,
105
+ minWidth: `${columnWidths.protocol}px`,
106
+ color: colors.textPrimary,
107
+ fontWeight: '600',
108
+ fontFamily: fonts.body,
109
+ fontSize: '11px',
110
+ }}
111
+ >
112
+ Protocol
113
+ </th>
114
+ <th
115
+ style={{
116
+ padding: '8px 12px',
117
+ textAlign: 'left',
118
+ borderBottom: `1px solid ${colors.borderLight}`,
119
+ borderRight: `1px solid ${colors.borderLight}`,
120
+ width: `${columnWidths.method}px`,
121
+ minWidth: `${columnWidths.method}px`,
122
+ color: colors.textPrimary,
123
+ fontWeight: '600',
124
+ fontFamily: fonts.body,
125
+ fontSize: '11px',
126
+ }}
127
+ >
128
+ Method
129
+ </th>
130
+ <th
131
+ style={{
132
+ padding: '8px 12px',
133
+ textAlign: 'left',
134
+ borderBottom: `1px solid ${colors.borderLight}`,
135
+ borderRight: `1px solid ${colors.borderLight}`,
136
+ width: `${columnWidths.status}px`,
137
+ minWidth: `${columnWidths.status}px`,
138
+ color: colors.textPrimary,
139
+ fontWeight: '600',
140
+ fontFamily: fonts.body,
141
+ fontSize: '11px',
142
+ }}
143
+ >
144
+ Status
145
+ </th>
146
+ <th
147
+ style={{
148
+ padding: '8px 12px',
149
+ textAlign: 'left',
150
+ borderBottom: `1px solid ${colors.borderLight}`,
151
+ color: colors.textPrimary,
152
+ fontWeight: '600',
153
+ fontFamily: fonts.body,
154
+ fontSize: '11px',
155
+ }}
156
+ >
157
+ Endpoint
158
+ </th>
159
+ </tr>
160
+ </thead>
161
+ );
162
+ }
163
+
164
+ export default TableHeader;
@@ -0,0 +1,117 @@
1
+ function TourOverlay({ elementRect, onClick }) {
2
+ if (!elementRect) {
3
+ return (
4
+ <div
5
+ style={{
6
+ position: 'absolute',
7
+ top: 0,
8
+ left: 0,
9
+ right: 0,
10
+ bottom: 0,
11
+ background: 'rgba(0, 0, 0, 0.8)',
12
+ }}
13
+ />
14
+ );
15
+ }
16
+
17
+ const highlightPadding = 8;
18
+ const highlightBorderWidth = 3;
19
+
20
+ return (
21
+ <>
22
+ {elementRect.top > 0 && (
23
+ <div
24
+ style={{
25
+ position: 'fixed',
26
+ top: 0,
27
+ left: 0,
28
+ right: 0,
29
+ height: `${elementRect.top - highlightPadding}px`,
30
+ background: 'rgba(0, 0, 0, 0.8)',
31
+ zIndex: 9999,
32
+ }}
33
+ />
34
+ )}
35
+ {elementRect.bottom < window.innerHeight && (
36
+ <div
37
+ style={{
38
+ position: 'fixed',
39
+ bottom: 0,
40
+ left: 0,
41
+ right: 0,
42
+ height: `${window.innerHeight - elementRect.bottom - highlightPadding}px`,
43
+ background: 'rgba(0, 0, 0, 0.8)',
44
+ zIndex: 9999,
45
+ }}
46
+ />
47
+ )}
48
+ {elementRect.left > 0 && (
49
+ <div
50
+ style={{
51
+ position: 'fixed',
52
+ top: `${Math.max(0, elementRect.top - highlightPadding)}px`,
53
+ left: 0,
54
+ width: `${elementRect.left - highlightPadding}px`,
55
+ height: `${elementRect.height + highlightPadding * 2}px`,
56
+ background: 'rgba(0, 0, 0, 0.8)',
57
+ zIndex: 9999,
58
+ }}
59
+ />
60
+ )}
61
+ {elementRect.right < window.innerWidth && (
62
+ <div
63
+ style={{
64
+ position: 'fixed',
65
+ top: `${Math.max(0, elementRect.top - highlightPadding)}px`,
66
+ right: 0,
67
+ width: `${window.innerWidth - elementRect.right - highlightPadding}px`,
68
+ height: `${elementRect.height + highlightPadding * 2}px`,
69
+ background: 'rgba(0, 0, 0, 0.8)',
70
+ zIndex: 9999,
71
+ }}
72
+ />
73
+ )}
74
+ <div
75
+ style={{
76
+ position: 'fixed',
77
+ left: elementRect.left - highlightPadding - highlightBorderWidth,
78
+ top: elementRect.top - highlightPadding - highlightBorderWidth,
79
+ width: elementRect.width + (highlightPadding + highlightBorderWidth) * 2,
80
+ height: elementRect.height + (highlightPadding + highlightBorderWidth) * 2,
81
+ border: `${highlightBorderWidth}px solid #4ec9b0`,
82
+ borderRadius: '8px',
83
+ boxShadow:
84
+ '0 0 0 2px rgba(78, 201, 176, 0.3), ' +
85
+ '0 0 20px rgba(78, 201, 176, 0.5), ' +
86
+ '0 0 40px rgba(78, 201, 176, 0.3), ' +
87
+ 'inset 0 0 20px rgba(78, 201, 176, 0.1)',
88
+ zIndex: 10000,
89
+ pointerEvents: 'none',
90
+ animation: 'pulse 2s ease-in-out infinite',
91
+ }}
92
+ />
93
+ <style>
94
+ {`
95
+ @keyframes pulse {
96
+ 0%, 100% {
97
+ box-shadow:
98
+ 0 0 0 2px rgba(78, 201, 176, 0.3),
99
+ 0 0 20px rgba(78, 201, 176, 0.5),
100
+ 0 0 40px rgba(78, 201, 176, 0.3),
101
+ inset 0 0 20px rgba(78, 201, 176, 0.1);
102
+ }
103
+ 50% {
104
+ box-shadow:
105
+ 0 0 0 3px rgba(78, 201, 176, 0.4),
106
+ 0 0 30px rgba(78, 201, 176, 0.7),
107
+ 0 0 60px rgba(78, 201, 176, 0.5),
108
+ inset 0 0 30px rgba(78, 201, 176, 0.2);
109
+ }
110
+ }
111
+ `}
112
+ </style>
113
+ </>
114
+ );
115
+ }
116
+
117
+ export default TourOverlay;