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
|
+
"use strict";var __createBinding=this&&this.__createBinding||(Object.create?(function(e,o,l,r){r===void 0&&(r=l);var t=Object.getOwnPropertyDescriptor(o,l);(!t||("get"in t?!o.__esModule:t.writable||t.configurable))&&(t={enumerable:!0,get:function(){return o[l]}}),Object.defineProperty(e,r,t)}):(function(e,o,l,r){r===void 0&&(r=l),e[r]=o[l]})),__setModuleDefault=this&&this.__setModuleDefault||(Object.create?(function(e,o){Object.defineProperty(e,"default",{enumerable:!0,value:o})}):function(e,o){e.default=o}),__importStar=this&&this.__importStar||(function(){var e=function(o){return e=Object.getOwnPropertyNames||function(l){var r=[];for(var t in l)Object.prototype.hasOwnProperty.call(l,t)&&(r[r.length]=t);return r},e(o)};return function(o){if(o&&o.__esModule)return o;var l={};if(o!=null)for(var r=e(o),t=0;t<r.length;t++)r[t]!=="default"&&__createBinding(l,o,r[t]);return __setModuleDefault(l,o),l}})(),__importDefault=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(exports,"__esModule",{value:!0});const react_1=__importStar(require("react")),react_native_1=require("react-native"),react_native_svg_1=__importStar(require("react-native-svg")),AppColors_1=require("../../styles/AppColors"),AppFonts_1=require("../../styles/AppFonts"),helpers_1=require("../../helpers"),NetworkIcons_1=require("../NetworkIcons"),HighlightText_1=__importDefault(require("../HighlightText")),TouchableScale_1=__importDefault(require("../TouchableScale")),i18n_1=require("../../i18n");function formatByteSize(e){return!e||e<=0?"0 B":e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(2)} MB`}function SocketCard({item:e,onPress:o,searchStr:l,isNew:r,isSelected:t,onToggleSelect:f,serialNumber:_}){const{t:d}=(0,i18n_1.useTranslation)(),n=e.url.startsWith("wss://")||e.url.startsWith("https://"),g=e.client==="socket.io"||e.url.includes("/socket.io"),u=(0,react_1.useMemo)(()=>g?{label:"SIO",color:AppColors_1.AppColors.violet600,bg:`${AppColors_1.AppColors.violet600}14`,border:`${AppColors_1.AppColors.violet600}35`}:n?{label:"WSS",color:AppColors_1.AppColors.emerald600,bg:`${AppColors_1.AppColors.emerald600}14`,border:`${AppColors_1.AppColors.emerald600}35`}:{label:"WS",color:AppColors_1.AppColors.blue600,bg:`${AppColors_1.AppColors.blue600}14`,border:`${AppColors_1.AppColors.blue600}35`},[g,n]),b=e.status||"open",a=b==="open",p=b==="connecting",s=b==="error",m=(0,react_1.useMemo)(()=>a?AppColors_1.AppColors.greenColor:p?AppColors_1.AppColors.amber600:s?AppColors_1.AppColors.errorColor:AppColors_1.AppColors.slate400,[a,p,s]),C=(0,react_1.useMemo)(()=>a?{label:"OPEN",color:AppColors_1.AppColors.greenColor,bg:`${AppColors_1.AppColors.greenColor}15`,border:`${AppColors_1.AppColors.greenColor}40`}:p?{label:"CONNECTING",color:AppColors_1.AppColors.amber600,bg:`${AppColors_1.AppColors.amber600}15`,border:`${AppColors_1.AppColors.amber600}40`}:s?{label:e.closeCode?`ERR ${e.closeCode}`:"ERROR",color:AppColors_1.AppColors.errorColor,bg:`${AppColors_1.AppColors.errorColor}15`,border:`${AppColors_1.AppColors.errorColor}40`}:{label:e.closeCode?`CLOSED (${e.closeCode})`:"CLOSED",color:AppColors_1.AppColors.slate500,bg:`${AppColors_1.AppColors.slate500}15`,border:`${AppColors_1.AppColors.slate500}40`},[a,p,s,e.closeCode]),w=(0,react_1.useMemo)(()=>{try{const c=e.url.replace(/^(wss?|https?):\/\//,""),i=c.indexOf("/");if(i>=0){const h=c.substring(0,i),S=c.substring(i);return{host:h,path:S}}return{host:c,path:"/"}}catch{return{host:e.url,path:"/"}}},[e.url]),x=c=>{c?.stopPropagation?.();const i=e.url.replace(/^wss:\/\//i,"https://").replace(/^ws:\/\//i,"http://");react_native_1.Alert.alert(d("common.openInBrowser","Open in Browser"),`${d("common.openInBrowserPrompt","Are you sure you want to open this URL in your external browser?")}
|
|
2
|
+
|
|
3
|
+
${i}`,[{text:d("common.cancel","Cancel"),style:"cancel"},{text:d("common.open","Open"),onPress:()=>{react_native_1.Linking.canOpenURL(i).then(h=>{h?react_native_1.Linking.openURL(i):react_native_1.Linking.openURL(i).catch(()=>{})}).catch(()=>{})}}])},A=(0,react_1.useRef)(new react_native_1.Animated.Value(r?.35:0)).current;(0,react_1.useEffect)(()=>{r&&react_native_1.Animated.timing(A,{toValue:0,duration:1200,useNativeDriver:!1}).start()},[r,A]);const y=(e.totalBytesSent||0)+(e.totalBytesReceived||0),T=e.duration!=null?`${e.duration}ms`:"Active",v=(0,helpers_1.formatDateTime)(e.startTime);return<react_native_1.View style={styles.container}>
|
|
4
|
+
<TouchableScale_1.default onPress={o}style={[styles.card,{borderLeftWidth:3.5,borderLeftColor:m,backgroundColor:s?AppColors_1.AppColors.errorCardBg:AppColors_1.AppColors.white},r&&styles.cardNew]}>
|
|
5
|
+
<react_native_1.View style={styles.cardBody}>
|
|
6
|
+
|
|
7
|
+
<react_native_1.View style={styles.cardHeaderRow}>
|
|
8
|
+
<react_native_1.View style={styles.cardHeaderLeft}>
|
|
9
|
+
{f&&<react_native_1.Pressable onPress={()=>f(e.id)}hitSlop={12}style={[styles.smallCheckbox,t&&styles.smallCheckboxChecked]}>
|
|
10
|
+
{t&&<react_native_svg_1.default width={9}height={9}viewBox="0 0 24 24"fill="none">
|
|
11
|
+
<react_native_svg_1.Path d="M20 6L9 17l-5-5"stroke={AppColors_1.AppColors.white}strokeWidth="4"strokeLinecap="round"strokeLinejoin="round"/>
|
|
12
|
+
</react_native_svg_1.default>}
|
|
13
|
+
</react_native_1.Pressable>}
|
|
14
|
+
|
|
15
|
+
{_!=null&&<react_native_1.Text style={styles.serialNumber}>#{_}</react_native_1.Text>}
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
<react_native_1.View style={[styles.protocolBadge,{backgroundColor:u.bg,borderColor:u.border}]}>
|
|
19
|
+
<react_native_1.Text style={[styles.protocolBadgeText,{color:u.color}]}>
|
|
20
|
+
{u.label}
|
|
21
|
+
</react_native_1.Text>
|
|
22
|
+
</react_native_1.View>
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
{g&&<react_native_1.View style={[styles.chip,{backgroundColor:`${AppColors_1.AppColors.violet600}12`,borderColor:`${AppColors_1.AppColors.violet600}2B`}]}>
|
|
26
|
+
<react_native_1.Text style={[styles.chipText,{color:AppColors_1.AppColors.violet600}]}>
|
|
27
|
+
SOCKET.IO
|
|
28
|
+
</react_native_1.Text>
|
|
29
|
+
</react_native_1.View>}
|
|
30
|
+
</react_native_1.View>
|
|
31
|
+
|
|
32
|
+
<react_native_1.View style={styles.cardHeaderRight}>
|
|
33
|
+
|
|
34
|
+
<react_native_1.View style={[styles.statusPill,{backgroundColor:C.bg,borderColor:C.border}]}>
|
|
35
|
+
{a?<react_native_1.View style={styles.pulsingDot}/>:p?<NetworkIcons_1.ClockIcon color={AppColors_1.AppColors.amber600}size={9}/>:s?<NetworkIcons_1.CircleXIcon color={AppColors_1.AppColors.errorColor}size={9}/>:<NetworkIcons_1.CircleCheckIcon color={AppColors_1.AppColors.slate500}size={9}/>}
|
|
36
|
+
<react_native_1.Text style={[styles.statusPillText,{color:C.color}]}>
|
|
37
|
+
{C.label}
|
|
38
|
+
</react_native_1.Text>
|
|
39
|
+
</react_native_1.View>
|
|
40
|
+
|
|
41
|
+
<react_native_1.Pressable onPress={x}hitSlop={8}style={styles.globeBtn}accessibilityRole="button"accessibilityLabel="Open in Browser">
|
|
42
|
+
<NetworkIcons_1.GlobeIcon color={AppColors_1.AppColors.grayTextWeak}size={12}/>
|
|
43
|
+
</react_native_1.Pressable>
|
|
44
|
+
|
|
45
|
+
<NetworkIcons_1.ForwardChevronIcon color={AppColors_1.AppColors.grayTextWeak}size={13}/>
|
|
46
|
+
</react_native_1.View>
|
|
47
|
+
</react_native_1.View>
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
<react_native_1.View style={styles.urlBox}>
|
|
51
|
+
<react_native_1.View style={styles.urlMainRow}>
|
|
52
|
+
<HighlightText_1.default text={w.path}search={l}style={styles.pathText}highlightStyle={styles.highlight}numberOfLines={1}ellipsizeMode="middle"/>
|
|
53
|
+
</react_native_1.View>
|
|
54
|
+
|
|
55
|
+
<react_native_1.View style={styles.hostRow}>
|
|
56
|
+
<react_native_1.View style={[styles.protoBadge,{backgroundColor:n?`${AppColors_1.AppColors.emerald600}12`:`${AppColors_1.AppColors.blue600}12`,borderColor:n?`${AppColors_1.AppColors.emerald600}2B`:`${AppColors_1.AppColors.blue600}2B`}]}>
|
|
57
|
+
{n?<NetworkIcons_1.LockIcon size={9}color={AppColors_1.AppColors.emerald600}/>:<NetworkIcons_1.GlobeIcon size={9}color={AppColors_1.AppColors.blue600}/>}
|
|
58
|
+
<react_native_1.Text style={[styles.protoBadgeText,{color:n?AppColors_1.AppColors.emerald600:AppColors_1.AppColors.blue600}]}>
|
|
59
|
+
{n?"WSS":"WS"}
|
|
60
|
+
</react_native_1.Text>
|
|
61
|
+
</react_native_1.View>
|
|
62
|
+
|
|
63
|
+
<react_native_1.Text style={styles.hostText}numberOfLines={1}ellipsizeMode="tail">
|
|
64
|
+
{w.host}
|
|
65
|
+
</react_native_1.Text>
|
|
66
|
+
</react_native_1.View>
|
|
67
|
+
</react_native_1.View>
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
<react_native_1.View style={styles.cardFooterRow}>
|
|
71
|
+
<react_native_1.View style={styles.footerLeft}>
|
|
72
|
+
<react_native_1.View style={styles.cardDateRow}>
|
|
73
|
+
<NetworkIcons_1.CalendarIcon color={AppColors_1.AppColors.grayTextWeak}size={10}/>
|
|
74
|
+
<react_native_1.Text style={styles.cardDateText}numberOfLines={1}>
|
|
75
|
+
{v||(0,helpers_1.formatTime)(e.startTime)}
|
|
76
|
+
</react_native_1.Text>
|
|
77
|
+
</react_native_1.View>
|
|
78
|
+
</react_native_1.View>
|
|
79
|
+
|
|
80
|
+
<react_native_1.View style={styles.footerRight}>
|
|
81
|
+
|
|
82
|
+
<react_native_1.View style={[styles.metaStatChip,{backgroundColor:`${AppColors_1.AppColors.blue600}10`,borderColor:`${AppColors_1.AppColors.blue600}26`}]}>
|
|
83
|
+
<NetworkIcons_1.SendFrameIcon size={9}color={AppColors_1.AppColors.blue600}/>
|
|
84
|
+
<react_native_1.Text style={[styles.metaStatText,{color:AppColors_1.AppColors.blue600}]}>
|
|
85
|
+
{e.sentCount||0}
|
|
86
|
+
</react_native_1.Text>
|
|
87
|
+
</react_native_1.View>
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
<react_native_1.View style={[styles.metaStatChip,{backgroundColor:`${AppColors_1.AppColors.emerald600}10`,borderColor:`${AppColors_1.AppColors.emerald600}26`}]}>
|
|
91
|
+
<NetworkIcons_1.ReceiveFrameIcon size={9}color={AppColors_1.AppColors.emerald600}/>
|
|
92
|
+
<react_native_1.Text style={[styles.metaStatText,{color:AppColors_1.AppColors.emerald600}]}>
|
|
93
|
+
{e.receivedCount||0}
|
|
94
|
+
</react_native_1.Text>
|
|
95
|
+
</react_native_1.View>
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
{y>0&&<react_native_1.View style={[styles.metaStatChip,{backgroundColor:`${AppColors_1.AppColors.purple}10`,borderColor:`${AppColors_1.AppColors.purple}26`}]}>
|
|
99
|
+
<NetworkIcons_1.SizeIcon size={9}color={AppColors_1.AppColors.purple}/>
|
|
100
|
+
<react_native_1.Text style={[styles.metaStatText,{color:AppColors_1.AppColors.purple}]}>
|
|
101
|
+
{formatByteSize(y)}
|
|
102
|
+
</react_native_1.Text>
|
|
103
|
+
</react_native_1.View>}
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
<react_native_1.View style={[styles.metaStatChip,{backgroundColor:a?`${AppColors_1.AppColors.greenColor}10`:`${AppColors_1.AppColors.slate400}10`,borderColor:a?`${AppColors_1.AppColors.greenColor}26`:`${AppColors_1.AppColors.slate400}26`}]}>
|
|
107
|
+
<NetworkIcons_1.ClockIcon size={9}color={a?AppColors_1.AppColors.greenColor:AppColors_1.AppColors.grayTextWeak}/>
|
|
108
|
+
<react_native_1.Text style={[styles.metaStatText,{color:a?AppColors_1.AppColors.greenColor:AppColors_1.AppColors.grayTextWeak}]}>
|
|
109
|
+
{T}
|
|
110
|
+
</react_native_1.Text>
|
|
111
|
+
</react_native_1.View>
|
|
112
|
+
</react_native_1.View>
|
|
113
|
+
</react_native_1.View>
|
|
114
|
+
</react_native_1.View>
|
|
115
|
+
</TouchableScale_1.default>
|
|
116
|
+
</react_native_1.View>}const styles=react_native_1.StyleSheet.create({container:{marginHorizontal:4,marginBottom:6},card:{borderRadius:12,borderWidth:1,borderColor:AppColors_1.AppColors.dividerColor,shadowColor:AppColors_1.AppColors.shadowColorString,shadowOffset:{width:0,height:1},shadowOpacity:.05,shadowRadius:2,elevation:1,overflow:"hidden"},cardNew:{borderColor:`${AppColors_1.AppColors.brandPurple}66`,backgroundColor:`${AppColors_1.AppColors.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:AppColors_1.AppColors.grayTextWeak,alignItems:"center",justifyContent:"center",backgroundColor:AppColors_1.AppColors.white,marginRight:2},smallCheckboxChecked:{backgroundColor:AppColors_1.AppColors.purple,borderColor:AppColors_1.AppColors.purple},serialNumber:{fontFamily:AppFonts_1.AppFonts.interSemiBold,fontSize:10.5,color:AppColors_1.AppColors.grayTextWeak},protocolBadge:{paddingHorizontal:5.5,paddingVertical:1.5,borderRadius:5,borderWidth:1},protocolBadgeText:{fontFamily:AppFonts_1.AppFonts.interBold,fontSize:9.5,letterSpacing:.3},chip:{paddingHorizontal:5,paddingVertical:1.5,borderRadius:4,borderWidth:1},chipText:{fontFamily:AppFonts_1.AppFonts.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:AppFonts_1.AppFonts.interBold,fontSize:9.5,letterSpacing:.3},pulsingDot:{width:6,height:6,borderRadius:3,backgroundColor:AppColors_1.AppColors.greenColor},globeBtn:{padding:3,borderRadius:4,backgroundColor:`${AppColors_1.AppColors.grayTextWeak}12`},urlBox:{marginBottom:8},urlMainRow:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",gap:6,marginBottom:3},pathText:{flex:1,fontFamily:AppFonts_1.AppFonts.interBold,fontSize:12.5,color:AppColors_1.AppColors.grayTextStrong,lineHeight:17},highlight:{backgroundColor:"rgba(250, 204, 21, 0.40)",color:AppColors_1.AppColors.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:AppFonts_1.AppFonts.interBold,fontSize:8.5,letterSpacing:.2},hostText:{flex:1,fontFamily:AppFonts_1.AppFonts.interMedium,fontSize:11,color:AppColors_1.AppColors.grayTextWeak},cardFooterRow:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",paddingTop:6,borderTopWidth:1,borderTopColor:AppColors_1.AppColors.dividerColor},footerLeft:{flexDirection:"row",alignItems:"center",flex:1,minWidth:0,marginRight:6},cardDateRow:{flexDirection:"row",alignItems:"center",gap:4},cardDateText:{fontFamily:AppFonts_1.AppFonts.interMedium,fontSize:10,color:AppColors_1.AppColors.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:AppFonts_1.AppFonts.interSemiBold,fontSize:9.5}});function areSocketPropsEqual(e,o){return e.item===o.item&&e.isSelected===o.isSelected&&e.isNew===o.isNew&&e.searchStr===o.searchStr&&e.serialNumber===o.serialNumber&&e.onPress===o.onPress&&e.onToggleSelect===o.onToggleSelect}exports.default=react_1.default.memo(SocketCard,areSocketPropsEqual);
|
|
@@ -0,0 +1,317 @@
|
|
|
1
|
+
"use strict";var __createBinding=this&&this.__createBinding||(Object.create?(function(e,o,a,l){l===void 0&&(l=a);var r=Object.getOwnPropertyDescriptor(o,a);(!r||("get"in r?!o.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:function(){return o[a]}}),Object.defineProperty(e,l,r)}):(function(e,o,a,l){l===void 0&&(l=a),e[l]=o[a]})),__setModuleDefault=this&&this.__setModuleDefault||(Object.create?(function(e,o){Object.defineProperty(e,"default",{enumerable:!0,value:o})}):function(e,o){e.default=o}),__importStar=this&&this.__importStar||(function(){var e=function(o){return e=Object.getOwnPropertyNames||function(a){var l=[];for(var r in a)Object.prototype.hasOwnProperty.call(a,r)&&(l[l.length]=r);return l},e(o)};return function(o){if(o&&o.__esModule)return o;var a={};if(o!=null)for(var l=e(o),r=0;r<l.length;r++)l[r]!=="default"&&__createBinding(a,o,l[r]);return __setModuleDefault(a,o),a}})(),__importDefault=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(exports,"__esModule",{value:!0});const react_1=__importStar(require("react")),react_native_1=require("react-native"),styles_1=__importDefault(require("../../styles")),AppColors_1=require("../../styles/AppColors"),AppFonts_1=require("../../styles/AppFonts"),i18n_1=require("../../i18n"),SegmentedTabs_1=__importDefault(require("../SegmentedTabs")),JsonViewer_1=__importDefault(require("../JsonViewer")),CopyButton_1=__importDefault(require("../CopyButton")),ShareButton_1=__importDefault(require("../ShareButton")),CodeSnippet_1=__importDefault(require("../CodeSnippet")),HighlightText_1=__importDefault(require("../HighlightText")),TouchableScale_1=__importDefault(require("../TouchableScale")),helpers_1=require("../../helpers"),shareFormatter_1=require("../../helpers/shareFormatter"),NetworkIcons_1=require("../NetworkIcons");function formatByteSize(e){return!e||e<=0?"0 B":e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(2)} MB`}const SocketDetail=({item:e})=>{const{t:o}=(0,i18n_1.useTranslation)(),[a,l]=(0,react_1.useState)("messages"),[r,f]=(0,react_1.useState)(""),[s,u]=(0,react_1.useState)("all"),[m,y]=(0,react_1.useState)(new Set);if(!e)return null;const C=e.url.startsWith("wss://")||e.url.startsWith("https://"),c=e.client==="socket.io"||e.url.includes("/socket.io"),d=(0,react_1.useMemo)(()=>{const t=(e.status||"open").toLowerCase();return t==="open"?AppColors_1.AppColors.greenColor:t==="connecting"?AppColors_1.AppColors.amber600:t==="error"?AppColors_1.AppColors.errorColor:AppColors_1.AppColors.slate500},[e.status]),g=()=>{const t=e.url.replace(/^wss:\/\//,"https://").replace(/^ws:\/\//,"http://");react_native_1.Alert.alert(o("common.openInBrowser")||"Open in Browser",`${o("common.openInBrowserPrompt")||"Open URL in browser?"}
|
|
2
|
+
|
|
3
|
+
${t}`,[{text:o("common.cancel")||"Cancel",style:"cancel"},{text:o("common.open")||"Open",onPress:()=>{react_native_1.Linking.canOpenURL(t).then(i=>{i&&react_native_1.Linking.openURL(t).catch(()=>{})})}}])},b=async()=>{await(0,shareFormatter_1.shareSocketReport)(e)},S=t=>{y(i=>{const n=new Set(i);return n.has(t)?n.delete(t):n.add(t),n})},h=()=>{const t=new Set((e.frames||[]).map(i=>i.id));y(t)},V=()=>{y(new Set)},x=(0,react_1.useMemo)(()=>{let t=e.frames||[];if(s!=="all"&&(t=t.filter(i=>i.direction===s)),r.trim()){const i=r.trim().toLowerCase();t=t.filter(n=>!!(n.eventName&&n.eventName.toLowerCase().includes(i)||n.type&&n.type.toLowerCase().includes(i)||typeof n.data=="string"&&n.data.toLowerCase().includes(i)||n.data&&typeof n.data=="object"&&JSON.stringify(n.data).toLowerCase().includes(i)))}return t},[e.frames,s,r]),F=(e.totalBytesSent||0)+(e.totalBytesReceived||0),w=(0,react_1.useMemo)(()=>c?`import { io } from 'socket.io-client';
|
|
4
|
+
|
|
5
|
+
const socket = io('${e.url}', {
|
|
6
|
+
transports: ['websocket'],
|
|
7
|
+
query: ${JSON.stringify(e.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('${e.url}'${e.protocols?`, ${JSON.stringify(e.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
|
+
};`,[e.url,e.protocols,e.query,c]),T=`wscat -c "${e.url}"`,v=e.url.indexOf("://"),p=v!==-1?e.url.substring(0,v+3):"";return<react_native_1.View style={{flex:1,backgroundColor:AppColors_1.AppColors.contentBg}}>
|
|
35
|
+
|
|
36
|
+
<react_native_1.View style={{paddingHorizontal:8,paddingTop:4}}>
|
|
37
|
+
<react_native_1.View style={styles_1.default.detailInfoBar}>
|
|
38
|
+
|
|
39
|
+
<react_native_1.View style={{flexDirection:"row",alignItems:"center",justifyContent:"space-between",flexWrap:"wrap",gap:6,paddingBottom:8,borderBottomWidth:1,borderBottomColor:AppColors_1.AppColors.dividerColor}}>
|
|
40
|
+
<react_native_1.View style={{flexDirection:"row",alignItems:"center",gap:5,flexWrap:"wrap",flex:1}}>
|
|
41
|
+
|
|
42
|
+
<react_native_1.View style={[styles_1.default.methodBadge,{backgroundColor:c?AppColors_1.AppColors.violet600:C?AppColors_1.AppColors.emerald600:AppColors_1.AppColors.blue600,paddingHorizontal:8,paddingVertical:3.5,borderRadius:6}]}>
|
|
43
|
+
<react_native_1.Text style={[styles_1.default.methodBadgeText,{color:AppColors_1.AppColors.white,fontSize:10.5,fontFamily:AppFonts_1.AppFonts.interBold}]}>
|
|
44
|
+
{c?"SIO":C?"WSS":"WS"}
|
|
45
|
+
</react_native_1.Text>
|
|
46
|
+
</react_native_1.View>
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
<react_native_1.View style={[styles_1.default.chip,{backgroundColor:c?`${AppColors_1.AppColors.violet600}14`:`${AppColors_1.AppColors.sky500}14`,borderColor:c?`${AppColors_1.AppColors.violet600}30`:`${AppColors_1.AppColors.sky500}30`,paddingHorizontal:6,paddingVertical:3,borderRadius:6}]}>
|
|
50
|
+
<react_native_1.Text style={[styles_1.default.chipText,{fontFamily:AppFonts_1.AppFonts.interBold,fontSize:9.5,color:c?AppColors_1.AppColors.violet600:AppColors_1.AppColors.sky600}]}>
|
|
51
|
+
{(e.client||"WEBSOCKET").toUpperCase()}
|
|
52
|
+
</react_native_1.Text>
|
|
53
|
+
</react_native_1.View>
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
<react_native_1.View style={[styles_1.default.chip,{backgroundColor:`${d}18`,borderColor:`${d}40`,paddingHorizontal:7,paddingVertical:3,borderRadius:6}]}>
|
|
57
|
+
{e.status==="error"?<NetworkIcons_1.FailIcon size={8}color={AppColors_1.AppColors.errorColor}/>:<react_native_1.View style={{width:6,height:6,borderRadius:3,backgroundColor:d}}/>}
|
|
58
|
+
<react_native_1.Text style={[styles_1.default.chipText,{color:d,fontFamily:AppFonts_1.AppFonts.interBold,fontSize:10.5}]}>
|
|
59
|
+
{(e.status||"open").toUpperCase()}
|
|
60
|
+
</react_native_1.Text>
|
|
61
|
+
</react_native_1.View>
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
<react_native_1.View style={[styles_1.default.chip,{backgroundColor:`${AppColors_1.AppColors.brandPurple}14`,borderColor:`${AppColors_1.AppColors.brandPurple}30`,paddingHorizontal:7,paddingVertical:3,borderRadius:6,gap:4}]}>
|
|
65
|
+
<NetworkIcons_1.ClockIcon color={AppColors_1.AppColors.brandPurple}size={10}/>
|
|
66
|
+
<react_native_1.Text style={[styles_1.default.chipText,{color:AppColors_1.AppColors.brandPurple,fontFamily:AppFonts_1.AppFonts.interBold,fontSize:10.5}]}>
|
|
67
|
+
{e.duration!=null?`${e.duration}ms`:"Active"}
|
|
68
|
+
</react_native_1.Text>
|
|
69
|
+
</react_native_1.View>
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
<react_native_1.View style={[styles_1.default.chip,{backgroundColor:`${AppColors_1.AppColors.teal600}14`,borderColor:`${AppColors_1.AppColors.teal600}30`,paddingHorizontal:7,paddingVertical:3,borderRadius:6,gap:4}]}>
|
|
73
|
+
<NetworkIcons_1.SendFrameIcon color={AppColors_1.AppColors.teal600}size={10}/>
|
|
74
|
+
<react_native_1.Text style={[styles_1.default.chipText,{color:AppColors_1.AppColors.teal600,fontFamily:AppFonts_1.AppFonts.interBold,fontSize:10.5}]}>
|
|
75
|
+
{e.frames?.length||0} frames
|
|
76
|
+
</react_native_1.Text>
|
|
77
|
+
</react_native_1.View>
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
<react_native_1.View style={[styles_1.default.chip,{backgroundColor:`${AppColors_1.AppColors.sky600}14`,borderColor:`${AppColors_1.AppColors.sky600}30`,paddingHorizontal:7,paddingVertical:3,borderRadius:6,gap:4}]}>
|
|
81
|
+
<NetworkIcons_1.SizeIcon color={AppColors_1.AppColors.sky600}size={10}/>
|
|
82
|
+
<react_native_1.Text style={[styles_1.default.chipText,{color:AppColors_1.AppColors.sky600,fontFamily:AppFonts_1.AppFonts.interBold,fontSize:10.5}]}>
|
|
83
|
+
{formatByteSize(F)}
|
|
84
|
+
</react_native_1.Text>
|
|
85
|
+
</react_native_1.View>
|
|
86
|
+
</react_native_1.View>
|
|
87
|
+
</react_native_1.View>
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
<react_native_1.View style={{backgroundColor:AppColors_1.AppColors.grayBackground,borderRadius:10,borderWidth:1,borderColor:AppColors_1.AppColors.dividerColor,padding:10,marginTop:8,gap:8}}>
|
|
91
|
+
|
|
92
|
+
<react_native_1.View style={{flexDirection:"row",alignItems:"center",justifyContent:"space-between",flexWrap:"nowrap",gap:6}}>
|
|
93
|
+
<react_native_1.View style={{flexDirection:"row",alignItems:"center",gap:6,flexShrink:1,minWidth:0}}>
|
|
94
|
+
{p?<react_native_1.View style={{backgroundColor:p.startsWith("wss")||p.startsWith("https")?`${AppColors_1.AppColors.green600}18`:`${AppColors_1.AppColors.amber500}18`,paddingHorizontal:6,paddingVertical:2,borderRadius:4}}>
|
|
95
|
+
<react_native_1.Text style={{fontFamily:AppFonts_1.AppFonts.interBold,fontSize:9,color:p.startsWith("wss")||p.startsWith("https")?AppColors_1.AppColors.green600:AppColors_1.AppColors.amber500}}>
|
|
96
|
+
{p.replace("://","").toUpperCase()}
|
|
97
|
+
</react_native_1.Text>
|
|
98
|
+
</react_native_1.View>:null}
|
|
99
|
+
|
|
100
|
+
<react_native_1.Text style={{fontFamily:AppFonts_1.AppFonts.interBold,fontSize:10,color:AppColors_1.AppColors.grayTextWeak,letterSpacing:.4,textTransform:"uppercase"}}numberOfLines={1}>
|
|
101
|
+
ENDPOINT URL
|
|
102
|
+
</react_native_1.Text>
|
|
103
|
+
</react_native_1.View>
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
<react_native_1.View style={{flexDirection:"row",alignItems:"center",gap:5,flexShrink:0}}>
|
|
107
|
+
<CopyButton_1.default value={T}label="wscat"iconType="terminal"/>
|
|
108
|
+
<ShareButton_1.default onShare={b}/>
|
|
109
|
+
<CopyButton_1.default value={w}label="JS"iconType="fetch"/>
|
|
110
|
+
<CopyButton_1.default value={e.url}label="URL"iconType="copy"/>
|
|
111
|
+
<TouchableScale_1.default style={[styles_1.default.iconSquareBtn,{backgroundColor:`${AppColors_1.AppColors.sky600}15`,borderColor:`${AppColors_1.AppColors.sky600}35`}]}onPress={g}hitSlop={10}accessibilityLabel="Open in Browser">
|
|
112
|
+
<NetworkIcons_1.ExternalLinkIcon color={AppColors_1.AppColors.sky600}size={13}/>
|
|
113
|
+
</TouchableScale_1.default>
|
|
114
|
+
</react_native_1.View>
|
|
115
|
+
</react_native_1.View>
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
<react_native_1.Pressable onPress={g}>
|
|
119
|
+
<react_native_1.Text selectable={!0}style={{fontFamily:AppFonts_1.AppFonts.interMedium,fontSize:12.5,color:AppColors_1.AppColors.skyBlue,textDecorationLine:"underline",lineHeight:18}}>
|
|
120
|
+
{e.url}
|
|
121
|
+
</react_native_1.Text>
|
|
122
|
+
</react_native_1.Pressable>
|
|
123
|
+
</react_native_1.View>
|
|
124
|
+
</react_native_1.View>
|
|
125
|
+
</react_native_1.View>
|
|
126
|
+
|
|
127
|
+
|
|
128
|
+
<SegmentedTabs_1.default tabs={[{key:"messages",label:`${o("socket.messages","Messages")} (${e.frames?.length||0})`,themeColor:AppColors_1.AppColors.violet600,icon:t=><NetworkIcons_1.SendFrameIcon size={12}color={t?AppColors_1.AppColors.white:AppColors_1.AppColors.grayText}/>},{key:"overview",label:o("socket.overview","Overview"),themeColor:AppColors_1.AppColors.sky600,icon:t=><NetworkIcons_1.GlobeIcon size={12}color={t?AppColors_1.AppColors.white:AppColors_1.AppColors.grayText}/>},{key:"params",label:`${o("socket.params","Params")} (${Object.keys(e.query||{}).length})`,themeColor:AppColors_1.AppColors.teal600,icon:t=><NetworkIcons_1.LayersIcon size={12}color={t?AppColors_1.AppColors.white:AppColors_1.AppColors.grayText}/>},{key:"raw",label:o("socket.rawAndCode","Raw & Code"),themeColor:AppColors_1.AppColors.amber600,icon:t=><NetworkIcons_1.TerminalIcon size={12}color={t?AppColors_1.AppColors.white:AppColors_1.AppColors.grayText}/>}]}activeKey={a}onChange={l}style={{marginHorizontal:6,marginBottom:10,marginTop:6}}/>
|
|
129
|
+
|
|
130
|
+
|
|
131
|
+
{a==="messages"&&<react_native_1.View style={{flex:1}}>
|
|
132
|
+
|
|
133
|
+
<react_native_1.View style={socketDetailStyles.frameControlBar}>
|
|
134
|
+
<react_native_1.View style={socketDetailStyles.frameSearchBar}>
|
|
135
|
+
<NetworkIcons_1.SearchIcon size={13}color={AppColors_1.AppColors.grayTextWeak}/>
|
|
136
|
+
<react_native_1.TextInput style={socketDetailStyles.frameSearchInput}placeholder={o("socket.searchFramesPlaceholder","Search frame payloads or event names...")}placeholderTextColor={AppColors_1.AppColors.grayTextWeak}value={r}onChangeText={f}clearButtonMode="while-editing"/>
|
|
137
|
+
{r.length>0&&<react_native_1.Pressable onPress={()=>f("")}>
|
|
138
|
+
<NetworkIcons_1.ClearIcon size={12}color={AppColors_1.AppColors.grayTextWeak}/>
|
|
139
|
+
</react_native_1.Pressable>}
|
|
140
|
+
</react_native_1.View>
|
|
141
|
+
|
|
142
|
+
|
|
143
|
+
<react_native_1.View style={socketDetailStyles.frameFilterRow}>
|
|
144
|
+
<react_native_1.View style={socketDetailStyles.dirPillGroup}>
|
|
145
|
+
<react_native_1.TouchableOpacity onPress={()=>u("all")}style={[socketDetailStyles.dirPill,s==="all"&&socketDetailStyles.dirPillActive]}>
|
|
146
|
+
<react_native_1.Text style={[socketDetailStyles.dirPillText,s==="all"&&socketDetailStyles.dirPillTextActive]}>
|
|
147
|
+
{o("common.all","All")}
|
|
148
|
+
</react_native_1.Text>
|
|
149
|
+
</react_native_1.TouchableOpacity>
|
|
150
|
+
|
|
151
|
+
<react_native_1.TouchableOpacity onPress={()=>u("send")}style={[socketDetailStyles.dirPill,s==="send"&&socketDetailStyles.dirPillActive,{flexDirection:"row",alignItems:"center",gap:4}]}>
|
|
152
|
+
<NetworkIcons_1.SendFrameIcon size={10}color={s==="send"?AppColors_1.AppColors.white:AppColors_1.AppColors.emerald600}/>
|
|
153
|
+
<react_native_1.Text style={[socketDetailStyles.dirPillText,s==="send"&&socketDetailStyles.dirPillTextActive]}>
|
|
154
|
+
{o("socket.sent","Sent")}
|
|
155
|
+
</react_native_1.Text>
|
|
156
|
+
</react_native_1.TouchableOpacity>
|
|
157
|
+
|
|
158
|
+
<react_native_1.TouchableOpacity onPress={()=>u("receive")}style={[socketDetailStyles.dirPill,s==="receive"&&socketDetailStyles.dirPillActive,{flexDirection:"row",alignItems:"center",gap:4}]}>
|
|
159
|
+
<NetworkIcons_1.ReceiveFrameIcon size={10}color={s==="receive"?AppColors_1.AppColors.white:AppColors_1.AppColors.sky600}/>
|
|
160
|
+
<react_native_1.Text style={[socketDetailStyles.dirPillText,s==="receive"&&socketDetailStyles.dirPillTextActive]}>
|
|
161
|
+
{o("socket.recv","Recv")}
|
|
162
|
+
</react_native_1.Text>
|
|
163
|
+
</react_native_1.TouchableOpacity>
|
|
164
|
+
</react_native_1.View>
|
|
165
|
+
|
|
166
|
+
<react_native_1.View style={socketDetailStyles.expandGroup}>
|
|
167
|
+
<react_native_1.TouchableOpacity onPress={h}style={socketDetailStyles.textBtn}>
|
|
168
|
+
<react_native_1.Text style={socketDetailStyles.textBtnLabel}>{o("common.expandAll","Expand All")}</react_native_1.Text>
|
|
169
|
+
</react_native_1.TouchableOpacity>
|
|
170
|
+
<react_native_1.Text style={socketDetailStyles.textBtnSep}>•</react_native_1.Text>
|
|
171
|
+
<react_native_1.TouchableOpacity onPress={V}style={socketDetailStyles.textBtn}>
|
|
172
|
+
<react_native_1.Text style={socketDetailStyles.textBtnLabel}>{o("common.collapseAll","Collapse All")}</react_native_1.Text>
|
|
173
|
+
</react_native_1.TouchableOpacity>
|
|
174
|
+
</react_native_1.View>
|
|
175
|
+
</react_native_1.View>
|
|
176
|
+
</react_native_1.View>
|
|
177
|
+
|
|
178
|
+
|
|
179
|
+
<react_native_1.ScrollView style={socketDetailStyles.framesScrollView}contentContainerStyle={{padding:12}}>
|
|
180
|
+
{x.length===0?<react_native_1.View style={socketDetailStyles.emptyFrames}>
|
|
181
|
+
<react_native_1.Text style={socketDetailStyles.emptyFramesText}>
|
|
182
|
+
{e.frames?.length===0?"No messages transferred on this connection yet":"No frames match the active search or direction filter"}
|
|
183
|
+
</react_native_1.Text>
|
|
184
|
+
</react_native_1.View>:x.map((t,i)=>{const n=t.direction==="send",A=m.has(t.id),_=n?AppColors_1.AppColors.blue600:AppColors_1.AppColors.emerald600,B=n?`${AppColors_1.AppColors.blue600}12`:`${AppColors_1.AppColors.emerald600}12`,k=t.timestamp-e.startTime;return<react_native_1.View key={t.id}style={socketDetailStyles.frameCard}>
|
|
185
|
+
|
|
186
|
+
<react_native_1.Pressable onPress={()=>S(t.id)}style={socketDetailStyles.frameCardHeader}>
|
|
187
|
+
<react_native_1.View style={socketDetailStyles.frameHeaderLeft}>
|
|
188
|
+
<react_native_1.View style={[socketDetailStyles.dirBadge,{backgroundColor:B}]}>
|
|
189
|
+
{n?<NetworkIcons_1.SendFrameIcon size={10}color={_}/>:<NetworkIcons_1.ReceiveFrameIcon size={10}color={_}/>}
|
|
190
|
+
<react_native_1.Text style={[socketDetailStyles.dirBadgeText,{color:_}]}>
|
|
191
|
+
{n?"SENT":"RECV"}
|
|
192
|
+
</react_native_1.Text>
|
|
193
|
+
</react_native_1.View>
|
|
194
|
+
|
|
195
|
+
{t.eventName&&<react_native_1.View style={socketDetailStyles.eventBadge}>
|
|
196
|
+
<react_native_1.Text style={socketDetailStyles.eventBadgeText}numberOfLines={1}>
|
|
197
|
+
{t.eventName}
|
|
198
|
+
</react_native_1.Text>
|
|
199
|
+
</react_native_1.View>}
|
|
200
|
+
|
|
201
|
+
<react_native_1.Text style={socketDetailStyles.frameIndexText}>#{i+1}</react_native_1.Text>
|
|
202
|
+
</react_native_1.View>
|
|
203
|
+
|
|
204
|
+
<react_native_1.View style={socketDetailStyles.frameHeaderRight}>
|
|
205
|
+
<react_native_1.Text style={socketDetailStyles.frameOffsetTime}>
|
|
206
|
+
+{k}ms
|
|
207
|
+
</react_native_1.Text>
|
|
208
|
+
<react_native_1.View style={socketDetailStyles.frameSizePill}>
|
|
209
|
+
<react_native_1.Text style={socketDetailStyles.frameSizeText}>
|
|
210
|
+
{formatByteSize(t.size||0)}
|
|
211
|
+
</react_native_1.Text>
|
|
212
|
+
</react_native_1.View>
|
|
213
|
+
<CopyButton_1.default value={t.raw??t.data}label="Frame"/>
|
|
214
|
+
<NetworkIcons_1.ChevronIcon direction={A?"up":"down"}size={12}color={AppColors_1.AppColors.grayTextWeak}/>
|
|
215
|
+
</react_native_1.View>
|
|
216
|
+
</react_native_1.Pressable>
|
|
217
|
+
|
|
218
|
+
|
|
219
|
+
<react_native_1.View style={socketDetailStyles.frameBody}>
|
|
220
|
+
{typeof t.data=="object"&&t.data!==null?<JsonViewer_1.default data={t.data}search={r}forceOpen={A}/>:<react_native_1.Text style={socketDetailStyles.frameRawText}>
|
|
221
|
+
<HighlightText_1.default text={String(t.data)}search={r}/>
|
|
222
|
+
</react_native_1.Text>}
|
|
223
|
+
</react_native_1.View>
|
|
224
|
+
</react_native_1.View>})}
|
|
225
|
+
</react_native_1.ScrollView>
|
|
226
|
+
</react_native_1.View>}
|
|
227
|
+
|
|
228
|
+
|
|
229
|
+
{a==="overview"&&<react_native_1.ScrollView style={socketDetailStyles.tabContentScroll}contentContainerStyle={{padding:12}}>
|
|
230
|
+
<react_native_1.View style={socketDetailStyles.sectionCard}>
|
|
231
|
+
<react_native_1.Text style={socketDetailStyles.sectionHeading}>CONNECTION DETAILS</react_native_1.Text>
|
|
232
|
+
|
|
233
|
+
<react_native_1.View style={socketDetailStyles.infoRow}>
|
|
234
|
+
<react_native_1.Text style={socketDetailStyles.infoKey}>URL</react_native_1.Text>
|
|
235
|
+
<react_native_1.Text style={socketDetailStyles.infoVal}selectable>{e.url}</react_native_1.Text>
|
|
236
|
+
</react_native_1.View>
|
|
237
|
+
|
|
238
|
+
<react_native_1.View style={socketDetailStyles.infoRow}>
|
|
239
|
+
<react_native_1.Text style={socketDetailStyles.infoKey}>Client Engine</react_native_1.Text>
|
|
240
|
+
<react_native_1.Text style={socketDetailStyles.infoVal}>{e.client?.toUpperCase()||"WEBSOCKET"}</react_native_1.Text>
|
|
241
|
+
</react_native_1.View>
|
|
242
|
+
|
|
243
|
+
<react_native_1.View style={socketDetailStyles.infoRow}>
|
|
244
|
+
<react_native_1.Text style={socketDetailStyles.infoKey}>Ready State</react_native_1.Text>
|
|
245
|
+
<react_native_1.Text style={socketDetailStyles.infoVal}>
|
|
246
|
+
{e.readyState===1?"1 (OPEN)":e.readyState===0?"0 (CONNECTING)":e.readyState===2?"2 (CLOSING)":"3 (CLOSED)"}
|
|
247
|
+
</react_native_1.Text>
|
|
248
|
+
</react_native_1.View>
|
|
249
|
+
|
|
250
|
+
<react_native_1.View style={socketDetailStyles.infoRow}>
|
|
251
|
+
<react_native_1.Text style={socketDetailStyles.infoKey}>Connected At</react_native_1.Text>
|
|
252
|
+
<react_native_1.Text style={socketDetailStyles.infoVal}>{(0,helpers_1.formatDateTime)(e.startTime)}</react_native_1.Text>
|
|
253
|
+
</react_native_1.View>
|
|
254
|
+
|
|
255
|
+
{e.endTime&&<react_native_1.View style={socketDetailStyles.infoRow}>
|
|
256
|
+
<react_native_1.Text style={socketDetailStyles.infoKey}>Closed At</react_native_1.Text>
|
|
257
|
+
<react_native_1.Text style={socketDetailStyles.infoVal}>{(0,helpers_1.formatDateTime)(e.endTime)}</react_native_1.Text>
|
|
258
|
+
</react_native_1.View>}
|
|
259
|
+
|
|
260
|
+
{e.closeCode!=null&&<react_native_1.View style={socketDetailStyles.infoRow}>
|
|
261
|
+
<react_native_1.Text style={socketDetailStyles.infoKey}>Close Code & Reason</react_native_1.Text>
|
|
262
|
+
<react_native_1.Text style={socketDetailStyles.infoVal}>{e.closeCode} ({e.closeReason||"N/A"})</react_native_1.Text>
|
|
263
|
+
</react_native_1.View>}
|
|
264
|
+
|
|
265
|
+
{e.protocols&&<react_native_1.View style={socketDetailStyles.infoRow}>
|
|
266
|
+
<react_native_1.Text style={socketDetailStyles.infoKey}>Subprotocols</react_native_1.Text>
|
|
267
|
+
<react_native_1.Text style={socketDetailStyles.infoVal}>
|
|
268
|
+
{Array.isArray(e.protocols)?e.protocols.join(", "):e.protocols}
|
|
269
|
+
</react_native_1.Text>
|
|
270
|
+
</react_native_1.View>}
|
|
271
|
+
|
|
272
|
+
{e.caller&&<react_native_1.View style={socketDetailStyles.infoRow}>
|
|
273
|
+
<react_native_1.Text style={socketDetailStyles.infoKey}>Caller Stack</react_native_1.Text>
|
|
274
|
+
<react_native_1.Text style={[socketDetailStyles.infoVal,{fontFamily:AppFonts_1.AppFonts.interMedium,color:AppColors_1.AppColors.brandPurple}]}selectable>
|
|
275
|
+
{e.caller}
|
|
276
|
+
</react_native_1.Text>
|
|
277
|
+
</react_native_1.View>}
|
|
278
|
+
|
|
279
|
+
{e.error&&<react_native_1.View style={socketDetailStyles.infoRow}>
|
|
280
|
+
<react_native_1.Text style={socketDetailStyles.infoKey}>Error</react_native_1.Text>
|
|
281
|
+
<react_native_1.Text style={[socketDetailStyles.infoVal,{color:AppColors_1.AppColors.errorColor}]}selectable>
|
|
282
|
+
{e.error}
|
|
283
|
+
</react_native_1.Text>
|
|
284
|
+
</react_native_1.View>}
|
|
285
|
+
</react_native_1.View>
|
|
286
|
+
</react_native_1.ScrollView>}
|
|
287
|
+
|
|
288
|
+
|
|
289
|
+
{a==="params"&&<react_native_1.ScrollView style={socketDetailStyles.tabContentScroll}contentContainerStyle={{padding:12}}>
|
|
290
|
+
<react_native_1.View style={socketDetailStyles.sectionCard}>
|
|
291
|
+
<react_native_1.Text style={socketDetailStyles.sectionHeading}>HANDSHAKE QUERY PARAMETERS</react_native_1.Text>
|
|
292
|
+
{!e.query||Object.keys(e.query).length===0?<react_native_1.Text style={socketDetailStyles.emptySectionText}>No query parameters passed in connection URL</react_native_1.Text>:Object.entries(e.query).map(([t,i])=><react_native_1.View key={t}style={socketDetailStyles.paramRow}>
|
|
293
|
+
<react_native_1.Text style={socketDetailStyles.paramKey}selectable>{t}</react_native_1.Text>
|
|
294
|
+
<react_native_1.Text style={socketDetailStyles.paramVal}selectable>{i}</react_native_1.Text>
|
|
295
|
+
<CopyButton_1.default value={i}label={t}/>
|
|
296
|
+
</react_native_1.View>)}
|
|
297
|
+
</react_native_1.View>
|
|
298
|
+
</react_native_1.ScrollView>}
|
|
299
|
+
|
|
300
|
+
|
|
301
|
+
{a==="raw"&&<react_native_1.ScrollView style={socketDetailStyles.tabContentScroll}contentContainerStyle={{padding:12}}>
|
|
302
|
+
<react_native_1.View style={socketDetailStyles.sectionCard}>
|
|
303
|
+
<react_native_1.Text style={socketDetailStyles.sectionHeading}>JAVASCRIPT CLIENT CODE</react_native_1.Text>
|
|
304
|
+
<CodeSnippet_1.default code={w}language="javascript"/>
|
|
305
|
+
</react_native_1.View>
|
|
306
|
+
|
|
307
|
+
<react_native_1.View style={[socketDetailStyles.sectionCard,{marginTop:14}]}>
|
|
308
|
+
<react_native_1.Text style={socketDetailStyles.sectionHeading}>TERMINAL WSCAT COMMAND</react_native_1.Text>
|
|
309
|
+
<CodeSnippet_1.default code={T}language="javascript"/>
|
|
310
|
+
</react_native_1.View>
|
|
311
|
+
|
|
312
|
+
<react_native_1.View style={[socketDetailStyles.sectionCard,{marginTop:14}]}>
|
|
313
|
+
<react_native_1.Text style={socketDetailStyles.sectionHeading}>RAW CONNECTION JSON DUMP</react_native_1.Text>
|
|
314
|
+
<JsonViewer_1.default data={e}/>
|
|
315
|
+
</react_native_1.View>
|
|
316
|
+
</react_native_1.ScrollView>}
|
|
317
|
+
</react_native_1.View>};exports.default=SocketDetail;const socketDetailStyles=react_native_1.StyleSheet.create({frameControlBar:{padding:10,backgroundColor:AppColors_1.AppColors.graySurface,borderBottomWidth:1,borderBottomColor:AppColors_1.AppColors.dividerColor,gap:8},frameSearchBar:{flexDirection:"row",alignItems:"center",backgroundColor:AppColors_1.AppColors.contentBg,borderRadius:8,borderWidth:1,borderColor:AppColors_1.AppColors.dividerColor,paddingHorizontal:8,height:34,gap:6},frameSearchInput:{flex:1,fontFamily:AppFonts_1.AppFonts.interRegular,fontSize:12,color:AppColors_1.AppColors.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:AppColors_1.AppColors.dividerColor,backgroundColor:AppColors_1.AppColors.contentBg},dirPillActive:{backgroundColor:`${AppColors_1.AppColors.brandPurple}18`,borderColor:AppColors_1.AppColors.brandPurple},dirPillText:{fontFamily:AppFonts_1.AppFonts.interMedium,fontSize:11,color:AppColors_1.AppColors.grayTextWeak},dirPillTextActive:{color:AppColors_1.AppColors.brandPurple,fontFamily:AppFonts_1.AppFonts.interBold},expandGroup:{flexDirection:"row",alignItems:"center",gap:4},textBtn:{paddingVertical:2,paddingHorizontal:4},textBtnLabel:{fontFamily:AppFonts_1.AppFonts.interMedium,fontSize:11,color:AppColors_1.AppColors.brandPurple},textBtnSep:{color:AppColors_1.AppColors.grayTextWeak,fontSize:10},framesScrollView:{flex:1},emptyFrames:{padding:32,alignItems:"center"},emptyFramesText:{fontFamily:AppFonts_1.AppFonts.interMedium,fontSize:12.5,color:AppColors_1.AppColors.grayTextWeak,textAlign:"center"},frameCard:{backgroundColor:AppColors_1.AppColors.contentBg,borderRadius:8,borderWidth:1,borderColor:AppColors_1.AppColors.dividerColor,marginBottom:8,overflow:"hidden"},frameCardHeader:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",paddingHorizontal:10,paddingVertical:7,backgroundColor:AppColors_1.AppColors.graySurface,borderBottomWidth:1,borderBottomColor:AppColors_1.AppColors.dividerColor},frameHeaderLeft:{flexDirection:"row",alignItems:"center",gap:6},dirBadge:{flexDirection:"row",alignItems:"center",paddingHorizontal:5,paddingVertical:2,borderRadius:4,gap:3},dirBadgeText:{fontFamily:AppFonts_1.AppFonts.interBold,fontSize:9.5},eventBadge:{backgroundColor:`${AppColors_1.AppColors.violet600}18`,paddingHorizontal:6,paddingVertical:2,borderRadius:4,maxWidth:130},eventBadgeText:{fontFamily:AppFonts_1.AppFonts.interBold,fontSize:10,color:AppColors_1.AppColors.violet600},frameIndexText:{fontFamily:AppFonts_1.AppFonts.interMedium,fontSize:10,color:AppColors_1.AppColors.grayTextWeak},frameHeaderRight:{flexDirection:"row",alignItems:"center",gap:6},frameOffsetTime:{fontFamily:AppFonts_1.AppFonts.interRegular,fontSize:10,color:AppColors_1.AppColors.grayTextWeak},frameSizePill:{backgroundColor:`${AppColors_1.AppColors.slate400}18`,paddingHorizontal:4,paddingVertical:1,borderRadius:4},frameSizeText:{fontFamily:AppFonts_1.AppFonts.interMedium,fontSize:9.5,color:AppColors_1.AppColors.grayTextStrong},frameBody:{padding:8},frameRawText:{fontFamily:AppFonts_1.AppFonts.interRegular,fontSize:12,color:AppColors_1.AppColors.grayTextStrong,lineHeight:16},tabContentScroll:{flex:1},sectionCard:{backgroundColor:AppColors_1.AppColors.contentBg,borderRadius:10,borderWidth:1,borderColor:AppColors_1.AppColors.dividerColor,padding:12},sectionHeading:{fontFamily:AppFonts_1.AppFonts.interBold,fontSize:11,color:AppColors_1.AppColors.grayTextWeak,letterSpacing:.6,marginBottom:10},infoRow:{paddingVertical:8,borderBottomWidth:1,borderBottomColor:AppColors_1.AppColors.dividerColor},infoKey:{fontFamily:AppFonts_1.AppFonts.interMedium,fontSize:11,color:AppColors_1.AppColors.grayTextWeak,marginBottom:2},infoVal:{fontFamily:AppFonts_1.AppFonts.interSemiBold,fontSize:12.5,color:AppColors_1.AppColors.grayTextStrong,lineHeight:18},emptySectionText:{fontFamily:AppFonts_1.AppFonts.interRegular,fontSize:12,color:AppColors_1.AppColors.grayTextWeak,fontStyle:"italic",paddingVertical:8},paramRow:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",paddingVertical:8,borderBottomWidth:1,borderBottomColor:AppColors_1.AppColors.dividerColor,gap:8},paramKey:{fontFamily:AppFonts_1.AppFonts.interBold,fontSize:12,color:AppColors_1.AppColors.brandPurple,width:"30%"},paramVal:{flex:1,fontFamily:AppFonts_1.AppFonts.interMedium,fontSize:12,color:AppColors_1.AppColors.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
|
+
"use strict";var __createBinding=this&&this.__createBinding||(Object.create?(function(o,r,l,n){n===void 0&&(n=l);var a=Object.getOwnPropertyDescriptor(r,l);(!a||("get"in a?!r.__esModule:a.writable||a.configurable))&&(a={enumerable:!0,get:function(){return r[l]}}),Object.defineProperty(o,n,a)}):(function(o,r,l,n){n===void 0&&(n=l),o[n]=r[l]})),__setModuleDefault=this&&this.__setModuleDefault||(Object.create?(function(o,r){Object.defineProperty(o,"default",{enumerable:!0,value:r})}):function(o,r){o.default=r}),__importStar=this&&this.__importStar||(function(){var o=function(r){return o=Object.getOwnPropertyNames||function(l){var n=[];for(var a in l)Object.prototype.hasOwnProperty.call(l,a)&&(n[n.length]=a);return n},o(r)};return function(r){if(r&&r.__esModule)return r;var l={};if(r!=null)for(var n=o(r),a=0;a<n.length;a++)n[a]!=="default"&&__createBinding(l,r,n[a]);return __setModuleDefault(l,r),l}})(),__importDefault=this&&this.__importDefault||function(o){return o&&o.__esModule?o:{default:o}};Object.defineProperty(exports,"__esModule",{value:!0}),exports.SocketFilterModal=exports.isSocketFiltersDefault=exports.DEFAULT_SOCKET_FILTERS=void 0;const react_1=__importStar(require("react")),react_native_1=require("react-native"),AppColors_1=require("../../styles/AppColors"),AppFonts_1=require("../../styles/AppFonts"),NetworkIcons_1=require("../NetworkIcons"),TouchableScale_1=__importDefault(require("../TouchableScale"));exports.DEFAULT_SOCKET_FILTERS={search:"",status:new Set(["all"]),types:new Set(["all"]),sortBy:"time_desc"};const isSocketFiltersDefault=o=>(o.status.has("all")||o.status.size===0)&&(o.types.has("all")||o.types.size===0)&&o.sortBy==="time_desc";exports.isSocketFiltersDefault=isSocketFiltersDefault;const SocketFilterModal=({visible:o,onClose:r,filters:l,onApply:n,records:a})=>{const[c,p]=(0,react_1.useState)(()=>({...l,status:new Set(l.status),types:new Set(l.types)}));(0,react_1.useEffect)(()=>{o&&p({...l,status:new Set(l.status),types:new Set(l.types)})},[o,l]);const s=(0,react_1.useMemo)(()=>{let e=0,t=0,i=0,y=0,_=0,b=0,f=0;return a.forEach(d=>{const u=d.status||"open";u==="open"?e++:u==="closed"?t++:u==="connecting"?i++:u==="error"&&y++,d.client==="socket.io"||d.url.includes("/socket.io")?f++:d.url.startsWith("wss://")?_++:b++}),{all:a.length,open:e,closed:t,connecting:i,error:y,wss:_,ws:b,sio:f}},[a]),h=e=>{const t=new Set(c.status);e==="all"?(t.clear(),t.add("all")):(t.delete("all"),t.has(e)?t.delete(e):t.add(e),t.size===0&&t.add("all")),p(i=>({...i,status:t}))},T=e=>{const t=new Set(c.types);e==="all"?(t.clear(),t.add("all")):(t.delete("all"),t.has(e)?t.delete(e):t.add(e),t.size===0&&t.add("all")),p(i=>({...i,types:t}))},g=()=>{p({search:c.search,status:new Set(["all"]),types:new Set(["all"]),sortBy:"time_desc"})},w=()=>{n(c),r()};return<react_native_1.Modal visible={o}transparent animationType="fade"onRequestClose={r}>
|
|
2
|
+
<react_native_1.View style={styles.backdrop}>
|
|
3
|
+
<react_native_1.Pressable style={styles.backdropPress}onPress={r}/>
|
|
4
|
+
<react_native_1.View style={styles.container}>
|
|
5
|
+
|
|
6
|
+
<react_native_1.View style={styles.header}>
|
|
7
|
+
<react_native_1.View style={styles.headerLeft}>
|
|
8
|
+
<NetworkIcons_1.FilterIcon size={18}color={AppColors_1.AppColors.brandPurple}/>
|
|
9
|
+
<react_native_1.Text style={styles.headerTitle}>Filter WebSockets</react_native_1.Text>
|
|
10
|
+
</react_native_1.View>
|
|
11
|
+
<react_native_1.TouchableOpacity onPress={r}hitSlop={{top:8,bottom:8,left:8,right:8}}style={styles.closeBtn}>
|
|
12
|
+
<NetworkIcons_1.CloseWhite size={14}color={AppColors_1.AppColors.grayTextWeak}/>
|
|
13
|
+
</react_native_1.TouchableOpacity>
|
|
14
|
+
</react_native_1.View>
|
|
15
|
+
|
|
16
|
+
<react_native_1.ScrollView style={styles.content}showsVerticalScrollIndicator={!1}>
|
|
17
|
+
|
|
18
|
+
<react_native_1.Text style={styles.sectionTitle}>CONNECTION STATUS</react_native_1.Text>
|
|
19
|
+
<react_native_1.View style={styles.chipRow}>
|
|
20
|
+
{[{key:"all",label:"All",count:s.all,color:AppColors_1.AppColors.brandPurple},{key:"open",label:"Open",count:s.open,color:AppColors_1.AppColors.greenColor},{key:"closed",label:"Closed",count:s.closed,color:AppColors_1.AppColors.slate500},{key:"connecting",label:"Connecting",count:s.connecting,color:AppColors_1.AppColors.amber600},{key:"error",label:"Error",count:s.error,color:AppColors_1.AppColors.errorColor}].map(e=>{const t=c.status.has(e.key);return<react_native_1.TouchableOpacity key={e.key}onPress={()=>h(e.key)}style={[styles.chip,t&&{backgroundColor:`${e.color}18`,borderColor:e.color}]}>
|
|
21
|
+
<react_native_1.Text style={[styles.chipText,t&&{color:e.color,fontFamily:AppFonts_1.AppFonts.interBold}]}>
|
|
22
|
+
{e.label}
|
|
23
|
+
</react_native_1.Text>
|
|
24
|
+
<react_native_1.View style={[styles.countPill,t&&{backgroundColor:`${e.color}30`}]}>
|
|
25
|
+
<react_native_1.Text style={[styles.countText,t&&{color:e.color}]}>
|
|
26
|
+
{e.count}
|
|
27
|
+
</react_native_1.Text>
|
|
28
|
+
</react_native_1.View>
|
|
29
|
+
</react_native_1.TouchableOpacity>})}
|
|
30
|
+
</react_native_1.View>
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
<react_native_1.Text style={styles.sectionTitle}>PROTOCOL & CLIENT</react_native_1.Text>
|
|
34
|
+
<react_native_1.View style={styles.chipRow}>
|
|
35
|
+
{[{key:"all",label:"All Protocols",count:s.all,color:AppColors_1.AppColors.brandPurple},{key:"wss",label:"Secure (WSS)",count:s.wss,color:AppColors_1.AppColors.emerald600},{key:"ws",label:"Standard (WS)",count:s.ws,color:AppColors_1.AppColors.blue600},{key:"sio",label:"Socket.IO",count:s.sio,color:AppColors_1.AppColors.violet600}].map(e=>{const t=c.types.has(e.key);return<react_native_1.TouchableOpacity key={e.key}onPress={()=>T(e.key)}style={[styles.chip,t&&{backgroundColor:`${e.color}18`,borderColor:e.color}]}>
|
|
36
|
+
<react_native_1.Text style={[styles.chipText,t&&{color:e.color,fontFamily:AppFonts_1.AppFonts.interBold}]}>
|
|
37
|
+
{e.label}
|
|
38
|
+
</react_native_1.Text>
|
|
39
|
+
<react_native_1.View style={[styles.countPill,t&&{backgroundColor:`${e.color}30`}]}>
|
|
40
|
+
<react_native_1.Text style={[styles.countText,t&&{color:e.color}]}>
|
|
41
|
+
{e.count}
|
|
42
|
+
</react_native_1.Text>
|
|
43
|
+
</react_native_1.View>
|
|
44
|
+
</react_native_1.TouchableOpacity>})}
|
|
45
|
+
</react_native_1.View>
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
<react_native_1.Text style={styles.sectionTitle}>SORT BY</react_native_1.Text>
|
|
49
|
+
<react_native_1.View style={styles.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 t=c.sortBy===e.key;return<react_native_1.TouchableOpacity key={e.key}onPress={()=>p(i=>({...i,sortBy:e.key}))}style={[styles.chip,t&&styles.chipActiveSort]}>
|
|
51
|
+
<react_native_1.Text style={[styles.chipText,t&&styles.chipTextActiveSort]}>
|
|
52
|
+
{e.label}
|
|
53
|
+
</react_native_1.Text>
|
|
54
|
+
</react_native_1.TouchableOpacity>})}
|
|
55
|
+
</react_native_1.View>
|
|
56
|
+
</react_native_1.ScrollView>
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
<react_native_1.View style={styles.footer}>
|
|
60
|
+
<react_native_1.TouchableOpacity onPress={g}style={styles.resetBtn}>
|
|
61
|
+
<react_native_1.Text style={styles.resetBtnText}>Reset</react_native_1.Text>
|
|
62
|
+
</react_native_1.TouchableOpacity>
|
|
63
|
+
<TouchableScale_1.default onPress={w}style={styles.applyBtn}>
|
|
64
|
+
<react_native_1.Text style={styles.applyBtnText}>Apply Filters</react_native_1.Text>
|
|
65
|
+
</TouchableScale_1.default>
|
|
66
|
+
</react_native_1.View>
|
|
67
|
+
</react_native_1.View>
|
|
68
|
+
</react_native_1.View>
|
|
69
|
+
</react_native_1.Modal>};exports.SocketFilterModal=SocketFilterModal,exports.default=exports.SocketFilterModal;const styles=react_native_1.StyleSheet.create({backdrop:{flex:1,backgroundColor:"rgba(0,0,0,0.5)",justifyContent:"center",alignItems:"center",padding:16},backdropPress:{...react_native_1.StyleSheet.absoluteFillObject},container:{width:"100%",maxHeight:"80%",backgroundColor:AppColors_1.AppColors.contentBg,borderRadius:16,overflow:"hidden",shadowColor:AppColors_1.AppColors.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:AppColors_1.AppColors.dividerColor},headerLeft:{flexDirection:"row",alignItems:"center",gap:8},headerTitle:{fontFamily:AppFonts_1.AppFonts.interBold,fontSize:16,color:AppColors_1.AppColors.grayTextStrong},closeBtn:{padding:4},content:{padding:16},sectionTitle:{fontFamily:AppFonts_1.AppFonts.interBold,fontSize:11,color:AppColors_1.AppColors.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:AppColors_1.AppColors.dividerColor,backgroundColor:AppColors_1.AppColors.graySurface,gap:6},chipActiveSort:{backgroundColor:`${AppColors_1.AppColors.brandPurple}18`,borderColor:AppColors_1.AppColors.brandPurple},chipText:{fontFamily:AppFonts_1.AppFonts.interMedium,fontSize:12,color:AppColors_1.AppColors.grayTextStrong},chipTextActiveSort:{color:AppColors_1.AppColors.brandPurple,fontFamily:AppFonts_1.AppFonts.interBold},countPill:{backgroundColor:`${AppColors_1.AppColors.slate500}18`,paddingHorizontal:5,paddingVertical:1,borderRadius:10},countText:{fontFamily:AppFonts_1.AppFonts.interBold,fontSize:10,color:AppColors_1.AppColors.grayTextWeak},footer:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",paddingHorizontal:16,paddingVertical:12,borderTopWidth:1,borderTopColor:AppColors_1.AppColors.dividerColor,gap:12},resetBtn:{paddingVertical:10,paddingHorizontal:16,borderRadius:8,borderWidth:1,borderColor:AppColors_1.AppColors.dividerColor},resetBtnText:{fontFamily:AppFonts_1.AppFonts.interSemiBold,fontSize:13,color:AppColors_1.AppColors.grayTextWeak},applyBtn:{flex:1,backgroundColor:AppColors_1.AppColors.brandPurple,paddingVertical:11,borderRadius:8,alignItems:"center",justifyContent:"center"},applyBtnText:{fontFamily:AppFonts_1.AppFonts.interBold,fontSize:13,color:AppColors_1.AppColors.white}});
|