diff --git a/agent/go.mod b/agent/go.mod index f11dd0116..35ea35695 100644 --- a/agent/go.mod +++ b/agent/go.mod @@ -17,7 +17,7 @@ require ( github.com/orcaman/concurrent-map v0.0.0-20210106121528-16402b402231 github.com/ory/kratos-client-go v0.8.2-alpha.1 github.com/patrickmn/go-cache v2.1.0+incompatible - github.com/up9inc/basenine/client/go v0.0.0-20220107003657-7c0578359920 + github.com/up9inc/basenine/client/go v0.0.0-20220110083745-04fbc6c2068d github.com/up9inc/mizu/shared v0.0.0 github.com/up9inc/mizu/tap v0.0.0 github.com/up9inc/mizu/tap/api v0.0.0 diff --git a/agent/go.sum b/agent/go.sum index 2fd853b26..70ebea0e2 100644 --- a/agent/go.sum +++ b/agent/go.sum @@ -472,8 +472,8 @@ github.com/ugorji/go v1.1.7 h1:/68gy2h+1mWMrwZFeD1kQialdSzAb432dtpeJ42ovdo= github.com/ugorji/go v1.1.7/go.mod h1:kZn38zHttfInRq0xu/PH0az30d+z6vm202qpg1oXVMw= github.com/ugorji/go/codec v1.1.7 h1:2SvQaVZ1ouYrrKKwoSk2pzd4A9evlKJb9oTL+OaLUSs= github.com/ugorji/go/codec v1.1.7/go.mod h1:Ax+UKWsSmolVDwsd+7N3ZtXu+yMGCf907BLYF3GoBXY= -github.com/up9inc/basenine/client/go v0.0.0-20220107003657-7c0578359920 h1:QQpgRleNNpxxAG/rKmk4dwJh0jHyRaQz4QOVlPmqv1c= -github.com/up9inc/basenine/client/go v0.0.0-20220107003657-7c0578359920/go.mod h1:SvJGPoa/6erhUQV7kvHBwM/0x5LyO6XaG2lUaCaKiUI= +github.com/up9inc/basenine/client/go v0.0.0-20220110083745-04fbc6c2068d h1:WTz53dcfqCIWZpZLQoHbIcNc21s0ZHEZH7EqMPp99qQ= +github.com/up9inc/basenine/client/go v0.0.0-20220110083745-04fbc6c2068d/go.mod h1:SvJGPoa/6erhUQV7kvHBwM/0x5LyO6XaG2lUaCaKiUI= github.com/vektah/gqlparser v1.1.2/go.mod h1:1ycwN7Ij5njmMkPPAOaRFY4rET2Enx7IkVv3vaXspKw= github.com/vishvananda/netns v0.0.0-20210104183010-2eb08e3e575f h1:p4VB7kIXpOQvVn1ZaTIVp+3vuYAXFe3OJEvjbUYJLaA= github.com/vishvananda/netns v0.0.0-20210104183010-2eb08e3e575f/go.mod h1:DD4vA1DwXk04H54A1oHXtwZmA0grkVMdPxx/VGLCah0= diff --git a/agent/pkg/api/main.go b/agent/pkg/api/main.go index 42f86817a..e0d8bb1cb 100644 --- a/agent/pkg/api/main.go +++ b/agent/pkg/api/main.go @@ -119,15 +119,12 @@ func startReadingChannel(outputItems <-chan *tapApi.OutputChannelItem, extension extension := extensionsMap[item.Protocol.Name] resolvedSource, resolvedDestionation := resolveIP(item.ConnectionInfo) mizuEntry := extension.Dissector.Analyze(item, resolvedSource, resolvedDestionation) - baseEntry := extension.Dissector.Summarize(mizuEntry) - mizuEntry.Base = baseEntry if extension.Protocol.Name == "http" { if !disableOASValidation { var httpPair tapApi.HTTPRequestResponsePair json.Unmarshal([]byte(mizuEntry.HTTPPair), &httpPair) contract := handleOAS(ctx, doc, router, httpPair.Request.Payload.RawRequest, httpPair.Response.Payload.RawResponse, contractContent) - baseEntry.ContractStatus = contract.Status mizuEntry.ContractStatus = contract.Status mizuEntry.ContractRequestReason = contract.RequestReason mizuEntry.ContractResponseReason = contract.ResponseReason @@ -137,7 +134,7 @@ func startReadingChannel(outputItems <-chan *tapApi.OutputChannelItem, extension harEntry, err := utils.NewEntry(mizuEntry.Request, mizuEntry.Response, mizuEntry.StartTime, mizuEntry.ElapsedTime) if err == nil { rules, _, _ := models.RunValidationRulesState(*harEntry, mizuEntry.Destination.Name) - baseEntry.Rules = rules + mizuEntry.Rules = rules } } diff --git a/agent/pkg/api/socket_routes.go b/agent/pkg/api/socket_routes.go index 41a1064e6..3118e8696 100644 --- a/agent/pkg/api/socket_routes.go +++ b/agent/pkg/api/socket_routes.go @@ -16,6 +16,7 @@ import ( "github.com/up9inc/mizu/shared" "github.com/up9inc/mizu/shared/debounce" "github.com/up9inc/mizu/shared/logger" + tapApi "github.com/up9inc/mizu/tap/api" ) type EventHandlers interface { @@ -131,18 +132,10 @@ func websocketHandler(w http.ResponseWriter, r *http.Request, eventHandlers Even return } - var dataMap map[string]interface{} - err = json.Unmarshal(bytes, &dataMap) + var entry *tapApi.Entry + err = json.Unmarshal(bytes, &entry) - var base map[string]interface{} - switch dataMap["base"].(type) { - case map[string]interface{}: - base = dataMap["base"].(map[string]interface{}) - base["id"] = uint(dataMap["id"].(float64)) - default: - logger.Log.Debugf("Base field has an unrecognized type: %+v", dataMap) - continue - } + base := tapApi.Summarize(entry) baseEntryBytes, _ := models.CreateBaseEntryWebSocketMessage(base) SendToSocket(socketId, baseEntryBytes) diff --git a/agent/pkg/controllers/entries_controller.go b/agent/pkg/controllers/entries_controller.go index 0b2f0724a..61a2b2301 100644 --- a/agent/pkg/controllers/entries_controller.go +++ b/agent/pkg/controllers/entries_controller.go @@ -64,8 +64,8 @@ func GetEntries(c *gin.Context) { var dataSlice []interface{} for _, row := range data { - var dataMap map[string]interface{} - err = json.Unmarshal(row, &dataMap) + var entry *tapApi.Entry + err = json.Unmarshal(row, &entry) if err != nil { c.JSON(http.StatusBadRequest, gin.H{ "error": true, @@ -76,8 +76,7 @@ func GetEntries(c *gin.Context) { return // exit } - base := dataMap["base"].(map[string]interface{}) - base["id"] = uint(dataMap["id"].(float64)) + base := tapApi.Summarize(entry) dataSlice = append(dataSlice, base) } @@ -95,9 +94,19 @@ func GetEntries(c *gin.Context) { } func GetEntry(c *gin.Context) { + singleEntryRequest := &models.SingleEntryRequest{} + + if err := c.BindQuery(singleEntryRequest); err != nil { + c.JSON(http.StatusBadRequest, err) + } + validationError := validation.Validate(singleEntryRequest) + if validationError != nil { + c.JSON(http.StatusBadRequest, validationError) + } + id, _ := strconv.Atoi(c.Param("id")) - var entry tapApi.MizuEntry - bytes, err := basenine.Single(shared.BasenineHost, shared.BaseninePort, id) + var entry *tapApi.Entry + bytes, err := basenine.Single(shared.BasenineHost, shared.BaseninePort, id, singleEntryRequest.Query) if Error(c, err) { return // exit } @@ -125,7 +134,7 @@ func GetEntry(c *gin.Context) { json.Unmarshal(inrec, &rules) } - c.JSON(http.StatusOK, tapApi.MizuEntryWrapper{ + c.JSON(http.StatusOK, tapApi.EntryWrapper{ Protocol: entry.Protocol, Representation: string(representation), BodySize: bodySize, diff --git a/agent/pkg/models/models.go b/agent/pkg/models/models.go index 3ed193db2..7f9ee101b 100644 --- a/agent/pkg/models/models.go +++ b/agent/pkg/models/models.go @@ -12,7 +12,7 @@ import ( "github.com/up9inc/mizu/tap" ) -func GetEntry(r *tapApi.MizuEntry, v tapApi.DataUnmarshaler) error { +func GetEntry(r *tapApi.Entry, v tapApi.DataUnmarshaler) error { return v.UnmarshalData(r) } @@ -28,6 +28,10 @@ type EntriesRequest struct { TimeoutMs int `form:"timeoutMs" validate:"min=1"` } +type SingleEntryRequest struct { + Query string `form:"query"` +} + type EntriesResponse struct { Data []interface{} `json:"data"` Meta *basenine.Metadata `json:"meta"` @@ -35,7 +39,7 @@ type EntriesResponse struct { type WebSocketEntryMessage struct { *shared.WebSocketMessageMetadata - Data map[string]interface{} `json:"data,omitempty"` + Data *tapApi.BaseEntry `json:"data,omitempty"` } type WebSocketTappedEntryMessage struct { @@ -74,7 +78,7 @@ type WebSocketStartTimeMessage struct { Data int64 `json:"data"` } -func CreateBaseEntryWebSocketMessage(base map[string]interface{}) ([]byte, error) { +func CreateBaseEntryWebSocketMessage(base *tapApi.BaseEntry) ([]byte, error) { message := &WebSocketEntryMessage{ WebSocketMessageMetadata: &shared.WebSocketMessageMetadata{ MessageType: shared.WebSocketMessageTypeEntry, diff --git a/agent/pkg/up9/main.go b/agent/pkg/up9/main.go index e44c2b9e2..54405b5e1 100644 --- a/agent/pkg/up9/main.go +++ b/agent/pkg/up9/main.go @@ -243,7 +243,7 @@ func syncEntriesImpl(token string, model string, envPrefix string, uploadInterva var dataMap map[string]interface{} err = json.Unmarshal(dataBytes, &dataMap) - var entry tapApi.MizuEntry + var entry tapApi.Entry if err := json.Unmarshal([]byte(dataBytes), &entry); err != nil { continue } diff --git a/deploy/kubernetes/helm-chart/values.yaml b/deploy/kubernetes/helm-chart/values.yaml index 3beb7b3c4..2a5e85065 100644 --- a/deploy/kubernetes/helm-chart/values.yaml +++ b/deploy/kubernetes/helm-chart/values.yaml @@ -32,7 +32,7 @@ container: port: 9099 image: repository: "709825985650.dkr.ecr.us-east-1.amazonaws.com/up9/basenine" - tag: "v0.2.26" + tag: "v0.3.0" kratos: name: "kratos" port: 4433 diff --git a/shared/consts.go b/shared/consts.go index 5c7b18f50..a6c90a63b 100644 --- a/shared/consts.go +++ b/shared/consts.go @@ -17,5 +17,5 @@ const ( BasenineHost = "127.0.0.1" BaseninePort = "9099" BasenineImageRepo = "ghcr.io/up9inc/basenine" - BasenineImageTag = "v0.2.26" + BasenineImageTag = "v0.3.0" ) diff --git a/tap/api/api.go b/tap/api/api.go index 3b1f9834a..c90405f3b 100644 --- a/tap/api/api.go +++ b/tap/api/api.go @@ -81,7 +81,7 @@ type OutputChannelItem struct { Timestamp int64 ConnectionInfo *ConnectionInfo Pair *RequestResponsePair - Summary *BaseEntryDetails + Summary *BaseEntry } type SuperTimer struct { @@ -97,8 +97,7 @@ type Dissector interface { Register(*Extension) Ping() Dissect(b *bufio.Reader, isClient bool, tcpID *TcpID, counterPair *CounterPair, superTimer *SuperTimer, superIdentifier *SuperIdentifier, emitter Emitter, options *TrafficFilteringOptions) error - Analyze(item *OutputChannelItem, resolvedSource string, resolvedDestination string) *MizuEntry - Summarize(entry *MizuEntry) *BaseEntryDetails + Analyze(item *OutputChannelItem, resolvedSource string, resolvedDestination string) *Entry Represent(request map[string]interface{}, response map[string]interface{}) (object []byte, bodySize int64, err error) Macros() map[string]string } @@ -117,7 +116,7 @@ func (e *Emitting) Emit(item *OutputChannelItem) { e.AppStats.IncMatchedPairs() } -type MizuEntry struct { +type Entry struct { Id uint `json:"id"` Protocol Protocol `json:"proto"` Source *TCP `json:"src"` @@ -127,13 +126,13 @@ type MizuEntry struct { StartTime time.Time `json:"startTime"` Request map[string]interface{} `json:"request"` Response map[string]interface{} `json:"response"` - Base *BaseEntryDetails `json:"base"` Summary string `json:"summary"` Method string `json:"method"` Status int `json:"status"` ElapsedTime int64 `json:"elapsedTime"` Path string `json:"path"` IsOutgoing bool `json:"isOutgoing,omitempty"` + Rules ApplicableRules `json:"rules,omitempty"` ContractStatus ContractStatus `json:"contractStatus,omitempty"` ContractRequestReason string `json:"contractRequestReason,omitempty"` ContractResponseReason string `json:"contractResponseReason,omitempty"` @@ -141,22 +140,22 @@ type MizuEntry struct { HTTPPair string `json:"httpPair,omitempty"` } -type MizuEntryWrapper struct { +type EntryWrapper struct { Protocol Protocol `json:"protocol"` Representation string `json:"representation"` BodySize int64 `json:"bodySize"` - Data MizuEntry `json:"data"` + Data *Entry `json:"data"` Rules []map[string]interface{} `json:"rulesMatched,omitempty"` IsRulesEnabled bool `json:"isRulesEnabled"` } -type BaseEntryDetails struct { +type BaseEntry struct { Id uint `json:"id"` - Protocol Protocol `json:"protocol,omitempty"` + Protocol Protocol `json:"proto,omitempty"` Url string `json:"url,omitempty"` Path string `json:"path,omitempty"` Summary string `json:"summary,omitempty"` - StatusCode int `json:"statusCode"` + StatusCode int `json:"status"` Method string `json:"method,omitempty"` Timestamp int64 `json:"timestamp,omitempty"` Source *TCP `json:"src"` @@ -182,11 +181,29 @@ type Contract struct { Content string `json:"content"` } -type DataUnmarshaler interface { - UnmarshalData(*MizuEntry) error +func Summarize(entry *Entry) *BaseEntry { + return &BaseEntry{ + Id: entry.Id, + Protocol: entry.Protocol, + Path: entry.Path, + Summary: entry.Summary, + StatusCode: entry.Status, + Method: entry.Method, + Timestamp: entry.Timestamp, + Source: entry.Source, + Destination: entry.Destination, + IsOutgoing: entry.IsOutgoing, + Latency: entry.ElapsedTime, + Rules: entry.Rules, + ContractStatus: entry.ContractStatus, + } } -func (bed *BaseEntryDetails) UnmarshalData(entry *MizuEntry) error { +type DataUnmarshaler interface { + UnmarshalData(*Entry) error +} + +func (bed *BaseEntry) UnmarshalData(entry *Entry) error { bed.Protocol = entry.Protocol bed.Id = entry.Id bed.Path = entry.Path diff --git a/tap/extensions/amqp/main.go b/tap/extensions/amqp/main.go index 01bd2fac6..8de968b3c 100644 --- a/tap/extensions/amqp/main.go +++ b/tap/extensions/amqp/main.go @@ -223,7 +223,7 @@ func (d dissecting) Dissect(b *bufio.Reader, isClient bool, tcpID *api.TcpID, co } } -func (d dissecting) Analyze(item *api.OutputChannelItem, resolvedSource string, resolvedDestination string) *api.MizuEntry { +func (d dissecting) Analyze(item *api.OutputChannelItem, resolvedSource string, resolvedDestination string) *api.Entry { request := item.Pair.Request.Payload.(map[string]interface{}) reqDetails := request["details"].(map[string]interface{}) @@ -261,7 +261,7 @@ func (d dissecting) Analyze(item *api.OutputChannelItem, resolvedSource string, request["url"] = summary reqDetails["method"] = request["method"] - return &api.MizuEntry{ + return &api.Entry{ Protocol: protocol, Source: &api.TCP{ Name: resolvedSource, @@ -286,25 +286,6 @@ func (d dissecting) Analyze(item *api.OutputChannelItem, resolvedSource string, } -func (d dissecting) Summarize(entry *api.MizuEntry) *api.BaseEntryDetails { - return &api.BaseEntryDetails{ - Id: entry.Id, - Protocol: protocol, - Summary: entry.Summary, - StatusCode: entry.Status, - Method: entry.Method, - Timestamp: entry.Timestamp, - Source: entry.Source, - Destination: entry.Destination, - IsOutgoing: entry.IsOutgoing, - Latency: entry.ElapsedTime, - Rules: api.ApplicableRules{ - Latency: 0, - Status: false, - }, - } -} - func (d dissecting) Represent(request map[string]interface{}, response map[string]interface{}) (object []byte, bodySize int64, err error) { bodySize = 0 representation := make(map[string]interface{}, 0) diff --git a/tap/extensions/http/main.go b/tap/extensions/http/main.go index 26cf40c8c..b443867de 100644 --- a/tap/extensions/http/main.go +++ b/tap/extensions/http/main.go @@ -157,7 +157,7 @@ func (d dissecting) Dissect(b *bufio.Reader, isClient bool, tcpID *api.TcpID, co return nil } -func (d dissecting) Analyze(item *api.OutputChannelItem, resolvedSource string, resolvedDestination string) *api.MizuEntry { +func (d dissecting) Analyze(item *api.OutputChannelItem, resolvedSource string, resolvedDestination string) *api.Entry { var host, authority, path string request := item.Pair.Request.Payload.(map[string]interface{}) @@ -241,7 +241,7 @@ func (d dissecting) Analyze(item *api.OutputChannelItem, resolvedSource string, elapsedTime = 0 } httpPair, _ := json.Marshal(item.Pair) - return &api.MizuEntry{ + return &api.Entry{ Protocol: item.Protocol, Source: &api.TCP{ Name: resolvedSource, @@ -267,26 +267,6 @@ func (d dissecting) Analyze(item *api.OutputChannelItem, resolvedSource string, } } -func (d dissecting) Summarize(entry *api.MizuEntry) *api.BaseEntryDetails { - return &api.BaseEntryDetails{ - Id: entry.Id, - Protocol: entry.Protocol, - Path: entry.Path, - Summary: entry.Summary, - StatusCode: entry.Status, - Method: entry.Method, - Timestamp: entry.Timestamp, - Source: entry.Source, - Destination: entry.Destination, - IsOutgoing: entry.IsOutgoing, - Latency: entry.ElapsedTime, - Rules: api.ApplicableRules{ - Latency: 0, - Status: false, - }, - } -} - func representRequest(request map[string]interface{}) (repRequest []interface{}) { details, _ := json.Marshal([]api.TableData{ { diff --git a/tap/extensions/kafka/main.go b/tap/extensions/kafka/main.go index 43af66140..5a09dd979 100644 --- a/tap/extensions/kafka/main.go +++ b/tap/extensions/kafka/main.go @@ -62,7 +62,7 @@ func (d dissecting) Dissect(b *bufio.Reader, isClient bool, tcpID *api.TcpID, co } } -func (d dissecting) Analyze(item *api.OutputChannelItem, resolvedSource string, resolvedDestination string) *api.MizuEntry { +func (d dissecting) Analyze(item *api.OutputChannelItem, resolvedSource string, resolvedDestination string) *api.Entry { request := item.Pair.Request.Payload.(map[string]interface{}) reqDetails := request["details"].(map[string]interface{}) apiKey := ApiKey(reqDetails["apiKey"].(float64)) @@ -146,7 +146,7 @@ func (d dissecting) Analyze(item *api.OutputChannelItem, resolvedSource string, if elapsedTime < 0 { elapsedTime = 0 } - return &api.MizuEntry{ + return &api.Entry{ Protocol: _protocol, Source: &api.TCP{ Name: resolvedSource, @@ -171,25 +171,6 @@ func (d dissecting) Analyze(item *api.OutputChannelItem, resolvedSource string, } } -func (d dissecting) Summarize(entry *api.MizuEntry) *api.BaseEntryDetails { - return &api.BaseEntryDetails{ - Id: entry.Id, - Protocol: _protocol, - Summary: entry.Summary, - StatusCode: entry.Status, - Method: entry.Method, - Timestamp: entry.Timestamp, - Source: entry.Source, - Destination: entry.Destination, - IsOutgoing: entry.IsOutgoing, - Latency: entry.ElapsedTime, - Rules: api.ApplicableRules{ - Latency: 0, - Status: false, - }, - } -} - func (d dissecting) Represent(request map[string]interface{}, response map[string]interface{}) (object []byte, bodySize int64, err error) { bodySize = 0 representation := make(map[string]interface{}, 0) diff --git a/tap/extensions/redis/main.go b/tap/extensions/redis/main.go index e8a6d0f31..360ecc32a 100644 --- a/tap/extensions/redis/main.go +++ b/tap/extensions/redis/main.go @@ -59,7 +59,7 @@ func (d dissecting) Dissect(b *bufio.Reader, isClient bool, tcpID *api.TcpID, co } } -func (d dissecting) Analyze(item *api.OutputChannelItem, resolvedSource string, resolvedDestination string) *api.MizuEntry { +func (d dissecting) Analyze(item *api.OutputChannelItem, resolvedSource string, resolvedDestination string) *api.Entry { request := item.Pair.Request.Payload.(map[string]interface{}) response := item.Pair.Response.Payload.(map[string]interface{}) reqDetails := request["details"].(map[string]interface{}) @@ -80,7 +80,7 @@ func (d dissecting) Analyze(item *api.OutputChannelItem, resolvedSource string, if elapsedTime < 0 { elapsedTime = 0 } - return &api.MizuEntry{ + return &api.Entry{ Protocol: protocol, Source: &api.TCP{ Name: resolvedSource, @@ -106,25 +106,6 @@ func (d dissecting) Analyze(item *api.OutputChannelItem, resolvedSource string, } -func (d dissecting) Summarize(entry *api.MizuEntry) *api.BaseEntryDetails { - return &api.BaseEntryDetails{ - Id: entry.Id, - Protocol: protocol, - Summary: entry.Summary, - StatusCode: entry.Status, - Method: entry.Method, - Timestamp: entry.Timestamp, - Source: entry.Source, - Destination: entry.Destination, - IsOutgoing: entry.IsOutgoing, - Latency: entry.ElapsedTime, - Rules: api.ApplicableRules{ - Latency: 0, - Status: false, - }, - } -} - func (d dissecting) Represent(request map[string]interface{}, response map[string]interface{}) (object []byte, bodySize int64, err error) { bodySize = 0 representation := make(map[string]interface{}, 0) diff --git a/ui/src/components/EntryDetailed.tsx b/ui/src/components/EntryDetailed.tsx index 72f8ba5c7..8029429fd 100644 --- a/ui/src/components/EntryDetailed.tsx +++ b/ui/src/components/EntryDetailed.tsx @@ -69,9 +69,7 @@ const EntryTitle: React.FC = ({protocol, data, bodySize, elapsedTime, updat ; }; -const EntrySummary: React.FC = ({data, updateQuery}) => { - const entry = data.base; - +const EntrySummary: React.FC = ({entry, updateQuery}) => { return = ({entryData, updateQu elapsedTime={entryData.data.elapsedTime} updateQuery={updateQuery} /> - {entryData.data && } + {entryData.data && } <> {entryData.data && = ({entry, focusedEntryId, setFocus const isSelected = focusedEntryId === entry.id.toString(); - const classification = getClassification(entry.statusCode) + const classification = getClassification(entry.status) const numberOfRules = entry.rules.numberOfRules let ingoingIcon; let outgoingIcon; @@ -123,7 +123,7 @@ export const EntryItem: React.FC = ({entry, focusedEntryId, setFocus break; } - const isStatusCodeEnabled = ((entry.protocol.name === "http" && "statusCode" in entry) || entry.statusCode !== 0); + const isStatusCodeEnabled = ((entry.proto.name === "http" && "status" in entry) || entry.status !== 0); var endpointServiceContainer = "10px"; if (!isStatusCodeEnabled) endpointServiceContainer = "20px"; @@ -137,7 +137,7 @@ export const EntryItem: React.FC = ({entry, focusedEntryId, setFocus setFocusedEntryId(entry.id.toString()); }} style={{ - border: isSelected ? `1px ${entry.protocol.backgroundColor} solid` : "1px transparent solid", + border: isSelected ? `1px ${entry.proto.backgroundColor} solid` : "1px transparent solid", position: !headingMode ? "absolute" : "unset", top: style['top'], marginTop: !headingMode ? style['marginTop'] : "10px", @@ -145,12 +145,12 @@ export const EntryItem: React.FC = ({entry, focusedEntryId, setFocus }} > {!headingMode ? : null} {isStatusCodeEnabled &&
- +
}
@@ -171,7 +171,7 @@ export const EntryItem: React.FC = ({entry, focusedEntryId, setFocus {entry.src.name ? entry.src.name : "[Unresolved]"} - + = ({query, setQuery, background

- true if the given selector's value starts with the string: + true if the given selector's value starts with (similarly endsWith, contains) the string: = ({query, setQuery, background language="python" /> - true if the given selector's value ends with the string: + a field that contains a JSON encoded string can be filtered based a JSONPath: - true if the given selector's value contains the string: + fields that contain sensitive information can be redacted: diff --git a/ui/src/components/TrafficPage.tsx b/ui/src/components/TrafficPage.tsx index f38440f30..57fc6a603 100644 --- a/ui/src/components/TrafficPage.tsx +++ b/ui/src/components/TrafficPage.tsx @@ -212,7 +212,7 @@ export const TrafficPage: React.FC = ({onTLSDetected, setAnaly setSelectedEntryData(null); (async () => { try { - const entryData = await api.getEntry(focusedEntryId); + const entryData = await api.getEntry(focusedEntryId, query); setSelectedEntryData(entryData); } catch (error) { if (error.response?.data?.type) { diff --git a/ui/src/components/style/Filters.module.sass b/ui/src/components/style/Filters.module.sass index a815d7a9d..05ca06971 100644 --- a/ui/src/components/style/Filters.module.sass +++ b/ui/src/components/style/Filters.module.sass @@ -32,9 +32,8 @@ fieldset border: none -$divider-breakpoint-1: 1474px -$divider-breakpoint-2: 1366px -$divider-breakpoint-3: 1980px +$divider-breakpoint-1: 1055px +$divider-breakpoint-2: 1453px @media (max-width: $divider-breakpoint-1) .divider1 @@ -43,7 +42,3 @@ $divider-breakpoint-3: 1980px @media (max-width: $divider-breakpoint-2) .divider2 display: none - -@media (min-width: $divider-breakpoint-1) and (max-width: $divider-breakpoint-3) - .divider2 - display: none diff --git a/ui/src/helpers/api.js b/ui/src/helpers/api.js index 0082febfa..19fee9a6b 100644 --- a/ui/src/helpers/api.js +++ b/ui/src/helpers/api.js @@ -38,8 +38,8 @@ export default class Api { return response.data; } - getEntry = async (id) => { - const response = await this.client.get(`/entries/${id}`); + getEntry = async (id, query) => { + const response = await this.client.get(`/entries/${id}?query=${query}`); return response.data; }