mirror of
https://github.com/kubeshark/kubeshark.git
synced 2025-08-15 07:05:27 +00:00
Merge branch 'develop' into fix/better-close-other-dissectors
This commit is contained in:
commit
2a21059781
@ -320,6 +320,7 @@ func dialSocketWithRetry(socketAddress string, retryAmount int, retryDelay time.
|
|||||||
for i := 1; i < retryAmount; i++ {
|
for i := 1; i < retryAmount; i++ {
|
||||||
socketConnection, _, err := dialer.Dial(socketAddress, nil)
|
socketConnection, _, err := dialer.Dial(socketAddress, nil)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
lastErr = err
|
||||||
if i < retryAmount {
|
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)
|
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)
|
time.Sleep(retryDelay)
|
||||||
|
@ -123,22 +123,23 @@ func SendToSocket(socketId int, message []byte) error {
|
|||||||
return fmt.Errorf("socket %v is disconnected", socketId)
|
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
|
socketObj.lock.Lock() // gorilla socket panics from concurrent writes to a single socket
|
||||||
err := socketObj.connection.WriteMessage(1, message)
|
defer socketObj.lock.Unlock()
|
||||||
socketObj.lock.Unlock()
|
|
||||||
sent = true
|
|
||||||
|
|
||||||
if err != nil {
|
if connectedWebsockets[socketId] == nil {
|
||||||
return fmt.Errorf("failed to write message to socket %v, err: %w", socketId, err)
|
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
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -142,17 +142,18 @@ func (g *defaultOasGenerator) runGenerator() {
|
|||||||
|
|
||||||
func (g *defaultOasGenerator) handleEntry(mizuEntry *api.Entry) {
|
func (g *defaultOasGenerator) handleEntry(mizuEntry *api.Entry) {
|
||||||
if mizuEntry.Protocol.Name == "http" {
|
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)
|
entry, err := har.NewEntry(mizuEntry.Request, mizuEntry.Response, mizuEntry.StartTime, mizuEntry.ElapsedTime)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
logger.Log.Warningf("Failed to turn MizuEntry %d into HAR Entry: %s", mizuEntry.Id, err)
|
logger.Log.Warningf("Failed to turn MizuEntry %d into HAR Entry: %s", mizuEntry.Id, err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
dest := mizuEntry.Destination.Name
|
|
||||||
if dest == "" {
|
|
||||||
dest = mizuEntry.Destination.IP + ":" + mizuEntry.Destination.Port
|
|
||||||
}
|
|
||||||
|
|
||||||
entryWSource := &EntryWithSource{
|
entryWSource := &EntryWithSource{
|
||||||
Entry: *entry,
|
Entry: *entry,
|
||||||
Source: mizuEntry.Source.Name,
|
Source: mizuEntry.Source.Name,
|
||||||
|
20
cli/Makefile
20
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)
|
(cd bin && shasum -a 256 mizu_${SUFFIX} > mizu_${SUFFIX}.sha256)
|
||||||
|
|
||||||
build-all: ## Build for all supported platforms.
|
build-all: ## Build for all supported platforms.
|
||||||
@echo "Compiling for every OS and Platform"
|
echo "Compiling for every OS and Platform" && \
|
||||||
@mkdir -p bin && sed s/_VER_/$(VER)/g README.md.TEMPLATE > bin/README.md
|
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=amd64 && \
|
||||||
@$(MAKE) build GOOS=linux GOARCH=arm64
|
$(MAKE) build GOOS=linux GOARCH=arm64 && \
|
||||||
@$(MAKE) build GOOS=darwin GOARCH=amd64
|
$(MAKE) build GOOS=darwin GOARCH=amd64 && \
|
||||||
@$(MAKE) build GOOS=darwin GOARCH=arm64
|
$(MAKE) build GOOS=darwin GOARCH=arm64 && \
|
||||||
@$(MAKE) build GOOS=windows GOARCH=amd64
|
$(MAKE) build GOOS=windows GOARCH=amd64 && \
|
||||||
@mv ./bin/mizu_windows_amd64 ./bin/mizu.exe
|
mv ./bin/mizu_windows_amd64 ./bin/mizu.exe && \
|
||||||
@echo "---------"
|
echo "---------" && \
|
||||||
@find ./bin -ls
|
find ./bin -ls
|
||||||
|
|
||||||
clean: ## Clean all build artifacts.
|
clean: ## Clean all build artifacts.
|
||||||
go clean
|
go clean
|
||||||
|
@ -11,7 +11,6 @@ import (
|
|||||||
"github.com/up9inc/mizu/cli/uiUtils"
|
"github.com/up9inc/mizu/cli/uiUtils"
|
||||||
"github.com/up9inc/mizu/shared"
|
"github.com/up9inc/mizu/shared"
|
||||||
|
|
||||||
basenine "github.com/up9inc/basenine/server/lib"
|
|
||||||
"github.com/up9inc/mizu/shared/logger"
|
"github.com/up9inc/mizu/shared/logger"
|
||||||
"github.com/up9inc/mizu/shared/units"
|
"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
|
return insertionFilter
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -11,7 +11,6 @@ require (
|
|||||||
github.com/op/go-logging v0.0.0-20160315200505-970db520ece7
|
github.com/op/go-logging v0.0.0-20160315200505-970db520ece7
|
||||||
github.com/spf13/cobra v1.3.0
|
github.com/spf13/cobra v1.3.0
|
||||||
github.com/spf13/pflag v1.0.5
|
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
|
github.com/up9inc/mizu/shared v0.0.0
|
||||||
golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8
|
golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8
|
||||||
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b
|
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b
|
||||||
@ -32,11 +31,8 @@ require (
|
|||||||
github.com/MakeNowJust/heredoc v1.0.0 // indirect
|
github.com/MakeNowJust/heredoc v1.0.0 // indirect
|
||||||
github.com/PuerkitoBio/purell v1.1.1 // indirect
|
github.com/PuerkitoBio/purell v1.1.1 // indirect
|
||||||
github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 // 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/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/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/docker/go-units v0.4.0 // indirect
|
||||||
github.com/evanphx/json-patch v5.6.0+incompatible // indirect
|
github.com/evanphx/json-patch v5.6.0+incompatible // indirect
|
||||||
github.com/exponent-io/jsonpath v0.0.0-20210407135951-1de76d718b3f // 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/modern-go/reflect2 v1.0.2 // indirect
|
||||||
github.com/monochromegane/go-gitignore v0.0.0-20200626010858-205db1a8cc00 // 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/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/peterbourgon/diskv v2.0.1+incompatible // indirect
|
||||||
github.com/pkg/errors v0.9.1 // indirect
|
github.com/pkg/errors v0.9.1 // indirect
|
||||||
github.com/pmezard/go-difflib v1.0.0 // indirect
|
github.com/pmezard/go-difflib v1.0.0 // indirect
|
||||||
|
12
cli/go.sum
12
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/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 h1:d+Bc7a5rLufV/sSk/8dngufqelfh6jnri85riMAaF/M=
|
||||||
github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE=
|
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-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=
|
||||||
github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/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=
|
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/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/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/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/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-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc=
|
||||||
github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk=
|
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/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/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/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/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 h1:3uh0PgVws3nIA0Q+MwDC8yjEPf9zjRfZZWXZYDct3Tw=
|
||||||
github.com/docker/go-units v0.4.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk=
|
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/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 h1:DQuhQpB1tVlglWS2hLQ5OV6B5r8aGxSrPc5Qo6uTN78=
|
||||||
github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A=
|
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/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/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=
|
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/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/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/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/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 v0.0.0-20181112141820-a009c3971eca/go.mod h1:ce1O1j6UtZfjr22oyGxGLbauSBp2YVXpARAosm7dHBg=
|
||||||
github.com/xlab/treeprint v1.1.0 h1:G/1DjNkPpfZCFt9CSh6b5/nY4VimlbHF3Rh4obvtzDk=
|
github.com/xlab/treeprint v1.1.0 h1:G/1DjNkPpfZCFt9CSh6b5/nY4VimlbHF3Rh4obvtzDk=
|
||||||
|
@ -49,7 +49,7 @@
|
|||||||
"moment": "^2.29.1",
|
"moment": "^2.29.1",
|
||||||
"node-fetch": "^3.1.1",
|
"node-fetch": "^3.1.1",
|
||||||
"numeral": "^2.0.6",
|
"numeral": "^2.0.6",
|
||||||
"protobuf-decoder": "^0.1.0",
|
"protobuf-decoder": "^0.1.2",
|
||||||
"react-graph-vis": "^1.0.7",
|
"react-graph-vis": "^1.0.7",
|
||||||
"react-lowlight": "^3.0.0",
|
"react-lowlight": "^3.0.0",
|
||||||
"react-router-dom": "^6.2.1",
|
"react-router-dom": "^6.2.1",
|
||||||
|
@ -78,15 +78,8 @@ export const ServiceMapModal: React.FC<ServiceMapModalProps> = ({ isOpen, onClos
|
|||||||
const serviceMapData: ServiceMapGraph = await getServiceMapDataApi()
|
const serviceMapData: ServiceMapGraph = await getServiceMapDataApi()
|
||||||
setServiceMapApiData(serviceMapData)
|
setServiceMapApiData(serviceMapData)
|
||||||
const newGraphData: GraphData = { nodes: [], edges: [] }
|
const newGraphData: GraphData = { nodes: [], edges: [] }
|
||||||
|
|
||||||
if (serviceMapData.nodes) {
|
|
||||||
newGraphData.nodes = serviceMapData.nodes.map(mapNodesDatatoGraph)
|
newGraphData.nodes = serviceMapData.nodes.map(mapNodesDatatoGraph)
|
||||||
}
|
|
||||||
|
|
||||||
if (serviceMapData.edges) {
|
|
||||||
newGraphData.edges = serviceMapData.edges.map(mapEdgesDatatoGraph)
|
newGraphData.edges = serviceMapData.edges.map(mapEdgesDatatoGraph)
|
||||||
}
|
|
||||||
|
|
||||||
setGraphData(newGraphData)
|
setGraphData(newGraphData)
|
||||||
} catch (ex) {
|
} catch (ex) {
|
||||||
toast.error("An error occurred while loading Mizu Service Map, see console for mode details", { containerId: TOAST_CONTAINER_ID });
|
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<ServiceMapModalProps> = ({ isOpen, onClos
|
|||||||
return [...resolved, ...unResolved]
|
return [...resolved, ...unResolved]
|
||||||
}, [serviceMapApiData])
|
}, [serviceMapApiData])
|
||||||
|
|
||||||
const filterServiceMap = (newProtocolsFilters?: any[], newServiceFilters?: string[]) => {
|
const filterServiceMap = useCallback((newProtocolsFilters?: any[], newServiceFilters?: string[]) => {
|
||||||
const filterProt = newProtocolsFilters || checkedProtocols
|
const filterProt = newProtocolsFilters || checkedProtocols
|
||||||
const filterService = newServiceFilters || checkedServices
|
const filterService = newServiceFilters || checkedServices
|
||||||
setCheckedProtocols(filterProt)
|
setCheckedProtocols(filterProt)
|
||||||
@ -140,10 +133,14 @@ export const ServiceMapModal: React.FC<ServiceMapModalProps> = ({ isOpen, onClos
|
|||||||
edges: serviceMapApiData.edges?.filter(edge => filterProt.includes(edge.protocol.abbr)).map(mapEdgesDatatoGraph)
|
edges: serviceMapApiData.edges?.filter(edge => filterProt.includes(edge.protocol.abbr)).map(mapEdgesDatatoGraph)
|
||||||
}
|
}
|
||||||
setGraphData(newGraphData);
|
setGraphData(newGraphData);
|
||||||
}
|
}, [checkedProtocols, checkedServices, serviceMapApiData])
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (checkedServices.length > 0) return // only after refresh
|
if (checkedServices.length > 0)
|
||||||
|
filterServiceMap()
|
||||||
|
else
|
||||||
filterServiceMap(checkedProtocols, getServicesForFilter.map(x => x.key).filter(serviceName => !Utils.isIpAddress(serviceName)))
|
filterServiceMap(checkedProtocols, getServicesForFilter.map(x => x.key).filter(serviceName => !Utils.isIpAddress(serviceName)))
|
||||||
}, [getServicesForFilter])
|
}, [getServicesForFilter])
|
||||||
|
|
||||||
@ -176,7 +173,7 @@ export const ServiceMapModal: React.FC<ServiceMapModalProps> = ({ isOpen, onClos
|
|||||||
<Box sx={modalStyle}>
|
<Box sx={modalStyle}>
|
||||||
<div className={styles.modalContainer}>
|
<div className={styles.modalContainer}>
|
||||||
<div className={styles.filterSection}>
|
<div className={styles.filterSection}>
|
||||||
<Resizeable minWidth={170}>
|
<Resizeable minWidth={170} maxWidth={320}>
|
||||||
<div className={styles.filterWrapper}>
|
<div className={styles.filterWrapper}>
|
||||||
<div className={styles.protocolsFilterList}>
|
<div className={styles.protocolsFilterList}>
|
||||||
<SelectList items={protocols} checkBoxWidth="5%" tableName={"Protocols"} multiSelect={true}
|
<SelectList items={protocols} checkBoxWidth="5%" tableName={"Protocols"} multiSelect={true}
|
||||||
|
@ -67,11 +67,11 @@ const ServiceMapOptions = {
|
|||||||
color: '#343434',
|
color: '#343434',
|
||||||
size: 12, // px
|
size: 12, // px
|
||||||
face: 'arial',
|
face: 'arial',
|
||||||
background: 'none',
|
background: 'rgba(255,255,255,0.7)',
|
||||||
strokeWidth: 2, // px
|
strokeWidth: 2, // px
|
||||||
strokeColor: '#ffffff',
|
strokeColor: '#ffffff',
|
||||||
align: 'horizontal',
|
align: 'horizontal',
|
||||||
multi: false,
|
multi: false
|
||||||
},
|
},
|
||||||
labelHighlightBold: true,
|
labelHighlightBold: true,
|
||||||
selectionWidth: 1,
|
selectionWidth: 1,
|
||||||
|
@ -212,7 +212,7 @@ export const EntriesList: React.FC<EntriesListProps> = ({
|
|||||||
<div>Displaying <b id="entries-length">{entries?.length > MAX_ENTRIES ? MAX_ENTRIES : entries?.length}</b> results out of <b
|
<div>Displaying <b id="entries-length">{entries?.length > MAX_ENTRIES ? MAX_ENTRIES : entries?.length}</b> results out of <b
|
||||||
id="total-entries">{queriedTotal}</b> total
|
id="total-entries">{queriedTotal}</b> total
|
||||||
</div>
|
</div>
|
||||||
{startTime !== 0 && <div>Started listening at <span style={{
|
{startTime !== 0 && <div>First traffic entry time <span style={{
|
||||||
marginRight: 5,
|
marginRight: 5,
|
||||||
fontWeight: 600,
|
fontWeight: 600,
|
||||||
fontSize: 13
|
fontSize: 13
|
||||||
|
@ -130,6 +130,7 @@ export const EntryBodySection: React.FC<EntryBodySectionProps> = ({
|
|||||||
|
|
||||||
const isBase64Encoding = encoding === 'base64';
|
const isBase64Encoding = encoding === 'base64';
|
||||||
const supportsPrettying = supportedFormats.some(format => contentType?.indexOf(format) > -1);
|
const supportsPrettying = supportedFormats.some(format => contentType?.indexOf(format) > -1);
|
||||||
|
const [isDecodeGrpc, setIsDecodeGrpc] = useState(true);
|
||||||
|
|
||||||
const formatTextBody = (body: any): string => {
|
const formatTextBody = (body: any): string => {
|
||||||
if (!decodeBase64) return body;
|
if (!decodeBase64) return body;
|
||||||
@ -157,8 +158,12 @@ export const EntryBodySection: React.FC<EntryBodySectionProps> = ({
|
|||||||
return jsonBeautify(protobufDecoded, null, 2, 80);
|
return jsonBeautify(protobufDecoded, null, 2, 80);
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
if(isDecodeGrpc)
|
||||||
|
setIsDecodeGrpc(false);
|
||||||
|
if (!String(error).includes("More than one message in")){
|
||||||
console.error(error);
|
console.error(error);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return bodyBuf;
|
return bodyBuf;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -178,21 +183,23 @@ export const EntryBodySection: React.FC<EntryBodySectionProps> = ({
|
|||||||
<Checkbox checked={showLineNumbers} onToggle={() => { setShowLineNumbers(!showLineNumbers) }} />
|
<Checkbox checked={showLineNumbers} onToggle={() => { setShowLineNumbers(!showLineNumbers) }} />
|
||||||
</div>
|
</div>
|
||||||
<span style={{ marginLeft: '.2rem' }}>Line numbers</span>
|
<span style={{ marginLeft: '.2rem' }}>Line numbers</span>
|
||||||
|
|
||||||
{isBase64Encoding && <div style={{ paddingTop: 3, paddingLeft: 20 }}>
|
{isBase64Encoding && <div style={{ paddingTop: 3, paddingLeft: 20 }}>
|
||||||
<Checkbox checked={decodeBase64} onToggle={() => { setDecodeBase64(!decodeBase64) }} />
|
<Checkbox checked={decodeBase64} onToggle={() => { setDecodeBase64(!decodeBase64) }} />
|
||||||
</div>}
|
</div>}
|
||||||
{isBase64Encoding && <span style={{ marginLeft: '.2rem' }}>Decode Base64</span>}
|
{isBase64Encoding && <span style={{ marginLeft: '.2rem' }}>Decode Base64</span>}
|
||||||
|
{!isDecodeGrpc && <span style={{ fontSize: '12px', color: '#DB2156', marginLeft: '.8rem' }}>More than one message in protobuf payload is not supported</span>}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<SyntaxHighlighter
|
<SyntaxHighlighter
|
||||||
code={formatTextBody(content)}
|
code={formatTextBody(content)}
|
||||||
showLineNumbers={showLineNumbers}
|
showLineNumbers={showLineNumbers}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
</EntrySectionContainer>}
|
</EntrySectionContainer>}
|
||||||
</React.Fragment>
|
</React.Fragment>
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
interface EntrySectionProps {
|
interface EntrySectionProps {
|
||||||
title: string,
|
title: string,
|
||||||
color: string,
|
color: string,
|
||||||
|
@ -67,7 +67,6 @@
|
|||||||
|
|
||||||
.capture img
|
.capture img
|
||||||
height: 14px
|
height: 14px
|
||||||
z-index: 1000
|
|
||||||
margin-top: 12px
|
margin-top: 12px
|
||||||
margin-left: -2px
|
margin-left: -2px
|
||||||
|
|
||||||
|
@ -5,9 +5,10 @@ import styles from './style/Resizeable.module.sass'
|
|||||||
export interface Props {
|
export interface Props {
|
||||||
children
|
children
|
||||||
minWidth: number
|
minWidth: number
|
||||||
|
maxWidth?: number
|
||||||
}
|
}
|
||||||
|
|
||||||
const Resizeable: React.FC<Props> = ({ children, minWidth }) => {
|
const Resizeable: React.FC<Props> = ({ children, minWidth, maxWidth }) => {
|
||||||
const resizeble = useRef(null)
|
const resizeble = useRef(null)
|
||||||
let mousePos = { x: 0, y: 0 }
|
let mousePos = { x: 0, y: 0 }
|
||||||
let elementDimention = { w: 0, h: 0 }
|
let elementDimention = { w: 0, h: 0 }
|
||||||
@ -47,14 +48,11 @@ const Resizeable: React.FC<Props> = ({ children, minWidth }) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<React.Fragment>
|
<div className={styles.resizable} ref={resizeble} style={{ width: elemWidth, maxWidth: maxWidth }}>
|
||||||
<div className={styles.resizable} ref={resizeble} style={{ width: elemWidth }}>
|
|
||||||
{children}
|
{children}
|
||||||
<div className={`${styles.resizer} ${styles.resizerRight}`} onMouseDown={mouseDownHandler}></div>
|
<div className={`${styles.resizer} ${styles.resizerRight}`} onMouseDown={mouseDownHandler}></div>
|
||||||
{/* <div className={`${styles.resizer} ${styles.resizerB}`} onMouseDown={mouseDownHandler}></div> -- FutureUse*/}
|
{/* <div className={`${styles.resizer} ${styles.resizerB}`} onMouseDown={mouseDownHandler}></div> -- FutureUse*/}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</React.Fragment>
|
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -8,6 +8,7 @@
|
|||||||
align-items: center
|
align-items: center
|
||||||
justify-content: center
|
justify-content: center
|
||||||
background-color: rgba(25, 25, 25, 0.5)
|
background-color: rgba(25, 25, 25, 0.5)
|
||||||
|
z-index: 1000
|
||||||
|
|
||||||
.loadingOverlaySpinner
|
.loadingOverlaySpinner
|
||||||
width: 60px
|
width: 60px
|
||||||
|
@ -27,7 +27,6 @@
|
|||||||
"node-fetch": "^3.1.1",
|
"node-fetch": "^3.1.1",
|
||||||
"node-sass": "^6.0.0",
|
"node-sass": "^6.0.0",
|
||||||
"numeral": "^2.0.6",
|
"numeral": "^2.0.6",
|
||||||
"protobuf-decoder": "^0.1.0",
|
|
||||||
"react": "^17.0.2",
|
"react": "^17.0.2",
|
||||||
"react-copy-to-clipboard": "^5.0.3",
|
"react-copy-to-clipboard": "^5.0.3",
|
||||||
"react-dom": "^17.0.2",
|
"react-dom": "^17.0.2",
|
||||||
|
@ -139,6 +139,7 @@ button
|
|||||||
|
|
||||||
::-webkit-scrollbar
|
::-webkit-scrollbar
|
||||||
width: 6px
|
width: 6px
|
||||||
|
height: 6px
|
||||||
|
|
||||||
::-webkit-scrollbar-thumb
|
::-webkit-scrollbar-thumb
|
||||||
background-color: $light-blue-color
|
background-color: $light-blue-color
|
||||||
|
Loading…
Reference in New Issue
Block a user