react-native-inapp-inspector 2.3.19 → 2.3.21
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/README.md +14 -14
- package/android/src/main/java/com/inappinspector/NetworkInspectorModule.kt +67 -0
- package/dist/commonjs/analytics.js +1 -24
- package/dist/commonjs/bundle.js +1 -16
- package/dist/commonjs/capture.js +1 -35
- package/dist/commonjs/components/AnalyticsDetail.js +92 -623
- package/dist/commonjs/components/AnalyticsEventCard.js +54 -350
- package/dist/commonjs/components/AnalyticsGraph.js +70 -370
- package/dist/commonjs/components/AnimatedEntrance.js +1 -11
- package/dist/commonjs/components/AppHeaderLogo.js +7 -134
- package/dist/commonjs/components/BrandCircleIcon.js +73 -118
- package/dist/commonjs/components/BrandSquareIcon.js +63 -108
- package/dist/commonjs/components/CodeSnippet.js +48 -623
- package/dist/commonjs/components/ConsoleLogCard.js +63 -537
- package/dist/commonjs/components/CopyButton.js +3 -89
- package/dist/commonjs/components/DiffViewer.js +19 -83
- package/dist/commonjs/components/DomainHeader.js +27 -127
- package/dist/commonjs/components/EmptyState.js +10 -87
- package/dist/commonjs/components/EndOfListFooter.js +7 -81
- package/dist/commonjs/components/ErrorBoundary.js +72 -566
- package/dist/commonjs/components/HeadersSection.js +31 -110
- package/dist/commonjs/components/HighlightText.js +17 -58
- package/dist/commonjs/components/Inspector/AboutModal.d.ts +6 -0
- package/dist/commonjs/components/Inspector/AboutModal.js +243 -0
- package/dist/commonjs/components/Inspector/AnalyticsFilterModal.js +98 -797
- package/dist/commonjs/components/Inspector/AnalyticsTab.js +284 -930
- package/dist/commonjs/components/Inspector/BundleTab.js +551 -2918
- package/dist/commonjs/components/Inspector/ConsoleTab.js +79 -492
- package/dist/commonjs/components/Inspector/CrashDetail.js +123 -672
- package/dist/commonjs/components/Inspector/CrashFilterModal.js +66 -498
- package/dist/commonjs/components/Inspector/CrashTab.js +98 -670
- package/dist/commonjs/components/Inspector/DebuggingTab.js +74 -875
- package/dist/commonjs/components/Inspector/DeviceInfoTab.js +143 -907
- package/dist/commonjs/components/Inspector/FabLauncher.js +42 -466
- package/dist/commonjs/components/Inspector/FeatureUnderDevNotice.js +6 -99
- package/dist/commonjs/components/Inspector/InspectorContext.js +1 -21
- package/dist/commonjs/components/Inspector/InspectorHeader.js +191 -1110
- package/dist/commonjs/components/Inspector/LogDetail.js +168 -994
- package/dist/commonjs/components/Inspector/MainScreen.js +52 -335
- package/dist/commonjs/components/Inspector/MediaGalleryTab.js +97 -644
- package/dist/commonjs/components/Inspector/MediaPreviewModal.js +90 -605
- package/dist/commonjs/components/Inspector/NavigationTracker.js +1 -12
- package/dist/commonjs/components/Inspector/NetworkDetail.js +89 -411
- package/dist/commonjs/components/Inspector/NetworkFilterModal.js +60 -576
- package/dist/commonjs/components/Inspector/NetworkTab.js +84 -514
- package/dist/commonjs/components/Inspector/NpmStarPrompt.js +18 -434
- package/dist/commonjs/components/Inspector/NpmUpdateToast.js +25 -298
- package/dist/commonjs/components/Inspector/PerformanceTab.js +182 -1397
- package/dist/commonjs/components/Inspector/ReduxDetail.js +188 -1089
- package/dist/commonjs/components/Inspector/ReduxTab.js +85 -701
- package/dist/commonjs/components/Inspector/SettingsPanel.js +427 -3807
- package/dist/commonjs/components/Inspector/SkeletonPlaceholder.js +11 -180
- package/dist/commonjs/components/Inspector/StorageTab.js +93 -826
- package/dist/commonjs/components/Inspector/TabBar.js +36 -334
- package/dist/commonjs/components/Inspector/UpdateAvailableModal.js +37 -412
- package/dist/commonjs/components/JsonViewer.js +168 -381
- package/dist/commonjs/components/LogCard.js +57 -567
- package/dist/commonjs/components/LogSyntaxHighlighter.js +11 -130
- package/dist/commonjs/components/MetaAccordion.js +69 -238
- package/dist/commonjs/components/MiniBarChart.js +3 -56
- package/dist/commonjs/components/MiniLineChart.js +3 -58
- package/dist/commonjs/components/NetworkIcons.d.ts +13 -0
- package/dist/commonjs/components/NetworkIcons.js +521 -1022
- package/dist/commonjs/components/QRCodeView.js +5 -79
- package/dist/commonjs/components/SectionHeader.js +15 -37
- package/dist/commonjs/components/SegmentedTabs.js +7 -62
- package/dist/commonjs/components/SkeletonPlaceholder.js +11 -180
- package/dist/commonjs/components/Slider.js +15 -243
- package/dist/commonjs/components/SourcePageCard.js +30 -89
- package/dist/commonjs/components/Toast.js +5 -147
- package/dist/commonjs/components/TouchableScale.js +3 -24
- package/dist/commonjs/components/TreeNode.js +55 -130
- package/dist/commonjs/console.js +1 -16
- package/dist/commonjs/constants/index.js +1 -32
- package/dist/commonjs/constants/telemetryConfig.js +1 -6
- package/dist/commonjs/constants/version.d.ts +1 -1
- package/dist/commonjs/constants/version.js +1 -4
- package/dist/commonjs/crash.js +1 -23
- package/dist/commonjs/customHooks/analyticsLogger.js +1 -250
- package/dist/commonjs/customHooks/bundleAnalyzer.js +1 -957
- package/dist/commonjs/customHooks/consoleLogger.js +6 -445
- package/dist/commonjs/customHooks/crashHandler.js +7 -656
- package/dist/commonjs/customHooks/logFilters.js +1 -23
- package/dist/commonjs/customHooks/networkLogger.js +2 -536
- package/dist/commonjs/customHooks/performanceTracker.js +63 -750
- package/dist/commonjs/customHooks/reduxLogger.js +2 -313
- package/dist/commonjs/customHooks/storageInspector.js +1 -435
- package/dist/commonjs/customHooks/useAccordion.js +1 -18
- package/dist/commonjs/decorators/index.js +1 -100
- package/dist/commonjs/helpers/gaAnalyticsRegistry.js +1 -148
- package/dist/commonjs/helpers/index.d.ts +1 -0
- package/dist/commonjs/helpers/index.js +8 -921
- package/dist/commonjs/helpers/memoryManager.js +1 -99
- package/dist/commonjs/helpers/qrGenerator.js +1 -367
- package/dist/commonjs/helpers/remoteConfig.js +1 -165
- package/dist/commonjs/helpers/searchQueryParser.js +1 -62
- package/dist/commonjs/helpers/settingsStore.js +1 -144
- package/dist/commonjs/helpers/telemetry.js +1 -501
- package/dist/commonjs/helpers/toast.js +1 -20
- package/dist/commonjs/i18n/index.js +1 -90
- package/dist/commonjs/i18n/locales/en.json +1 -1140
- package/dist/commonjs/index.js +5 -2168
- package/dist/commonjs/metro.js +6 -468
- package/dist/commonjs/native/NativeInspector.d.ts +1 -0
- package/dist/commonjs/native/NativeInspector.js +1 -415
- package/dist/commonjs/native/NativeNetworkInspector.js +1 -4
- package/dist/commonjs/network.js +1 -13
- package/dist/commonjs/performance.js +1 -29
- package/dist/commonjs/redux.js +1 -20
- package/dist/commonjs/storage.js +1 -14
- package/dist/commonjs/styles/AppColors.js +1 -423
- package/dist/commonjs/styles/AppFonts.js +1 -17
- package/dist/commonjs/styles/common.js +1 -190
- package/dist/commonjs/styles/index.d.ts +6 -0
- package/dist/commonjs/styles/index.js +1 -1589
- package/dist/commonjs/types/enums.d.ts +0 -1
- package/dist/commonjs/types/enums.js +1 -152
- package/dist/commonjs/types/index.js +1 -18
- package/dist/commonjs/types/interfaces.d.ts +2 -2
- package/dist/commonjs/types/interfaces.js +1 -2
- package/dist/esm/analytics.js +1 -2
- package/dist/esm/bundle.js +1 -2
- package/dist/esm/capture.js +1 -32
- package/dist/esm/components/AnalyticsDetail.js +171 -664
- package/dist/esm/components/AnalyticsEventCard.js +77 -335
- package/dist/esm/components/AnalyticsGraph.js +95 -357
- package/dist/esm/components/AnimatedEntrance.js +1 -6
- package/dist/esm/components/AppHeaderLogo.js +7 -94
- package/dist/esm/components/BrandCircleIcon.js +114 -119
- package/dist/esm/components/BrandSquareIcon.js +73 -78
- package/dist/esm/components/CodeSnippet.js +58 -595
- package/dist/esm/components/ConsoleLogCard.js +91 -526
- package/dist/esm/components/CopyButton.js +3 -51
- package/dist/esm/components/DiffViewer.js +22 -48
- package/dist/esm/components/DomainHeader.js +43 -138
- package/dist/esm/components/EmptyState.js +17 -56
- package/dist/esm/components/EndOfListFooter.js +15 -83
- package/dist/esm/components/ErrorBoundary.js +125 -582
- package/dist/esm/components/HeadersSection.js +52 -93
- package/dist/esm/components/HighlightText.js +17 -53
- package/dist/esm/components/Inspector/AboutModal.d.ts +6 -0
- package/dist/esm/components/Inspector/AboutModal.js +243 -0
- package/dist/esm/components/Inspector/AnalyticsFilterModal.js +225 -886
- package/dist/esm/components/Inspector/AnalyticsTab.js +296 -904
- package/dist/esm/components/Inspector/BundleTab.js +1175 -3502
- package/dist/esm/components/Inspector/ConsoleTab.js +113 -488
- package/dist/esm/components/Inspector/CrashDetail.js +236 -747
- package/dist/esm/components/Inspector/CrashFilterModal.js +149 -541
- package/dist/esm/components/Inspector/CrashTab.js +177 -711
- package/dist/esm/components/Inspector/DebuggingTab.js +164 -925
- package/dist/esm/components/Inspector/DeviceInfoTab.js +199 -924
- package/dist/esm/components/Inspector/FabLauncher.js +68 -454
- package/dist/esm/components/Inspector/FeatureUnderDevNotice.js +14 -70
- package/dist/esm/components/Inspector/InspectorContext.js +1 -12
- package/dist/esm/components/Inspector/InspectorHeader.js +282 -1163
- package/dist/esm/components/Inspector/LogDetail.js +235 -1023
- package/dist/esm/components/Inspector/MainScreen.js +78 -323
- package/dist/esm/components/Inspector/MediaGalleryTab.js +143 -650
- package/dist/esm/components/Inspector/MediaPreviewModal.js +138 -613
- package/dist/esm/components/Inspector/NavigationTracker.js +1 -10
- package/dist/esm/components/Inspector/NetworkDetail.js +138 -455
- package/dist/esm/components/Inspector/NetworkFilterModal.js +122 -597
- package/dist/esm/components/Inspector/NetworkTab.js +125 -517
- package/dist/esm/components/Inspector/NpmStarPrompt.js +58 -434
- package/dist/esm/components/Inspector/NpmUpdateToast.js +45 -281
- package/dist/esm/components/Inspector/PerformanceTab.js +393 -1570
- package/dist/esm/components/Inspector/ReduxDetail.js +307 -1170
- package/dist/esm/components/Inspector/ReduxTab.js +144 -722
- package/dist/esm/components/Inspector/SettingsPanel.js +643 -3985
- package/dist/esm/components/Inspector/SkeletonPlaceholder.js +30 -163
- package/dist/esm/components/Inspector/StorageTab.js +172 -866
- package/dist/esm/components/Inspector/TabBar.js +45 -305
- package/dist/esm/components/Inspector/UpdateAvailableModal.js +80 -418
- package/dist/esm/components/JsonViewer.js +179 -354
- package/dist/esm/components/LogCard.js +93 -565
- package/dist/esm/components/LogSyntaxHighlighter.js +11 -123
- package/dist/esm/components/MetaAccordion.js +136 -267
- package/dist/esm/components/MiniBarChart.js +3 -18
- package/dist/esm/components/MiniLineChart.js +3 -20
- package/dist/esm/components/NetworkIcons.d.ts +13 -0
- package/dist/esm/components/NetworkIcons.js +523 -838
- package/dist/esm/components/QRCodeView.js +8 -45
- package/dist/esm/components/SectionHeader.js +22 -39
- package/dist/esm/components/SegmentedTabs.js +8 -58
- package/dist/esm/components/SkeletonPlaceholder.js +30 -163
- package/dist/esm/components/Slider.js +24 -213
- package/dist/esm/components/SourcePageCard.js +65 -86
- package/dist/esm/components/Toast.js +10 -117
- package/dist/esm/components/TouchableScale.js +3 -19
- package/dist/esm/components/TreeNode.js +58 -95
- package/dist/esm/console.js +1 -2
- package/dist/esm/constants/index.js +1 -28
- package/dist/esm/constants/telemetryConfig.js +1 -3
- package/dist/esm/constants/version.d.ts +1 -1
- package/dist/esm/constants/version.js +1 -1
- package/dist/esm/crash.js +1 -2
- package/dist/esm/customHooks/analyticsLogger.js +1 -230
- package/dist/esm/customHooks/bundleAnalyzer.js +1 -944
- package/dist/esm/customHooks/consoleLogger.js +6 -432
- package/dist/esm/customHooks/crashHandler.js +7 -630
- package/dist/esm/customHooks/logFilters.js +1 -20
- package/dist/esm/customHooks/networkLogger.js +2 -519
- package/dist/esm/customHooks/performanceTracker.js +63 -723
- package/dist/esm/customHooks/reduxLogger.js +2 -293
- package/dist/esm/customHooks/storageInspector.js +1 -418
- package/dist/esm/customHooks/useAccordion.js +1 -16
- package/dist/esm/decorators/index.js +1 -95
- package/dist/esm/helpers/gaAnalyticsRegistry.js +1 -143
- package/dist/esm/helpers/index.d.ts +1 -0
- package/dist/esm/helpers/index.js +8 -861
- package/dist/esm/helpers/memoryManager.js +1 -91
- package/dist/esm/helpers/qrGenerator.js +1 -364
- package/dist/esm/helpers/remoteConfig.js +1 -160
- package/dist/esm/helpers/searchQueryParser.js +1 -59
- package/dist/esm/helpers/settingsStore.js +1 -134
- package/dist/esm/helpers/telemetry.js +1 -489
- package/dist/esm/helpers/toast.js +1 -15
- package/dist/esm/i18n/index.js +1 -78
- package/dist/esm/i18n/locales/en.json +1 -1140
- package/dist/esm/index.js +7 -1982
- package/dist/esm/metro.js +6 -459
- package/dist/esm/native/NativeInspector.d.ts +1 -0
- package/dist/esm/native/NativeInspector.js +1 -382
- package/dist/esm/native/NativeNetworkInspector.js +1 -2
- package/dist/esm/network.js +1 -1
- package/dist/esm/performance.js +1 -2
- package/dist/esm/redux.js +1 -1
- package/dist/esm/storage.js +1 -1
- package/dist/esm/styles/AppColors.js +1 -417
- package/dist/esm/styles/AppFonts.js +1 -13
- package/dist/esm/styles/common.js +1 -186
- package/dist/esm/styles/index.d.ts +6 -0
- package/dist/esm/styles/index.js +1 -1551
- package/dist/esm/types/enums.d.ts +0 -1
- package/dist/esm/types/enums.js +1 -149
- package/dist/esm/types/index.js +1 -2
- package/dist/esm/types/interfaces.d.ts +2 -2
- package/dist/esm/types/interfaces.js +1 -1
- package/ios/NetworkInspectorModule.mm +60 -12
- package/package.json +5 -3
- package/src/native/NativeInspector.ts +18 -0
- package/dist/commonjs/components/Inspector/FeedbackModal.d.ts +0 -7
- package/dist/commonjs/components/Inspector/FeedbackModal.js +0 -552
- package/dist/esm/components/Inspector/FeedbackModal.d.ts +0 -7
- package/dist/esm/components/Inspector/FeedbackModal.js +0 -515
- package/src/analytics.ts +0 -35
- package/src/bundle.ts +0 -25
- package/src/capture.ts +0 -109
- package/src/components/AnalyticsDetail.tsx +0 -870
- package/src/components/AnalyticsEventCard.tsx +0 -444
- package/src/components/AnalyticsGraph.tsx +0 -583
- package/src/components/AnimatedEntrance.tsx +0 -20
- package/src/components/AppHeaderLogo.tsx +0 -143
- package/src/components/BrandCircleIcon.tsx +0 -144
- package/src/components/BrandSquareIcon.tsx +0 -184
- package/src/components/CodeSnippet.tsx +0 -725
- package/src/components/ConsoleLogCard.tsx +0 -679
- package/src/components/CopyButton.tsx +0 -87
- package/src/components/DiffViewer.tsx +0 -82
- package/src/components/DomainHeader.tsx +0 -224
- package/src/components/EmptyState.tsx +0 -97
- package/src/components/EndOfListFooter.tsx +0 -100
- package/src/components/ErrorBoundary.tsx +0 -688
- package/src/components/HeadersSection.tsx +0 -172
- package/src/components/HighlightText.tsx +0 -100
- package/src/components/Inspector/AnalyticsFilterModal.tsx +0 -1250
- package/src/components/Inspector/AnalyticsTab.tsx +0 -1362
- package/src/components/Inspector/BundleTab.tsx +0 -4768
- package/src/components/Inspector/ConsoleTab.tsx +0 -726
- package/src/components/Inspector/CrashDetail.tsx +0 -997
- package/src/components/Inspector/CrashFilterModal.tsx +0 -721
- package/src/components/Inspector/CrashTab.tsx +0 -933
- package/src/components/Inspector/DebuggingTab.tsx +0 -1103
- package/src/components/Inspector/DeviceInfoTab.tsx +0 -1397
- package/src/components/Inspector/FabLauncher.tsx +0 -590
- package/src/components/Inspector/FeatureUnderDevNotice.tsx +0 -94
- package/src/components/Inspector/FeedbackModal.tsx +0 -626
- package/src/components/Inspector/InspectorContext.tsx +0 -28
- package/src/components/Inspector/InspectorHeader.tsx +0 -1583
- package/src/components/Inspector/LogDetail.tsx +0 -1431
- package/src/components/Inspector/MainScreen.tsx +0 -460
- package/src/components/Inspector/MediaGalleryTab.tsx +0 -829
- package/src/components/Inspector/MediaPreviewModal.tsx +0 -783
- package/src/components/Inspector/NavigationTracker.tsx +0 -13
- package/src/components/Inspector/NetworkDetail.tsx +0 -778
- package/src/components/Inspector/NetworkFilterModal.tsx +0 -730
- package/src/components/Inspector/NetworkTab.tsx +0 -820
- package/src/components/Inspector/NpmStarPrompt.tsx +0 -532
- package/src/components/Inspector/NpmUpdateToast.tsx +0 -387
- package/src/components/Inspector/PerformanceTab.tsx +0 -1967
- package/src/components/Inspector/ReduxDetail.tsx +0 -1651
- package/src/components/Inspector/ReduxTab.tsx +0 -987
- package/src/components/Inspector/SettingsPanel.tsx +0 -5136
- package/src/components/Inspector/SkeletonPlaceholder.tsx +0 -206
- package/src/components/Inspector/StorageTab.tsx +0 -1159
- package/src/components/Inspector/TabBar.tsx +0 -431
- package/src/components/Inspector/UpdateAvailableModal.tsx +0 -555
- package/src/components/JsonViewer.tsx +0 -549
- package/src/components/LogCard.tsx +0 -694
- package/src/components/LogSyntaxHighlighter.tsx +0 -178
- package/src/components/MetaAccordion.tsx +0 -355
- package/src/components/MiniBarChart.tsx +0 -42
- package/src/components/MiniLineChart.tsx +0 -33
- package/src/components/NetworkIcons.tsx +0 -2655
- package/src/components/QRCodeView.tsx +0 -75
- package/src/components/SectionHeader.tsx +0 -101
- package/src/components/SegmentedTabs.tsx +0 -84
- package/src/components/SkeletonPlaceholder.tsx +0 -206
- package/src/components/Slider.tsx +0 -300
- package/src/components/SourcePageCard.tsx +0 -150
- package/src/components/Toast.tsx +0 -131
- package/src/components/TouchableScale.tsx +0 -61
- package/src/components/TreeNode.tsx +0 -171
- package/src/console.ts +0 -24
- package/src/constants/index.ts +0 -41
- package/src/constants/telemetryConfig.ts +0 -4
- package/src/constants/version.ts +0 -3
- package/src/crash.ts +0 -32
- package/src/customHooks/analyticsLogger.ts +0 -336
- package/src/customHooks/bundleAnalyzer.ts +0 -1256
- package/src/customHooks/consoleLogger.ts +0 -530
- package/src/customHooks/crashHandler.ts +0 -944
- package/src/customHooks/logFilters.ts +0 -32
- package/src/customHooks/networkLogger.ts +0 -624
- package/src/customHooks/performanceTracker.ts +0 -1014
- package/src/customHooks/reduxLogger.ts +0 -406
- package/src/customHooks/storageInspector.ts +0 -513
- package/src/customHooks/useAccordion.tsx +0 -27
- package/src/decorators/index.ts +0 -184
- package/src/helpers/gaAnalyticsRegistry.ts +0 -204
- package/src/helpers/index.ts +0 -1092
- package/src/helpers/memoryManager.ts +0 -138
- package/src/helpers/qrGenerator.ts +0 -430
- package/src/helpers/remoteConfig.ts +0 -212
- package/src/helpers/searchQueryParser.ts +0 -84
- package/src/helpers/settingsStore.ts +0 -171
- package/src/helpers/telemetry.ts +0 -568
- package/src/helpers/toast.ts +0 -17
- package/src/i18n/index.ts +0 -104
- package/src/i18n/locales/en.json +0 -1141
- package/src/index.tsx +0 -2650
- package/src/metro.ts +0 -598
- package/src/network.ts +0 -22
- package/src/performance.ts +0 -38
- package/src/redux.ts +0 -23
- package/src/storage.ts +0 -18
- package/src/styles/AppColors.ts +0 -455
- package/src/styles/AppFonts.ts +0 -26
- package/src/styles/common.ts +0 -209
- package/src/styles/index.ts +0 -1606
- package/src/types/enums.ts +0 -210
- package/src/types/index.ts +0 -34
- package/src/types/interfaces.ts +0 -535
|
@@ -1,820 +0,0 @@
|
|
|
1
|
-
import React, {useCallback, useMemo, useRef} from 'react';
|
|
2
|
-
import {
|
|
3
|
-
Animated,
|
|
4
|
-
FlatList,
|
|
5
|
-
Platform,
|
|
6
|
-
Pressable,
|
|
7
|
-
ScrollView,
|
|
8
|
-
Text,
|
|
9
|
-
TextInput,
|
|
10
|
-
View,
|
|
11
|
-
} from 'react-native';
|
|
12
|
-
import {animateNextLayout, useInspector} from './InspectorContext';
|
|
13
|
-
import TouchableScale from '../TouchableScale';
|
|
14
|
-
import AnimatedEntrance from '../AnimatedEntrance';
|
|
15
|
-
import DomainHeader from '../DomainHeader';
|
|
16
|
-
import LogCard from '../LogCard';
|
|
17
|
-
import EmptyState from '../EmptyState';
|
|
18
|
-
import EndOfListFooter from '../EndOfListFooter';
|
|
19
|
-
import NetworkFilterModal, {
|
|
20
|
-
NetworkFilterState,
|
|
21
|
-
DEFAULT_NETWORK_FILTERS,
|
|
22
|
-
isNetworkFiltersDefault,
|
|
23
|
-
} from './NetworkFilterModal';
|
|
24
|
-
import styles from '../../styles';
|
|
25
|
-
import {AppColors} from '../../styles/AppColors';
|
|
26
|
-
import {AppFonts} from '../../styles/AppFonts';
|
|
27
|
-
import {STATUS_FILTERS, METHOD_COLORS} from '../../constants';
|
|
28
|
-
import {GroupedListItem, Method, SearchScope} from '../../types';
|
|
29
|
-
import {useTranslation} from '../../i18n';
|
|
30
|
-
import {
|
|
31
|
-
SearchIcon,
|
|
32
|
-
ClearIcon,
|
|
33
|
-
TrashIcon,
|
|
34
|
-
SortArrowIcon,
|
|
35
|
-
FilterIcon,
|
|
36
|
-
ChevronIcon,
|
|
37
|
-
CheckIcon,
|
|
38
|
-
CircleCheckIcon,
|
|
39
|
-
CircleXIcon,
|
|
40
|
-
CircleAlertIcon,
|
|
41
|
-
LayersIcon,
|
|
42
|
-
HeaderPauseIcon,
|
|
43
|
-
ClockIcon,
|
|
44
|
-
GlobeIcon,
|
|
45
|
-
RequestIcon,
|
|
46
|
-
ResponseIcon,
|
|
47
|
-
HeadersIcon,
|
|
48
|
-
AtomIcon,
|
|
49
|
-
BoltIcon,
|
|
50
|
-
ShieldAlertIcon,
|
|
51
|
-
} from '../NetworkIcons';
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
const NetworkTab = React.memo(() => {
|
|
56
|
-
const {
|
|
57
|
-
groupedData,
|
|
58
|
-
search,
|
|
59
|
-
setSearch,
|
|
60
|
-
searchScope,
|
|
61
|
-
setSearchScope,
|
|
62
|
-
isRegexSearch,
|
|
63
|
-
setIsRegexSearch,
|
|
64
|
-
isCaseSensitive,
|
|
65
|
-
setIsCaseSensitive,
|
|
66
|
-
quickFilter,
|
|
67
|
-
setQuickFilter,
|
|
68
|
-
handleDelete,
|
|
69
|
-
selectedLogs,
|
|
70
|
-
sortOrder,
|
|
71
|
-
setSortOrder,
|
|
72
|
-
statusFilters,
|
|
73
|
-
setStatusFilters,
|
|
74
|
-
methodFilters,
|
|
75
|
-
setMethodFilters,
|
|
76
|
-
availableMethods,
|
|
77
|
-
filteredLogs,
|
|
78
|
-
logs,
|
|
79
|
-
toggleSectionFilter,
|
|
80
|
-
toggleSectionCollapse,
|
|
81
|
-
minStart,
|
|
82
|
-
totalRange,
|
|
83
|
-
newLogIds,
|
|
84
|
-
toggleSelect,
|
|
85
|
-
setSelected,
|
|
86
|
-
isNetworkPaused,
|
|
87
|
-
setIsNetworkPaused,
|
|
88
|
-
} = useInspector();
|
|
89
|
-
|
|
90
|
-
const {t} = useTranslation();
|
|
91
|
-
const apisListRef = useRef<FlatList<any>>(null);
|
|
92
|
-
|
|
93
|
-
const [isFilterModalOpen, setIsFilterModalOpen] = React.useState(false);
|
|
94
|
-
const [isSearchFocused, setIsSearchFocused] = React.useState(false);
|
|
95
|
-
|
|
96
|
-
const modalFilterState: NetworkFilterState = useMemo(
|
|
97
|
-
() => ({
|
|
98
|
-
statusCodes:
|
|
99
|
-
statusFilters.size > 0 ? new Set(statusFilters) : new Set(['all']),
|
|
100
|
-
methods:
|
|
101
|
-
methodFilters.size > 0 ? new Set(methodFilters) : new Set(['all']),
|
|
102
|
-
latency: 'all',
|
|
103
|
-
protocol: 'all',
|
|
104
|
-
sortBy: sortOrder === 'newest' ? 'time_desc' : 'time_asc',
|
|
105
|
-
}),
|
|
106
|
-
[statusFilters, methodFilters, sortOrder],
|
|
107
|
-
);
|
|
108
|
-
|
|
109
|
-
const handleApplyNetworkFilters = useCallback(
|
|
110
|
-
(newFilters: NetworkFilterState) => {
|
|
111
|
-
if (
|
|
112
|
-
newFilters.statusCodes.has('all') ||
|
|
113
|
-
newFilters.statusCodes.size === 0
|
|
114
|
-
) {
|
|
115
|
-
setStatusFilters(new Set());
|
|
116
|
-
} else {
|
|
117
|
-
setStatusFilters(new Set(newFilters.statusCodes));
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
if (newFilters.methods.has('all') || newFilters.methods.size === 0) {
|
|
121
|
-
setMethodFilters(new Set());
|
|
122
|
-
} else {
|
|
123
|
-
setMethodFilters(
|
|
124
|
-
new Set([...newFilters.methods].map(m => m as Method)),
|
|
125
|
-
);
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
if (newFilters.sortBy === 'time_asc') {
|
|
129
|
-
setSortOrder('oldest');
|
|
130
|
-
} else {
|
|
131
|
-
setSortOrder('newest');
|
|
132
|
-
}
|
|
133
|
-
},
|
|
134
|
-
[setStatusFilters, setMethodFilters, setSortOrder],
|
|
135
|
-
);
|
|
136
|
-
|
|
137
|
-
const quickCounts = useMemo(() => {
|
|
138
|
-
let errorCount = 0;
|
|
139
|
-
let successCount = 0;
|
|
140
|
-
let slowCount = 0;
|
|
141
|
-
let postCount = 0;
|
|
142
|
-
let getCount = 0;
|
|
143
|
-
let gqlCount = 0;
|
|
144
|
-
|
|
145
|
-
logs.forEach(l => {
|
|
146
|
-
const s =
|
|
147
|
-
typeof l.status === 'number'
|
|
148
|
-
? l.status
|
|
149
|
-
: parseInt(String(l.status), 10);
|
|
150
|
-
if (l.status === 0 || l.status == null || (!isNaN(s) && s >= 400)) {
|
|
151
|
-
errorCount++;
|
|
152
|
-
} else if (!isNaN(s) && s >= 200 && s < 400) {
|
|
153
|
-
successCount++;
|
|
154
|
-
}
|
|
155
|
-
if ((l.duration || 0) >= 500) {
|
|
156
|
-
slowCount++;
|
|
157
|
-
}
|
|
158
|
-
const m = (l.method || '').toUpperCase();
|
|
159
|
-
if (m === 'POST') postCount++;
|
|
160
|
-
if (m === 'GET') getCount++;
|
|
161
|
-
const u = (l.url || '').toLowerCase();
|
|
162
|
-
const c = (l.client || '').toLowerCase();
|
|
163
|
-
if (
|
|
164
|
-
u.includes('graphql') ||
|
|
165
|
-
c.includes('graphql') ||
|
|
166
|
-
c.includes('apollo')
|
|
167
|
-
) {
|
|
168
|
-
gqlCount++;
|
|
169
|
-
}
|
|
170
|
-
});
|
|
171
|
-
|
|
172
|
-
return {
|
|
173
|
-
all: logs.length,
|
|
174
|
-
errors: errorCount,
|
|
175
|
-
success: successCount,
|
|
176
|
-
slow: slowCount,
|
|
177
|
-
post: postCount,
|
|
178
|
-
get: getCount,
|
|
179
|
-
graphql: gqlCount,
|
|
180
|
-
};
|
|
181
|
-
}, [logs]);
|
|
182
|
-
|
|
183
|
-
const QUICK_CHIPS = useMemo(
|
|
184
|
-
() => [
|
|
185
|
-
{
|
|
186
|
-
id: 'all',
|
|
187
|
-
label: 'All',
|
|
188
|
-
count: quickCounts.all,
|
|
189
|
-
color: AppColors.purple,
|
|
190
|
-
},
|
|
191
|
-
{
|
|
192
|
-
id: 'errors',
|
|
193
|
-
label: 'Errors',
|
|
194
|
-
count: quickCounts.errors,
|
|
195
|
-
color: AppColors.errorColor,
|
|
196
|
-
},
|
|
197
|
-
{
|
|
198
|
-
id: 'success',
|
|
199
|
-
label: '2xx OK',
|
|
200
|
-
count: quickCounts.success,
|
|
201
|
-
color: AppColors.greenColor,
|
|
202
|
-
},
|
|
203
|
-
{
|
|
204
|
-
id: 'slow',
|
|
205
|
-
label: 'Slow >500ms',
|
|
206
|
-
count: quickCounts.slow,
|
|
207
|
-
color: AppColors.warningIconGold,
|
|
208
|
-
},
|
|
209
|
-
{
|
|
210
|
-
id: 'POST',
|
|
211
|
-
label: 'POST',
|
|
212
|
-
count: quickCounts.post,
|
|
213
|
-
color: METHOD_COLORS.POST || '#3B82F6',
|
|
214
|
-
},
|
|
215
|
-
{
|
|
216
|
-
id: 'GET',
|
|
217
|
-
label: 'GET',
|
|
218
|
-
count: quickCounts.get,
|
|
219
|
-
color: METHOD_COLORS.GET || '#10B981',
|
|
220
|
-
},
|
|
221
|
-
{
|
|
222
|
-
id: 'graphql',
|
|
223
|
-
label: 'GraphQL',
|
|
224
|
-
count: quickCounts.graphql,
|
|
225
|
-
color: '#E10098',
|
|
226
|
-
},
|
|
227
|
-
],
|
|
228
|
-
[quickCounts],
|
|
229
|
-
);
|
|
230
|
-
|
|
231
|
-
const networkMetrics = useMemo(() => {
|
|
232
|
-
if (!logs || logs.length === 0) return null;
|
|
233
|
-
let successCount = 0;
|
|
234
|
-
let completedCount = 0;
|
|
235
|
-
let totalDuration = 0;
|
|
236
|
-
let totalBytes = 0;
|
|
237
|
-
const durations: number[] = [];
|
|
238
|
-
|
|
239
|
-
logs.forEach(log => {
|
|
240
|
-
if (log.status != null) {
|
|
241
|
-
completedCount++;
|
|
242
|
-
const s = typeof log.status === 'number' ? log.status : parseInt(String(log.status), 10);
|
|
243
|
-
if (!isNaN(s)) {
|
|
244
|
-
if (s >= 200 && s < 400) {
|
|
245
|
-
successCount++;
|
|
246
|
-
}
|
|
247
|
-
}
|
|
248
|
-
}
|
|
249
|
-
if (typeof log.duration === 'number' && log.duration > 0) {
|
|
250
|
-
durations.push(log.duration);
|
|
251
|
-
totalDuration += log.duration;
|
|
252
|
-
}
|
|
253
|
-
});
|
|
254
|
-
|
|
255
|
-
durations.sort((a, b) => a - b);
|
|
256
|
-
const avgDuration = durations.length > 0 ? Math.round(totalDuration / durations.length) : 0;
|
|
257
|
-
const p95 = durations.length > 0 ? durations[Math.floor(durations.length * 0.95)] : 0;
|
|
258
|
-
const successRate = completedCount > 0 ? Math.round((successCount / completedCount) * 100) : 100;
|
|
259
|
-
|
|
260
|
-
return {
|
|
261
|
-
successRate,
|
|
262
|
-
avgDuration,
|
|
263
|
-
p95,
|
|
264
|
-
totalCount: logs.length,
|
|
265
|
-
};
|
|
266
|
-
}, [logs]);
|
|
267
|
-
|
|
268
|
-
const renderItem = useCallback(
|
|
269
|
-
({item, index}: {item: GroupedListItem; index: number}) => {
|
|
270
|
-
if (item.type === 'header') {
|
|
271
|
-
return (
|
|
272
|
-
<AnimatedEntrance index={index} distance={8}>
|
|
273
|
-
<DomainHeader
|
|
274
|
-
pageName={item.pageName}
|
|
275
|
-
color={item.color}
|
|
276
|
-
stats={item.stats}
|
|
277
|
-
activeFilters={item.activeFilters}
|
|
278
|
-
onToggleFilter={toggleSectionFilter}
|
|
279
|
-
isCollapsed={item.isCollapsed}
|
|
280
|
-
onToggleCollapse={toggleSectionCollapse}
|
|
281
|
-
isFirst={item.isFirst}
|
|
282
|
-
timestamp={item.timestamp}
|
|
283
|
-
/>
|
|
284
|
-
</AnimatedEntrance>
|
|
285
|
-
);
|
|
286
|
-
}
|
|
287
|
-
|
|
288
|
-
const {log, isLast, color} = item;
|
|
289
|
-
return (
|
|
290
|
-
<AnimatedEntrance
|
|
291
|
-
index={index}
|
|
292
|
-
distance={8}
|
|
293
|
-
style={[
|
|
294
|
-
styles.treeNodeRow,
|
|
295
|
-
isLast && styles.treeNodeRowLast,
|
|
296
|
-
]}>
|
|
297
|
-
<View style={styles.treeLines}>
|
|
298
|
-
<View
|
|
299
|
-
style={[
|
|
300
|
-
styles.modernTreeLine,
|
|
301
|
-
{borderColor: color},
|
|
302
|
-
isLast && styles.modernTreeLineLast,
|
|
303
|
-
]}
|
|
304
|
-
/>
|
|
305
|
-
{!isLast && (
|
|
306
|
-
<View style={[styles.modernTreeBranch, {borderColor: color}]} />
|
|
307
|
-
)}
|
|
308
|
-
</View>
|
|
309
|
-
<View style={styles.treeCardWrapper}>
|
|
310
|
-
<LogCard
|
|
311
|
-
item={log}
|
|
312
|
-
isSelected={selectedLogs.has(log.id)}
|
|
313
|
-
onToggleSelect={toggleSelect}
|
|
314
|
-
onPress={() => {
|
|
315
|
-
setSelected(log);
|
|
316
|
-
}}
|
|
317
|
-
timelineMinStart={minStart}
|
|
318
|
-
timelineTotalRange={totalRange}
|
|
319
|
-
isNew={newLogIds.has(log.id)}
|
|
320
|
-
searchStr={search}
|
|
321
|
-
/>
|
|
322
|
-
</View>
|
|
323
|
-
</AnimatedEntrance>
|
|
324
|
-
);
|
|
325
|
-
},
|
|
326
|
-
[
|
|
327
|
-
minStart,
|
|
328
|
-
totalRange,
|
|
329
|
-
newLogIds,
|
|
330
|
-
selectedLogs,
|
|
331
|
-
toggleSelect,
|
|
332
|
-
search,
|
|
333
|
-
toggleSectionFilter,
|
|
334
|
-
toggleSectionCollapse,
|
|
335
|
-
setSelected,
|
|
336
|
-
],
|
|
337
|
-
);
|
|
338
|
-
|
|
339
|
-
return (
|
|
340
|
-
<View style={{flex: 1}}>
|
|
341
|
-
<View style={{marginTop: 6}}>
|
|
342
|
-
{/* Network Health & Telemetry Strip */}
|
|
343
|
-
{networkMetrics != null && networkMetrics.totalCount > 0 && (
|
|
344
|
-
<View
|
|
345
|
-
style={{
|
|
346
|
-
flexDirection: 'row',
|
|
347
|
-
alignItems: 'center',
|
|
348
|
-
justifyContent: 'space-between',
|
|
349
|
-
backgroundColor: AppColors.grayBackground,
|
|
350
|
-
borderRadius: 8,
|
|
351
|
-
paddingHorizontal: 10,
|
|
352
|
-
paddingVertical: 5.5,
|
|
353
|
-
marginHorizontal: 12,
|
|
354
|
-
marginBottom: 6,
|
|
355
|
-
borderWidth: 1,
|
|
356
|
-
borderColor: AppColors.dividerColor,
|
|
357
|
-
}}>
|
|
358
|
-
{/* Success Rate */}
|
|
359
|
-
<View style={{flexDirection: 'row', alignItems: 'center', gap: 4.5}}>
|
|
360
|
-
<View
|
|
361
|
-
style={{
|
|
362
|
-
width: 6,
|
|
363
|
-
height: 6,
|
|
364
|
-
borderRadius: 3,
|
|
365
|
-
backgroundColor:
|
|
366
|
-
networkMetrics.successRate >= 95
|
|
367
|
-
? AppColors.greenColor
|
|
368
|
-
: networkMetrics.successRate >= 80
|
|
369
|
-
? AppColors.amber500
|
|
370
|
-
: AppColors.errorColor,
|
|
371
|
-
}}
|
|
372
|
-
/>
|
|
373
|
-
<Text style={{fontFamily: AppFonts.interBold, fontSize: 10.5, color: AppColors.primaryBlack}}>
|
|
374
|
-
{networkMetrics.successRate}%
|
|
375
|
-
</Text>
|
|
376
|
-
<Text style={{fontFamily: AppFonts.interRegular, fontSize: 10, color: AppColors.grayTextWeak}}>
|
|
377
|
-
{t('network.successRate')}
|
|
378
|
-
</Text>
|
|
379
|
-
</View>
|
|
380
|
-
|
|
381
|
-
<View style={{width: 1, height: 11, backgroundColor: AppColors.dividerColor}} />
|
|
382
|
-
|
|
383
|
-
{/* Avg Latency */}
|
|
384
|
-
<View style={{flexDirection: 'row', alignItems: 'center', gap: 4}}>
|
|
385
|
-
<ClockIcon color={AppColors.purple} size={10} />
|
|
386
|
-
<Text style={{fontFamily: AppFonts.interBold, fontSize: 10.5, color: AppColors.purple}}>
|
|
387
|
-
{networkMetrics.avgDuration}ms
|
|
388
|
-
</Text>
|
|
389
|
-
<Text style={{fontFamily: AppFonts.interRegular, fontSize: 10, color: AppColors.grayTextWeak}}>
|
|
390
|
-
{t('network.avgLatency')}
|
|
391
|
-
</Text>
|
|
392
|
-
</View>
|
|
393
|
-
|
|
394
|
-
<View style={{width: 1, height: 11, backgroundColor: AppColors.dividerColor}} />
|
|
395
|
-
|
|
396
|
-
{/* P95 Latency */}
|
|
397
|
-
<View style={{flexDirection: 'row', alignItems: 'center', gap: 4}}>
|
|
398
|
-
<Text style={{fontFamily: AppFonts.interBold, fontSize: 10.5, color: AppColors.primaryBlack}}>
|
|
399
|
-
{networkMetrics.p95}ms
|
|
400
|
-
</Text>
|
|
401
|
-
<Text style={{fontFamily: AppFonts.interRegular, fontSize: 10, color: AppColors.grayTextWeak}}>
|
|
402
|
-
P95
|
|
403
|
-
</Text>
|
|
404
|
-
</View>
|
|
405
|
-
</View>
|
|
406
|
-
)}
|
|
407
|
-
|
|
408
|
-
{/* Toolbar Row with Search & Actions */}
|
|
409
|
-
<View style={styles.toolbarRow}>
|
|
410
|
-
<View
|
|
411
|
-
style={[
|
|
412
|
-
styles.searchContainer,
|
|
413
|
-
isSearchFocused && {
|
|
414
|
-
borderColor: AppColors.purple,
|
|
415
|
-
borderWidth: 1.5,
|
|
416
|
-
},
|
|
417
|
-
]}>
|
|
418
|
-
<SearchIcon
|
|
419
|
-
color={
|
|
420
|
-
isSearchFocused
|
|
421
|
-
? AppColors.purple
|
|
422
|
-
: AppColors.grayTextWeak
|
|
423
|
-
}
|
|
424
|
-
size={15}
|
|
425
|
-
/>
|
|
426
|
-
<TextInput
|
|
427
|
-
placeholder="Search URL, status, method, headers, body..."
|
|
428
|
-
placeholderTextColor={AppColors.grayTextWeak}
|
|
429
|
-
value={search}
|
|
430
|
-
onChangeText={setSearch}
|
|
431
|
-
onFocus={() => setIsSearchFocused(true)}
|
|
432
|
-
onBlur={() => setIsSearchFocused(false)}
|
|
433
|
-
style={styles.searchInput}
|
|
434
|
-
autoCorrect={false}
|
|
435
|
-
autoCapitalize="none"
|
|
436
|
-
/>
|
|
437
|
-
|
|
438
|
-
{search.length > 0 && (
|
|
439
|
-
<View
|
|
440
|
-
style={{
|
|
441
|
-
flexDirection: 'row',
|
|
442
|
-
alignItems: 'center',
|
|
443
|
-
gap: 4,
|
|
444
|
-
}}>
|
|
445
|
-
<View
|
|
446
|
-
style={{
|
|
447
|
-
backgroundColor: `${AppColors.purple}20`,
|
|
448
|
-
borderRadius: 10,
|
|
449
|
-
paddingHorizontal: 6,
|
|
450
|
-
paddingVertical: 1.5,
|
|
451
|
-
}}>
|
|
452
|
-
<Text
|
|
453
|
-
style={{
|
|
454
|
-
color: AppColors.purple,
|
|
455
|
-
fontSize: 9.5,
|
|
456
|
-
fontFamily: AppFonts.interBold,
|
|
457
|
-
}}>
|
|
458
|
-
{filteredLogs.length}
|
|
459
|
-
</Text>
|
|
460
|
-
</View>
|
|
461
|
-
<Pressable
|
|
462
|
-
onPress={() => setSearch('')}
|
|
463
|
-
hitSlop={10}
|
|
464
|
-
style={styles.clearBtn}>
|
|
465
|
-
<ClearIcon
|
|
466
|
-
color={AppColors.grayTextWeak}
|
|
467
|
-
size={13}
|
|
468
|
-
/>
|
|
469
|
-
</Pressable>
|
|
470
|
-
</View>
|
|
471
|
-
)}
|
|
472
|
-
</View>
|
|
473
|
-
|
|
474
|
-
<View style={styles.toolbarRight}>
|
|
475
|
-
<TouchableScale
|
|
476
|
-
style={[
|
|
477
|
-
styles.toolbarBtn,
|
|
478
|
-
isNetworkPaused && {
|
|
479
|
-
borderColor: `${AppColors.darkOrange}50`,
|
|
480
|
-
backgroundColor: `${AppColors.darkOrange}18`,
|
|
481
|
-
},
|
|
482
|
-
]}
|
|
483
|
-
onPress={() => setIsNetworkPaused(p => !p)}
|
|
484
|
-
hitSlop={6}>
|
|
485
|
-
<HeaderPauseIcon
|
|
486
|
-
isPaused={isNetworkPaused}
|
|
487
|
-
color={
|
|
488
|
-
isNetworkPaused
|
|
489
|
-
? AppColors.darkOrange
|
|
490
|
-
: AppColors.grayTextStrong
|
|
491
|
-
}
|
|
492
|
-
size={16}
|
|
493
|
-
/>
|
|
494
|
-
</TouchableScale>
|
|
495
|
-
|
|
496
|
-
<TouchableScale
|
|
497
|
-
style={[
|
|
498
|
-
styles.toolbarBtn,
|
|
499
|
-
{
|
|
500
|
-
borderColor: `${AppColors.errorColor}38`,
|
|
501
|
-
backgroundColor: `${AppColors.errorColor}0F`,
|
|
502
|
-
},
|
|
503
|
-
]}
|
|
504
|
-
onPress={handleDelete}
|
|
505
|
-
hitSlop={6}>
|
|
506
|
-
<TrashIcon
|
|
507
|
-
color={AppColors.errorColor}
|
|
508
|
-
size={15}
|
|
509
|
-
/>
|
|
510
|
-
{selectedLogs.size > 0 && (
|
|
511
|
-
<View style={styles.trashBadge}>
|
|
512
|
-
<Text style={styles.trashBadgeText}>
|
|
513
|
-
{selectedLogs.size}
|
|
514
|
-
</Text>
|
|
515
|
-
</View>
|
|
516
|
-
)}
|
|
517
|
-
</TouchableScale>
|
|
518
|
-
|
|
519
|
-
<TouchableScale
|
|
520
|
-
style={styles.toolbarBtn}
|
|
521
|
-
onPress={() =>
|
|
522
|
-
setSortOrder(o =>
|
|
523
|
-
o === 'newest' ? 'oldest' : 'newest',
|
|
524
|
-
)
|
|
525
|
-
}
|
|
526
|
-
hitSlop={10}>
|
|
527
|
-
<SortArrowIcon
|
|
528
|
-
direction={
|
|
529
|
-
sortOrder === 'newest' ? 'down' : 'up'
|
|
530
|
-
}
|
|
531
|
-
color={AppColors.grayTextStrong}
|
|
532
|
-
size={18}
|
|
533
|
-
/>
|
|
534
|
-
</TouchableScale>
|
|
535
|
-
|
|
536
|
-
<TouchableScale
|
|
537
|
-
style={[
|
|
538
|
-
styles.toolbarBtn,
|
|
539
|
-
(statusFilters.size > 0 || methodFilters.size > 0) && {
|
|
540
|
-
borderColor: AppColors.purple,
|
|
541
|
-
backgroundColor: `${AppColors.purple}15`,
|
|
542
|
-
},
|
|
543
|
-
]}
|
|
544
|
-
onPress={() => setIsFilterModalOpen(true)}
|
|
545
|
-
hitSlop={6}>
|
|
546
|
-
<FilterIcon
|
|
547
|
-
color={
|
|
548
|
-
statusFilters.size > 0 || methodFilters.size > 0
|
|
549
|
-
? AppColors.purple
|
|
550
|
-
: AppColors.grayTextStrong
|
|
551
|
-
}
|
|
552
|
-
size={16}
|
|
553
|
-
/>
|
|
554
|
-
{(statusFilters.size > 0 ||
|
|
555
|
-
methodFilters.size > 0) && (
|
|
556
|
-
<View style={styles.activeFilterDot} />
|
|
557
|
-
)}
|
|
558
|
-
</TouchableScale>
|
|
559
|
-
</View>
|
|
560
|
-
</View>
|
|
561
|
-
|
|
562
|
-
{/* Quick Filter Horizontal Chips Bar with Sticky "More Filters" on Right */}
|
|
563
|
-
<View
|
|
564
|
-
style={{
|
|
565
|
-
flexDirection: 'row',
|
|
566
|
-
alignItems: 'center',
|
|
567
|
-
marginBottom: 8,
|
|
568
|
-
paddingHorizontal: 12,
|
|
569
|
-
gap: 6,
|
|
570
|
-
}}>
|
|
571
|
-
<ScrollView
|
|
572
|
-
horizontal
|
|
573
|
-
showsHorizontalScrollIndicator={false}
|
|
574
|
-
style={{flex: 1}}
|
|
575
|
-
contentContainerStyle={{
|
|
576
|
-
flexDirection: 'row',
|
|
577
|
-
alignItems: 'center',
|
|
578
|
-
gap: 6,
|
|
579
|
-
paddingRight: 6,
|
|
580
|
-
}}>
|
|
581
|
-
{QUICK_CHIPS.map(chip => {
|
|
582
|
-
const isActive = quickFilter === chip.id;
|
|
583
|
-
const chipColor = chip.color || AppColors.purple;
|
|
584
|
-
const iconColor = isActive ? AppColors.white : chipColor;
|
|
585
|
-
return (
|
|
586
|
-
<TouchableScale
|
|
587
|
-
key={chip.id}
|
|
588
|
-
onPress={() => {
|
|
589
|
-
setQuickFilter(isActive ? 'all' : chip.id);
|
|
590
|
-
}}>
|
|
591
|
-
<View
|
|
592
|
-
style={{
|
|
593
|
-
flexDirection: 'row',
|
|
594
|
-
alignItems: 'center',
|
|
595
|
-
paddingHorizontal: 9,
|
|
596
|
-
paddingVertical: 4.5,
|
|
597
|
-
borderRadius: 8,
|
|
598
|
-
backgroundColor: isActive
|
|
599
|
-
? chipColor
|
|
600
|
-
: `${chipColor}12`,
|
|
601
|
-
borderWidth: 1,
|
|
602
|
-
borderColor: isActive
|
|
603
|
-
? chipColor
|
|
604
|
-
: `${chipColor}30`,
|
|
605
|
-
gap: 5,
|
|
606
|
-
}}>
|
|
607
|
-
{chip.id === 'all' && <LayersIcon size={11} color={iconColor} />}
|
|
608
|
-
{chip.id === 'errors' && <CircleXIcon size={11} color={iconColor} />}
|
|
609
|
-
{chip.id === 'success' && <CircleCheckIcon size={11} color={iconColor} />}
|
|
610
|
-
{chip.id === 'slow' && <ClockIcon size={11} color={iconColor} />}
|
|
611
|
-
{chip.id === 'POST' && <RequestIcon size={11} color={iconColor} />}
|
|
612
|
-
{chip.id === 'GET' && <ResponseIcon size={11} color={iconColor} />}
|
|
613
|
-
{chip.id === 'graphql' && <AtomIcon size={11} color={iconColor} />}
|
|
614
|
-
<Text
|
|
615
|
-
style={{
|
|
616
|
-
fontFamily: AppFonts.interBold,
|
|
617
|
-
fontSize: 10.5,
|
|
618
|
-
color: isActive
|
|
619
|
-
? AppColors.white
|
|
620
|
-
: AppColors.primaryBlack,
|
|
621
|
-
}}>
|
|
622
|
-
{chip.label}
|
|
623
|
-
</Text>
|
|
624
|
-
<View
|
|
625
|
-
style={{
|
|
626
|
-
backgroundColor: isActive
|
|
627
|
-
? 'rgba(255,255,255,0.25)'
|
|
628
|
-
: `${chipColor}20`,
|
|
629
|
-
paddingHorizontal: 5,
|
|
630
|
-
paddingVertical: 1,
|
|
631
|
-
borderRadius: 8,
|
|
632
|
-
}}>
|
|
633
|
-
<Text
|
|
634
|
-
style={{
|
|
635
|
-
fontFamily: AppFonts.interBold,
|
|
636
|
-
fontSize: 9,
|
|
637
|
-
color: isActive ? AppColors.white : chipColor,
|
|
638
|
-
}}>
|
|
639
|
-
{chip.count}
|
|
640
|
-
</Text>
|
|
641
|
-
</View>
|
|
642
|
-
</View>
|
|
643
|
-
</TouchableScale>
|
|
644
|
-
);
|
|
645
|
-
})}
|
|
646
|
-
</ScrollView>
|
|
647
|
-
|
|
648
|
-
<TouchableScale
|
|
649
|
-
onPress={() => setIsFilterModalOpen(true)}
|
|
650
|
-
style={{flexShrink: 0}}>
|
|
651
|
-
<View
|
|
652
|
-
style={{
|
|
653
|
-
flexDirection: 'row',
|
|
654
|
-
alignItems: 'center',
|
|
655
|
-
paddingHorizontal: 10,
|
|
656
|
-
paddingVertical: 4.5,
|
|
657
|
-
borderRadius: 8,
|
|
658
|
-
backgroundColor:
|
|
659
|
-
statusFilters.size > 0 || methodFilters.size > 0
|
|
660
|
-
? `${AppColors.purple}20`
|
|
661
|
-
: AppColors.grayBackground,
|
|
662
|
-
borderWidth: 1,
|
|
663
|
-
borderColor:
|
|
664
|
-
statusFilters.size > 0 || methodFilters.size > 0
|
|
665
|
-
? AppColors.purple
|
|
666
|
-
: AppColors.grayBorderSecondary,
|
|
667
|
-
gap: 5,
|
|
668
|
-
shadowColor: AppColors.black,
|
|
669
|
-
shadowOpacity: 0.04,
|
|
670
|
-
shadowRadius: 2,
|
|
671
|
-
shadowOffset: {width: 0, height: 1},
|
|
672
|
-
elevation: 1,
|
|
673
|
-
}}>
|
|
674
|
-
<FilterIcon
|
|
675
|
-
size={11}
|
|
676
|
-
color={
|
|
677
|
-
statusFilters.size > 0 || methodFilters.size > 0
|
|
678
|
-
? AppColors.purple
|
|
679
|
-
: AppColors.grayText
|
|
680
|
-
}
|
|
681
|
-
/>
|
|
682
|
-
<Text
|
|
683
|
-
style={{
|
|
684
|
-
fontFamily: AppFonts.interBold,
|
|
685
|
-
fontSize: 10.5,
|
|
686
|
-
color:
|
|
687
|
-
statusFilters.size > 0 || methodFilters.size > 0
|
|
688
|
-
? AppColors.purple
|
|
689
|
-
: AppColors.grayText,
|
|
690
|
-
}}>
|
|
691
|
-
More Filters
|
|
692
|
-
</Text>
|
|
693
|
-
{(statusFilters.size > 0 || methodFilters.size > 0) && (
|
|
694
|
-
<View
|
|
695
|
-
style={{
|
|
696
|
-
backgroundColor: AppColors.purple,
|
|
697
|
-
paddingHorizontal: 4.5,
|
|
698
|
-
paddingVertical: 1,
|
|
699
|
-
borderRadius: 6,
|
|
700
|
-
}}>
|
|
701
|
-
<Text
|
|
702
|
-
style={{
|
|
703
|
-
fontFamily: AppFonts.interBold,
|
|
704
|
-
fontSize: 8.5,
|
|
705
|
-
color: AppColors.white,
|
|
706
|
-
}}>
|
|
707
|
-
{statusFilters.size + methodFilters.size}
|
|
708
|
-
</Text>
|
|
709
|
-
</View>
|
|
710
|
-
)}
|
|
711
|
-
</View>
|
|
712
|
-
</TouchableScale>
|
|
713
|
-
</View>
|
|
714
|
-
|
|
715
|
-
{/* Active Filter Helper Status Bar */}
|
|
716
|
-
{(quickFilter !== 'all' ||
|
|
717
|
-
search.trim().length > 0 ||
|
|
718
|
-
statusFilters.size > 0 ||
|
|
719
|
-
methodFilters.size > 0 ||
|
|
720
|
-
filteredLogs.length !== logs.length) && (
|
|
721
|
-
<View
|
|
722
|
-
style={{
|
|
723
|
-
flexDirection: 'row',
|
|
724
|
-
alignItems: 'center',
|
|
725
|
-
justifyContent: 'space-between',
|
|
726
|
-
marginHorizontal: 12,
|
|
727
|
-
marginBottom: 8,
|
|
728
|
-
paddingHorizontal: 10,
|
|
729
|
-
paddingVertical: 5.5,
|
|
730
|
-
backgroundColor: `${AppColors.purple}10`,
|
|
731
|
-
borderRadius: 8,
|
|
732
|
-
borderWidth: 1,
|
|
733
|
-
borderColor: `${AppColors.purple}25`,
|
|
734
|
-
}}>
|
|
735
|
-
<Text
|
|
736
|
-
style={{
|
|
737
|
-
fontFamily: AppFonts.interMedium,
|
|
738
|
-
fontSize: 10.5,
|
|
739
|
-
color: AppColors.purple,
|
|
740
|
-
}}>
|
|
741
|
-
Showing {filteredLogs.length} of {logs.length} requests
|
|
742
|
-
</Text>
|
|
743
|
-
<TouchableScale
|
|
744
|
-
onPress={() => {
|
|
745
|
-
setSearch('');
|
|
746
|
-
setQuickFilter('all');
|
|
747
|
-
setStatusFilters(new Set());
|
|
748
|
-
setMethodFilters(new Set());
|
|
749
|
-
}}>
|
|
750
|
-
<Text
|
|
751
|
-
style={{
|
|
752
|
-
fontFamily: AppFonts.interBold,
|
|
753
|
-
fontSize: 10.5,
|
|
754
|
-
color: AppColors.errorColor,
|
|
755
|
-
}}>
|
|
756
|
-
Clear All Filters
|
|
757
|
-
</Text>
|
|
758
|
-
</TouchableScale>
|
|
759
|
-
</View>
|
|
760
|
-
)}
|
|
761
|
-
</View>
|
|
762
|
-
|
|
763
|
-
<FlatList
|
|
764
|
-
ref={apisListRef}
|
|
765
|
-
data={groupedData}
|
|
766
|
-
keyExtractor={item => item?.id?.toString()}
|
|
767
|
-
renderItem={renderItem}
|
|
768
|
-
initialNumToRender={12}
|
|
769
|
-
maxToRenderPerBatch={8}
|
|
770
|
-
windowSize={5}
|
|
771
|
-
removeClippedSubviews={Platform.OS === 'android'}
|
|
772
|
-
renderToHardwareTextureAndroid={true}
|
|
773
|
-
ListEmptyComponent={
|
|
774
|
-
<EmptyState
|
|
775
|
-
isSearch={
|
|
776
|
-
search.length > 0 ||
|
|
777
|
-
statusFilters.size > 0 ||
|
|
778
|
-
methodFilters.size > 0 ||
|
|
779
|
-
quickFilter !== 'all'
|
|
780
|
-
}
|
|
781
|
-
searchQuery={search}
|
|
782
|
-
customTitle={
|
|
783
|
-
search.length > 0
|
|
784
|
-
? 'No matching API requests'
|
|
785
|
-
: 'No network activity'
|
|
786
|
-
}
|
|
787
|
-
onClearSearch={() => {
|
|
788
|
-
setSearch('');
|
|
789
|
-
setStatusFilters(new Set());
|
|
790
|
-
setMethodFilters(new Set());
|
|
791
|
-
setQuickFilter('all');
|
|
792
|
-
setSearchScope('all');
|
|
793
|
-
}}
|
|
794
|
-
/>
|
|
795
|
-
}
|
|
796
|
-
ListFooterComponent={
|
|
797
|
-
groupedData.length > 0 ? (
|
|
798
|
-
<EndOfListFooter count={filteredLogs.length} label="requests" />
|
|
799
|
-
) : null
|
|
800
|
-
}
|
|
801
|
-
contentContainerStyle={[
|
|
802
|
-
styles.listContent,
|
|
803
|
-
filteredLogs.length === 0 && {flexGrow: 1},
|
|
804
|
-
]}
|
|
805
|
-
keyboardShouldPersistTaps="handled"
|
|
806
|
-
/>
|
|
807
|
-
|
|
808
|
-
{/* Modern Network Filter Modal */}
|
|
809
|
-
<NetworkFilterModal
|
|
810
|
-
visible={isFilterModalOpen}
|
|
811
|
-
onClose={() => setIsFilterModalOpen(false)}
|
|
812
|
-
filters={modalFilterState}
|
|
813
|
-
onApply={handleApplyNetworkFilters}
|
|
814
|
-
searchQuery={search}
|
|
815
|
-
/>
|
|
816
|
-
</View>
|
|
817
|
-
);
|
|
818
|
-
});
|
|
819
|
-
|
|
820
|
-
export default NetworkTab;
|