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,613 +1,138 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import { AppColors } from '../../styles/AppColors';
|
|
5
|
-
import { AppFonts } from '../../styles/AppFonts';
|
|
6
|
-
import { useTranslation } from '../../i18n';
|
|
7
|
-
import { METHOD_COLORS } from '../../constants';
|
|
8
|
-
import { FilterIcon, CloseWhite, ClockIcon, CircleCheckIcon, CircleAlertIcon, CircleXIcon, LayersIcon, RepeatIcon, ShieldAlertIcon, BoltIcon, GlobeIcon, LockIcon, UnlockIcon, RocketIcon, TurtleIcon, HourglassIcon, PackageIcon, } from '../NetworkIcons';
|
|
9
|
-
import TouchableScale from '../TouchableScale';
|
|
10
|
-
export const DEFAULT_NETWORK_FILTERS = {
|
|
11
|
-
statusCodes: new Set(['all']),
|
|
12
|
-
methods: new Set(['all']),
|
|
13
|
-
latency: 'all',
|
|
14
|
-
protocol: 'all',
|
|
15
|
-
sortBy: 'time_desc',
|
|
16
|
-
};
|
|
17
|
-
export const isNetworkFiltersDefault = (f) => (f.statusCodes.has('all') || f.statusCodes.size === 0) &&
|
|
18
|
-
(f.methods.has('all') || f.methods.size === 0) &&
|
|
19
|
-
f.latency === 'all' &&
|
|
20
|
-
f.protocol === 'all' &&
|
|
21
|
-
f.sortBy === 'time_desc';
|
|
22
|
-
export const NetworkFilterModal = ({ visible, onClose, filters, onApply, searchQuery = '', }) => {
|
|
23
|
-
const { t } = useTranslation();
|
|
24
|
-
const { logs } = useInspector();
|
|
25
|
-
const [draft, setDraft] = useState(() => ({
|
|
26
|
-
...filters,
|
|
27
|
-
statusCodes: new Set(filters.statusCodes),
|
|
28
|
-
methods: new Set(filters.methods),
|
|
29
|
-
}));
|
|
30
|
-
useEffect(() => {
|
|
31
|
-
if (visible) {
|
|
32
|
-
setDraft({
|
|
33
|
-
...filters,
|
|
34
|
-
statusCodes: new Set(filters.statusCodes),
|
|
35
|
-
methods: new Set(filters.methods),
|
|
36
|
-
});
|
|
37
|
-
}
|
|
38
|
-
}, [visible, filters]);
|
|
39
|
-
const counts = useMemo(() => {
|
|
40
|
-
const statusMap = {
|
|
41
|
-
all: logs.length,
|
|
42
|
-
'2xx': 0,
|
|
43
|
-
'3xx': 0,
|
|
44
|
-
'4xx': 0,
|
|
45
|
-
'5xx': 0,
|
|
46
|
-
failed: 0,
|
|
47
|
-
};
|
|
48
|
-
const methodMap = { all: logs.length };
|
|
49
|
-
let fastCount = 0;
|
|
50
|
-
let normalCount = 0;
|
|
51
|
-
let slowCount = 0;
|
|
52
|
-
let httpsCount = 0;
|
|
53
|
-
let httpCount = 0;
|
|
54
|
-
for (const log of logs) {
|
|
55
|
-
const s = typeof log.status === 'number' ? log.status : parseInt(String(log.status), 10);
|
|
56
|
-
if (log.status === 0 || log.status == null) {
|
|
57
|
-
statusMap.failed = (statusMap.failed || 0) + 1;
|
|
58
|
-
}
|
|
59
|
-
else if (!isNaN(s)) {
|
|
60
|
-
if (s >= 200 && s < 300)
|
|
61
|
-
statusMap['2xx'] = (statusMap['2xx'] || 0) + 1;
|
|
62
|
-
else if (s >= 300 && s < 400)
|
|
63
|
-
statusMap['3xx'] = (statusMap['3xx'] || 0) + 1;
|
|
64
|
-
else if (s >= 400 && s < 500)
|
|
65
|
-
statusMap['4xx'] = (statusMap['4xx'] || 0) + 1;
|
|
66
|
-
else if (s >= 500)
|
|
67
|
-
statusMap['5xx'] = (statusMap['5xx'] || 0) + 1;
|
|
68
|
-
}
|
|
69
|
-
const m = (log.method || 'GET').toUpperCase();
|
|
70
|
-
methodMap[m] = (methodMap[m] || 0) + 1;
|
|
71
|
-
const dur = log.duration || 0;
|
|
72
|
-
if (dur < 200)
|
|
73
|
-
fastCount++;
|
|
74
|
-
else if (dur <= 500)
|
|
75
|
-
normalCount++;
|
|
76
|
-
else
|
|
77
|
-
slowCount++;
|
|
78
|
-
if ((log.url || '').toLowerCase().startsWith('https'))
|
|
79
|
-
httpsCount++;
|
|
80
|
-
else
|
|
81
|
-
httpCount++;
|
|
82
|
-
}
|
|
83
|
-
return {
|
|
84
|
-
statusMap,
|
|
85
|
-
methodMap,
|
|
86
|
-
fastCount,
|
|
87
|
-
normalCount,
|
|
88
|
-
slowCount,
|
|
89
|
-
httpsCount,
|
|
90
|
-
httpCount,
|
|
91
|
-
};
|
|
92
|
-
}, [logs]);
|
|
93
|
-
const previewMatchCount = useMemo(() => {
|
|
94
|
-
return logs.filter(log => {
|
|
95
|
-
if (!draft.statusCodes.has('all') && draft.statusCodes.size > 0) {
|
|
96
|
-
const s = typeof log.status === 'number' ? log.status : parseInt(String(log.status), 10);
|
|
97
|
-
let matches = false;
|
|
98
|
-
if (draft.statusCodes.has('failed') && (log.status === 0 || log.status == null))
|
|
99
|
-
matches = true;
|
|
100
|
-
if (draft.statusCodes.has('2xx') && !isNaN(s) && s >= 200 && s < 300)
|
|
101
|
-
matches = true;
|
|
102
|
-
if (draft.statusCodes.has('3xx') && !isNaN(s) && s >= 300 && s < 400)
|
|
103
|
-
matches = true;
|
|
104
|
-
if (draft.statusCodes.has('4xx') && !isNaN(s) && s >= 400 && s < 500)
|
|
105
|
-
matches = true;
|
|
106
|
-
if (draft.statusCodes.has('5xx') && !isNaN(s) && s >= 500)
|
|
107
|
-
matches = true;
|
|
108
|
-
if (!matches)
|
|
109
|
-
return false;
|
|
110
|
-
}
|
|
111
|
-
if (!draft.methods.has('all') && draft.methods.size > 0) {
|
|
112
|
-
const m = (log.method || 'GET').toUpperCase();
|
|
113
|
-
if (!draft.methods.has(m))
|
|
114
|
-
return false;
|
|
115
|
-
}
|
|
116
|
-
const dur = log.duration || 0;
|
|
117
|
-
if (draft.latency === 'fast' && dur >= 200)
|
|
118
|
-
return false;
|
|
119
|
-
if (draft.latency === 'normal' && (dur < 200 || dur > 500))
|
|
120
|
-
return false;
|
|
121
|
-
if (draft.latency === 'slow' && dur <= 500)
|
|
122
|
-
return false;
|
|
123
|
-
const isHttps = (log.url || '').toLowerCase().startsWith('https');
|
|
124
|
-
if (draft.protocol === 'https' && !isHttps)
|
|
125
|
-
return false;
|
|
126
|
-
if (draft.protocol === 'http' && isHttps)
|
|
127
|
-
return false;
|
|
128
|
-
if (searchQuery.trim().length > 0) {
|
|
129
|
-
const q = searchQuery.toLowerCase();
|
|
130
|
-
const u = (log.url || '').toLowerCase();
|
|
131
|
-
if (!u.includes(q))
|
|
132
|
-
return false;
|
|
133
|
-
}
|
|
134
|
-
return true;
|
|
135
|
-
}).length;
|
|
136
|
-
}, [logs, draft, searchQuery]);
|
|
137
|
-
const toggleStatus = (key) => {
|
|
138
|
-
setDraft(prev => {
|
|
139
|
-
const next = new Set(prev.statusCodes);
|
|
140
|
-
if (key === 'all') {
|
|
141
|
-
return { ...prev, statusCodes: new Set(['all']) };
|
|
142
|
-
}
|
|
143
|
-
next.delete('all');
|
|
144
|
-
if (next.has(key)) {
|
|
145
|
-
next.delete(key);
|
|
146
|
-
if (next.size === 0)
|
|
147
|
-
next.add('all');
|
|
148
|
-
}
|
|
149
|
-
else {
|
|
150
|
-
next.add(key);
|
|
151
|
-
}
|
|
152
|
-
return { ...prev, statusCodes: next };
|
|
153
|
-
});
|
|
154
|
-
};
|
|
155
|
-
const toggleMethod = (key) => {
|
|
156
|
-
setDraft(prev => {
|
|
157
|
-
const next = new Set(prev.methods);
|
|
158
|
-
if (key === 'all') {
|
|
159
|
-
return { ...prev, methods: new Set(['all']) };
|
|
160
|
-
}
|
|
161
|
-
next.delete('all');
|
|
162
|
-
if (next.has(key)) {
|
|
163
|
-
next.delete(key);
|
|
164
|
-
if (next.size === 0)
|
|
165
|
-
next.add('all');
|
|
166
|
-
}
|
|
167
|
-
else {
|
|
168
|
-
next.add(key);
|
|
169
|
-
}
|
|
170
|
-
return { ...prev, methods: next };
|
|
171
|
-
});
|
|
172
|
-
};
|
|
173
|
-
const handleReset = () => {
|
|
174
|
-
setDraft({
|
|
175
|
-
statusCodes: new Set(['all']),
|
|
176
|
-
methods: new Set(['all']),
|
|
177
|
-
latency: 'all',
|
|
178
|
-
protocol: 'all',
|
|
179
|
-
sortBy: 'time_desc',
|
|
180
|
-
});
|
|
181
|
-
};
|
|
182
|
-
const handleApply = () => {
|
|
183
|
-
onApply(draft);
|
|
184
|
-
onClose();
|
|
185
|
-
};
|
|
186
|
-
const activeFiltersCount = useMemo(() => {
|
|
187
|
-
let count = 0;
|
|
188
|
-
if (!draft.statusCodes.has('all') && draft.statusCodes.size > 0)
|
|
189
|
-
count += draft.statusCodes.size;
|
|
190
|
-
if (!draft.methods.has('all') && draft.methods.size > 0)
|
|
191
|
-
count += draft.methods.size;
|
|
192
|
-
if (draft.latency !== 'all')
|
|
193
|
-
count++;
|
|
194
|
-
if (draft.protocol !== 'all')
|
|
195
|
-
count++;
|
|
196
|
-
if (draft.sortBy !== 'time_desc')
|
|
197
|
-
count++;
|
|
198
|
-
return count;
|
|
199
|
-
}, [draft]);
|
|
200
|
-
return (<Modal visible={visible} transparent animationType="fade" onRequestClose={onClose}>
|
|
201
|
-
<Pressable style={styles.overlay} onPress={onClose}>
|
|
202
|
-
<Pressable style={styles.modalCard} onPress={e => e.stopPropagation()}>
|
|
1
|
+
import{useEffect as te,useMemo as N,useState as le}from"react";import{Modal as Ce,Pressable as Y,ScrollView as Te,StyleSheet as we,Text as S,TouchableOpacity as L,View as T}from"react-native";import{useInspector as me}from"./InspectorContext";import{AppColors as t}from"../../styles/AppColors";import{AppFonts as B}from"../../styles/AppFonts";import{useTranslation as ke}from"../../i18n";import{METHOD_COLORS as Se}from"../../constants";import{FilterIcon as Be,CloseWhite as Pe,ClockIcon as K,CircleCheckIcon as Ie,CircleAlertIcon as X,CircleXIcon as Oe,LayersIcon as A,RepeatIcon as ze,ShieldAlertIcon as Ve,BoltIcon as Re,GlobeIcon as Fe,LockIcon as Le,UnlockIcon as We,RocketIcon as Ee,TurtleIcon as Me,HourglassIcon as Ne,PackageIcon as Ae}from"../NetworkIcons";import J from"../TouchableScale";export const DEFAULT_NETWORK_FILTERS={statusCodes:new Set(["all"]),methods:new Set(["all"]),latency:"all",protocol:"all",sortBy:"time_desc"},isNetworkFiltersDefault=I=>(I.statusCodes.has("all")||I.statusCodes.size===0)&&(I.methods.has("all")||I.methods.size===0)&&I.latency==="all"&&I.protocol==="all"&&I.sortBy==="time_desc",NetworkFilterModal=({visible:I,onClose:E,filters:R,onApply:Z,searchQuery:M=""})=>{const{t:De}=ke(),{logs:W}=me(),[r,F]=le(()=>({...R,statusCodes:new Set(R.statusCodes),methods:new Set(R.methods)}));te(()=>{I&&F({...R,statusCodes:new Set(R.statusCodes),methods:new Set(R.methods)})},[I,R]);const P=N(()=>{const e={all:W.length,"2xx":0,"3xx":0,"4xx":0,"5xx":0,failed:0},l={all:W.length};let C=0,g=0,O=0,v=0,_=0;for(const z of W){const V=typeof z.status=="number"?z.status:parseInt(String(z.status),10);z.status===0||z.status==null?e.failed=(e.failed||0)+1:isNaN(V)||(V>=200&&V<300?e["2xx"]=(e["2xx"]||0)+1:V>=300&&V<400?e["3xx"]=(e["3xx"]||0)+1:V>=400&&V<500?e["4xx"]=(e["4xx"]||0)+1:V>=500&&(e["5xx"]=(e["5xx"]||0)+1));const U=(z.method||"GET").toUpperCase();l[U]=(l[U]||0)+1;const G=z.duration||0;G<200?C++:G<=500?g++:O++,(z.url||"").toLowerCase().startsWith("https")?v++:_++}return{statusMap:e,methodMap:l,fastCount:C,normalCount:g,slowCount:O,httpsCount:v,httpCount:_}},[W]),D=N(()=>W.filter(e=>{if(!r.statusCodes.has("all")&&r.statusCodes.size>0){const g=typeof e.status=="number"?e.status:parseInt(String(e.status),10);let O=!1;if(r.statusCodes.has("failed")&&(e.status===0||e.status==null)&&(O=!0),r.statusCodes.has("2xx")&&!isNaN(g)&&g>=200&&g<300&&(O=!0),r.statusCodes.has("3xx")&&!isNaN(g)&&g>=300&&g<400&&(O=!0),r.statusCodes.has("4xx")&&!isNaN(g)&&g>=400&&g<500&&(O=!0),r.statusCodes.has("5xx")&&!isNaN(g)&&g>=500&&(O=!0),!O)return!1}if(!r.methods.has("all")&&r.methods.size>0){const g=(e.method||"GET").toUpperCase();if(!r.methods.has(g))return!1}const l=e.duration||0;if(r.latency==="fast"&&l>=200||r.latency==="normal"&&(l<200||l>500)||r.latency==="slow"&&l<=500)return!1;const C=(e.url||"").toLowerCase().startsWith("https");if(r.protocol==="https"&&!C||r.protocol==="http"&&C)return!1;if(M.trim().length>0){const g=M.toLowerCase();if(!(e.url||"").toLowerCase().includes(g))return!1}return!0}).length,[W,r,M]),Q=e=>{F(l=>{const C=new Set(l.statusCodes);return e==="all"?{...l,statusCodes:new Set(["all"])}:(C.delete("all"),C.has(e)?(C.delete(e),C.size===0&&C.add("all")):C.add(e),{...l,statusCodes:C})})},H=e=>{F(l=>{const C=new Set(l.methods);return e==="all"?{...l,methods:new Set(["all"])}:(C.delete("all"),C.has(e)?(C.delete(e),C.size===0&&C.add("all")):C.add(e),{...l,methods:C})})},ee=()=>{F({statusCodes:new Set(["all"]),methods:new Set(["all"]),latency:"all",protocol:"all",sortBy:"time_desc"})},oe=()=>{Z(r),E()},$=N(()=>{let e=0;return!r.statusCodes.has("all")&&r.statusCodes.size>0&&(e+=r.statusCodes.size),!r.methods.has("all")&&r.methods.size>0&&(e+=r.methods.size),r.latency!=="all"&&e++,r.protocol!=="all"&&e++,r.sortBy!=="time_desc"&&e++,e},[r]);return<Ce visible={I}transparent animationType="fade"onRequestClose={E}>
|
|
2
|
+
<Y style={o.overlay}onPress={E}>
|
|
3
|
+
<Y style={o.modalCard}onPress={e=>e.stopPropagation()}>
|
|
203
4
|
|
|
204
|
-
<
|
|
205
|
-
<
|
|
206
|
-
<
|
|
207
|
-
<
|
|
208
|
-
</
|
|
209
|
-
<
|
|
210
|
-
<
|
|
211
|
-
<
|
|
212
|
-
{
|
|
213
|
-
<
|
|
214
|
-
</
|
|
215
|
-
</
|
|
216
|
-
<
|
|
217
|
-
</
|
|
218
|
-
</
|
|
219
|
-
<
|
|
220
|
-
<
|
|
221
|
-
</
|
|
222
|
-
</
|
|
5
|
+
<T style={o.header}>
|
|
6
|
+
<T style={o.headerLeft}>
|
|
7
|
+
<T style={o.iconCircle}>
|
|
8
|
+
<Be size={16}color={t.purple}/>
|
|
9
|
+
</T>
|
|
10
|
+
<T>
|
|
11
|
+
<T style={{flexDirection:"row",alignItems:"center",gap:6}}>
|
|
12
|
+
<S style={o.title}>Network Filters</S>
|
|
13
|
+
{$>0&&<T style={o.activeBadge}>
|
|
14
|
+
<S style={o.activeBadgeText}>{$} active</S>
|
|
15
|
+
</T>}
|
|
16
|
+
</T>
|
|
17
|
+
<S style={o.subtitle}>Filter requests by status, method & speed</S>
|
|
18
|
+
</T>
|
|
19
|
+
</T>
|
|
20
|
+
<L onPress={E}hitSlop={10}style={o.closeBtn}>
|
|
21
|
+
<Pe size={14}color={t.grayText}/>
|
|
22
|
+
</L>
|
|
23
|
+
</T>
|
|
223
24
|
|
|
224
|
-
<
|
|
25
|
+
<Te style={o.scrollArea}contentContainerStyle={o.scrollContent}showsVerticalScrollIndicator={!1}>
|
|
225
26
|
|
|
226
|
-
<
|
|
227
|
-
<
|
|
228
|
-
<
|
|
229
|
-
{[
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
backgroundColor: `${item.color}15`,
|
|
243
|
-
borderColor: item.color,
|
|
244
|
-
},
|
|
245
|
-
]}>
|
|
246
|
-
<IconComp size={13} color={isSelected ? item.color : AppColors.grayTextWeak}/>
|
|
247
|
-
<Text style={[
|
|
248
|
-
styles.chipLabel,
|
|
249
|
-
isSelected && { color: item.color, fontFamily: AppFonts.interBold },
|
|
250
|
-
]}>
|
|
251
|
-
{item.label}
|
|
252
|
-
</Text>
|
|
253
|
-
<View style={[
|
|
254
|
-
styles.countPill,
|
|
255
|
-
isSelected && { backgroundColor: `${item.color}25` },
|
|
256
|
-
]}>
|
|
257
|
-
<Text style={[
|
|
258
|
-
styles.countPillText,
|
|
259
|
-
isSelected && { color: item.color },
|
|
260
|
-
]}>
|
|
261
|
-
{item.count}
|
|
262
|
-
</Text>
|
|
263
|
-
</View>
|
|
264
|
-
</TouchableOpacity>);
|
|
265
|
-
})}
|
|
266
|
-
</View>
|
|
267
|
-
</View>
|
|
27
|
+
<T style={o.section}>
|
|
28
|
+
<S style={o.sectionTitle}>HTTP STATUS CODE</S>
|
|
29
|
+
<T style={o.chipsWrap}>
|
|
30
|
+
{[{key:"all",label:"All Statuses",color:t.purple,icon:A,count:P.statusMap.all},{key:"2xx",label:"2xx Success",color:t.greenColor,icon:Ie,count:P.statusMap["2xx"]||0},{key:"3xx",label:"3xx Redirect",color:t.warningIconGold,icon:ze,count:P.statusMap["3xx"]||0},{key:"4xx",label:"4xx Client Error",color:t.darkOrange,icon:X,count:P.statusMap["4xx"]||0},{key:"5xx",label:"5xx Server Error",color:t.errorColor,icon:Oe,count:P.statusMap["5xx"]||0},{key:"failed",label:"Network Failed / 0",color:t.errorColor,icon:Ve,count:P.statusMap.failed||0}].map(e=>{const l=r.statusCodes.has(e.key),C=e.icon;return<L key={e.key}activeOpacity={.7}onPress={()=>Q(e.key)}style={[o.chip,l&&{backgroundColor:`${e.color}15`,borderColor:e.color}]}>
|
|
31
|
+
<C size={13}color={l?e.color:t.grayTextWeak}/>
|
|
32
|
+
<S style={[o.chipLabel,l&&{color:e.color,fontFamily:B.interBold}]}>
|
|
33
|
+
{e.label}
|
|
34
|
+
</S>
|
|
35
|
+
<T style={[o.countPill,l&&{backgroundColor:`${e.color}25`}]}>
|
|
36
|
+
<S style={[o.countPillText,l&&{color:e.color}]}>
|
|
37
|
+
{e.count}
|
|
38
|
+
</S>
|
|
39
|
+
</T>
|
|
40
|
+
</L>})}
|
|
41
|
+
</T>
|
|
42
|
+
</T>
|
|
268
43
|
|
|
269
44
|
|
|
270
|
-
<
|
|
271
|
-
<
|
|
272
|
-
<
|
|
273
|
-
<
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
backgroundColor: `${AppColors.purple}15`,
|
|
277
|
-
borderColor: AppColors.purple,
|
|
278
|
-
},
|
|
279
|
-
]}>
|
|
280
|
-
<LayersIcon size={12} color={draft.methods.has('all') ? AppColors.purple : AppColors.grayTextWeak}/>
|
|
281
|
-
<Text style={[
|
|
282
|
-
styles.chipLabel,
|
|
283
|
-
draft.methods.has('all') && { color: AppColors.purple, fontFamily: AppFonts.interBold },
|
|
284
|
-
]}>
|
|
45
|
+
<T style={o.section}>
|
|
46
|
+
<S style={o.sectionTitle}>HTTP METHOD</S>
|
|
47
|
+
<T style={o.chipsWrap}>
|
|
48
|
+
<L activeOpacity={.7}onPress={()=>H("all")}style={[o.chip,r.methods.has("all")&&{backgroundColor:`${t.purple}15`,borderColor:t.purple}]}>
|
|
49
|
+
<A size={12}color={r.methods.has("all")?t.purple:t.grayTextWeak}/>
|
|
50
|
+
<S style={[o.chipLabel,r.methods.has("all")&&{color:t.purple,fontFamily:B.interBold}]}>
|
|
285
51
|
All Methods
|
|
286
|
-
</
|
|
287
|
-
<
|
|
288
|
-
<
|
|
289
|
-
{
|
|
290
|
-
</
|
|
291
|
-
</
|
|
292
|
-
</
|
|
52
|
+
</S>
|
|
53
|
+
<T style={[o.countPill,r.methods.has("all")&&{backgroundColor:`${t.purple}25`}]}>
|
|
54
|
+
<S style={[o.countPillText,r.methods.has("all")&&{color:t.purple}]}>
|
|
55
|
+
{P.methodMap.all}
|
|
56
|
+
</S>
|
|
57
|
+
</T>
|
|
58
|
+
</L>
|
|
293
59
|
|
|
294
|
-
{[
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
styles.chipLabel,
|
|
308
|
-
isSelected && { color: mColor, fontFamily: AppFonts.interBold },
|
|
309
|
-
]}>
|
|
310
|
-
{m}
|
|
311
|
-
</Text>
|
|
312
|
-
<View style={[
|
|
313
|
-
styles.countPill,
|
|
314
|
-
isSelected && { backgroundColor: `${mColor}25` },
|
|
315
|
-
]}>
|
|
316
|
-
<Text style={[
|
|
317
|
-
styles.countPillText,
|
|
318
|
-
isSelected && { color: mColor },
|
|
319
|
-
]}>
|
|
320
|
-
{count}
|
|
321
|
-
</Text>
|
|
322
|
-
</View>
|
|
323
|
-
</TouchableOpacity>);
|
|
324
|
-
})}
|
|
325
|
-
</View>
|
|
326
|
-
</View>
|
|
60
|
+
{["GET","POST","PUT","DELETE","PATCH","QUERY","OPTIONS","HEAD"].map(e=>{const l=r.methods.has(e),C=Se[e]||t.grayText,g=P.methodMap[e]||0;return<L key={e}activeOpacity={.7}onPress={()=>H(e)}style={[o.chip,l&&{backgroundColor:`${C}18`,borderColor:C}]}>
|
|
61
|
+
<T style={[o.methodDot,{backgroundColor:C}]}/>
|
|
62
|
+
<S style={[o.chipLabel,l&&{color:C,fontFamily:B.interBold}]}>
|
|
63
|
+
{e}
|
|
64
|
+
</S>
|
|
65
|
+
<T style={[o.countPill,l&&{backgroundColor:`${C}25`}]}>
|
|
66
|
+
<S style={[o.countPillText,l&&{color:C}]}>
|
|
67
|
+
{g}
|
|
68
|
+
</S>
|
|
69
|
+
</T>
|
|
70
|
+
</L>})}
|
|
71
|
+
</T>
|
|
72
|
+
</T>
|
|
327
73
|
|
|
328
74
|
|
|
329
|
-
<
|
|
330
|
-
<
|
|
331
|
-
<
|
|
332
|
-
{[
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
},
|
|
346
|
-
]}>
|
|
347
|
-
<IconComp size={13} color={isSelected ? item.color : AppColors.grayTextWeak}/>
|
|
348
|
-
<Text style={[
|
|
349
|
-
styles.chipLabel,
|
|
350
|
-
isSelected && { color: item.color, fontFamily: AppFonts.interBold },
|
|
351
|
-
]}>
|
|
352
|
-
{item.label}
|
|
353
|
-
</Text>
|
|
354
|
-
{item.count != null && (<View style={[styles.countPill, isSelected && { backgroundColor: `${item.color}25` }]}>
|
|
355
|
-
<Text style={[styles.countPillText, isSelected && { color: item.color }]}>
|
|
356
|
-
{item.count}
|
|
357
|
-
</Text>
|
|
358
|
-
</View>)}
|
|
359
|
-
</TouchableOpacity>);
|
|
360
|
-
})}
|
|
361
|
-
</View>
|
|
362
|
-
</View>
|
|
75
|
+
<T style={o.section}>
|
|
76
|
+
<S style={o.sectionTitle}>LATENCY & SPEED</S>
|
|
77
|
+
<T style={o.chipsWrap}>
|
|
78
|
+
{[{key:"all",label:"All Speeds",color:t.purple,icon:A},{key:"fast",label:"Fast (<200ms)",color:t.greenColor,icon:Re,count:P.fastCount},{key:"normal",label:"Normal (200-500ms)",color:t.skyBlue,icon:K,count:P.normalCount},{key:"slow",label:"Slow (>500ms)",color:t.errorColor,icon:X,count:P.slowCount}].map(e=>{const l=r.latency===e.key,C=e.icon;return<L key={e.key}activeOpacity={.7}onPress={()=>F(g=>({...g,latency:e.key}))}style={[o.chip,l&&{backgroundColor:`${e.color}15`,borderColor:e.color}]}>
|
|
79
|
+
<C size={13}color={l?e.color:t.grayTextWeak}/>
|
|
80
|
+
<S style={[o.chipLabel,l&&{color:e.color,fontFamily:B.interBold}]}>
|
|
81
|
+
{e.label}
|
|
82
|
+
</S>
|
|
83
|
+
{e.count!=null&&<T style={[o.countPill,l&&{backgroundColor:`${e.color}25`}]}>
|
|
84
|
+
<S style={[o.countPillText,l&&{color:e.color}]}>
|
|
85
|
+
{e.count}
|
|
86
|
+
</S>
|
|
87
|
+
</T>}
|
|
88
|
+
</L>})}
|
|
89
|
+
</T>
|
|
90
|
+
</T>
|
|
363
91
|
|
|
364
92
|
|
|
365
|
-
<
|
|
366
|
-
<
|
|
367
|
-
<
|
|
368
|
-
{[
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
]}>
|
|
382
|
-
<IconComp size={13} color={isSelected ? item.color : AppColors.grayTextWeak}/>
|
|
383
|
-
<Text style={[
|
|
384
|
-
styles.chipLabel,
|
|
385
|
-
isSelected && { color: item.color, fontFamily: AppFonts.interBold },
|
|
386
|
-
]}>
|
|
387
|
-
{item.label}
|
|
388
|
-
</Text>
|
|
389
|
-
{item.count != null && (<View style={[styles.countPill, isSelected && { backgroundColor: `${item.color}25` }]}>
|
|
390
|
-
<Text style={[styles.countPillText, isSelected && { color: item.color }]}>
|
|
391
|
-
{item.count}
|
|
392
|
-
</Text>
|
|
393
|
-
</View>)}
|
|
394
|
-
</TouchableOpacity>);
|
|
395
|
-
})}
|
|
396
|
-
</View>
|
|
397
|
-
</View>
|
|
93
|
+
<T style={o.section}>
|
|
94
|
+
<S style={o.sectionTitle}>PROTOCOL</S>
|
|
95
|
+
<T style={o.chipsWrap}>
|
|
96
|
+
{[{key:"all",label:"All Protocols",color:t.purple,icon:Fe},{key:"https",label:"HTTPS Secure",color:t.mintGreenText,icon:Le,count:P.httpsCount},{key:"http",label:"HTTP Insecure",color:t.amber700,icon:We,count:P.httpCount}].map(e=>{const l=r.protocol===e.key,C=e.icon;return<L key={e.key}activeOpacity={.7}onPress={()=>F(g=>({...g,protocol:e.key}))}style={[o.chip,l&&{backgroundColor:`${e.color}15`,borderColor:e.color}]}>
|
|
97
|
+
<C size={13}color={l?e.color:t.grayTextWeak}/>
|
|
98
|
+
<S style={[o.chipLabel,l&&{color:e.color,fontFamily:B.interBold}]}>
|
|
99
|
+
{e.label}
|
|
100
|
+
</S>
|
|
101
|
+
{e.count!=null&&<T style={[o.countPill,l&&{backgroundColor:`${e.color}25`}]}>
|
|
102
|
+
<S style={[o.countPillText,l&&{color:e.color}]}>
|
|
103
|
+
{e.count}
|
|
104
|
+
</S>
|
|
105
|
+
</T>}
|
|
106
|
+
</L>})}
|
|
107
|
+
</T>
|
|
108
|
+
</T>
|
|
398
109
|
|
|
399
110
|
|
|
400
|
-
<
|
|
401
|
-
<
|
|
402
|
-
<
|
|
403
|
-
{[
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
return (<TouchableOpacity key={item.key} activeOpacity={0.7} onPress={() => setDraft(prev => ({ ...prev, sortBy: item.key }))} style={[
|
|
413
|
-
styles.chip,
|
|
414
|
-
isSelected && {
|
|
415
|
-
backgroundColor: `${AppColors.purple}15`,
|
|
416
|
-
borderColor: AppColors.purple,
|
|
417
|
-
},
|
|
418
|
-
]}>
|
|
419
|
-
<IconComp size={13} color={isSelected ? AppColors.purple : AppColors.grayTextWeak}/>
|
|
420
|
-
<Text style={[
|
|
421
|
-
styles.chipLabel,
|
|
422
|
-
isSelected && { color: AppColors.purple, fontFamily: AppFonts.interBold },
|
|
423
|
-
]}>
|
|
424
|
-
{item.label}
|
|
425
|
-
</Text>
|
|
426
|
-
</TouchableOpacity>);
|
|
427
|
-
})}
|
|
428
|
-
</View>
|
|
429
|
-
</View>
|
|
430
|
-
</ScrollView>
|
|
111
|
+
<T style={o.section}>
|
|
112
|
+
<S style={o.sectionTitle}>SORT BY</S>
|
|
113
|
+
<T style={o.chipsWrap}>
|
|
114
|
+
{[{key:"time_desc",label:"Newest First (Default)",icon:K},{key:"time_asc",label:"Oldest First",icon:Ne},{key:"duration_desc",label:"Slowest Response",icon:Me},{key:"duration_asc",label:"Fastest Response",icon:Ee},{key:"size_desc",label:"Largest Response Size",icon:Ae}].map(e=>{const l=r.sortBy===e.key,C=e.icon;return<L key={e.key}activeOpacity={.7}onPress={()=>F(g=>({...g,sortBy:e.key}))}style={[o.chip,l&&{backgroundColor:`${t.purple}15`,borderColor:t.purple}]}>
|
|
115
|
+
<C size={13}color={l?t.purple:t.grayTextWeak}/>
|
|
116
|
+
<S style={[o.chipLabel,l&&{color:t.purple,fontFamily:B.interBold}]}>
|
|
117
|
+
{e.label}
|
|
118
|
+
</S>
|
|
119
|
+
</L>})}
|
|
120
|
+
</T>
|
|
121
|
+
</T>
|
|
122
|
+
</Te>
|
|
431
123
|
|
|
432
124
|
|
|
433
|
-
<
|
|
434
|
-
<
|
|
435
|
-
<
|
|
436
|
-
</
|
|
125
|
+
<T style={o.footer}>
|
|
126
|
+
<J onPress={ee}style={o.resetBtn}>
|
|
127
|
+
<S style={o.resetBtnText}>Reset All</S>
|
|
128
|
+
</J>
|
|
437
129
|
|
|
438
|
-
<
|
|
439
|
-
<
|
|
440
|
-
Apply ({
|
|
441
|
-
</
|
|
442
|
-
</
|
|
443
|
-
</
|
|
444
|
-
</
|
|
445
|
-
</
|
|
446
|
-
</
|
|
447
|
-
};
|
|
448
|
-
const styles = StyleSheet.create({
|
|
449
|
-
overlay: {
|
|
450
|
-
flex: 1,
|
|
451
|
-
backgroundColor: 'rgba(0, 0, 0, 0.55)',
|
|
452
|
-
justifyContent: 'flex-end',
|
|
453
|
-
},
|
|
454
|
-
modalCard: {
|
|
455
|
-
backgroundColor: AppColors.primaryLight,
|
|
456
|
-
borderTopLeftRadius: 20,
|
|
457
|
-
borderTopRightRadius: 20,
|
|
458
|
-
maxHeight: '85%',
|
|
459
|
-
shadowColor: AppColors.black,
|
|
460
|
-
shadowOffset: { width: 0, height: -4 },
|
|
461
|
-
shadowOpacity: 0.15,
|
|
462
|
-
shadowRadius: 10,
|
|
463
|
-
elevation: 8,
|
|
464
|
-
},
|
|
465
|
-
header: {
|
|
466
|
-
flexDirection: 'row',
|
|
467
|
-
alignItems: 'center',
|
|
468
|
-
justifyContent: 'space-between',
|
|
469
|
-
paddingHorizontal: 16,
|
|
470
|
-
paddingTop: 16,
|
|
471
|
-
paddingBottom: 12,
|
|
472
|
-
borderBottomWidth: 1,
|
|
473
|
-
borderBottomColor: AppColors.grayBorderSecondary,
|
|
474
|
-
},
|
|
475
|
-
headerLeft: {
|
|
476
|
-
flexDirection: 'row',
|
|
477
|
-
alignItems: 'center',
|
|
478
|
-
gap: 10,
|
|
479
|
-
flex: 1,
|
|
480
|
-
},
|
|
481
|
-
iconCircle: {
|
|
482
|
-
width: 34,
|
|
483
|
-
height: 34,
|
|
484
|
-
borderRadius: 10,
|
|
485
|
-
backgroundColor: `${AppColors.purple}15`,
|
|
486
|
-
alignItems: 'center',
|
|
487
|
-
justifyContent: 'center',
|
|
488
|
-
},
|
|
489
|
-
title: {
|
|
490
|
-
fontFamily: AppFonts.interBold,
|
|
491
|
-
fontSize: 16,
|
|
492
|
-
color: AppColors.primaryBlack,
|
|
493
|
-
},
|
|
494
|
-
subtitle: {
|
|
495
|
-
fontFamily: AppFonts.interRegular,
|
|
496
|
-
fontSize: 11,
|
|
497
|
-
color: AppColors.grayText,
|
|
498
|
-
marginTop: 1,
|
|
499
|
-
},
|
|
500
|
-
activeBadge: {
|
|
501
|
-
backgroundColor: `${AppColors.purple}20`,
|
|
502
|
-
paddingHorizontal: 6,
|
|
503
|
-
paddingVertical: 1.5,
|
|
504
|
-
borderRadius: 8,
|
|
505
|
-
borderWidth: 1,
|
|
506
|
-
borderColor: `${AppColors.purple}40`,
|
|
507
|
-
},
|
|
508
|
-
activeBadgeText: {
|
|
509
|
-
fontFamily: AppFonts.interBold,
|
|
510
|
-
fontSize: 9.5,
|
|
511
|
-
color: AppColors.purple,
|
|
512
|
-
},
|
|
513
|
-
closeBtn: {
|
|
514
|
-
padding: 6,
|
|
515
|
-
},
|
|
516
|
-
scrollArea: {
|
|
517
|
-
maxHeight: 460,
|
|
518
|
-
},
|
|
519
|
-
scrollContent: {
|
|
520
|
-
padding: 16,
|
|
521
|
-
gap: 16,
|
|
522
|
-
},
|
|
523
|
-
section: {
|
|
524
|
-
gap: 8,
|
|
525
|
-
},
|
|
526
|
-
sectionTitle: {
|
|
527
|
-
fontFamily: AppFonts.interBold,
|
|
528
|
-
fontSize: 11,
|
|
529
|
-
color: AppColors.grayTextWeak,
|
|
530
|
-
letterSpacing: 0.8,
|
|
531
|
-
},
|
|
532
|
-
chipsWrap: {
|
|
533
|
-
flexDirection: 'row',
|
|
534
|
-
flexWrap: 'wrap',
|
|
535
|
-
gap: 8,
|
|
536
|
-
},
|
|
537
|
-
chip: {
|
|
538
|
-
flexDirection: 'row',
|
|
539
|
-
alignItems: 'center',
|
|
540
|
-
gap: 6,
|
|
541
|
-
paddingHorizontal: 10,
|
|
542
|
-
paddingVertical: 6,
|
|
543
|
-
borderRadius: 8,
|
|
544
|
-
backgroundColor: AppColors.grayBackground,
|
|
545
|
-
borderWidth: 1,
|
|
546
|
-
borderColor: AppColors.grayBorderSecondary,
|
|
547
|
-
},
|
|
548
|
-
chipLabel: {
|
|
549
|
-
fontFamily: AppFonts.interMedium,
|
|
550
|
-
fontSize: 12,
|
|
551
|
-
color: AppColors.primaryBlack,
|
|
552
|
-
},
|
|
553
|
-
methodDot: {
|
|
554
|
-
width: 6.5,
|
|
555
|
-
height: 6.5,
|
|
556
|
-
borderRadius: 3.5,
|
|
557
|
-
},
|
|
558
|
-
countPill: {
|
|
559
|
-
backgroundColor: `${AppColors.grayBorderSecondary}50`,
|
|
560
|
-
paddingHorizontal: 5,
|
|
561
|
-
paddingVertical: 1,
|
|
562
|
-
borderRadius: 6,
|
|
563
|
-
},
|
|
564
|
-
countPillText: {
|
|
565
|
-
fontFamily: AppFonts.interBold,
|
|
566
|
-
fontSize: 9.5,
|
|
567
|
-
color: AppColors.grayText,
|
|
568
|
-
},
|
|
569
|
-
footer: {
|
|
570
|
-
flexDirection: 'row',
|
|
571
|
-
alignItems: 'center',
|
|
572
|
-
gap: 10,
|
|
573
|
-
paddingHorizontal: 16,
|
|
574
|
-
paddingVertical: 14,
|
|
575
|
-
borderTopWidth: 1,
|
|
576
|
-
borderTopColor: AppColors.grayBorderSecondary,
|
|
577
|
-
backgroundColor: AppColors.primaryLight,
|
|
578
|
-
},
|
|
579
|
-
resetBtn: {
|
|
580
|
-
flex: 1,
|
|
581
|
-
paddingVertical: 11,
|
|
582
|
-
borderRadius: 10,
|
|
583
|
-
borderWidth: 1,
|
|
584
|
-
borderColor: AppColors.grayBorderSecondary,
|
|
585
|
-
alignItems: 'center',
|
|
586
|
-
justifyContent: 'center',
|
|
587
|
-
backgroundColor: AppColors.grayBackground,
|
|
588
|
-
},
|
|
589
|
-
resetBtnText: {
|
|
590
|
-
fontFamily: AppFonts.interBold,
|
|
591
|
-
fontSize: 13,
|
|
592
|
-
color: AppColors.grayTextStrong,
|
|
593
|
-
},
|
|
594
|
-
applyBtn: {
|
|
595
|
-
flex: 2,
|
|
596
|
-
paddingVertical: 11,
|
|
597
|
-
borderRadius: 10,
|
|
598
|
-
alignItems: 'center',
|
|
599
|
-
justifyContent: 'center',
|
|
600
|
-
backgroundColor: AppColors.purple,
|
|
601
|
-
shadowColor: AppColors.purple,
|
|
602
|
-
shadowOffset: { width: 0, height: 2 },
|
|
603
|
-
shadowOpacity: 0.25,
|
|
604
|
-
shadowRadius: 4,
|
|
605
|
-
elevation: 3,
|
|
606
|
-
},
|
|
607
|
-
applyBtnText: {
|
|
608
|
-
fontFamily: AppFonts.interBold,
|
|
609
|
-
fontSize: 13,
|
|
610
|
-
color: AppColors.white,
|
|
611
|
-
},
|
|
612
|
-
});
|
|
613
|
-
export default NetworkFilterModal;
|
|
130
|
+
<J onPress={oe}style={o.applyBtn}>
|
|
131
|
+
<S style={o.applyBtnText}>
|
|
132
|
+
Apply ({D} Request{D===1?"":"s"})
|
|
133
|
+
</S>
|
|
134
|
+
</J>
|
|
135
|
+
</T>
|
|
136
|
+
</Y>
|
|
137
|
+
</Y>
|
|
138
|
+
</Ce>};const o=we.create({overlay:{flex:1,backgroundColor:"rgba(0, 0, 0, 0.55)",justifyContent:"flex-end"},modalCard:{backgroundColor:t.primaryLight,borderTopLeftRadius:20,borderTopRightRadius:20,maxHeight:"85%",shadowColor:t.black,shadowOffset:{width:0,height:-4},shadowOpacity:.15,shadowRadius:10,elevation:8},header:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",paddingHorizontal:16,paddingTop:16,paddingBottom:12,borderBottomWidth:1,borderBottomColor:t.grayBorderSecondary},headerLeft:{flexDirection:"row",alignItems:"center",gap:10,flex:1},iconCircle:{width:34,height:34,borderRadius:10,backgroundColor:`${t.purple}15`,alignItems:"center",justifyContent:"center"},title:{fontFamily:B.interBold,fontSize:16,color:t.primaryBlack},subtitle:{fontFamily:B.interRegular,fontSize:11,color:t.grayText,marginTop:1},activeBadge:{backgroundColor:`${t.purple}20`,paddingHorizontal:6,paddingVertical:1.5,borderRadius:8,borderWidth:1,borderColor:`${t.purple}40`},activeBadgeText:{fontFamily:B.interBold,fontSize:9.5,color:t.purple},closeBtn:{padding:6},scrollArea:{maxHeight:460},scrollContent:{padding:16,gap:16},section:{gap:8},sectionTitle:{fontFamily:B.interBold,fontSize:11,color:t.grayTextWeak,letterSpacing:.8},chipsWrap:{flexDirection:"row",flexWrap:"wrap",gap:8},chip:{flexDirection:"row",alignItems:"center",gap:6,paddingHorizontal:10,paddingVertical:6,borderRadius:8,backgroundColor:t.grayBackground,borderWidth:1,borderColor:t.grayBorderSecondary},chipLabel:{fontFamily:B.interMedium,fontSize:12,color:t.primaryBlack},methodDot:{width:6.5,height:6.5,borderRadius:3.5},countPill:{backgroundColor:`${t.grayBorderSecondary}50`,paddingHorizontal:5,paddingVertical:1,borderRadius:6},countPillText:{fontFamily:B.interBold,fontSize:9.5,color:t.grayText},footer:{flexDirection:"row",alignItems:"center",gap:10,paddingHorizontal:16,paddingVertical:14,borderTopWidth:1,borderTopColor:t.grayBorderSecondary,backgroundColor:t.primaryLight},resetBtn:{flex:1,paddingVertical:11,borderRadius:10,borderWidth:1,borderColor:t.grayBorderSecondary,alignItems:"center",justifyContent:"center",backgroundColor:t.grayBackground},resetBtnText:{fontFamily:B.interBold,fontSize:13,color:t.grayTextStrong},applyBtn:{flex:2,paddingVertical:11,borderRadius:10,alignItems:"center",justifyContent:"center",backgroundColor:t.purple,shadowColor:t.purple,shadowOffset:{width:0,height:2},shadowOpacity:.25,shadowRadius:4,elevation:3},applyBtnText:{fontFamily:B.interBold,fontSize:13,color:t.white}});export default NetworkFilterModal;
|