diff --git a/agent/main.go b/agent/main.go index 8122a35df..9128d0731 100644 --- a/agent/main.go +++ b/agent/main.go @@ -320,6 +320,7 @@ func dialSocketWithRetry(socketAddress string, retryAmount int, retryDelay time. for i := 1; i < retryAmount; i++ { socketConnection, _, err := dialer.Dial(socketAddress, nil) if err != nil { + lastErr = err if i < retryAmount { logger.Log.Infof("socket connection to %s failed: %v, retrying %d out of %d in %d seconds...", socketAddress, err, i, retryAmount, retryDelay/time.Second) time.Sleep(retryDelay) diff --git a/agent/pkg/api/socket_routes.go b/agent/pkg/api/socket_routes.go index eddf160cd..085617bcc 100644 --- a/agent/pkg/api/socket_routes.go +++ b/agent/pkg/api/socket_routes.go @@ -123,22 +123,23 @@ func SendToSocket(socketId int, message []byte) error { return fmt.Errorf("socket %v is disconnected", socketId) } - var sent = false - time.AfterFunc(time.Second*5, func() { - if !sent { - logger.Log.Error("socket timed out") - socketCleanup(socketId, socketObj) - } - }) - socketObj.lock.Lock() // gorilla socket panics from concurrent writes to a single socket - err := socketObj.connection.WriteMessage(1, message) - socketObj.lock.Unlock() - sent = true + defer socketObj.lock.Unlock() - if err != nil { - return fmt.Errorf("failed to write message to socket %v, err: %w", socketId, err) + if connectedWebsockets[socketId] == nil { + return fmt.Errorf("socket %v is disconnected", socketId) } + + if err := socketObj.connection.SetWriteDeadline(time.Now().Add(time.Second * 10)); err != nil { + socketCleanup(socketId, socketObj) + return fmt.Errorf("error setting timeout to socket %v, err: %v", socketId, err) + } + + if err := socketObj.connection.WriteMessage(websocket.TextMessage, message); err != nil { + socketCleanup(socketId, socketObj) + return fmt.Errorf("failed to write message to socket %v, err: %v", socketId, err) + } + return nil } diff --git a/agent/pkg/oas/oas_generator.go b/agent/pkg/oas/oas_generator.go index 2d39e1722..bfcaca712 100644 --- a/agent/pkg/oas/oas_generator.go +++ b/agent/pkg/oas/oas_generator.go @@ -142,17 +142,18 @@ func (g *defaultOasGenerator) runGenerator() { func (g *defaultOasGenerator) handleEntry(mizuEntry *api.Entry) { if mizuEntry.Protocol.Name == "http" { + dest := mizuEntry.Destination.Name + if dest == "" { + logger.Log.Debugf("OAS: Unresolved entry %d", mizuEntry.Id) + return + } + entry, err := har.NewEntry(mizuEntry.Request, mizuEntry.Response, mizuEntry.StartTime, mizuEntry.ElapsedTime) if err != nil { logger.Log.Warningf("Failed to turn MizuEntry %d into HAR Entry: %s", mizuEntry.Id, err) return } - dest := mizuEntry.Destination.Name - if dest == "" { - dest = mizuEntry.Destination.IP + ":" + mizuEntry.Destination.Port - } - entryWSource := &EntryWithSource{ Entry: *entry, Source: mizuEntry.Source.Name, diff --git a/cli/Makefile b/cli/Makefile index 7a78898df..112a403db 100644 --- a/cli/Makefile +++ b/cli/Makefile @@ -36,16 +36,16 @@ build-base: ## Build mizu CLI binary (select platform via GOOS / GOARCH env vari (cd bin && shasum -a 256 mizu_${SUFFIX} > mizu_${SUFFIX}.sha256) build-all: ## Build for all supported platforms. - @echo "Compiling for every OS and Platform" - @mkdir -p bin && sed s/_VER_/$(VER)/g README.md.TEMPLATE > bin/README.md - @$(MAKE) build GOOS=linux GOARCH=amd64 - @$(MAKE) build GOOS=linux GOARCH=arm64 - @$(MAKE) build GOOS=darwin GOARCH=amd64 - @$(MAKE) build GOOS=darwin GOARCH=arm64 - @$(MAKE) build GOOS=windows GOARCH=amd64 - @mv ./bin/mizu_windows_amd64 ./bin/mizu.exe - @echo "---------" - @find ./bin -ls + echo "Compiling for every OS and Platform" && \ + mkdir -p bin && sed s/_VER_/$(VER)/g README.md.TEMPLATE > bin/README.md && \ + $(MAKE) build GOOS=linux GOARCH=amd64 && \ + $(MAKE) build GOOS=linux GOARCH=arm64 && \ + $(MAKE) build GOOS=darwin GOARCH=amd64 && \ + $(MAKE) build GOOS=darwin GOARCH=arm64 && \ + $(MAKE) build GOOS=windows GOARCH=amd64 && \ + mv ./bin/mizu_windows_amd64 ./bin/mizu.exe && \ + echo "---------" && \ + find ./bin -ls clean: ## Clean all build artifacts. go clean diff --git a/cli/config/configStructs/tapConfig.go b/cli/config/configStructs/tapConfig.go index 2d45c264d..f2cdd612a 100644 --- a/cli/config/configStructs/tapConfig.go +++ b/cli/config/configStructs/tapConfig.go @@ -11,7 +11,6 @@ import ( "github.com/up9inc/mizu/cli/uiUtils" "github.com/up9inc/mizu/shared" - basenine "github.com/up9inc/basenine/server/lib" "github.com/up9inc/mizu/shared/logger" "github.com/up9inc/mizu/shared/units" ) @@ -79,10 +78,6 @@ func (config *TapConfig) GetInsertionFilter() string { } } } - _, err := basenine.Parse(insertionFilter) - if err != nil { - logger.Log.Warningf(uiUtils.Warning, fmt.Sprintf("Insertion filter syntax error: %v", err)) - } return insertionFilter } diff --git a/cli/go.mod b/cli/go.mod index a68989973..521f40f43 100644 --- a/cli/go.mod +++ b/cli/go.mod @@ -11,7 +11,6 @@ require ( github.com/op/go-logging v0.0.0-20160315200505-970db520ece7 github.com/spf13/cobra v1.3.0 github.com/spf13/pflag v1.0.5 - github.com/up9inc/basenine/server/lib v0.0.0-20220419100955-e2ca51087607 github.com/up9inc/mizu/shared v0.0.0 golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8 gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b @@ -32,11 +31,8 @@ require ( github.com/MakeNowJust/heredoc v1.0.0 // indirect github.com/PuerkitoBio/purell v1.1.1 // indirect github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 // indirect - github.com/alecthomas/participle/v2 v2.0.0-alpha7 // indirect github.com/chai2010/gettext-go v0.0.0-20160711120539-c6fed771bfd5 // indirect - github.com/clbanning/mxj/v2 v2.5.5 // indirect github.com/davecgh/go-spew v1.1.1 // indirect - github.com/dlclark/regexp2 v1.4.0 // indirect github.com/docker/go-units v0.4.0 // indirect github.com/evanphx/json-patch v5.6.0+incompatible // indirect github.com/exponent-io/jsonpath v0.0.0-20210407135951-1de76d718b3f // indirect @@ -70,7 +66,6 @@ require ( github.com/modern-go/reflect2 v1.0.2 // indirect github.com/monochromegane/go-gitignore v0.0.0-20200626010858-205db1a8cc00 // indirect github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f // indirect - github.com/ohler55/ojg v1.14.0 // indirect github.com/peterbourgon/diskv v2.0.1+incompatible // indirect github.com/pkg/errors v0.9.1 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect diff --git a/cli/go.sum b/cli/go.sum index 9d8420bac..06f4d20b3 100644 --- a/cli/go.sum +++ b/cli/go.sum @@ -83,10 +83,6 @@ github.com/PuerkitoBio/purell v1.1.1 h1:WEQqlqaGbrPkxLJWfBwQmfEAE1Z7ONdDLqrN38tN github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 h1:d+Bc7a5rLufV/sSk/8dngufqelfh6jnri85riMAaF/M= github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= -github.com/alecthomas/participle/v2 v2.0.0-alpha7 h1:cK4vjj0VSgb3lN1nuKA5F7dw+1s1pWBe5bx7nNCnN+c= -github.com/alecthomas/participle/v2 v2.0.0-alpha7/go.mod h1:NumScqsC42o9x+dGj8/YqsIfhrIQjFEOFovxotbBirA= -github.com/alecthomas/repr v0.0.0-20181024024818-d37bc2a10ba1 h1:GDQdwm/gAcJcLAKQQZGOJ4knlw+7rfEQQcmwTbt4p5E= -github.com/alecthomas/repr v0.0.0-20181024024818-d37bc2a10ba1/go.mod h1:xTS7Pm1pD1mvyM075QCDSRqH6qRLXylzS24ZTpRiSzQ= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= @@ -120,8 +116,6 @@ github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5P github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= github.com/circonus-labs/circonus-gometrics v2.3.1+incompatible/go.mod h1:nmEj6Dob7S7YxXgwXpfOuvO54S+tGdZdw9fuRZt25Ag= github.com/circonus-labs/circonusllhist v0.1.3/go.mod h1:kMXHVDlOchFAehlya5ePtbp5jckzBHf4XRpQvBOLI+I= -github.com/clbanning/mxj/v2 v2.5.5 h1:oT81vUeEiQQ/DcHbzSytRngP6Ky9O+L+0Bw0zSJag9E= -github.com/clbanning/mxj/v2 v2.5.5/go.mod h1:hNiWqW14h+kc+MdF9C6/YoRfjEJoR3ou6tn/Qo+ve2s= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= @@ -155,8 +149,6 @@ github.com/denisbrodbeck/machineid v1.0.1 h1:geKr9qtkB876mXguW2X6TU4ZynleN6ezuMS github.com/denisbrodbeck/machineid v1.0.1/go.mod h1:dJUwb7PTidGDeYyUBmXZ2GphQBbjJCrnectwCyxcUSI= github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= -github.com/dlclark/regexp2 v1.4.0 h1:F1rxgk7p4uKjwIQxBs9oAXe5CqrXlCduYEJvrF4u93E= -github.com/dlclark/regexp2 v1.4.0/go.mod h1:2pZnwuY/m+8K6iRw6wQdMtk+rH5tNGR1i55kozfMjCc= github.com/docker/distribution v2.7.1+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= github.com/docker/go-units v0.4.0 h1:3uh0PgVws3nIA0Q+MwDC8yjEPf9zjRfZZWXZYDct3Tw= github.com/docker/go-units v0.4.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= @@ -486,8 +478,6 @@ github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWb github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= github.com/nxadm/tail v1.4.4 h1:DQuhQpB1tVlglWS2hLQ5OV6B5r8aGxSrPc5Qo6uTN78= github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= -github.com/ohler55/ojg v1.14.0 h1:DyHomsCwofNswmKj7BLMdx51xnKbXxgIo1rVWCaBcNk= -github.com/ohler55/ojg v1.14.0/go.mod h1:3+GH+0PggMKocQtbZCrFifal3yRpHiBT4QUkxFJI6e8= github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= github.com/olekukonko/tablewriter v0.0.4/go.mod h1:zq6QwlOf5SlnkVbMSr5EoBv3636FWnp+qbPhuoO21uA= github.com/onsi/ginkgo v0.0.0-20170829012221-11459a886d9c/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= @@ -599,8 +589,6 @@ github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69 github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= github.com/tv42/httpunix v0.0.0-20150427012821-b75d8614f926/go.mod h1:9ESjWnEqriFuLhtthL60Sar/7RFoluCcXsuvEwTV5KM= github.com/ugorji/go v1.1.4/go.mod h1:uQMGLiO92mf5W77hV/PUCpI3pbzQx3CRekS0kk+RGrc= -github.com/up9inc/basenine/server/lib v0.0.0-20220419100955-e2ca51087607 h1:gCOwbfjsLslDw63yj/3l9d5TH7ikhIWHd7j0lE9U26U= -github.com/up9inc/basenine/server/lib v0.0.0-20220419100955-e2ca51087607/go.mod h1:v0hIh31iwDGbkkdeSSppdMNm1oIigfCA2mG2XajKnf8= github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= github.com/xlab/treeprint v0.0.0-20181112141820-a009c3971eca/go.mod h1:ce1O1j6UtZfjr22oyGxGLbauSBp2YVXpARAosm7dHBg= github.com/xlab/treeprint v1.1.0 h1:G/1DjNkPpfZCFt9CSh6b5/nY4VimlbHF3Rh4obvtzDk= diff --git a/ui-common/package.json b/ui-common/package.json index 511f081d1..e8f00e77c 100644 --- a/ui-common/package.json +++ b/ui-common/package.json @@ -49,7 +49,7 @@ "moment": "^2.29.1", "node-fetch": "^3.1.1", "numeral": "^2.0.6", - "protobuf-decoder": "^0.1.0", + "protobuf-decoder": "^0.1.2", "react-graph-vis": "^1.0.7", "react-lowlight": "^3.0.0", "react-router-dom": "^6.2.1", diff --git a/ui-common/src/components/ServiceMapModal/ServiceMapModal.tsx b/ui-common/src/components/ServiceMapModal/ServiceMapModal.tsx index 9737891c4..266e1c108 100644 --- a/ui-common/src/components/ServiceMapModal/ServiceMapModal.tsx +++ b/ui-common/src/components/ServiceMapModal/ServiceMapModal.tsx @@ -78,15 +78,8 @@ export const ServiceMapModal: React.FC = ({ isOpen, onClos const serviceMapData: ServiceMapGraph = await getServiceMapDataApi() setServiceMapApiData(serviceMapData) const newGraphData: GraphData = { nodes: [], edges: [] } - - if (serviceMapData.nodes) { - newGraphData.nodes = serviceMapData.nodes.map(mapNodesDatatoGraph) - } - - if (serviceMapData.edges) { - newGraphData.edges = serviceMapData.edges.map(mapEdgesDatatoGraph) - } - + newGraphData.nodes = serviceMapData.nodes.map(mapNodesDatatoGraph) + newGraphData.edges = serviceMapData.edges.map(mapEdgesDatatoGraph) setGraphData(newGraphData) } catch (ex) { toast.error("An error occurred while loading Mizu Service Map, see console for mode details", { containerId: TOAST_CONTAINER_ID }); @@ -130,7 +123,7 @@ export const ServiceMapModal: React.FC = ({ isOpen, onClos return [...resolved, ...unResolved] }, [serviceMapApiData]) - const filterServiceMap = (newProtocolsFilters?: any[], newServiceFilters?: string[]) => { + const filterServiceMap = useCallback((newProtocolsFilters?: any[], newServiceFilters?: string[]) => { const filterProt = newProtocolsFilters || checkedProtocols const filterService = newServiceFilters || checkedServices setCheckedProtocols(filterProt) @@ -140,11 +133,15 @@ export const ServiceMapModal: React.FC = ({ isOpen, onClos edges: serviceMapApiData.edges?.filter(edge => filterProt.includes(edge.protocol.abbr)).map(mapEdgesDatatoGraph) } setGraphData(newGraphData); - } + }, [checkedProtocols, checkedServices, serviceMapApiData]) + + useEffect(() => { - if (checkedServices.length > 0) return // only after refresh - filterServiceMap(checkedProtocols, getServicesForFilter.map(x => x.key).filter(serviceName => !Utils.isIpAddress(serviceName))) + if (checkedServices.length > 0) + filterServiceMap() + else + filterServiceMap(checkedProtocols, getServicesForFilter.map(x => x.key).filter(serviceName => !Utils.isIpAddress(serviceName))) }, [getServicesForFilter]) useEffect(() => { @@ -176,7 +173,7 @@ export const ServiceMapModal: React.FC = ({ isOpen, onClos
- +
= ({
Displaying {entries?.length > MAX_ENTRIES ? MAX_ENTRIES : entries?.length} results out of {queriedTotal} total
- {startTime !== 0 &&
Started listening at First traffic entry time = ({label, value, selector = "", overrideQueryValue = "", displayIconOnMouseOver = true, useTooltip = true}) => { +const EntryViewLine: React.FC = ({ label, value, selector = "", overrideQueryValue = "", displayIconOnMouseOver = true, useTooltip = true }) => { let query: string; if (!selector) { query = ""; } else if (overrideQueryValue) { query = `${selector} == ${overrideQueryValue}`; - } else if (typeof(value) == "string") { + } else if (typeof (value) == "string") { query = `${selector} == "${JSON.stringify(value).slice(1, -1)}"`; } else { query = `${selector} == ${value}`; } return (label && - - - {label} - - - - - - ) || null; + + + {label} + + + + + + ) || null; } @@ -63,11 +63,11 @@ interface EntrySectionCollapsibleTitleProps { query?: string, } -const EntrySectionCollapsibleTitle: React.FC = ({title, color, expanded, setExpanded, query = ""}) => { +const EntrySectionCollapsibleTitle: React.FC = ({ title, color, expanded, setExpanded, query = "" }) => { return
{ setExpanded(!expanded) }} @@ -90,12 +90,12 @@ interface EntrySectionContainerProps { query?: string, } -export const EntrySectionContainer: React.FC = ({title, color, children, query = ""}) => { +export const EntrySectionContainer: React.FC = ({ title, color, children, query = "" }) => { const [expanded, setExpanded] = useState(true); return } + title={} > {children} @@ -130,6 +130,7 @@ export const EntryBodySection: React.FC = ({ const isBase64Encoding = encoding === 'base64'; const supportsPrettying = supportedFormats.some(format => contentType?.indexOf(format) > -1); + const [isDecodeGrpc, setIsDecodeGrpc] = useState(true); const formatTextBody = (body: any): string => { if (!decodeBase64) return body; @@ -141,7 +142,7 @@ export const EntryBodySection: React.FC = ({ if (jsonLikeFormats.some(format => contentType?.indexOf(format) > -1)) { if (!isPretty) return bodyBuf; return jsonBeautify(JSON.parse(bodyBuf), null, 2, 80); - } else if (xmlLikeFormats.some(format => contentType?.indexOf(format) > -1)) { + } else if (xmlLikeFormats.some(format => contentType?.indexOf(format) > -1)) { if (!isPretty) return bodyBuf; return xmlBeautify(bodyBuf, { indentation: ' ', @@ -157,49 +158,55 @@ export const EntryBodySection: React.FC = ({ return jsonBeautify(protobufDecoded, null, 2, 80); } } catch (error) { - console.error(error); + if(isDecodeGrpc) + setIsDecodeGrpc(false); + if (!String(error).includes("More than one message in")){ + console.error(error); + } } return bodyBuf; } return {content && content?.length > 0 && -
- {supportsPrettying &&
- {setIsPretty(!isPretty)}}/> + title={title} + color={color} + query={`${selector} == r".*"`} + > +
+ {supportsPrettying &&
+ { setIsPretty(!isPretty) }} />
} - {supportsPrettying && Pretty} + {supportsPrettying && Pretty} -
- {setShowLineNumbers(!showLineNumbers)}}/> +
+ { setShowLineNumbers(!showLineNumbers) }} />
- Line numbers - - {isBase64Encoding &&
- {setDecodeBase64(!decodeBase64)}}/> + Line numbers + {isBase64Encoding &&
+ { setDecodeBase64(!decodeBase64) }} />
} - {isBase64Encoding && Decode Base64} -
+ {isBase64Encoding && Decode Base64} + {!isDecodeGrpc && More than one message in protobuf payload is not supported} +
- + } } + interface EntrySectionProps { title: string, color: string, arrayToIterate: any[], } -export const EntryTableSection: React.FC = ({title, color, arrayToIterate}) => { +export const EntryTableSection: React.FC = ({ title, color, arrayToIterate }) => { let arrayToIterateSorted: any[]; if (arrayToIterate) { arrayToIterateSorted = arrayToIterate.sort((a, b) => { @@ -220,7 +227,7 @@ export const EntryTableSection: React.FC = ({title, color, ar - {arrayToIterateSorted.map(({name, value, selector}, index) => = ({title, color, ar />)}
-
: + : } } @@ -247,7 +254,7 @@ interface EntryPolicySectionCollapsibleTitleProps { setExpanded: any; } -const EntryPolicySectionCollapsibleTitle: React.FC = ({label, matched, expanded, setExpanded}) => { +const EntryPolicySectionCollapsibleTitle: React.FC = ({ label, matched, expanded, setExpanded }) => { return
- {label} - {matched} + {label} + {matched}
@@ -273,28 +280,28 @@ interface EntryPolicySectionContainerProps { children?: any; } -export const EntryPolicySectionContainer: React.FC = ({label, matched, children}) => { +export const EntryPolicySectionContainer: React.FC = ({ label, matched, children }) => { const [expanded, setExpanded] = useState(false); return } + title={} > {children} } -export const EntryTablePolicySection: React.FC = ({title, color, latency, arrayToIterate}) => { +export const EntryTablePolicySection: React.FC = ({ title, color, latency, arrayToIterate }) => { return { arrayToIterate && arrayToIterate.length > 0 ? - - - - {arrayToIterate.map(({rule, matched}, index) => { + +
+ + {arrayToIterate.map(({ rule, matched }, index) => { return ( - = latency : true)? "Success" : "Failure"}> + = latency : true) ? "Success" : "Failure"}> { { @@ -330,11 +337,11 @@ export const EntryTablePolicySection: React.FC = ({titl ) } - ) - } - -
-
+ ) + } + + +
: No rules could be applied to this request. }
@@ -347,7 +354,7 @@ interface EntryContractSectionProps { contractContent: string, } -export const EntryContractSection: React.FC = ({color, requestReason, responseReason, contractContent}) => { +export const EntryContractSection: React.FC = ({ color, requestReason, responseReason, contractContent }) => { return {requestReason && {requestReason} diff --git a/ui-common/src/components/TrafficViewer/EntryListItem/EntryListItem.module.sass b/ui-common/src/components/TrafficViewer/EntryListItem/EntryListItem.module.sass index 69ca738f8..199749224 100644 --- a/ui-common/src/components/TrafficViewer/EntryListItem/EntryListItem.module.sass +++ b/ui-common/src/components/TrafficViewer/EntryListItem/EntryListItem.module.sass @@ -67,7 +67,6 @@ .capture img height: 14px - z-index: 1000 margin-top: 12px margin-left: -2px diff --git a/ui-common/src/components/UI/Resizeable.tsx b/ui-common/src/components/UI/Resizeable.tsx index 305b3ea73..c72992f52 100644 --- a/ui-common/src/components/UI/Resizeable.tsx +++ b/ui-common/src/components/UI/Resizeable.tsx @@ -5,9 +5,10 @@ import styles from './style/Resizeable.module.sass' export interface Props { children minWidth: number + maxWidth?: number } -const Resizeable: React.FC = ({ children, minWidth }) => { +const Resizeable: React.FC = ({ children, minWidth, maxWidth }) => { const resizeble = useRef(null) let mousePos = { x: 0, y: 0 } let elementDimention = { w: 0, h: 0 } @@ -47,14 +48,11 @@ const Resizeable: React.FC = ({ children, minWidth }) => { }; return ( - -
- {children} -
- {/*
-- FutureUse*/} -
- -
+
+ {children} +
+ {/*
-- FutureUse*/} +
); }; diff --git a/ui-common/src/components/style/LoadingOverlay.module.sass b/ui-common/src/components/style/LoadingOverlay.module.sass index 2fd08b3bc..495a38ff3 100644 --- a/ui-common/src/components/style/LoadingOverlay.module.sass +++ b/ui-common/src/components/style/LoadingOverlay.module.sass @@ -8,6 +8,7 @@ align-items: center justify-content: center background-color: rgba(25, 25, 25, 0.5) + z-index: 1000 .loadingOverlaySpinner width: 60px diff --git a/ui/package.json b/ui/package.json index 4d6e96dc2..096d2b5b8 100644 --- a/ui/package.json +++ b/ui/package.json @@ -27,7 +27,6 @@ "node-fetch": "^3.1.1", "node-sass": "^6.0.0", "numeral": "^2.0.6", - "protobuf-decoder": "^0.1.0", "react": "^17.0.2", "react-copy-to-clipboard": "^5.0.3", "react-dom": "^17.0.2", diff --git a/ui/src/index.sass b/ui/src/index.sass index 38bdd9f0e..b9fd88849 100644 --- a/ui/src/index.sass +++ b/ui/src/index.sass @@ -139,6 +139,7 @@ button ::-webkit-scrollbar width: 6px + height: 6px ::-webkit-scrollbar-thumb background-color: $light-blue-color