react-native-inapp-inspector 1.1.13 → 1.1.15
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 +9 -34
- package/dist/commonjs/assets/svgAssets.d.ts +3 -0
- package/dist/commonjs/assets/svgAssets.js +17 -0
- package/dist/commonjs/components/AnalyticsEventCard.d.ts +1 -14
- package/dist/commonjs/components/AnalyticsEventCard.js +120 -50
- package/dist/commonjs/components/AnalyticsGraph.d.ts +2 -6
- package/dist/commonjs/components/AnalyticsGraph.js +8 -8
- package/dist/commonjs/components/AnalyticsTabView.d.ts +15 -0
- package/dist/commonjs/components/AnalyticsTabView.js +157 -0
- package/dist/commonjs/components/AnimatedEntrance.d.ts +1 -1
- package/dist/commonjs/components/AnimatedEntrance.js +2 -2
- package/dist/commonjs/components/ApiDetailView.d.ts +22 -0
- package/dist/commonjs/components/ApiDetailView.js +304 -0
- package/dist/commonjs/components/ApisTabView.d.ts +33 -0
- package/dist/commonjs/components/ApisTabView.js +235 -0
- package/dist/commonjs/components/CodeSnippet.d.ts +1 -5
- package/dist/commonjs/components/CodeSnippet.js +34 -34
- package/dist/commonjs/components/ConsoleLogCard.d.ts +1 -8
- package/dist/commonjs/components/ConsoleLogCard.js +262 -442
- package/dist/commonjs/components/ConsoleLogDetailView.d.ts +9 -0
- package/dist/commonjs/components/ConsoleLogDetailView.js +278 -0
- package/dist/commonjs/components/ConsoleLogsTabView.d.ts +24 -0
- package/dist/commonjs/components/ConsoleLogsTabView.js +354 -0
- package/dist/commonjs/components/DiffViewer.js +4 -2
- package/dist/commonjs/components/DomainHeader.js +66 -41
- package/dist/commonjs/components/EmptyState.d.ts +2 -2
- package/dist/commonjs/components/EmptyState.js +2 -2
- package/dist/commonjs/components/EndOfListFooter.d.ts +8 -0
- package/dist/commonjs/components/EndOfListFooter.js +90 -0
- package/dist/commonjs/components/ErrorBoundary.d.ts +5 -14
- package/dist/commonjs/components/ErrorBoundary.js +28 -28
- package/dist/commonjs/components/FloatingBubble.d.ts +14 -0
- package/dist/commonjs/components/FloatingBubble.js +75 -0
- package/dist/commonjs/components/HeadersSection.js +5 -3
- package/dist/commonjs/components/HighlightText.d.ts +1 -1
- package/dist/commonjs/components/HighlightText.js +5 -7
- package/dist/commonjs/components/Inspector/AnalyticsTab.d.ts +3 -0
- package/dist/commonjs/components/Inspector/AnalyticsTab.js +232 -0
- package/dist/commonjs/components/Inspector/ConsoleTab.d.ts +3 -0
- package/dist/commonjs/components/Inspector/ConsoleTab.js +410 -0
- package/dist/commonjs/components/Inspector/FabLauncher.d.ts +3 -0
- package/dist/commonjs/components/Inspector/FabLauncher.js +54 -0
- package/dist/commonjs/components/Inspector/InsightsDashboard.d.ts +3 -0
- package/dist/commonjs/components/Inspector/InsightsDashboard.js +619 -0
- package/dist/commonjs/components/Inspector/InspectorContext.d.ts +5 -0
- package/dist/commonjs/components/Inspector/InspectorContext.js +18 -0
- package/dist/commonjs/components/Inspector/InspectorHeader.d.ts +3 -0
- package/dist/commonjs/components/Inspector/InspectorHeader.js +452 -0
- package/dist/commonjs/components/Inspector/LogDetail.d.ts +3 -0
- package/dist/commonjs/components/Inspector/LogDetail.js +963 -0
- package/dist/commonjs/components/Inspector/MainScreen.d.ts +3 -0
- package/dist/commonjs/components/Inspector/MainScreen.js +68 -0
- package/dist/commonjs/components/Inspector/NavigationTracker.d.ts +3 -0
- package/dist/commonjs/components/Inspector/NavigationTracker.js +12 -0
- package/dist/commonjs/components/Inspector/NetworkDetail.d.ts +3 -0
- package/dist/commonjs/components/Inspector/NetworkDetail.js +405 -0
- package/dist/commonjs/components/Inspector/NetworkTab.d.ts +3 -0
- package/dist/commonjs/components/Inspector/NetworkTab.js +281 -0
- package/dist/commonjs/components/Inspector/ReduxTab.d.ts +3 -0
- package/dist/commonjs/components/Inspector/ReduxTab.js +75 -0
- package/dist/commonjs/components/Inspector/SettingsPanel.d.ts +3 -0
- package/dist/commonjs/components/Inspector/SettingsPanel.js +1476 -0
- package/dist/commonjs/components/Inspector/TabBar.d.ts +3 -0
- package/dist/commonjs/components/Inspector/TabBar.js +95 -0
- package/dist/commonjs/components/Inspector/WebViewTab.d.ts +3 -0
- package/dist/commonjs/components/Inspector/WebViewTab.js +757 -0
- package/dist/commonjs/components/InspectorHeader.d.ts +19 -0
- package/dist/commonjs/components/InspectorHeader.js +329 -0
- package/dist/commonjs/components/InspectorTabBar.d.ts +16 -0
- package/dist/commonjs/components/InspectorTabBar.js +90 -0
- package/dist/commonjs/components/JsonViewer.d.ts +4 -1
- package/dist/commonjs/components/JsonViewer.js +110 -171
- package/dist/commonjs/components/LogCard.js +109 -86
- package/dist/commonjs/components/MetaAccordion.d.ts +1 -10
- package/dist/commonjs/components/MetaAccordion.js +23 -21
- package/dist/commonjs/components/NavigationTracker.d.ts +7 -0
- package/dist/commonjs/components/NavigationTracker.js +76 -0
- package/dist/commonjs/components/NetworkIcons.d.ts +6 -0
- package/dist/commonjs/components/NetworkIcons.js +54 -8
- package/dist/commonjs/components/ReduxTabView.d.ts +9 -0
- package/dist/commonjs/components/ReduxTabView.js +56 -0
- package/dist/commonjs/components/ReduxTreeView.js +241 -200
- package/dist/commonjs/components/SegmentedTabs.d.ts +15 -0
- package/dist/commonjs/components/SegmentedTabs.js +52 -0
- package/dist/commonjs/components/SettingsView.d.ts +13 -0
- package/dist/commonjs/components/SettingsView.js +328 -0
- package/dist/commonjs/components/TouchableScale.d.ts +2 -2
- package/dist/commonjs/components/TouchableScale.js +2 -2
- package/dist/commonjs/components/TreeNode.js +2 -2
- package/dist/commonjs/constants/index.js +1 -12
- package/dist/commonjs/constants/version.d.ts +1 -1
- package/dist/commonjs/constants/version.js +1 -1
- package/dist/commonjs/customHooks/analyticsLogger.d.ts +8 -0
- package/dist/commonjs/customHooks/analyticsLogger.js +42 -1
- package/dist/commonjs/customHooks/consoleLogger.js +137 -13
- package/dist/commonjs/customHooks/networkLogger.d.ts +0 -1
- package/dist/commonjs/customHooks/networkLogger.js +0 -1
- package/dist/commonjs/customHooks/reduxLogger.d.ts +2 -9
- package/dist/commonjs/enums/index.d.ts +39 -0
- package/dist/commonjs/enums/index.js +50 -0
- package/dist/commonjs/helpers/index.d.ts +27 -1
- package/dist/commonjs/helpers/index.js +187 -12
- package/dist/commonjs/helpers/settingsStore.d.ts +2 -24
- package/dist/commonjs/i18n/en.json +144 -0
- package/dist/commonjs/i18n/index.d.ts +2 -0
- package/dist/commonjs/i18n/index.js +27 -0
- package/dist/commonjs/i18n/locales/en.json +314 -0
- package/dist/commonjs/index.d.ts +2 -3
- package/dist/commonjs/index.js +207 -4927
- package/dist/commonjs/styles/AppColors.d.ts +148 -0
- package/dist/commonjs/styles/AppColors.js +176 -0
- package/dist/commonjs/styles/common.d.ts +3 -0
- package/dist/commonjs/styles/common.js +201 -0
- package/dist/commonjs/styles/index.d.ts +219 -435
- package/dist/commonjs/styles/index.js +312 -488
- package/dist/commonjs/types/enums.d.ts +9 -0
- package/dist/commonjs/types/enums.js +4 -0
- package/dist/commonjs/types/index.d.ts +4 -111
- package/dist/commonjs/types/index.js +16 -0
- package/dist/commonjs/types/interfaces.d.ts +337 -0
- package/dist/commonjs/types/interfaces.js +2 -0
- package/dist/esm/assets/svgAssets.d.ts +3 -0
- package/dist/esm/assets/svgAssets.js +14 -0
- package/dist/esm/components/AnalyticsEventCard.d.ts +1 -14
- package/dist/esm/components/AnalyticsEventCard.js +118 -48
- package/dist/esm/components/AnalyticsGraph.d.ts +2 -6
- package/dist/esm/components/AnalyticsGraph.js +8 -8
- package/dist/esm/components/AnalyticsTabView.d.ts +15 -0
- package/dist/esm/components/AnalyticsTabView.js +151 -0
- package/dist/esm/components/AnimatedEntrance.d.ts +1 -1
- package/dist/esm/components/AnimatedEntrance.js +2 -2
- package/dist/esm/components/ApiDetailView.d.ts +22 -0
- package/dist/esm/components/ApiDetailView.js +264 -0
- package/dist/esm/components/ApisTabView.d.ts +33 -0
- package/dist/esm/components/ApisTabView.js +196 -0
- package/dist/esm/components/CodeSnippet.d.ts +1 -5
- package/dist/esm/components/CodeSnippet.js +34 -34
- package/dist/esm/components/ConsoleLogCard.d.ts +1 -8
- package/dist/esm/components/ConsoleLogCard.js +262 -409
- package/dist/esm/components/ConsoleLogDetailView.d.ts +9 -0
- package/dist/esm/components/ConsoleLogDetailView.js +271 -0
- package/dist/esm/components/ConsoleLogsTabView.d.ts +24 -0
- package/dist/esm/components/ConsoleLogsTabView.js +348 -0
- package/dist/esm/components/DiffViewer.js +4 -2
- package/dist/esm/components/DomainHeader.js +66 -41
- package/dist/esm/components/EmptyState.d.ts +2 -2
- package/dist/esm/components/EmptyState.js +2 -2
- package/dist/esm/components/EndOfListFooter.d.ts +8 -0
- package/dist/esm/components/EndOfListFooter.js +83 -0
- package/dist/esm/components/ErrorBoundary.d.ts +5 -14
- package/dist/esm/components/ErrorBoundary.js +29 -29
- package/dist/esm/components/FloatingBubble.d.ts +14 -0
- package/dist/esm/components/FloatingBubble.js +68 -0
- package/dist/esm/components/HeadersSection.js +5 -3
- package/dist/esm/components/HighlightText.d.ts +1 -1
- package/dist/esm/components/HighlightText.js +5 -7
- package/dist/esm/components/Inspector/AnalyticsTab.d.ts +3 -0
- package/dist/esm/components/Inspector/AnalyticsTab.js +194 -0
- package/dist/esm/components/Inspector/ConsoleTab.d.ts +3 -0
- package/dist/esm/components/Inspector/ConsoleTab.js +372 -0
- package/dist/esm/components/Inspector/FabLauncher.d.ts +3 -0
- package/dist/esm/components/Inspector/FabLauncher.js +49 -0
- package/dist/esm/components/Inspector/InsightsDashboard.d.ts +3 -0
- package/dist/esm/components/Inspector/InsightsDashboard.js +614 -0
- package/dist/esm/components/Inspector/InspectorContext.d.ts +5 -0
- package/dist/esm/components/Inspector/InspectorContext.js +13 -0
- package/dist/esm/components/Inspector/InspectorHeader.d.ts +3 -0
- package/dist/esm/components/Inspector/InspectorHeader.js +447 -0
- package/dist/esm/components/Inspector/LogDetail.d.ts +3 -0
- package/dist/esm/components/Inspector/LogDetail.js +925 -0
- package/dist/esm/components/Inspector/MainScreen.d.ts +3 -0
- package/dist/esm/components/Inspector/MainScreen.js +63 -0
- package/dist/esm/components/Inspector/NavigationTracker.d.ts +3 -0
- package/dist/esm/components/Inspector/NavigationTracker.js +10 -0
- package/dist/esm/components/Inspector/NetworkDetail.d.ts +3 -0
- package/dist/esm/components/Inspector/NetworkDetail.js +367 -0
- package/dist/esm/components/Inspector/NetworkTab.d.ts +3 -0
- package/dist/esm/components/Inspector/NetworkTab.js +243 -0
- package/dist/esm/components/Inspector/ReduxTab.d.ts +3 -0
- package/dist/esm/components/Inspector/ReduxTab.js +70 -0
- package/dist/esm/components/Inspector/SettingsPanel.d.ts +3 -0
- package/dist/esm/components/Inspector/SettingsPanel.js +1438 -0
- package/dist/esm/components/Inspector/TabBar.d.ts +3 -0
- package/dist/esm/components/Inspector/TabBar.js +90 -0
- package/dist/esm/components/Inspector/WebViewTab.d.ts +3 -0
- package/dist/esm/components/Inspector/WebViewTab.js +752 -0
- package/dist/esm/components/InspectorHeader.d.ts +19 -0
- package/dist/esm/components/InspectorHeader.js +323 -0
- package/dist/esm/components/InspectorTabBar.d.ts +16 -0
- package/dist/esm/components/InspectorTabBar.js +84 -0
- package/dist/esm/components/JsonViewer.d.ts +4 -1
- package/dist/esm/components/JsonViewer.js +111 -172
- package/dist/esm/components/LogCard.js +111 -88
- package/dist/esm/components/MetaAccordion.d.ts +1 -10
- package/dist/esm/components/MetaAccordion.js +23 -21
- package/dist/esm/components/NavigationTracker.d.ts +7 -0
- package/dist/esm/components/NavigationTracker.js +39 -0
- package/dist/esm/components/NetworkIcons.d.ts +6 -0
- package/dist/esm/components/NetworkIcons.js +46 -6
- package/dist/esm/components/ReduxTabView.d.ts +9 -0
- package/dist/esm/components/ReduxTabView.js +50 -0
- package/dist/esm/components/ReduxTreeView.js +243 -202
- package/dist/esm/components/SegmentedTabs.d.ts +15 -0
- package/dist/esm/components/SegmentedTabs.js +47 -0
- package/dist/esm/components/SettingsView.d.ts +13 -0
- package/dist/esm/components/SettingsView.js +321 -0
- package/dist/esm/components/TouchableScale.d.ts +2 -2
- package/dist/esm/components/TouchableScale.js +2 -2
- package/dist/esm/components/TreeNode.js +2 -2
- package/dist/esm/constants/index.js +1 -12
- package/dist/esm/constants/version.d.ts +1 -1
- package/dist/esm/constants/version.js +1 -1
- package/dist/esm/customHooks/analyticsLogger.d.ts +8 -0
- package/dist/esm/customHooks/analyticsLogger.js +37 -0
- package/dist/esm/customHooks/consoleLogger.js +137 -13
- package/dist/esm/customHooks/networkLogger.d.ts +0 -1
- package/dist/esm/customHooks/networkLogger.js +0 -1
- package/dist/esm/customHooks/reduxLogger.d.ts +2 -9
- package/dist/esm/enums/index.d.ts +39 -0
- package/dist/esm/enums/index.js +47 -0
- package/dist/esm/helpers/index.d.ts +27 -1
- package/dist/esm/helpers/index.js +180 -11
- package/dist/esm/helpers/settingsStore.d.ts +2 -24
- package/dist/esm/i18n/en.json +144 -0
- package/dist/esm/i18n/index.d.ts +2 -0
- package/dist/esm/i18n/index.js +22 -0
- package/dist/esm/i18n/locales/en.json +314 -0
- package/dist/esm/index.d.ts +2 -3
- package/dist/esm/index.js +207 -4923
- package/dist/esm/styles/AppColors.d.ts +148 -0
- package/dist/esm/styles/AppColors.js +176 -0
- package/dist/esm/styles/common.d.ts +3 -0
- package/dist/esm/styles/common.js +197 -0
- package/dist/esm/styles/index.d.ts +219 -435
- package/dist/esm/styles/index.js +312 -488
- package/dist/esm/types/enums.d.ts +9 -0
- package/dist/esm/types/enums.js +3 -0
- package/dist/esm/types/index.d.ts +4 -111
- package/dist/esm/types/index.js +2 -1
- package/dist/esm/types/interfaces.d.ts +337 -0
- package/dist/esm/types/interfaces.js +1 -0
- package/example/App.tsx +88 -1
- package/example/android/app/build.gradle +29 -1
- package/example/android/app/src/main/java/com/example/MainApplication.kt +25 -0
- package/example/android/build.gradle +31 -4
- package/example/android/gradle/wrapper/gradle-wrapper.properties +1 -1
- package/example/android/gradle.properties +1 -0
- package/example/android/settings.gradle +20 -1
- package/example/package-lock.json +1 -1
- package/package.json +3 -1
|
@@ -1,74 +1,69 @@
|
|
|
1
1
|
import React, { useState, useEffect } from 'react';
|
|
2
|
-
import { ScrollView, View, Text, StyleSheet
|
|
3
|
-
import
|
|
2
|
+
import { ScrollView, View, Text, StyleSheet } from 'react-native';
|
|
3
|
+
import { useTranslation } from 'react-i18next';
|
|
4
4
|
// Components
|
|
5
5
|
import TreeNode from './TreeNode';
|
|
6
|
-
import
|
|
7
|
-
|
|
8
|
-
import {
|
|
6
|
+
import SegmentedTabs from './SegmentedTabs';
|
|
7
|
+
import HighlightText from './HighlightText';
|
|
8
|
+
import { PrettyIcon, RawIcon, TableIcon } from './NetworkIcons';
|
|
9
9
|
// Styles
|
|
10
10
|
import { AppColors } from '../styles/AppColors';
|
|
11
11
|
import { AppFonts } from '../styles/AppFonts';
|
|
12
12
|
import styles from '../styles';
|
|
13
|
-
// ── Tab Icons ────────────────────────────────────────────────────────────────
|
|
14
|
-
const PrettyIcon = ({ color = '#94A3B8', size = 12 }) => (<Svg width={size} height={size} viewBox="0 0 16 16" fill="none">
|
|
15
|
-
<Path d="M5 3C3.9 3 3 3.9 3 5v1.5c0 .8-.7 1.5-1.5 1.5S0 7.3 0 6.5V5c0-2.8 2.2-5 5-5 .6 0 1 .4 1 1s-.4 1-1 1zm6 0c-1.1 0-2 .9-2 2v1.5c0 .8-.7 1.5-1.5 1.5S6 9.3 6 8.5V5c0-2.8 2.2-5 5-5 .6 0 1 .4 1 1s-.4 1-1 1z" fill={color} opacity={0.9}/>
|
|
16
|
-
<Path d="M3 11v1.5c0 .8.7 1.5 1.5 1.5S6 13.3 6 12.5V11H3zm7 0v1.5c0 .8.7 1.5 1.5 1.5S13 13.3 13 12.5V11H10z" fill={color} opacity={0.6}/>
|
|
17
|
-
</Svg>);
|
|
18
|
-
const RawIcon = ({ color = '#94A3B8', size = 12 }) => (<Svg width={size} height={size} viewBox="0 0 16 16" fill="none">
|
|
19
|
-
<Rect x="1" y="2" width="10" height="1.5" rx="0.75" fill={color} opacity={0.9}/>
|
|
20
|
-
<Rect x="1" y="5.5" width="14" height="1.5" rx="0.75" fill={color} opacity={0.6}/>
|
|
21
|
-
<Rect x="1" y="9" width="8" height="1.5" rx="0.75" fill={color} opacity={0.45}/>
|
|
22
|
-
<Rect x="1" y="12.5" width="12" height="1.5" rx="0.75" fill={color} opacity={0.3}/>
|
|
23
|
-
</Svg>);
|
|
24
|
-
const TableIcon = ({ color = '#94A3B8', size = 12 }) => (<Svg width={size} height={size} viewBox="0 0 16 16" fill="none">
|
|
25
|
-
<Rect x="1" y="1" width="14" height="14" rx="2" stroke={color} strokeWidth={1.2} opacity={0.7}/>
|
|
26
|
-
<Path d="M1 5.5h14M1 10h14M5.5 1v14M10.5 1v14" stroke={color} strokeWidth={0.8} opacity={0.5}/>
|
|
27
|
-
</Svg>);
|
|
28
13
|
// ── JsonViewer Component ─────────────────────────────────────────────────────
|
|
29
|
-
const JsonViewer = ({ data, search, forceOpen, defaultExpandDepth, wrap, fullHeight = false, onModeChange, }) => {
|
|
30
|
-
const
|
|
14
|
+
const JsonViewer = ({ data, search, forceOpen, defaultExpandDepth, wrap, fullHeight = false, maxHeight, mode: externalMode, onModeChange, hideTabs = false, }) => {
|
|
15
|
+
const { t } = useTranslation();
|
|
16
|
+
const [mode, setMode] = useState(externalMode || 'pretty');
|
|
17
|
+
const rawText = React.useMemo(() => {
|
|
18
|
+
if (typeof data === 'string') {
|
|
19
|
+
return data;
|
|
20
|
+
}
|
|
21
|
+
try {
|
|
22
|
+
return JSON.stringify(data);
|
|
23
|
+
}
|
|
24
|
+
catch {
|
|
25
|
+
return String(data);
|
|
26
|
+
}
|
|
27
|
+
}, [data]);
|
|
28
|
+
useEffect(() => {
|
|
29
|
+
if (externalMode) {
|
|
30
|
+
setMode(externalMode);
|
|
31
|
+
}
|
|
32
|
+
}, [externalMode]);
|
|
31
33
|
useEffect(() => {
|
|
32
34
|
onModeChange?.(mode);
|
|
33
35
|
}, [mode, onModeChange]);
|
|
36
|
+
const contentWrapperStyle = [
|
|
37
|
+
localStyles.contentWrapper,
|
|
38
|
+
{ backgroundColor: AppColors.contentBg },
|
|
39
|
+
fullHeight && { flex: 1, maxHeight: undefined },
|
|
40
|
+
!fullHeight && maxHeight != null && { maxHeight },
|
|
41
|
+
];
|
|
42
|
+
const scrollStyle = [
|
|
43
|
+
localStyles.rawScroll,
|
|
44
|
+
!fullHeight && maxHeight != null && { maxHeight },
|
|
45
|
+
];
|
|
34
46
|
// Determine type and size details
|
|
35
47
|
const isObject = typeof data === 'object' && data !== null;
|
|
36
|
-
const
|
|
37
|
-
let typeLabel = typeof data;
|
|
38
|
-
let countLabel = '';
|
|
39
|
-
if (data === null) {
|
|
40
|
-
typeLabel = 'null';
|
|
41
|
-
}
|
|
42
|
-
else if (isArray) {
|
|
43
|
-
typeLabel = 'array';
|
|
44
|
-
countLabel = `${data.length} items`;
|
|
45
|
-
}
|
|
46
|
-
else if (isObject) {
|
|
47
|
-
typeLabel = 'object';
|
|
48
|
-
countLabel = `${Object.keys(data).length} keys`;
|
|
49
|
-
}
|
|
50
|
-
// Copy helper
|
|
51
|
-
const handleCopy = () => {
|
|
52
|
-
copyToClipboard(data, 'JSON data');
|
|
53
|
-
};
|
|
48
|
+
const isEmpty = isObject && Object.keys(data).length === 0;
|
|
54
49
|
// Render Table view (Key-Value flat table for root keys)
|
|
55
50
|
const renderTableMode = () => {
|
|
56
51
|
if (!isObject) {
|
|
57
52
|
return (<View style={localStyles.tableRow}>
|
|
58
|
-
<Text style={localStyles.tableCellKey}>value</Text>
|
|
53
|
+
<Text style={localStyles.tableCellKey}>{t('network.jsonViewer.value')}</Text>
|
|
59
54
|
<Text style={localStyles.tableCellValue}>{String(data)}</Text>
|
|
60
55
|
</View>);
|
|
61
56
|
}
|
|
62
57
|
const keys = Object.keys(data);
|
|
63
58
|
if (keys.length === 0) {
|
|
64
59
|
return (<View style={localStyles.emptyTable}>
|
|
65
|
-
<Text style={localStyles.emptyTableText}>
|
|
60
|
+
<Text style={localStyles.emptyTableText}>{t('network.jsonViewer.emptyTable')}</Text>
|
|
66
61
|
</View>);
|
|
67
62
|
}
|
|
68
63
|
return (<View style={localStyles.tableView}>
|
|
69
64
|
<View style={localStyles.tableHeaderRow}>
|
|
70
|
-
<Text style={[localStyles.tableHeaderCell, { flex: 2 }]}>
|
|
71
|
-
<Text style={[localStyles.tableHeaderCell, { flex: 3 }]}>
|
|
65
|
+
<Text style={[localStyles.tableHeaderCell, { flex: 2 }]}>{t('network.jsonViewer.key')}</Text>
|
|
66
|
+
<Text style={[localStyles.tableHeaderCell, { flex: 3 }]}>{t('network.jsonViewer.value')}</Text>
|
|
72
67
|
</View>
|
|
73
68
|
{keys.map((key) => {
|
|
74
69
|
const val = data[key];
|
|
@@ -97,68 +92,70 @@ const JsonViewer = ({ data, search, forceOpen, defaultExpandDepth, wrap, fullHei
|
|
|
97
92
|
// Tree View Content
|
|
98
93
|
const tree = (<TreeNode data={data} search={search} forceOpen={forceOpen} defaultExpandDepth={defaultExpandDepth}/>);
|
|
99
94
|
return (<View style={[localStyles.container, fullHeight && { flex: 1 }]}>
|
|
100
|
-
{/* ── Top Toolbar
|
|
101
|
-
<View style={localStyles.toolbar}>
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
</View>
|
|
121
|
-
|
|
122
|
-
{/* Right Actions — badges & copy removed (caller provides header) */}
|
|
123
|
-
|
|
124
|
-
</View>
|
|
95
|
+
{/* ── Top Toolbar (Postman-style) ── */}
|
|
96
|
+
{!hideTabs && (<View style={localStyles.toolbar}>
|
|
97
|
+
<SegmentedTabs tabs={[
|
|
98
|
+
{
|
|
99
|
+
key: 'pretty',
|
|
100
|
+
label: t('network.jsonViewer.pretty'),
|
|
101
|
+
icon: (isActive) => (<PrettyIcon color={isActive ? AppColors.white : AppColors.slate400} size={12}/>),
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
key: 'raw',
|
|
105
|
+
label: t('network.jsonViewer.raw'),
|
|
106
|
+
icon: (isActive) => (<RawIcon color={isActive ? AppColors.white : AppColors.slate400} size={12}/>),
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
key: 'table',
|
|
110
|
+
label: t('network.jsonViewer.table'),
|
|
111
|
+
icon: (isActive) => (<TableIcon color={isActive ? AppColors.white : AppColors.slate400} size={12}/>),
|
|
112
|
+
},
|
|
113
|
+
]} activeKey={mode} onChange={key => setMode(key)}/>
|
|
114
|
+
</View>)}
|
|
125
115
|
|
|
126
116
|
{/* ── Main View Content Area (Royal Monospace Theme) ── */}
|
|
127
|
-
<View style={
|
|
128
|
-
{mode === 'pretty' && (
|
|
117
|
+
<View style={contentWrapperStyle}>
|
|
118
|
+
{mode === 'pretty' && (isEmpty ? (<View style={localStyles.emptyTable}>
|
|
119
|
+
<Text style={localStyles.emptyTableText}>
|
|
120
|
+
{t('network.emptyResponse')}
|
|
121
|
+
</Text>
|
|
122
|
+
</View>) : (wrap ? (fullHeight ? (<ScrollView style={{ flex: 1 }} contentContainerStyle={{ flexGrow: 1 }}>
|
|
129
123
|
<View style={[styles.codeBlock, { width: '100%' }]}>{tree}</View>
|
|
130
|
-
</ScrollView>) : (<
|
|
131
|
-
<View style={styles.codeBlock}>{tree}</View>
|
|
132
|
-
</ScrollView>) : (<ScrollView
|
|
124
|
+
</ScrollView>) : (<ScrollView style={scrollStyle} contentContainerStyle={{ flexGrow: 1 }}>
|
|
125
|
+
<View style={[styles.codeBlock, { width: '100%' }]}>{tree}</View>
|
|
126
|
+
</ScrollView>)) : (fullHeight ? (<ScrollView style={{ flex: 1 }} contentContainerStyle={{ flexGrow: 1 }}>
|
|
133
127
|
<View style={styles.codeBlock}>{tree}</View>
|
|
134
|
-
</ScrollView>)
|
|
128
|
+
</ScrollView>) : (<ScrollView style={scrollStyle}>
|
|
129
|
+
<ScrollView horizontal showsHorizontalScrollIndicator={true} style={styles.codeBlockScroll}>
|
|
130
|
+
<View style={styles.codeBlock}>{tree}</View>
|
|
131
|
+
</ScrollView>
|
|
132
|
+
</ScrollView>))))}
|
|
135
133
|
|
|
136
|
-
{mode === 'raw' && (
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
</View>))}
|
|
134
|
+
{mode === 'raw' && (<ScrollView style={scrollStyle} contentContainerStyle={localStyles.rawContainer} showsVerticalScrollIndicator={true} nestedScrollEnabled={true}>
|
|
135
|
+
<HighlightText text={rawText} search={search} detectLinks={true} style={localStyles.rawPlainText} highlightStyle={{
|
|
136
|
+
backgroundColor: AppColors.yellowHighlight,
|
|
137
|
+
color: AppColors.primaryBlack,
|
|
138
|
+
borderRadius: 3,
|
|
139
|
+
paddingHorizontal: 2,
|
|
140
|
+
}}/>
|
|
141
|
+
</ScrollView>)}
|
|
145
142
|
|
|
146
|
-
{mode === 'table' && (fullHeight ? (<ScrollView style={
|
|
143
|
+
{mode === 'table' && (fullHeight ? (<ScrollView style={scrollStyle}>
|
|
147
144
|
{renderTableMode()}
|
|
148
|
-
</ScrollView>) : (<
|
|
145
|
+
</ScrollView>) : (<ScrollView style={scrollStyle}>
|
|
149
146
|
{renderTableMode()}
|
|
150
|
-
</
|
|
147
|
+
</ScrollView>))}
|
|
151
148
|
</View>
|
|
152
149
|
</View>);
|
|
153
150
|
};
|
|
154
151
|
const localStyles = StyleSheet.create({
|
|
155
152
|
container: {
|
|
156
|
-
backgroundColor:
|
|
153
|
+
backgroundColor: AppColors.white,
|
|
157
154
|
borderRadius: 12,
|
|
158
155
|
borderWidth: 1.5,
|
|
159
|
-
borderColor:
|
|
156
|
+
borderColor: AppColors.slate200,
|
|
160
157
|
overflow: 'hidden',
|
|
161
|
-
shadowColor:
|
|
158
|
+
shadowColor: AppColors.black,
|
|
162
159
|
shadowOpacity: 0.04,
|
|
163
160
|
shadowRadius: 5,
|
|
164
161
|
shadowOffset: { width: 0, height: 2 },
|
|
@@ -169,123 +166,65 @@ const localStyles = StyleSheet.create({
|
|
|
169
166
|
flexDirection: 'row',
|
|
170
167
|
alignItems: 'center',
|
|
171
168
|
justifyContent: 'space-between',
|
|
172
|
-
backgroundColor:
|
|
169
|
+
backgroundColor: AppColors.slate50,
|
|
173
170
|
borderBottomWidth: 1,
|
|
174
|
-
borderBottomColor:
|
|
171
|
+
borderBottomColor: AppColors.slate200,
|
|
175
172
|
paddingHorizontal: 12,
|
|
176
173
|
paddingVertical: 8,
|
|
177
174
|
},
|
|
178
|
-
segmentedControl: {
|
|
179
|
-
flexDirection: 'row',
|
|
180
|
-
backgroundColor: '#E2E8F0',
|
|
181
|
-
borderRadius: 8,
|
|
182
|
-
padding: 2,
|
|
183
|
-
},
|
|
184
|
-
segButton: {
|
|
185
|
-
flexDirection: 'row',
|
|
186
|
-
alignItems: 'center',
|
|
187
|
-
gap: 4,
|
|
188
|
-
paddingHorizontal: 10,
|
|
189
|
-
paddingVertical: 5,
|
|
190
|
-
borderRadius: 6,
|
|
191
|
-
},
|
|
192
|
-
segButtonActive: {
|
|
193
|
-
backgroundColor: '#FFFFFF',
|
|
194
|
-
shadowColor: '#000',
|
|
195
|
-
shadowOpacity: 0.08,
|
|
196
|
-
shadowRadius: 2,
|
|
197
|
-
shadowOffset: { width: 0, height: 1 },
|
|
198
|
-
elevation: 1,
|
|
199
|
-
},
|
|
200
|
-
segText: {
|
|
201
|
-
fontFamily: AppFonts.interBold,
|
|
202
|
-
fontSize: 9.5,
|
|
203
|
-
color: '#64748B',
|
|
204
|
-
letterSpacing: 0.3,
|
|
205
|
-
},
|
|
206
|
-
segTextActive: {
|
|
207
|
-
color: AppColors.purple,
|
|
208
|
-
},
|
|
209
|
-
rightActions: {
|
|
210
|
-
flexDirection: 'row',
|
|
211
|
-
alignItems: 'center',
|
|
212
|
-
gap: 6,
|
|
213
|
-
},
|
|
214
|
-
badge: {
|
|
215
|
-
backgroundColor: 'rgba(104,75,155,0.06)',
|
|
216
|
-
borderWidth: 1,
|
|
217
|
-
borderColor: 'rgba(104,75,155,0.15)',
|
|
218
|
-
borderRadius: 5,
|
|
219
|
-
paddingHorizontal: 6,
|
|
220
|
-
paddingVertical: 2.5,
|
|
221
|
-
},
|
|
222
|
-
badgeText: {
|
|
223
|
-
fontFamily: AppFonts.interBold,
|
|
224
|
-
fontSize: 9,
|
|
225
|
-
color: AppColors.purple,
|
|
226
|
-
},
|
|
227
|
-
copyButton: {
|
|
228
|
-
width: 24,
|
|
229
|
-
height: 24,
|
|
230
|
-
borderRadius: 6,
|
|
231
|
-
backgroundColor: 'rgba(104,75,155,0.08)',
|
|
232
|
-
alignItems: 'center',
|
|
233
|
-
justifyContent: 'center',
|
|
234
|
-
},
|
|
235
175
|
contentWrapper: {
|
|
236
|
-
backgroundColor:
|
|
176
|
+
backgroundColor: AppColors.white,
|
|
237
177
|
minHeight: 120,
|
|
238
|
-
maxHeight: 480,
|
|
239
178
|
},
|
|
240
179
|
rawScroll: {
|
|
241
180
|
flex: 1,
|
|
242
|
-
backgroundColor:
|
|
181
|
+
backgroundColor: AppColors.paperBg, // Royal off-white paper tone
|
|
243
182
|
},
|
|
244
|
-
|
|
183
|
+
rawContainer: {
|
|
245
184
|
padding: 12,
|
|
246
185
|
},
|
|
247
|
-
|
|
248
|
-
fontFamily:
|
|
249
|
-
fontSize:
|
|
250
|
-
color:
|
|
251
|
-
lineHeight:
|
|
186
|
+
rawPlainText: {
|
|
187
|
+
fontFamily: AppFonts.interRegular,
|
|
188
|
+
fontSize: 12.5,
|
|
189
|
+
color: AppColors.primaryBlack,
|
|
190
|
+
lineHeight: 18,
|
|
252
191
|
},
|
|
253
192
|
tableView: {
|
|
254
193
|
flex: 1,
|
|
255
194
|
},
|
|
256
195
|
tableHeaderRow: {
|
|
257
196
|
flexDirection: 'row',
|
|
258
|
-
backgroundColor:
|
|
197
|
+
backgroundColor: AppColors.slate100,
|
|
259
198
|
borderBottomWidth: 1,
|
|
260
|
-
borderBottomColor:
|
|
199
|
+
borderBottomColor: AppColors.slate200,
|
|
261
200
|
paddingVertical: 8,
|
|
262
201
|
paddingHorizontal: 12,
|
|
263
202
|
},
|
|
264
203
|
tableHeaderCell: {
|
|
265
204
|
fontFamily: AppFonts.interBold,
|
|
266
|
-
fontSize:
|
|
267
|
-
color:
|
|
205
|
+
fontSize: 11,
|
|
206
|
+
color: AppColors.slate600,
|
|
268
207
|
letterSpacing: 0.5,
|
|
269
208
|
textTransform: 'uppercase',
|
|
270
209
|
},
|
|
271
210
|
tableRow: {
|
|
272
211
|
flexDirection: 'row',
|
|
273
212
|
borderBottomWidth: 1,
|
|
274
|
-
borderBottomColor:
|
|
213
|
+
borderBottomColor: AppColors.slate100,
|
|
275
214
|
paddingVertical: 10,
|
|
276
215
|
paddingHorizontal: 12,
|
|
277
216
|
alignItems: 'center',
|
|
278
217
|
},
|
|
279
218
|
tableCellKey: {
|
|
280
|
-
fontFamily:
|
|
281
|
-
fontSize:
|
|
282
|
-
|
|
283
|
-
color: '#0F172A',
|
|
219
|
+
fontFamily: AppFonts.interBold,
|
|
220
|
+
fontSize: 12.5,
|
|
221
|
+
color: AppColors.purple,
|
|
284
222
|
},
|
|
285
223
|
tableCellValue: {
|
|
286
|
-
fontFamily:
|
|
287
|
-
fontSize:
|
|
288
|
-
color:
|
|
224
|
+
fontFamily: AppFonts.interRegular,
|
|
225
|
+
fontSize: 12.5,
|
|
226
|
+
color: AppColors.primaryBlack,
|
|
227
|
+
lineHeight: 18,
|
|
289
228
|
},
|
|
290
229
|
emptyTable: {
|
|
291
230
|
padding: 24,
|
|
@@ -294,8 +233,8 @@ const localStyles = StyleSheet.create({
|
|
|
294
233
|
},
|
|
295
234
|
emptyTableText: {
|
|
296
235
|
fontFamily: AppFonts.interMedium,
|
|
297
|
-
fontSize: 12,
|
|
298
|
-
color:
|
|
236
|
+
fontSize: 12.5,
|
|
237
|
+
color: AppColors.slate400,
|
|
299
238
|
},
|
|
300
239
|
});
|
|
301
240
|
export default JsonViewer;
|
|
@@ -3,13 +3,14 @@ import { Animated, View, Pressable, Text, StyleSheet } from 'react-native';
|
|
|
3
3
|
import Svg, { Path } from 'react-native-svg';
|
|
4
4
|
import { AppColors } from '../styles/AppColors';
|
|
5
5
|
import { METHOD_COLORS } from '../constants';
|
|
6
|
-
import { getStatusColor, getDurationColor, getPath, getBaseUrl, formatDateTime, } from '../helpers';
|
|
7
|
-
import { CalendarIcon, ClockIcon } from './NetworkIcons';
|
|
8
|
-
import { AppFonts } from '../styles/AppFonts';
|
|
6
|
+
import { getStatusColor, getDurationColor, getPath, getBaseUrl, formatDateTime, getSize, } from '../helpers';
|
|
7
|
+
import { CalendarIcon, ClockIcon, SizeIcon } from './NetworkIcons';
|
|
9
8
|
import styles from '../styles';
|
|
10
9
|
import HighlightText from './HighlightText';
|
|
11
10
|
import TouchableScale from './TouchableScale';
|
|
11
|
+
import { useTranslation } from 'react-i18next';
|
|
12
12
|
const LogCard = React.memo(function LogCard({ item, onPress, timelineMinStart, timelineTotalRange, isNew, isSelected, onToggleSelect, searchStr, }) {
|
|
13
|
+
const { t } = useTranslation();
|
|
13
14
|
const methodColor = METHOD_COLORS[item.method] ?? METHOD_COLORS.ALL;
|
|
14
15
|
const isFailed = item.status === 0 || (item.status != null && item.status >= 400);
|
|
15
16
|
const isLoading = item.status == null;
|
|
@@ -38,85 +39,137 @@ const LogCard = React.memo(function LogCard({ item, onPress, timelineMinStart, t
|
|
|
38
39
|
}, [isNew]);
|
|
39
40
|
const path = getPath(item.url);
|
|
40
41
|
const baseUrl = getBaseUrl(item.url) || item.url;
|
|
41
|
-
const
|
|
42
|
+
const cleanHost = baseUrl.replace(/^https?:\/\//, '');
|
|
43
|
+
const slug = path && path !== '/' ? path : item.url;
|
|
44
|
+
const showSlug = slug !== cleanHost;
|
|
42
45
|
const triggeredAt = formatDateTime(item.startTime);
|
|
43
46
|
const isJson = item.url.split('?')[0].toLowerCase().endsWith('.json');
|
|
44
47
|
return (<TouchableScale onPress={onPress} style={[
|
|
45
48
|
styles.card,
|
|
46
49
|
{
|
|
47
|
-
borderLeftWidth:
|
|
50
|
+
borderLeftWidth: 3.5,
|
|
48
51
|
borderLeftColor: cardStatusColor,
|
|
49
52
|
},
|
|
50
53
|
]}>
|
|
51
54
|
<View style={styles.cardBody}>
|
|
52
|
-
|
|
53
|
-
|
|
55
|
+
{/* Row 1: Header (Checkbox, Serial, Method Badge, Base URL / Host, Status Pill) */}
|
|
56
|
+
<View style={styles.cardHeaderRow}>
|
|
57
|
+
<View style={styles.cardHeaderLeft}>
|
|
58
|
+
<Pressable onPress={() => onToggleSelect(item.id)} hitSlop={12} style={[
|
|
54
59
|
styles.smallCheckbox,
|
|
55
60
|
isSelected && styles.smallCheckboxChecked,
|
|
56
61
|
]}>
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
62
|
+
{isSelected && (<Svg width={9} height={9} viewBox="0 0 24 24" fill="none">
|
|
63
|
+
<Path d="M20 6L9 17l-5-5" stroke={AppColors.white} strokeWidth="4" strokeLinecap="round" strokeLinejoin="round"/>
|
|
64
|
+
</Svg>)}
|
|
65
|
+
</Pressable>
|
|
61
66
|
|
|
62
|
-
|
|
67
|
+
<Text style={styles.serialNumber}>#{item.id + 1}</Text>
|
|
63
68
|
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
69
|
+
<View style={[styles.methodBadge, { backgroundColor: methodColor }]}>
|
|
70
|
+
<Text style={[styles.methodBadgeText, { color: AppColors.white }]}>
|
|
71
|
+
{item.method}
|
|
72
|
+
</Text>
|
|
73
|
+
</View>
|
|
74
|
+
|
|
75
|
+
<HighlightText text={cleanHost || item.url} search={searchStr} style={styles.cardHostText} highlightStyle={styles.highlight} numberOfLines={1} ellipsizeMode="tail"/>
|
|
76
|
+
</View>
|
|
77
|
+
|
|
78
|
+
<View style={[
|
|
79
|
+
styles.statusPill,
|
|
80
|
+
{
|
|
81
|
+
backgroundColor: isFailed
|
|
82
|
+
? `${AppColors.errorColor}15`
|
|
83
|
+
: isLoading
|
|
84
|
+
? `${AppColors.darkOrange}15`
|
|
85
|
+
: `${statusColor}15`,
|
|
86
|
+
borderColor: isFailed
|
|
87
|
+
? `${AppColors.errorColor}30`
|
|
88
|
+
: isLoading
|
|
89
|
+
? `${AppColors.darkOrange}30`
|
|
90
|
+
: `${statusColor}30`,
|
|
91
|
+
},
|
|
92
|
+
]}>
|
|
93
|
+
<Text style={[
|
|
94
|
+
styles.statusPillText,
|
|
95
|
+
{
|
|
96
|
+
color: isFailed
|
|
97
|
+
? AppColors.errorColor
|
|
98
|
+
: isLoading
|
|
99
|
+
? AppColors.darkOrange
|
|
100
|
+
: statusColor,
|
|
101
|
+
},
|
|
102
|
+
]}>
|
|
103
|
+
{isLoading
|
|
104
|
+
? '...'
|
|
105
|
+
: isFailed
|
|
106
|
+
? (item.status ? `${item.status}` : t('network.statusFailed'))
|
|
107
|
+
: item.status}
|
|
67
108
|
</Text>
|
|
68
109
|
</View>
|
|
110
|
+
</View>
|
|
69
111
|
|
|
70
|
-
|
|
112
|
+
{/* Row 2: Improved Slug Capsule Container */}
|
|
113
|
+
{showSlug && (<View style={styles.cardSlugBox}>
|
|
114
|
+
<View style={styles.slugLeft}>
|
|
115
|
+
<Text style={styles.slugTag}>PATH</Text>
|
|
116
|
+
<HighlightText text={slug} search={searchStr} style={styles.slugText} highlightStyle={styles.highlight} numberOfLines={1} ellipsizeMode="tail"/>
|
|
117
|
+
</View>
|
|
71
118
|
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
119
|
+
<View style={styles.slugRight}>
|
|
120
|
+
{isJson && (<View style={[
|
|
121
|
+
styles.chip,
|
|
122
|
+
{
|
|
123
|
+
backgroundColor: `${AppColors.darkOrange}12`,
|
|
124
|
+
borderColor: `${AppColors.darkOrange}28`,
|
|
125
|
+
},
|
|
126
|
+
]}>
|
|
127
|
+
<Text style={[styles.chipText, { color: AppColors.darkOrange }]}>
|
|
128
|
+
.json
|
|
129
|
+
</Text>
|
|
130
|
+
</View>)}
|
|
131
|
+
|
|
132
|
+
{item.duplicateCount != null && item.duplicateCount > 1 && (<View style={[
|
|
133
|
+
styles.chip,
|
|
134
|
+
{
|
|
135
|
+
backgroundColor: `${AppColors.purple}12`,
|
|
136
|
+
borderColor: `${AppColors.purple}28`,
|
|
137
|
+
},
|
|
138
|
+
]}>
|
|
139
|
+
<Text style={[
|
|
140
|
+
styles.chipText,
|
|
141
|
+
{ color: AppColors.purple, fontWeight: '700' },
|
|
142
|
+
]}>
|
|
143
|
+
×{item.duplicateCount}
|
|
144
|
+
</Text>
|
|
145
|
+
</View>)}
|
|
146
|
+
</View>
|
|
147
|
+
</View>)}
|
|
84
148
|
|
|
85
|
-
|
|
86
|
-
|
|
149
|
+
{/* Row 3: Footer (Timestamp on Left, Response Size & Duration on Right) */}
|
|
150
|
+
<View style={styles.cardFooterRow}>
|
|
151
|
+
<View style={styles.cardDateRow}>
|
|
152
|
+
<CalendarIcon color={AppColors.grayTextWeak} size={10}/>
|
|
153
|
+
<Text style={styles.cardDateText}>{triggeredAt}</Text>
|
|
154
|
+
</View>
|
|
155
|
+
|
|
156
|
+
<View style={styles.cardFooterRight}>
|
|
157
|
+
{item.response != null && (<View style={[
|
|
87
158
|
styles.chip,
|
|
88
159
|
{
|
|
89
|
-
backgroundColor: `${AppColors.purple}
|
|
90
|
-
borderColor: `${AppColors.purple}
|
|
91
|
-
marginLeft: 6,
|
|
160
|
+
backgroundColor: `${AppColors.purple}12`,
|
|
161
|
+
borderColor: `${AppColors.purple}2E`,
|
|
92
162
|
},
|
|
93
163
|
]}>
|
|
94
|
-
|
|
164
|
+
<SizeIcon color={AppColors.purple} size={9}/>
|
|
165
|
+
<Text style={[
|
|
95
166
|
styles.chipText,
|
|
96
|
-
{ color: AppColors.purple,
|
|
167
|
+
{ color: AppColors.purple, fontSize: 9.5 },
|
|
97
168
|
]}>
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
</View>
|
|
102
|
-
|
|
103
|
-
{showPathRow && (<View style={{ flexDirection: 'row', alignItems: 'flex-start', marginTop: 3, marginBottom: 5, paddingLeft: 30, gap: 6 }}>
|
|
104
|
-
<Text style={{ color: AppColors.grayTextWeak, fontSize: 9, fontFamily: AppFonts.interBold, letterSpacing: 0.5, marginTop: 2.5 }}>PATH</Text>
|
|
105
|
-
<HighlightText text={path} search={searchStr} style={{
|
|
106
|
-
fontFamily: AppFonts.Sfprotext || 'System',
|
|
107
|
-
fontSize: 12,
|
|
108
|
-
color: AppColors.grayText,
|
|
109
|
-
flex: 1,
|
|
110
|
-
}} highlightStyle={styles.highlight} numberOfLines={0}/>
|
|
111
|
-
</View>)}
|
|
112
|
-
|
|
113
|
-
<View style={styles.cardBottomRow}>
|
|
114
|
-
<View style={styles.cardDateRow}>
|
|
115
|
-
<CalendarIcon color={AppColors.grayTextWeak} size={11}/>
|
|
116
|
-
<Text style={styles.cardDateText}>{triggeredAt}</Text>
|
|
117
|
-
</View>
|
|
169
|
+
{getSize(item.response)}
|
|
170
|
+
</Text>
|
|
171
|
+
</View>)}
|
|
118
172
|
|
|
119
|
-
<View style={styles.cardMetaRow}>
|
|
120
173
|
{item.duration != null && !isFailed && (<View style={[
|
|
121
174
|
styles.chip,
|
|
122
175
|
{
|
|
@@ -124,43 +177,13 @@ const LogCard = React.memo(function LogCard({ item, onPress, timelineMinStart, t
|
|
|
124
177
|
borderColor: `${durationColor}30`,
|
|
125
178
|
},
|
|
126
179
|
]}>
|
|
127
|
-
<ClockIcon color={durationColor} size={
|
|
128
|
-
<Text style={[styles.chipText, { color: durationColor }]}>
|
|
180
|
+
<ClockIcon color={durationColor} size={9}/>
|
|
181
|
+
<Text style={[styles.chipText, { color: durationColor, fontSize: 9.5 }]}>
|
|
129
182
|
{item.duration}ms
|
|
130
183
|
</Text>
|
|
131
184
|
</View>)}
|
|
132
|
-
|
|
133
|
-
<View style={[
|
|
134
|
-
styles.chip,
|
|
135
|
-
{
|
|
136
|
-
backgroundColor: isFailed
|
|
137
|
-
? `${AppColors.errorColor}15`
|
|
138
|
-
: `${statusColor}15`,
|
|
139
|
-
borderColor: isFailed
|
|
140
|
-
? `${AppColors.errorColor}30`
|
|
141
|
-
: `${statusColor}30`,
|
|
142
|
-
},
|
|
143
|
-
]}>
|
|
144
|
-
<Text style={[
|
|
145
|
-
styles.chipText,
|
|
146
|
-
{ color: isFailed ? AppColors.errorColor : statusColor },
|
|
147
|
-
]}>
|
|
148
|
-
{isFailed ? 'Failed' : item.status}
|
|
149
|
-
</Text>
|
|
150
|
-
</View>
|
|
151
185
|
</View>
|
|
152
186
|
</View>
|
|
153
|
-
|
|
154
|
-
<View style={styles.timelineTrack}>
|
|
155
|
-
<View style={[
|
|
156
|
-
styles.timelineBar,
|
|
157
|
-
{
|
|
158
|
-
left: `${Math.max(0, leftPercent)}%`,
|
|
159
|
-
width: `${Math.min(100, widthPercent)}%`,
|
|
160
|
-
backgroundColor: methodColor,
|
|
161
|
-
},
|
|
162
|
-
]}/>
|
|
163
|
-
</View>
|
|
164
187
|
</View>
|
|
165
188
|
<Animated.View pointerEvents="none" style={[
|
|
166
189
|
StyleSheet.absoluteFill,
|
|
@@ -1,13 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
|
|
3
|
-
status: number | null | undefined;
|
|
4
|
-
statusColor: string;
|
|
5
|
-
duration: number | null | undefined;
|
|
6
|
-
size: string;
|
|
7
|
-
triggeredAt: string;
|
|
8
|
-
method: string;
|
|
9
|
-
contentType?: string;
|
|
10
|
-
url: string;
|
|
11
|
-
}
|
|
2
|
+
import { MetaAccordionProps } from '../types';
|
|
12
3
|
declare const MetaAccordion: ({ status, statusColor, duration, size, triggeredAt, method, contentType, url, }: MetaAccordionProps) => React.JSX.Element;
|
|
13
4
|
export default MetaAccordion;
|