react-native-inapp-inspector 2.4.0 → 2.4.2
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.ar.md +163 -0
- package/README.de.md +163 -0
- package/README.es.md +164 -0
- package/README.fr.md +163 -0
- package/README.hi.md +163 -0
- package/README.ja.md +180 -0
- package/README.ko.md +163 -0
- package/README.md +340 -243
- package/README.pt-BR.md +163 -0
- package/README.ru.md +163 -0
- package/README.zh-CN.md +387 -0
- package/android/src/main/java/com/inappinspector/NetworkInspectorModule.kt +82 -21
- package/assets/banner_dark.svg +186 -0
- package/assets/banner_light.svg +186 -0
- package/assets/icon_circle.svg +148 -0
- package/assets/icon_square.svg +369 -0
- package/assets/inapp_inspector_icon.gif +0 -0
- package/assets/inapp_inspector_icon_original.gif +0 -0
- package/assets/social_preview.png +0 -0
- package/assets/walkthrough.gif +0 -0
- package/dist/commonjs/components/AnimatedBrandOwl.d.ts +7 -0
- package/dist/commonjs/components/AnimatedBrandOwl.js +175 -0
- package/dist/commonjs/components/AppHeaderLogo.d.ts +1 -0
- package/dist/commonjs/components/AppHeaderLogo.js +7 -5
- package/dist/commonjs/components/BrandSquareIcon.d.ts +5 -0
- package/dist/commonjs/components/BrandSquareIcon.js +139 -0
- package/dist/commonjs/components/ConsoleLogCard.d.ts +2 -1
- package/dist/commonjs/components/ConsoleLogCard.js +23 -39
- package/dist/commonjs/components/Inspector/AboutModal.js +44 -54
- package/dist/commonjs/components/Inspector/AnalyticsTab.js +16 -16
- package/dist/commonjs/components/Inspector/ConfirmationModal.d.ts +13 -0
- package/dist/commonjs/components/Inspector/ConfirmationModal.js +32 -0
- package/dist/commonjs/components/Inspector/ConsoleTab.js +15 -15
- package/dist/commonjs/components/Inspector/CrashTab.js +25 -23
- package/dist/commonjs/components/Inspector/DebuggingTab.js +17 -17
- package/dist/commonjs/components/Inspector/FabLauncher.js +22 -30
- package/dist/commonjs/components/Inspector/FeatureUnderDevNotice.js +2 -2
- package/dist/commonjs/components/Inspector/LanguageSelectorModal.d.ts +15 -0
- package/dist/commonjs/components/Inspector/LanguageSelectorModal.js +90 -0
- package/dist/commonjs/components/Inspector/MainScreen.js +46 -33
- package/dist/commonjs/components/Inspector/MediaGalleryTab.js +21 -19
- package/dist/commonjs/components/Inspector/MediaPreviewModal.js +85 -101
- package/dist/commonjs/components/Inspector/NetworkTab.js +50 -50
- package/dist/commonjs/components/Inspector/NpmUpdateToast.js +1 -1
- package/dist/commonjs/components/Inspector/PushCard.d.ts +3 -2
- package/dist/commonjs/components/Inspector/PushCard.js +5 -4
- package/dist/commonjs/components/Inspector/PushDetail.js +32 -23
- package/dist/commonjs/components/Inspector/PushTab.js +13 -13
- package/dist/commonjs/components/Inspector/ReduxDetail.js +32 -32
- package/dist/commonjs/components/Inspector/ReduxTab.js +14 -14
- package/dist/commonjs/components/Inspector/SettingsPanel.js +258 -139
- package/dist/commonjs/components/Inspector/SocketCard.d.ts +5 -0
- package/dist/commonjs/components/Inspector/SocketCard.js +116 -0
- package/dist/commonjs/components/Inspector/SocketDetail.d.ts +4 -0
- package/dist/commonjs/components/Inspector/SocketDetail.js +317 -0
- package/dist/commonjs/components/Inspector/SocketFilterModal.d.ts +13 -0
- package/dist/commonjs/components/Inspector/SocketFilterModal.js +69 -0
- package/dist/commonjs/components/Inspector/SocketTab.d.ts +3 -0
- package/dist/commonjs/components/Inspector/SocketTab.js +112 -0
- package/dist/commonjs/components/Inspector/StorageTab.js +34 -32
- package/dist/commonjs/components/Inspector/SupportModal.d.ts +7 -0
- package/dist/commonjs/components/Inspector/SupportModal.js +125 -0
- package/dist/commonjs/components/Inspector/SupportPage.d.ts +5 -0
- package/dist/commonjs/components/Inspector/SupportPage.js +227 -0
- package/dist/commonjs/components/Inspector/TabBar.js +24 -23
- package/dist/commonjs/components/Inspector/UpdateAvailableModal.js +24 -24
- package/dist/commonjs/components/JsonViewer.js +7 -7
- package/dist/commonjs/components/LogCard.d.ts +3 -2
- package/dist/commonjs/components/LogCard.js +17 -14
- package/dist/commonjs/components/LogSyntaxHighlighter.js +5 -5
- package/dist/commonjs/components/ModuleErrorBoundary.js +2 -2
- package/dist/commonjs/components/NetworkIcons.d.ts +15 -0
- package/dist/commonjs/components/NetworkIcons.js +38 -3
- package/dist/commonjs/components/SegmentedTabs.js +1 -1
- package/dist/commonjs/constants/version.d.ts +1 -1
- package/dist/commonjs/constants/version.js +1 -1
- package/dist/commonjs/customHooks/socketLogger.d.ts +26 -0
- package/dist/commonjs/customHooks/socketLogger.js +2 -0
- package/dist/commonjs/helpers/index.js +3 -3
- package/dist/commonjs/helpers/memoryManager.d.ts +1 -0
- package/dist/commonjs/helpers/memoryManager.js +1 -1
- package/dist/commonjs/helpers/searchQueryParser.d.ts +1 -1
- package/dist/commonjs/helpers/searchQueryParser.js +5 -1
- package/dist/commonjs/helpers/settingsStore.d.ts +1 -0
- package/dist/commonjs/helpers/settingsStore.js +1 -1
- package/dist/commonjs/helpers/shareFormatter.d.ts +3 -1
- package/dist/commonjs/helpers/shareFormatter.js +8 -7
- package/dist/commonjs/i18n/index.d.ts +99 -1
- package/dist/commonjs/i18n/index.js +1 -1
- package/dist/commonjs/i18n/locales/ar.json +1 -1
- package/dist/commonjs/i18n/locales/bn.json +1 -0
- package/dist/commonjs/i18n/locales/de.json +1 -1
- package/dist/commonjs/i18n/locales/en.json +1 -1
- package/dist/commonjs/i18n/locales/es.json +1 -1
- package/dist/commonjs/i18n/locales/fr.json +1 -1
- package/dist/commonjs/i18n/locales/gu.json +1 -0
- package/dist/commonjs/i18n/locales/hi.json +1 -1
- package/dist/commonjs/i18n/locales/id.json +1 -0
- package/dist/commonjs/i18n/locales/it.json +1 -0
- package/dist/commonjs/i18n/locales/ja.json +1 -1
- package/dist/commonjs/i18n/locales/kn.json +1 -0
- package/dist/commonjs/i18n/locales/ko.json +1 -1
- package/dist/commonjs/i18n/locales/ml.json +1 -0
- package/dist/commonjs/i18n/locales/mr.json +1 -0
- package/dist/commonjs/i18n/locales/nl.json +1 -0
- package/dist/commonjs/i18n/locales/pa.json +1 -0
- package/dist/commonjs/i18n/locales/pl.json +1 -0
- package/dist/commonjs/i18n/locales/pt.json +1 -1
- package/dist/commonjs/i18n/locales/ru.json +1 -1
- package/dist/commonjs/i18n/locales/ta.json +1 -0
- package/dist/commonjs/i18n/locales/te.json +1 -0
- package/dist/commonjs/i18n/locales/tr.json +1 -0
- package/dist/commonjs/i18n/locales/vi.json +1 -0
- package/dist/commonjs/i18n/locales/zh.json +1 -1
- package/dist/commonjs/index.d.ts +13 -13
- package/dist/commonjs/index.js +5 -4
- package/dist/commonjs/native/NativeInspector.d.ts +1 -0
- package/dist/commonjs/socket.d.ts +4 -0
- package/dist/commonjs/socket.js +1 -0
- package/dist/commonjs/styles/index.d.ts +23 -0
- package/dist/commonjs/styles/index.js +1 -1
- package/dist/commonjs/types/enums.d.ts +40 -0
- package/dist/commonjs/types/enums.js +1 -1
- package/dist/commonjs/types/interfaces.d.ts +122 -1
- package/dist/esm/components/AnimatedBrandOwl.d.ts +7 -0
- package/dist/esm/components/AnimatedBrandOwl.js +175 -0
- package/dist/esm/components/AppHeaderLogo.d.ts +1 -0
- package/dist/esm/components/AppHeaderLogo.js +7 -5
- package/dist/esm/components/BrandSquareIcon.d.ts +5 -0
- package/dist/esm/components/BrandSquareIcon.js +139 -0
- package/dist/esm/components/ConsoleLogCard.d.ts +2 -1
- package/dist/esm/components/ConsoleLogCard.js +61 -77
- package/dist/esm/components/Inspector/AboutModal.js +85 -95
- package/dist/esm/components/Inspector/AnalyticsTab.js +31 -31
- package/dist/esm/components/Inspector/ConfirmationModal.d.ts +13 -0
- package/dist/esm/components/Inspector/ConfirmationModal.js +32 -0
- package/dist/esm/components/Inspector/ConsoleTab.js +49 -49
- package/dist/esm/components/Inspector/CrashTab.js +40 -38
- package/dist/esm/components/Inspector/DebuggingTab.js +29 -29
- package/dist/esm/components/Inspector/FabLauncher.js +50 -58
- package/dist/esm/components/Inspector/FeatureUnderDevNotice.js +7 -7
- package/dist/esm/components/Inspector/LanguageSelectorModal.d.ts +15 -0
- package/dist/esm/components/Inspector/LanguageSelectorModal.js +90 -0
- package/dist/esm/components/Inspector/MainScreen.js +123 -110
- package/dist/esm/components/Inspector/MediaGalleryTab.js +64 -62
- package/dist/esm/components/Inspector/MediaPreviewModal.js +107 -123
- package/dist/esm/components/Inspector/NetworkTab.js +90 -90
- package/dist/esm/components/Inspector/NpmUpdateToast.js +1 -1
- package/dist/esm/components/Inspector/PushCard.d.ts +3 -2
- package/dist/esm/components/Inspector/PushCard.js +23 -22
- package/dist/esm/components/Inspector/PushDetail.js +34 -25
- package/dist/esm/components/Inspector/PushTab.js +25 -25
- package/dist/esm/components/Inspector/ReduxDetail.js +42 -42
- package/dist/esm/components/Inspector/ReduxTab.js +35 -35
- package/dist/esm/components/Inspector/SettingsPanel.js +495 -376
- package/dist/esm/components/Inspector/SocketCard.d.ts +5 -0
- package/dist/esm/components/Inspector/SocketCard.js +116 -0
- package/dist/esm/components/Inspector/SocketDetail.d.ts +4 -0
- package/dist/esm/components/Inspector/SocketDetail.js +317 -0
- package/dist/esm/components/Inspector/SocketFilterModal.d.ts +13 -0
- package/dist/esm/components/Inspector/SocketFilterModal.js +69 -0
- package/dist/esm/components/Inspector/SocketTab.d.ts +3 -0
- package/dist/esm/components/Inspector/SocketTab.js +112 -0
- package/dist/esm/components/Inspector/StorageTab.js +136 -134
- package/dist/esm/components/Inspector/SupportModal.d.ts +7 -0
- package/dist/esm/components/Inspector/SupportModal.js +125 -0
- package/dist/esm/components/Inspector/SupportPage.d.ts +5 -0
- package/dist/esm/components/Inspector/SupportPage.js +227 -0
- package/dist/esm/components/Inspector/TabBar.js +36 -35
- package/dist/esm/components/Inspector/UpdateAvailableModal.js +22 -22
- package/dist/esm/components/JsonViewer.js +55 -55
- package/dist/esm/components/LogCard.d.ts +3 -2
- package/dist/esm/components/LogCard.js +61 -58
- package/dist/esm/components/LogSyntaxHighlighter.js +5 -5
- package/dist/esm/components/ModuleErrorBoundary.js +23 -23
- package/dist/esm/components/NetworkIcons.d.ts +15 -0
- package/dist/esm/components/NetworkIcons.js +38 -3
- package/dist/esm/components/SegmentedTabs.js +7 -7
- package/dist/esm/constants/version.d.ts +1 -1
- package/dist/esm/constants/version.js +1 -1
- package/dist/esm/customHooks/socketLogger.d.ts +26 -0
- package/dist/esm/customHooks/socketLogger.js +2 -0
- package/dist/esm/helpers/index.js +3 -3
- package/dist/esm/helpers/memoryManager.d.ts +1 -0
- package/dist/esm/helpers/memoryManager.js +1 -1
- package/dist/esm/helpers/searchQueryParser.d.ts +1 -1
- package/dist/esm/helpers/searchQueryParser.js +5 -1
- package/dist/esm/helpers/settingsStore.d.ts +1 -0
- package/dist/esm/helpers/settingsStore.js +1 -1
- package/dist/esm/helpers/shareFormatter.d.ts +3 -1
- package/dist/esm/helpers/shareFormatter.js +8 -7
- package/dist/esm/i18n/index.d.ts +99 -1
- package/dist/esm/i18n/index.js +1 -1
- package/dist/esm/i18n/locales/ar.json +1 -1
- package/dist/esm/i18n/locales/bn.json +1 -0
- package/dist/esm/i18n/locales/de.json +1 -1
- package/dist/esm/i18n/locales/en.json +1 -1
- package/dist/esm/i18n/locales/es.json +1 -1
- package/dist/esm/i18n/locales/fr.json +1 -1
- package/dist/esm/i18n/locales/gu.json +1 -0
- package/dist/esm/i18n/locales/hi.json +1 -1
- package/dist/esm/i18n/locales/id.json +1 -0
- package/dist/esm/i18n/locales/it.json +1 -0
- package/dist/esm/i18n/locales/ja.json +1 -1
- package/dist/esm/i18n/locales/kn.json +1 -0
- package/dist/esm/i18n/locales/ko.json +1 -1
- package/dist/esm/i18n/locales/ml.json +1 -0
- package/dist/esm/i18n/locales/mr.json +1 -0
- package/dist/esm/i18n/locales/nl.json +1 -0
- package/dist/esm/i18n/locales/pa.json +1 -0
- package/dist/esm/i18n/locales/pl.json +1 -0
- package/dist/esm/i18n/locales/pt.json +1 -1
- package/dist/esm/i18n/locales/ru.json +1 -1
- package/dist/esm/i18n/locales/ta.json +1 -0
- package/dist/esm/i18n/locales/te.json +1 -0
- package/dist/esm/i18n/locales/tr.json +1 -0
- package/dist/esm/i18n/locales/vi.json +1 -0
- package/dist/esm/i18n/locales/zh.json +1 -1
- package/dist/esm/index.d.ts +13 -13
- package/dist/esm/index.js +8 -7
- package/dist/esm/native/NativeInspector.d.ts +1 -0
- package/dist/esm/socket.d.ts +4 -0
- package/dist/esm/socket.js +1 -0
- package/dist/esm/styles/index.d.ts +23 -0
- package/dist/esm/styles/index.js +1 -1
- package/dist/esm/types/enums.d.ts +40 -0
- package/dist/esm/types/enums.js +1 -1
- package/dist/esm/types/interfaces.d.ts +122 -1
- package/ios/NetworkInspectorModule.mm +102 -12
- package/package.json +204 -2
- package/src/native/NativeInspector.ts +8 -0
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { SocketCardProps } from '../../types';
|
|
3
|
+
declare function SocketCard({ item, onPress, searchStr, isNew, isSelected, onToggleSelect, serialNumber, }: SocketCardProps): React.JSX.Element;
|
|
4
|
+
declare const _default: React.MemoExoticComponent<typeof SocketCard>;
|
|
5
|
+
export default _default;
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import te,{useMemo as O,useRef as le,useEffect as ae}from"react";import{Alert as ie,Animated as K,Linking as E,Pressable as X,StyleSheet as ne,Text as S,View as C}from"react-native";import Ce,{Path as Se}from"react-native-svg";import{AppColors as e}from"../../styles/AppColors";import{AppFonts as B}from"../../styles/AppFonts";import{formatDateTime as Te,formatTime as ke}from"../../helpers";import{CalendarIcon as Be,ClockIcon as J,CircleCheckIcon as Re,CircleXIcon as $e,ForwardChevronIcon as Ie,GlobeIcon as Q,LockIcon as We,ReceiveFrameIcon as Ve,SendFrameIcon as Pe,SizeIcon as De}from"../NetworkIcons";import Le from"../HighlightText";import Oe from"../TouchableScale";import{useTranslation as Fe}from"../../i18n";function ve(o){return!o||o<=0?"0 B":o<1024?`${o} B`:o<1024*1024?`${(o/1024).toFixed(1)} KB`:`${(o/(1024*1024)).toFixed(2)} MB`}function He({item:o,onPress:T,searchStr:Y,isNew:V,isSelected:M,onToggleSelect:N,serialNumber:A}){const{t:P}=Fe(),$=o.url.startsWith("wss://")||o.url.startsWith("https://"),F=o.client==="socket.io"||o.url.includes("/socket.io"),D=O(()=>F?{label:"SIO",color:e.violet600,bg:`${e.violet600}14`,border:`${e.violet600}35`}:$?{label:"WSS",color:e.emerald600,bg:`${e.emerald600}14`,border:`${e.emerald600}35`}:{label:"WS",color:e.blue600,bg:`${e.blue600}14`,border:`${e.blue600}35`},[F,$]),v=o.status||"open",k=v==="open",W=v==="connecting",z=v==="error",Z=O(()=>k?e.greenColor:W?e.amber600:z?e.errorColor:e.slate400,[k,W,z]),L=O(()=>k?{label:"OPEN",color:e.greenColor,bg:`${e.greenColor}15`,border:`${e.greenColor}40`}:W?{label:"CONNECTING",color:e.amber600,bg:`${e.amber600}15`,border:`${e.amber600}40`}:z?{label:o.closeCode?`ERR ${o.closeCode}`:"ERROR",color:e.errorColor,bg:`${e.errorColor}15`,border:`${e.errorColor}40`}:{label:o.closeCode?`CLOSED (${o.closeCode})`:"CLOSED",color:e.slate500,bg:`${e.slate500}15`,border:`${e.slate500}40`},[k,W,z,o.closeCode]),U=O(()=>{try{const I=o.url.replace(/^(wss?|https?):\/\//,""),R=I.indexOf("/");if(R>=0){const H=I.substring(0,R),re=I.substring(R);return{host:H,path:re}}return{host:I,path:"/"}}catch{return{host:o.url,path:"/"}}},[o.url]),_=I=>{I?.stopPropagation?.();const R=o.url.replace(/^wss:\/\//i,"https://").replace(/^ws:\/\//i,"http://");ie.alert(P("common.openInBrowser","Open in Browser"),`${P("common.openInBrowserPrompt","Are you sure you want to open this URL in your external browser?")}
|
|
2
|
+
|
|
3
|
+
${R}`,[{text:P("common.cancel","Cancel"),style:"cancel"},{text:P("common.open","Open"),onPress:()=>{E.canOpenURL(R).then(H=>{H?E.openURL(R):E.openURL(R).catch(()=>{})}).catch(()=>{})}}])},j=le(new K.Value(V?.35:0)).current;ae(()=>{V&&K.timing(j,{toValue:0,duration:1200,useNativeDriver:!1}).start()},[V,j]);const G=(o.totalBytesSent||0)+(o.totalBytesReceived||0),ee=o.duration!=null?`${o.duration}ms`:"Active",oe=Te(o.startTime);return<C style={r.container}>
|
|
4
|
+
<Oe onPress={T}style={[r.card,{borderLeftWidth:3.5,borderLeftColor:Z,backgroundColor:z?e.errorCardBg:e.white},V&&r.cardNew]}>
|
|
5
|
+
<C style={r.cardBody}>
|
|
6
|
+
|
|
7
|
+
<C style={r.cardHeaderRow}>
|
|
8
|
+
<C style={r.cardHeaderLeft}>
|
|
9
|
+
{N&&<X onPress={()=>N(o.id)}hitSlop={12}style={[r.smallCheckbox,M&&r.smallCheckboxChecked]}>
|
|
10
|
+
{M&&<Ce width={9}height={9}viewBox="0 0 24 24"fill="none">
|
|
11
|
+
<Se d="M20 6L9 17l-5-5"stroke={e.white}strokeWidth="4"strokeLinecap="round"strokeLinejoin="round"/>
|
|
12
|
+
</Ce>}
|
|
13
|
+
</X>}
|
|
14
|
+
|
|
15
|
+
{A!=null&&<S style={r.serialNumber}>#{A}</S>}
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
<C style={[r.protocolBadge,{backgroundColor:D.bg,borderColor:D.border}]}>
|
|
19
|
+
<S style={[r.protocolBadgeText,{color:D.color}]}>
|
|
20
|
+
{D.label}
|
|
21
|
+
</S>
|
|
22
|
+
</C>
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
{F&&<C style={[r.chip,{backgroundColor:`${e.violet600}12`,borderColor:`${e.violet600}2B`}]}>
|
|
26
|
+
<S style={[r.chipText,{color:e.violet600}]}>
|
|
27
|
+
SOCKET.IO
|
|
28
|
+
</S>
|
|
29
|
+
</C>}
|
|
30
|
+
</C>
|
|
31
|
+
|
|
32
|
+
<C style={r.cardHeaderRight}>
|
|
33
|
+
|
|
34
|
+
<C style={[r.statusPill,{backgroundColor:L.bg,borderColor:L.border}]}>
|
|
35
|
+
{k?<C style={r.pulsingDot}/>:W?<J color={e.amber600}size={9}/>:z?<$e color={e.errorColor}size={9}/>:<Re color={e.slate500}size={9}/>}
|
|
36
|
+
<S style={[r.statusPillText,{color:L.color}]}>
|
|
37
|
+
{L.label}
|
|
38
|
+
</S>
|
|
39
|
+
</C>
|
|
40
|
+
|
|
41
|
+
<X onPress={_}hitSlop={8}style={r.globeBtn}accessibilityRole="button"accessibilityLabel="Open in Browser">
|
|
42
|
+
<Q color={e.grayTextWeak}size={12}/>
|
|
43
|
+
</X>
|
|
44
|
+
|
|
45
|
+
<Ie color={e.grayTextWeak}size={13}/>
|
|
46
|
+
</C>
|
|
47
|
+
</C>
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
<C style={r.urlBox}>
|
|
51
|
+
<C style={r.urlMainRow}>
|
|
52
|
+
<Le text={U.path}search={Y}style={r.pathText}highlightStyle={r.highlight}numberOfLines={1}ellipsizeMode="middle"/>
|
|
53
|
+
</C>
|
|
54
|
+
|
|
55
|
+
<C style={r.hostRow}>
|
|
56
|
+
<C style={[r.protoBadge,{backgroundColor:$?`${e.emerald600}12`:`${e.blue600}12`,borderColor:$?`${e.emerald600}2B`:`${e.blue600}2B`}]}>
|
|
57
|
+
{$?<We size={9}color={e.emerald600}/>:<Q size={9}color={e.blue600}/>}
|
|
58
|
+
<S style={[r.protoBadgeText,{color:$?e.emerald600:e.blue600}]}>
|
|
59
|
+
{$?"WSS":"WS"}
|
|
60
|
+
</S>
|
|
61
|
+
</C>
|
|
62
|
+
|
|
63
|
+
<S style={r.hostText}numberOfLines={1}ellipsizeMode="tail">
|
|
64
|
+
{U.host}
|
|
65
|
+
</S>
|
|
66
|
+
</C>
|
|
67
|
+
</C>
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
<C style={r.cardFooterRow}>
|
|
71
|
+
<C style={r.footerLeft}>
|
|
72
|
+
<C style={r.cardDateRow}>
|
|
73
|
+
<Be color={e.grayTextWeak}size={10}/>
|
|
74
|
+
<S style={r.cardDateText}numberOfLines={1}>
|
|
75
|
+
{oe||ke(o.startTime)}
|
|
76
|
+
</S>
|
|
77
|
+
</C>
|
|
78
|
+
</C>
|
|
79
|
+
|
|
80
|
+
<C style={r.footerRight}>
|
|
81
|
+
|
|
82
|
+
<C style={[r.metaStatChip,{backgroundColor:`${e.blue600}10`,borderColor:`${e.blue600}26`}]}>
|
|
83
|
+
<Pe size={9}color={e.blue600}/>
|
|
84
|
+
<S style={[r.metaStatText,{color:e.blue600}]}>
|
|
85
|
+
{o.sentCount||0}
|
|
86
|
+
</S>
|
|
87
|
+
</C>
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
<C style={[r.metaStatChip,{backgroundColor:`${e.emerald600}10`,borderColor:`${e.emerald600}26`}]}>
|
|
91
|
+
<Ve size={9}color={e.emerald600}/>
|
|
92
|
+
<S style={[r.metaStatText,{color:e.emerald600}]}>
|
|
93
|
+
{o.receivedCount||0}
|
|
94
|
+
</S>
|
|
95
|
+
</C>
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
{G>0&&<C style={[r.metaStatChip,{backgroundColor:`${e.purple}10`,borderColor:`${e.purple}26`}]}>
|
|
99
|
+
<De size={9}color={e.purple}/>
|
|
100
|
+
<S style={[r.metaStatText,{color:e.purple}]}>
|
|
101
|
+
{ve(G)}
|
|
102
|
+
</S>
|
|
103
|
+
</C>}
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
<C style={[r.metaStatChip,{backgroundColor:k?`${e.greenColor}10`:`${e.slate400}10`,borderColor:k?`${e.greenColor}26`:`${e.slate400}26`}]}>
|
|
107
|
+
<J size={9}color={k?e.greenColor:e.grayTextWeak}/>
|
|
108
|
+
<S style={[r.metaStatText,{color:k?e.greenColor:e.grayTextWeak}]}>
|
|
109
|
+
{ee}
|
|
110
|
+
</S>
|
|
111
|
+
</C>
|
|
112
|
+
</C>
|
|
113
|
+
</C>
|
|
114
|
+
</C>
|
|
115
|
+
</Oe>
|
|
116
|
+
</C>}const r=ne.create({container:{marginHorizontal:4,marginBottom:6},card:{borderRadius:12,borderWidth:1,borderColor:e.dividerColor,shadowColor:e.shadowColorString,shadowOffset:{width:0,height:1},shadowOpacity:.05,shadowRadius:2,elevation:1,overflow:"hidden"},cardNew:{borderColor:`${e.brandPurple}66`,backgroundColor:`${e.brandPurple}05`},cardBody:{padding:10},cardHeaderRow:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",marginBottom:6},cardHeaderLeft:{flexDirection:"row",alignItems:"center",gap:6,flex:1,minWidth:0},smallCheckbox:{width:15,height:15,borderRadius:3.5,borderWidth:1.2,borderColor:e.grayTextWeak,alignItems:"center",justifyContent:"center",backgroundColor:e.white,marginRight:2},smallCheckboxChecked:{backgroundColor:e.purple,borderColor:e.purple},serialNumber:{fontFamily:B.interSemiBold,fontSize:10.5,color:e.grayTextWeak},protocolBadge:{paddingHorizontal:5.5,paddingVertical:1.5,borderRadius:5,borderWidth:1},protocolBadgeText:{fontFamily:B.interBold,fontSize:9.5,letterSpacing:.3},chip:{paddingHorizontal:5,paddingVertical:1.5,borderRadius:4,borderWidth:1},chipText:{fontFamily:B.interBold,fontSize:9,letterSpacing:.2},cardHeaderRight:{flexDirection:"row",alignItems:"center",gap:6},statusPill:{flexDirection:"row",alignItems:"center",gap:4,paddingHorizontal:6,paddingVertical:2,borderRadius:5,borderWidth:1},statusPillText:{fontFamily:B.interBold,fontSize:9.5,letterSpacing:.3},pulsingDot:{width:6,height:6,borderRadius:3,backgroundColor:e.greenColor},globeBtn:{padding:3,borderRadius:4,backgroundColor:`${e.grayTextWeak}12`},urlBox:{marginBottom:8},urlMainRow:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",gap:6,marginBottom:3},pathText:{flex:1,fontFamily:B.interBold,fontSize:12.5,color:e.grayTextStrong,lineHeight:17},highlight:{backgroundColor:"rgba(250, 204, 21, 0.40)",color:e.grayTextStrong,borderRadius:2},hostRow:{flexDirection:"row",alignItems:"center",gap:5},protoBadge:{flexDirection:"row",alignItems:"center",gap:3,paddingHorizontal:4.5,paddingVertical:1,borderRadius:4,borderWidth:1},protoBadgeText:{fontFamily:B.interBold,fontSize:8.5,letterSpacing:.2},hostText:{flex:1,fontFamily:B.interMedium,fontSize:11,color:e.grayTextWeak},cardFooterRow:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",paddingTop:6,borderTopWidth:1,borderTopColor:e.dividerColor},footerLeft:{flexDirection:"row",alignItems:"center",flex:1,minWidth:0,marginRight:6},cardDateRow:{flexDirection:"row",alignItems:"center",gap:4},cardDateText:{fontFamily:B.interMedium,fontSize:10,color:e.grayTextWeak},footerRight:{flexDirection:"row",alignItems:"center",gap:4},metaStatChip:{flexDirection:"row",alignItems:"center",gap:3,paddingHorizontal:5,paddingVertical:2,borderRadius:4,borderWidth:1},metaStatText:{fontFamily:B.interSemiBold,fontSize:9.5}});function Ee(o,T){return o.item===T.item&&o.isSelected===T.isSelected&&o.isNew===T.isNew&&o.searchStr===T.searchStr&&o.serialNumber===T.serialNumber&&o.onPress===T.onPress&&o.onToggleSelect===T.onToggleSelect}export default te.memo(He,Ee);
|
|
@@ -0,0 +1,317 @@
|
|
|
1
|
+
import{useMemo as E,useState as A}from"react";import{Alert as Pe,Linking as X,Pressable as M,ScrollView as $,StyleSheet as Fe,Text as T,TextInput as Ie,TouchableOpacity as I,View as S}from"react-native";import B from"../../styles";import{AppColors as e}from"../../styles/AppColors";import{AppFonts as C}from"../../styles/AppFonts";import{useTranslation as We}from"../../i18n";import Oe from"../SegmentedTabs";import Z from"../JsonViewer";import W from"../CopyButton";import Ae from"../ShareButton";import _ from"../CodeSnippet";import $e from"../HighlightText";import He from"../TouchableScale";import{formatDateTime as ee}from"../../helpers";import{shareSocketReport as Ne}from"../../helpers/shareFormatter";import{ClockIcon as De,ChevronIcon as Le,GlobeIcon as Ee,SendFrameIcon as H,ReceiveFrameIcon as Te,ClearIcon as Me,SearchIcon as Ke,ExternalLinkIcon as Ue,LayersIcon as Je,TerminalIcon as Ge,SizeIcon as Qe,FailIcon as Ye}from"../NetworkIcons";function be(o){return!o||o<=0?"0 B":o<1024?`${o} B`:o<1024*1024?`${(o/1024).toFixed(1)} KB`:`${(o/(1024*1024)).toFixed(2)} MB`}const Xe=({item:o})=>{const{t:V}=We(),[F,Se]=A("messages"),[z,K]=A(""),[v,N]=A("all"),[Ce,D]=A(new Set);if(!o)return null;const U=o.url.startsWith("wss://")||o.url.startsWith("https://"),R=o.client==="socket.io"||o.url.includes("/socket.io"),O=E(()=>{const b=(o.status||"open").toLowerCase();return b==="open"?e.greenColor:b==="connecting"?e.amber600:b==="error"?e.errorColor:e.slate500},[o.status]),j=()=>{const b=o.url.replace(/^wss:\/\//,"https://").replace(/^ws:\/\//,"http://");Pe.alert(V("common.openInBrowser")||"Open in Browser",`${V("common.openInBrowserPrompt")||"Open URL in browser?"}
|
|
2
|
+
|
|
3
|
+
${b}`,[{text:V("common.cancel")||"Cancel",style:"cancel"},{text:V("common.open")||"Open",onPress:()=>{X.canOpenURL(b).then(k=>{k&&X.openURL(b).catch(()=>{})})}}])},he=async()=>{await Ne(o)},ke=b=>{D(k=>{const h=new Set(k);return h.has(b)?h.delete(b):h.add(b),h})},Ve=()=>{const b=new Set((o.frames||[]).map(k=>k.id));D(b)},Be=()=>{D(new Set)},q=E(()=>{let b=o.frames||[];if(v!=="all"&&(b=b.filter(k=>k.direction===v)),z.trim()){const k=z.trim().toLowerCase();b=b.filter(h=>!!(h.eventName&&h.eventName.toLowerCase().includes(k)||h.type&&h.type.toLowerCase().includes(k)||typeof h.data=="string"&&h.data.toLowerCase().includes(k)||h.data&&typeof h.data=="object"&&JSON.stringify(h.data).toLowerCase().includes(k)))}return b},[o.frames,v,z]),ve=(o.totalBytesSent||0)+(o.totalBytesReceived||0),J=E(()=>R?`import { io } from 'socket.io-client';
|
|
4
|
+
|
|
5
|
+
const socket = io('${o.url}', {
|
|
6
|
+
transports: ['websocket'],
|
|
7
|
+
query: ${JSON.stringify(o.query||{},null,2)}
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
socket.on('connect', () => {
|
|
11
|
+
console.log('Connected with socket ID:', socket.id);
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
socket.on('message', (data) => {
|
|
15
|
+
console.log('Received:', data);
|
|
16
|
+
});`:`// Standard JavaScript WebSocket
|
|
17
|
+
const ws = new WebSocket('${o.url}'${o.protocols?`, ${JSON.stringify(o.protocols)}`:""});
|
|
18
|
+
|
|
19
|
+
ws.onopen = () => {
|
|
20
|
+
console.log('WebSocket connection opened');
|
|
21
|
+
ws.send(JSON.stringify({ type: 'ping' }));
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
ws.onmessage = (event) => {
|
|
25
|
+
console.log('Message from server:', event.data);
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
ws.onerror = (error) => {
|
|
29
|
+
console.error('WebSocket Error:', error);
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
ws.onclose = (event) => {
|
|
33
|
+
console.log('WebSocket closed:', event.code, event.reason);
|
|
34
|
+
};`,[o.url,o.protocols,o.query,R]),G=`wscat -c "${o.url}"`,Q=o.url.indexOf("://"),P=Q!==-1?o.url.substring(0,Q+3):"";return<S style={{flex:1,backgroundColor:e.contentBg}}>
|
|
35
|
+
|
|
36
|
+
<S style={{paddingHorizontal:8,paddingTop:4}}>
|
|
37
|
+
<S style={B.detailInfoBar}>
|
|
38
|
+
|
|
39
|
+
<S style={{flexDirection:"row",alignItems:"center",justifyContent:"space-between",flexWrap:"wrap",gap:6,paddingBottom:8,borderBottomWidth:1,borderBottomColor:e.dividerColor}}>
|
|
40
|
+
<S style={{flexDirection:"row",alignItems:"center",gap:5,flexWrap:"wrap",flex:1}}>
|
|
41
|
+
|
|
42
|
+
<S style={[B.methodBadge,{backgroundColor:R?e.violet600:U?e.emerald600:e.blue600,paddingHorizontal:8,paddingVertical:3.5,borderRadius:6}]}>
|
|
43
|
+
<T style={[B.methodBadgeText,{color:e.white,fontSize:10.5,fontFamily:C.interBold}]}>
|
|
44
|
+
{R?"SIO":U?"WSS":"WS"}
|
|
45
|
+
</T>
|
|
46
|
+
</S>
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
<S style={[B.chip,{backgroundColor:R?`${e.violet600}14`:`${e.sky500}14`,borderColor:R?`${e.violet600}30`:`${e.sky500}30`,paddingHorizontal:6,paddingVertical:3,borderRadius:6}]}>
|
|
50
|
+
<T style={[B.chipText,{fontFamily:C.interBold,fontSize:9.5,color:R?e.violet600:e.sky600}]}>
|
|
51
|
+
{(o.client||"WEBSOCKET").toUpperCase()}
|
|
52
|
+
</T>
|
|
53
|
+
</S>
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
<S style={[B.chip,{backgroundColor:`${O}18`,borderColor:`${O}40`,paddingHorizontal:7,paddingVertical:3,borderRadius:6}]}>
|
|
57
|
+
{o.status==="error"?<Ye size={8}color={e.errorColor}/>:<S style={{width:6,height:6,borderRadius:3,backgroundColor:O}}/>}
|
|
58
|
+
<T style={[B.chipText,{color:O,fontFamily:C.interBold,fontSize:10.5}]}>
|
|
59
|
+
{(o.status||"open").toUpperCase()}
|
|
60
|
+
</T>
|
|
61
|
+
</S>
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
<S style={[B.chip,{backgroundColor:`${e.brandPurple}14`,borderColor:`${e.brandPurple}30`,paddingHorizontal:7,paddingVertical:3,borderRadius:6,gap:4}]}>
|
|
65
|
+
<De color={e.brandPurple}size={10}/>
|
|
66
|
+
<T style={[B.chipText,{color:e.brandPurple,fontFamily:C.interBold,fontSize:10.5}]}>
|
|
67
|
+
{o.duration!=null?`${o.duration}ms`:"Active"}
|
|
68
|
+
</T>
|
|
69
|
+
</S>
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
<S style={[B.chip,{backgroundColor:`${e.teal600}14`,borderColor:`${e.teal600}30`,paddingHorizontal:7,paddingVertical:3,borderRadius:6,gap:4}]}>
|
|
73
|
+
<H color={e.teal600}size={10}/>
|
|
74
|
+
<T style={[B.chipText,{color:e.teal600,fontFamily:C.interBold,fontSize:10.5}]}>
|
|
75
|
+
{o.frames?.length||0} frames
|
|
76
|
+
</T>
|
|
77
|
+
</S>
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
<S style={[B.chip,{backgroundColor:`${e.sky600}14`,borderColor:`${e.sky600}30`,paddingHorizontal:7,paddingVertical:3,borderRadius:6,gap:4}]}>
|
|
81
|
+
<Qe color={e.sky600}size={10}/>
|
|
82
|
+
<T style={[B.chipText,{color:e.sky600,fontFamily:C.interBold,fontSize:10.5}]}>
|
|
83
|
+
{be(ve)}
|
|
84
|
+
</T>
|
|
85
|
+
</S>
|
|
86
|
+
</S>
|
|
87
|
+
</S>
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
<S style={{backgroundColor:e.grayBackground,borderRadius:10,borderWidth:1,borderColor:e.dividerColor,padding:10,marginTop:8,gap:8}}>
|
|
91
|
+
|
|
92
|
+
<S style={{flexDirection:"row",alignItems:"center",justifyContent:"space-between",flexWrap:"nowrap",gap:6}}>
|
|
93
|
+
<S style={{flexDirection:"row",alignItems:"center",gap:6,flexShrink:1,minWidth:0}}>
|
|
94
|
+
{P?<S style={{backgroundColor:P.startsWith("wss")||P.startsWith("https")?`${e.green600}18`:`${e.amber500}18`,paddingHorizontal:6,paddingVertical:2,borderRadius:4}}>
|
|
95
|
+
<T style={{fontFamily:C.interBold,fontSize:9,color:P.startsWith("wss")||P.startsWith("https")?e.green600:e.amber500}}>
|
|
96
|
+
{P.replace("://","").toUpperCase()}
|
|
97
|
+
</T>
|
|
98
|
+
</S>:null}
|
|
99
|
+
|
|
100
|
+
<T style={{fontFamily:C.interBold,fontSize:10,color:e.grayTextWeak,letterSpacing:.4,textTransform:"uppercase"}}numberOfLines={1}>
|
|
101
|
+
ENDPOINT URL
|
|
102
|
+
</T>
|
|
103
|
+
</S>
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
<S style={{flexDirection:"row",alignItems:"center",gap:5,flexShrink:0}}>
|
|
107
|
+
<W value={G}label="wscat"iconType="terminal"/>
|
|
108
|
+
<Ae onShare={he}/>
|
|
109
|
+
<W value={J}label="JS"iconType="fetch"/>
|
|
110
|
+
<W value={o.url}label="URL"iconType="copy"/>
|
|
111
|
+
<He style={[B.iconSquareBtn,{backgroundColor:`${e.sky600}15`,borderColor:`${e.sky600}35`}]}onPress={j}hitSlop={10}accessibilityLabel="Open in Browser">
|
|
112
|
+
<Ue color={e.sky600}size={13}/>
|
|
113
|
+
</He>
|
|
114
|
+
</S>
|
|
115
|
+
</S>
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
<M onPress={j}>
|
|
119
|
+
<T selectable={!0}style={{fontFamily:C.interMedium,fontSize:12.5,color:e.skyBlue,textDecorationLine:"underline",lineHeight:18}}>
|
|
120
|
+
{o.url}
|
|
121
|
+
</T>
|
|
122
|
+
</M>
|
|
123
|
+
</S>
|
|
124
|
+
</S>
|
|
125
|
+
</S>
|
|
126
|
+
|
|
127
|
+
|
|
128
|
+
<Oe tabs={[{key:"messages",label:`${V("socket.messages","Messages")} (${o.frames?.length||0})`,themeColor:e.violet600,icon:b=><H size={12}color={b?e.white:e.grayText}/>},{key:"overview",label:V("socket.overview","Overview"),themeColor:e.sky600,icon:b=><Ee size={12}color={b?e.white:e.grayText}/>},{key:"params",label:`${V("socket.params","Params")} (${Object.keys(o.query||{}).length})`,themeColor:e.teal600,icon:b=><Je size={12}color={b?e.white:e.grayText}/>},{key:"raw",label:V("socket.rawAndCode","Raw & Code"),themeColor:e.amber600,icon:b=><Ge size={12}color={b?e.white:e.grayText}/>}]}activeKey={F}onChange={Se}style={{marginHorizontal:6,marginBottom:10,marginTop:6}}/>
|
|
129
|
+
|
|
130
|
+
|
|
131
|
+
{F==="messages"&&<S style={{flex:1}}>
|
|
132
|
+
|
|
133
|
+
<S style={t.frameControlBar}>
|
|
134
|
+
<S style={t.frameSearchBar}>
|
|
135
|
+
<Ke size={13}color={e.grayTextWeak}/>
|
|
136
|
+
<Ie style={t.frameSearchInput}placeholder={V("socket.searchFramesPlaceholder","Search frame payloads or event names...")}placeholderTextColor={e.grayTextWeak}value={z}onChangeText={K}clearButtonMode="while-editing"/>
|
|
137
|
+
{z.length>0&&<M onPress={()=>K("")}>
|
|
138
|
+
<Me size={12}color={e.grayTextWeak}/>
|
|
139
|
+
</M>}
|
|
140
|
+
</S>
|
|
141
|
+
|
|
142
|
+
|
|
143
|
+
<S style={t.frameFilterRow}>
|
|
144
|
+
<S style={t.dirPillGroup}>
|
|
145
|
+
<I onPress={()=>N("all")}style={[t.dirPill,v==="all"&&t.dirPillActive]}>
|
|
146
|
+
<T style={[t.dirPillText,v==="all"&&t.dirPillTextActive]}>
|
|
147
|
+
{V("common.all","All")}
|
|
148
|
+
</T>
|
|
149
|
+
</I>
|
|
150
|
+
|
|
151
|
+
<I onPress={()=>N("send")}style={[t.dirPill,v==="send"&&t.dirPillActive,{flexDirection:"row",alignItems:"center",gap:4}]}>
|
|
152
|
+
<H size={10}color={v==="send"?e.white:e.emerald600}/>
|
|
153
|
+
<T style={[t.dirPillText,v==="send"&&t.dirPillTextActive]}>
|
|
154
|
+
{V("socket.sent","Sent")}
|
|
155
|
+
</T>
|
|
156
|
+
</I>
|
|
157
|
+
|
|
158
|
+
<I onPress={()=>N("receive")}style={[t.dirPill,v==="receive"&&t.dirPillActive,{flexDirection:"row",alignItems:"center",gap:4}]}>
|
|
159
|
+
<Te size={10}color={v==="receive"?e.white:e.sky600}/>
|
|
160
|
+
<T style={[t.dirPillText,v==="receive"&&t.dirPillTextActive]}>
|
|
161
|
+
{V("socket.recv","Recv")}
|
|
162
|
+
</T>
|
|
163
|
+
</I>
|
|
164
|
+
</S>
|
|
165
|
+
|
|
166
|
+
<S style={t.expandGroup}>
|
|
167
|
+
<I onPress={Ve}style={t.textBtn}>
|
|
168
|
+
<T style={t.textBtnLabel}>{V("common.expandAll","Expand All")}</T>
|
|
169
|
+
</I>
|
|
170
|
+
<T style={t.textBtnSep}>•</T>
|
|
171
|
+
<I onPress={Be}style={t.textBtn}>
|
|
172
|
+
<T style={t.textBtnLabel}>{V("common.collapseAll","Collapse All")}</T>
|
|
173
|
+
</I>
|
|
174
|
+
</S>
|
|
175
|
+
</S>
|
|
176
|
+
</S>
|
|
177
|
+
|
|
178
|
+
|
|
179
|
+
<$ style={t.framesScrollView}contentContainerStyle={{padding:12}}>
|
|
180
|
+
{q.length===0?<S style={t.emptyFrames}>
|
|
181
|
+
<T style={t.emptyFramesText}>
|
|
182
|
+
{o.frames?.length===0?"No messages transferred on this connection yet":"No frames match the active search or direction filter"}
|
|
183
|
+
</T>
|
|
184
|
+
</S>:q.map((b,k)=>{const h=b.direction==="send",Y=Ce.has(b.id),L=h?e.blue600:e.emerald600,ze=h?`${e.blue600}12`:`${e.emerald600}12`,Re=b.timestamp-o.startTime;return<S key={b.id}style={t.frameCard}>
|
|
185
|
+
|
|
186
|
+
<M onPress={()=>ke(b.id)}style={t.frameCardHeader}>
|
|
187
|
+
<S style={t.frameHeaderLeft}>
|
|
188
|
+
<S style={[t.dirBadge,{backgroundColor:ze}]}>
|
|
189
|
+
{h?<H size={10}color={L}/>:<Te size={10}color={L}/>}
|
|
190
|
+
<T style={[t.dirBadgeText,{color:L}]}>
|
|
191
|
+
{h?"SENT":"RECV"}
|
|
192
|
+
</T>
|
|
193
|
+
</S>
|
|
194
|
+
|
|
195
|
+
{b.eventName&&<S style={t.eventBadge}>
|
|
196
|
+
<T style={t.eventBadgeText}numberOfLines={1}>
|
|
197
|
+
{b.eventName}
|
|
198
|
+
</T>
|
|
199
|
+
</S>}
|
|
200
|
+
|
|
201
|
+
<T style={t.frameIndexText}>#{k+1}</T>
|
|
202
|
+
</S>
|
|
203
|
+
|
|
204
|
+
<S style={t.frameHeaderRight}>
|
|
205
|
+
<T style={t.frameOffsetTime}>
|
|
206
|
+
+{Re}ms
|
|
207
|
+
</T>
|
|
208
|
+
<S style={t.frameSizePill}>
|
|
209
|
+
<T style={t.frameSizeText}>
|
|
210
|
+
{be(b.size||0)}
|
|
211
|
+
</T>
|
|
212
|
+
</S>
|
|
213
|
+
<W value={b.raw??b.data}label="Frame"/>
|
|
214
|
+
<Le direction={Y?"up":"down"}size={12}color={e.grayTextWeak}/>
|
|
215
|
+
</S>
|
|
216
|
+
</M>
|
|
217
|
+
|
|
218
|
+
|
|
219
|
+
<S style={t.frameBody}>
|
|
220
|
+
{typeof b.data=="object"&&b.data!==null?<Z data={b.data}search={z}forceOpen={Y}/>:<T style={t.frameRawText}>
|
|
221
|
+
<$e text={String(b.data)}search={z}/>
|
|
222
|
+
</T>}
|
|
223
|
+
</S>
|
|
224
|
+
</S>})}
|
|
225
|
+
</$>
|
|
226
|
+
</S>}
|
|
227
|
+
|
|
228
|
+
|
|
229
|
+
{F==="overview"&&<$ style={t.tabContentScroll}contentContainerStyle={{padding:12}}>
|
|
230
|
+
<S style={t.sectionCard}>
|
|
231
|
+
<T style={t.sectionHeading}>CONNECTION DETAILS</T>
|
|
232
|
+
|
|
233
|
+
<S style={t.infoRow}>
|
|
234
|
+
<T style={t.infoKey}>URL</T>
|
|
235
|
+
<T style={t.infoVal}selectable>{o.url}</T>
|
|
236
|
+
</S>
|
|
237
|
+
|
|
238
|
+
<S style={t.infoRow}>
|
|
239
|
+
<T style={t.infoKey}>Client Engine</T>
|
|
240
|
+
<T style={t.infoVal}>{o.client?.toUpperCase()||"WEBSOCKET"}</T>
|
|
241
|
+
</S>
|
|
242
|
+
|
|
243
|
+
<S style={t.infoRow}>
|
|
244
|
+
<T style={t.infoKey}>Ready State</T>
|
|
245
|
+
<T style={t.infoVal}>
|
|
246
|
+
{o.readyState===1?"1 (OPEN)":o.readyState===0?"0 (CONNECTING)":o.readyState===2?"2 (CLOSING)":"3 (CLOSED)"}
|
|
247
|
+
</T>
|
|
248
|
+
</S>
|
|
249
|
+
|
|
250
|
+
<S style={t.infoRow}>
|
|
251
|
+
<T style={t.infoKey}>Connected At</T>
|
|
252
|
+
<T style={t.infoVal}>{ee(o.startTime)}</T>
|
|
253
|
+
</S>
|
|
254
|
+
|
|
255
|
+
{o.endTime&&<S style={t.infoRow}>
|
|
256
|
+
<T style={t.infoKey}>Closed At</T>
|
|
257
|
+
<T style={t.infoVal}>{ee(o.endTime)}</T>
|
|
258
|
+
</S>}
|
|
259
|
+
|
|
260
|
+
{o.closeCode!=null&&<S style={t.infoRow}>
|
|
261
|
+
<T style={t.infoKey}>Close Code & Reason</T>
|
|
262
|
+
<T style={t.infoVal}>{o.closeCode} ({o.closeReason||"N/A"})</T>
|
|
263
|
+
</S>}
|
|
264
|
+
|
|
265
|
+
{o.protocols&&<S style={t.infoRow}>
|
|
266
|
+
<T style={t.infoKey}>Subprotocols</T>
|
|
267
|
+
<T style={t.infoVal}>
|
|
268
|
+
{Array.isArray(o.protocols)?o.protocols.join(", "):o.protocols}
|
|
269
|
+
</T>
|
|
270
|
+
</S>}
|
|
271
|
+
|
|
272
|
+
{o.caller&&<S style={t.infoRow}>
|
|
273
|
+
<T style={t.infoKey}>Caller Stack</T>
|
|
274
|
+
<T style={[t.infoVal,{fontFamily:C.interMedium,color:e.brandPurple}]}selectable>
|
|
275
|
+
{o.caller}
|
|
276
|
+
</T>
|
|
277
|
+
</S>}
|
|
278
|
+
|
|
279
|
+
{o.error&&<S style={t.infoRow}>
|
|
280
|
+
<T style={t.infoKey}>Error</T>
|
|
281
|
+
<T style={[t.infoVal,{color:e.errorColor}]}selectable>
|
|
282
|
+
{o.error}
|
|
283
|
+
</T>
|
|
284
|
+
</S>}
|
|
285
|
+
</S>
|
|
286
|
+
</$>}
|
|
287
|
+
|
|
288
|
+
|
|
289
|
+
{F==="params"&&<$ style={t.tabContentScroll}contentContainerStyle={{padding:12}}>
|
|
290
|
+
<S style={t.sectionCard}>
|
|
291
|
+
<T style={t.sectionHeading}>HANDSHAKE QUERY PARAMETERS</T>
|
|
292
|
+
{!o.query||Object.keys(o.query).length===0?<T style={t.emptySectionText}>No query parameters passed in connection URL</T>:Object.entries(o.query).map(([b,k])=><S key={b}style={t.paramRow}>
|
|
293
|
+
<T style={t.paramKey}selectable>{b}</T>
|
|
294
|
+
<T style={t.paramVal}selectable>{k}</T>
|
|
295
|
+
<W value={k}label={b}/>
|
|
296
|
+
</S>)}
|
|
297
|
+
</S>
|
|
298
|
+
</$>}
|
|
299
|
+
|
|
300
|
+
|
|
301
|
+
{F==="raw"&&<$ style={t.tabContentScroll}contentContainerStyle={{padding:12}}>
|
|
302
|
+
<S style={t.sectionCard}>
|
|
303
|
+
<T style={t.sectionHeading}>JAVASCRIPT CLIENT CODE</T>
|
|
304
|
+
<_ code={J}language="javascript"/>
|
|
305
|
+
</S>
|
|
306
|
+
|
|
307
|
+
<S style={[t.sectionCard,{marginTop:14}]}>
|
|
308
|
+
<T style={t.sectionHeading}>TERMINAL WSCAT COMMAND</T>
|
|
309
|
+
<_ code={G}language="javascript"/>
|
|
310
|
+
</S>
|
|
311
|
+
|
|
312
|
+
<S style={[t.sectionCard,{marginTop:14}]}>
|
|
313
|
+
<T style={t.sectionHeading}>RAW CONNECTION JSON DUMP</T>
|
|
314
|
+
<Z data={o}/>
|
|
315
|
+
</S>
|
|
316
|
+
</$>}
|
|
317
|
+
</S>};export default Xe;const t=Fe.create({frameControlBar:{padding:10,backgroundColor:e.graySurface,borderBottomWidth:1,borderBottomColor:e.dividerColor,gap:8},frameSearchBar:{flexDirection:"row",alignItems:"center",backgroundColor:e.contentBg,borderRadius:8,borderWidth:1,borderColor:e.dividerColor,paddingHorizontal:8,height:34,gap:6},frameSearchInput:{flex:1,fontFamily:C.interRegular,fontSize:12,color:e.grayTextStrong,paddingVertical:0},frameFilterRow:{flexDirection:"row",alignItems:"center",justifyContent:"space-between"},dirPillGroup:{flexDirection:"row",gap:6},dirPill:{paddingHorizontal:8,paddingVertical:4,borderRadius:6,borderWidth:1,borderColor:e.dividerColor,backgroundColor:e.contentBg},dirPillActive:{backgroundColor:`${e.brandPurple}18`,borderColor:e.brandPurple},dirPillText:{fontFamily:C.interMedium,fontSize:11,color:e.grayTextWeak},dirPillTextActive:{color:e.brandPurple,fontFamily:C.interBold},expandGroup:{flexDirection:"row",alignItems:"center",gap:4},textBtn:{paddingVertical:2,paddingHorizontal:4},textBtnLabel:{fontFamily:C.interMedium,fontSize:11,color:e.brandPurple},textBtnSep:{color:e.grayTextWeak,fontSize:10},framesScrollView:{flex:1},emptyFrames:{padding:32,alignItems:"center"},emptyFramesText:{fontFamily:C.interMedium,fontSize:12.5,color:e.grayTextWeak,textAlign:"center"},frameCard:{backgroundColor:e.contentBg,borderRadius:8,borderWidth:1,borderColor:e.dividerColor,marginBottom:8,overflow:"hidden"},frameCardHeader:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",paddingHorizontal:10,paddingVertical:7,backgroundColor:e.graySurface,borderBottomWidth:1,borderBottomColor:e.dividerColor},frameHeaderLeft:{flexDirection:"row",alignItems:"center",gap:6},dirBadge:{flexDirection:"row",alignItems:"center",paddingHorizontal:5,paddingVertical:2,borderRadius:4,gap:3},dirBadgeText:{fontFamily:C.interBold,fontSize:9.5},eventBadge:{backgroundColor:`${e.violet600}18`,paddingHorizontal:6,paddingVertical:2,borderRadius:4,maxWidth:130},eventBadgeText:{fontFamily:C.interBold,fontSize:10,color:e.violet600},frameIndexText:{fontFamily:C.interMedium,fontSize:10,color:e.grayTextWeak},frameHeaderRight:{flexDirection:"row",alignItems:"center",gap:6},frameOffsetTime:{fontFamily:C.interRegular,fontSize:10,color:e.grayTextWeak},frameSizePill:{backgroundColor:`${e.slate400}18`,paddingHorizontal:4,paddingVertical:1,borderRadius:4},frameSizeText:{fontFamily:C.interMedium,fontSize:9.5,color:e.grayTextStrong},frameBody:{padding:8},frameRawText:{fontFamily:C.interRegular,fontSize:12,color:e.grayTextStrong,lineHeight:16},tabContentScroll:{flex:1},sectionCard:{backgroundColor:e.contentBg,borderRadius:10,borderWidth:1,borderColor:e.dividerColor,padding:12},sectionHeading:{fontFamily:C.interBold,fontSize:11,color:e.grayTextWeak,letterSpacing:.6,marginBottom:10},infoRow:{paddingVertical:8,borderBottomWidth:1,borderBottomColor:e.dividerColor},infoKey:{fontFamily:C.interMedium,fontSize:11,color:e.grayTextWeak,marginBottom:2},infoVal:{fontFamily:C.interSemiBold,fontSize:12.5,color:e.grayTextStrong,lineHeight:18},emptySectionText:{fontFamily:C.interRegular,fontSize:12,color:e.grayTextWeak,fontStyle:"italic",paddingVertical:8},paramRow:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",paddingVertical:8,borderBottomWidth:1,borderBottomColor:e.dividerColor,gap:8},paramKey:{fontFamily:C.interBold,fontSize:12,color:e.brandPurple,width:"30%"},paramVal:{flex:1,fontFamily:C.interMedium,fontSize:12,color:e.grayTextStrong}});
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { SocketConnectionRecord, SocketFilterState } from '../../types';
|
|
3
|
+
export declare const DEFAULT_SOCKET_FILTERS: SocketFilterState;
|
|
4
|
+
export declare const isSocketFiltersDefault: (f: SocketFilterState) => boolean;
|
|
5
|
+
interface SocketFilterModalProps {
|
|
6
|
+
visible: boolean;
|
|
7
|
+
onClose: () => void;
|
|
8
|
+
filters: SocketFilterState;
|
|
9
|
+
onApply: (filters: SocketFilterState) => void;
|
|
10
|
+
records: SocketConnectionRecord[];
|
|
11
|
+
}
|
|
12
|
+
export declare const SocketFilterModal: React.FC<SocketFilterModalProps>;
|
|
13
|
+
export default SocketFilterModal;
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import{useEffect as j,useMemo as N,useState as U}from"react";import{Modal as K,Pressable as Y,ScrollView as G,StyleSheet as _,Text as T,TouchableOpacity as V,View as S}from"react-native";import{AppColors as l}from"../../styles/AppColors";import{AppFonts as C}from"../../styles/AppFonts";import{FilterIcon as J,CloseWhite as Q}from"../NetworkIcons";import X from"../TouchableScale";export const DEFAULT_SOCKET_FILTERS={search:"",status:new Set(["all"]),types:new Set(["all"]),sortBy:"time_desc"},isSocketFiltersDefault=k=>(k.status.has("all")||k.status.size===0)&&(k.types.has("all")||k.types.size===0)&&k.sortBy==="time_desc",SocketFilterModal=({visible:k,onClose:O,filters:B,onApply:E,records:W})=>{const[P,F]=U(()=>({...B,status:new Set(B.status),types:new Set(B.types)}));j(()=>{k&&F({...B,status:new Set(B.status),types:new Set(B.types)})},[k,B]);const x=N(()=>{let e=0,o=0,m=0,A=0,I=0,v=0,D=0;return W.forEach(z=>{const R=z.status||"open";R==="open"?e++:R==="closed"?o++:R==="connecting"?m++:R==="error"&&A++,z.client==="socket.io"||z.url.includes("/socket.io")?D++:z.url.startsWith("wss://")?I++:v++}),{all:W.length,open:e,closed:o,connecting:m,error:A,wss:I,ws:v,sio:D}},[W]),L=e=>{const o=new Set(P.status);e==="all"?(o.clear(),o.add("all")):(o.delete("all"),o.has(e)?o.delete(e):o.add(e),o.size===0&&o.add("all")),F(m=>({...m,status:o}))},H=e=>{const o=new Set(P.types);e==="all"?(o.clear(),o.add("all")):(o.delete("all"),o.has(e)?o.delete(e):o.add(e),o.size===0&&o.add("all")),F(m=>({...m,types:o}))},M=()=>{F({search:P.search,status:new Set(["all"]),types:new Set(["all"]),sortBy:"time_desc"})},$=()=>{E(P),O()};return<K visible={k}transparent animationType="fade"onRequestClose={O}>
|
|
2
|
+
<S style={t.backdrop}>
|
|
3
|
+
<Y style={t.backdropPress}onPress={O}/>
|
|
4
|
+
<S style={t.container}>
|
|
5
|
+
|
|
6
|
+
<S style={t.header}>
|
|
7
|
+
<S style={t.headerLeft}>
|
|
8
|
+
<J size={18}color={l.brandPurple}/>
|
|
9
|
+
<T style={t.headerTitle}>Filter WebSockets</T>
|
|
10
|
+
</S>
|
|
11
|
+
<V onPress={O}hitSlop={{top:8,bottom:8,left:8,right:8}}style={t.closeBtn}>
|
|
12
|
+
<Q size={14}color={l.grayTextWeak}/>
|
|
13
|
+
</V>
|
|
14
|
+
</S>
|
|
15
|
+
|
|
16
|
+
<G style={t.content}showsVerticalScrollIndicator={!1}>
|
|
17
|
+
|
|
18
|
+
<T style={t.sectionTitle}>CONNECTION STATUS</T>
|
|
19
|
+
<S style={t.chipRow}>
|
|
20
|
+
{[{key:"all",label:"All",count:x.all,color:l.brandPurple},{key:"open",label:"Open",count:x.open,color:l.greenColor},{key:"closed",label:"Closed",count:x.closed,color:l.slate500},{key:"connecting",label:"Connecting",count:x.connecting,color:l.amber600},{key:"error",label:"Error",count:x.error,color:l.errorColor}].map(e=>{const o=P.status.has(e.key);return<V key={e.key}onPress={()=>L(e.key)}style={[t.chip,o&&{backgroundColor:`${e.color}18`,borderColor:e.color}]}>
|
|
21
|
+
<T style={[t.chipText,o&&{color:e.color,fontFamily:C.interBold}]}>
|
|
22
|
+
{e.label}
|
|
23
|
+
</T>
|
|
24
|
+
<S style={[t.countPill,o&&{backgroundColor:`${e.color}30`}]}>
|
|
25
|
+
<T style={[t.countText,o&&{color:e.color}]}>
|
|
26
|
+
{e.count}
|
|
27
|
+
</T>
|
|
28
|
+
</S>
|
|
29
|
+
</V>})}
|
|
30
|
+
</S>
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
<T style={t.sectionTitle}>PROTOCOL & CLIENT</T>
|
|
34
|
+
<S style={t.chipRow}>
|
|
35
|
+
{[{key:"all",label:"All Protocols",count:x.all,color:l.brandPurple},{key:"wss",label:"Secure (WSS)",count:x.wss,color:l.emerald600},{key:"ws",label:"Standard (WS)",count:x.ws,color:l.blue600},{key:"sio",label:"Socket.IO",count:x.sio,color:l.violet600}].map(e=>{const o=P.types.has(e.key);return<V key={e.key}onPress={()=>H(e.key)}style={[t.chip,o&&{backgroundColor:`${e.color}18`,borderColor:e.color}]}>
|
|
36
|
+
<T style={[t.chipText,o&&{color:e.color,fontFamily:C.interBold}]}>
|
|
37
|
+
{e.label}
|
|
38
|
+
</T>
|
|
39
|
+
<S style={[t.countPill,o&&{backgroundColor:`${e.color}30`}]}>
|
|
40
|
+
<T style={[t.countText,o&&{color:e.color}]}>
|
|
41
|
+
{e.count}
|
|
42
|
+
</T>
|
|
43
|
+
</S>
|
|
44
|
+
</V>})}
|
|
45
|
+
</S>
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
<T style={t.sectionTitle}>SORT BY</T>
|
|
49
|
+
<S style={t.chipRow}>
|
|
50
|
+
{[{key:"time_desc",label:"Newest First"},{key:"time_asc",label:"Oldest First"},{key:"frames_desc",label:"Most Frames"},{key:"duration_desc",label:"Longest Duration"}].map(e=>{const o=P.sortBy===e.key;return<V key={e.key}onPress={()=>F(m=>({...m,sortBy:e.key}))}style={[t.chip,o&&t.chipActiveSort]}>
|
|
51
|
+
<T style={[t.chipText,o&&t.chipTextActiveSort]}>
|
|
52
|
+
{e.label}
|
|
53
|
+
</T>
|
|
54
|
+
</V>})}
|
|
55
|
+
</S>
|
|
56
|
+
</G>
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
<S style={t.footer}>
|
|
60
|
+
<V onPress={M}style={t.resetBtn}>
|
|
61
|
+
<T style={t.resetBtnText}>Reset</T>
|
|
62
|
+
</V>
|
|
63
|
+
<X onPress={$}style={t.applyBtn}>
|
|
64
|
+
<T style={t.applyBtnText}>Apply Filters</T>
|
|
65
|
+
</X>
|
|
66
|
+
</S>
|
|
67
|
+
</S>
|
|
68
|
+
</S>
|
|
69
|
+
</K>};export default SocketFilterModal;const t=_.create({backdrop:{flex:1,backgroundColor:"rgba(0,0,0,0.5)",justifyContent:"center",alignItems:"center",padding:16},backdropPress:{..._.absoluteFillObject},container:{width:"100%",maxHeight:"80%",backgroundColor:l.contentBg,borderRadius:16,overflow:"hidden",shadowColor:l.black,shadowOffset:{width:0,height:4},shadowOpacity:.25,shadowRadius:10,elevation:8},header:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",paddingHorizontal:16,paddingVertical:14,borderBottomWidth:1,borderBottomColor:l.dividerColor},headerLeft:{flexDirection:"row",alignItems:"center",gap:8},headerTitle:{fontFamily:C.interBold,fontSize:16,color:l.grayTextStrong},closeBtn:{padding:4},content:{padding:16},sectionTitle:{fontFamily:C.interBold,fontSize:11,color:l.grayTextWeak,letterSpacing:.6,marginBottom:8,marginTop:10},chipRow:{flexDirection:"row",flexWrap:"wrap",gap:8,marginBottom:12},chip:{flexDirection:"row",alignItems:"center",paddingHorizontal:10,paddingVertical:6,borderRadius:8,borderWidth:1,borderColor:l.dividerColor,backgroundColor:l.graySurface,gap:6},chipActiveSort:{backgroundColor:`${l.brandPurple}18`,borderColor:l.brandPurple},chipText:{fontFamily:C.interMedium,fontSize:12,color:l.grayTextStrong},chipTextActiveSort:{color:l.brandPurple,fontFamily:C.interBold},countPill:{backgroundColor:`${l.slate500}18`,paddingHorizontal:5,paddingVertical:1,borderRadius:10},countText:{fontFamily:C.interBold,fontSize:10,color:l.grayTextWeak},footer:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",paddingHorizontal:16,paddingVertical:12,borderTopWidth:1,borderTopColor:l.dividerColor,gap:12},resetBtn:{paddingVertical:10,paddingHorizontal:16,borderRadius:8,borderWidth:1,borderColor:l.dividerColor},resetBtnText:{fontFamily:C.interSemiBold,fontSize:13,color:l.grayTextWeak},applyBtn:{flex:1,backgroundColor:l.brandPurple,paddingVertical:11,borderRadius:8,alignItems:"center",justifyContent:"center"},applyBtnText:{fontFamily:C.interBold,fontSize:13,color:l.white}});
|