mirror of
https://github.com/kubeshark/kubeshark.git
synced 2026-04-15 15:06:49 +00:00
Compare commits
4 Commits
32.0-dev19
...
32.0-dev23
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4c0aeb8146 | ||
|
|
0dc0459dff | ||
|
|
81f06003d5 | ||
|
|
c7d068748a |
@@ -124,8 +124,8 @@ func NewRequest(request map[string]interface{}) (harRequest *Request, err error)
|
|||||||
|
|
||||||
postData, _ := request["postData"].(map[string]interface{})
|
postData, _ := request["postData"].(map[string]interface{})
|
||||||
mimeType := postData["mimeType"]
|
mimeType := postData["mimeType"]
|
||||||
if mimeType == nil || len(mimeType.(string)) == 0 {
|
if mimeType == nil {
|
||||||
mimeType = "text/html"
|
mimeType = ""
|
||||||
}
|
}
|
||||||
text := postData["text"]
|
text := postData["text"]
|
||||||
postDataText := ""
|
postDataText := ""
|
||||||
@@ -177,8 +177,8 @@ func NewResponse(response map[string]interface{}) (harResponse *Response, err er
|
|||||||
|
|
||||||
content, _ := response["content"].(map[string]interface{})
|
content, _ := response["content"].(map[string]interface{})
|
||||||
mimeType := content["mimeType"]
|
mimeType := content["mimeType"]
|
||||||
if mimeType == nil || len(mimeType.(string)) == 0 {
|
if mimeType == nil {
|
||||||
mimeType = "text/html"
|
mimeType = ""
|
||||||
}
|
}
|
||||||
encoding := content["encoding"]
|
encoding := content["encoding"]
|
||||||
text := content["text"]
|
text := content["text"]
|
||||||
|
|||||||
@@ -13,4 +13,4 @@ test-pull-bin:
|
|||||||
|
|
||||||
test-pull-expect:
|
test-pull-expect:
|
||||||
@mkdir -p expect
|
@mkdir -p expect
|
||||||
@[ "${skipexpect}" ] && echo "Skipping downloading expected JSONs" || gsutil -o 'GSUtil:parallel_process_count=5' -o 'GSUtil:parallel_thread_count=5' -m cp -r gs://static.up9.io/mizu/test-pcap/expect8/http/\* expect
|
@[ "${skipexpect}" ] && echo "Skipping downloading expected JSONs" || gsutil -o 'GSUtil:parallel_process_count=5' -o 'GSUtil:parallel_thread_count=5' -m cp -r gs://static.up9.io/mizu/test-pcap/expect9/http/\* expect
|
||||||
|
|||||||
@@ -401,8 +401,8 @@ func representRequest(request map[string]interface{}) (repRequest []interface{})
|
|||||||
|
|
||||||
postData, _ := request["postData"].(map[string]interface{})
|
postData, _ := request["postData"].(map[string]interface{})
|
||||||
mimeType := postData["mimeType"]
|
mimeType := postData["mimeType"]
|
||||||
if mimeType == nil || len(mimeType.(string)) == 0 {
|
if mimeType == nil {
|
||||||
mimeType = "text/html"
|
mimeType = ""
|
||||||
}
|
}
|
||||||
text := postData["text"]
|
text := postData["text"]
|
||||||
if text != nil {
|
if text != nil {
|
||||||
@@ -483,8 +483,8 @@ func representResponse(response map[string]interface{}) (repResponse []interface
|
|||||||
|
|
||||||
content, _ := response["content"].(map[string]interface{})
|
content, _ := response["content"].(map[string]interface{})
|
||||||
mimeType := content["mimeType"]
|
mimeType := content["mimeType"]
|
||||||
if mimeType == nil || len(mimeType.(string)) == 0 {
|
if mimeType == nil {
|
||||||
mimeType = "text/html"
|
mimeType = ""
|
||||||
}
|
}
|
||||||
encoding := content["encoding"]
|
encoding := content["encoding"]
|
||||||
text := content["text"]
|
text := content["text"]
|
||||||
|
|||||||
@@ -274,25 +274,21 @@ export const EntryItem: React.FC<EntryProps> = ({entry, style, headingMode, name
|
|||||||
>
|
>
|
||||||
<img
|
<img
|
||||||
src={outgoingIcon}
|
src={outgoingIcon}
|
||||||
alt="Ingoing traffic"
|
alt="Outgoing traffic"
|
||||||
title="Ingoing"
|
title="Outgoing"
|
||||||
/>
|
/>
|
||||||
</Queryable>
|
</Queryable>
|
||||||
:
|
:
|
||||||
<Queryable
|
<Queryable
|
||||||
query={`outgoing == true`}
|
query={`outgoing == false`}
|
||||||
displayIconOnMouseOver={true}
|
displayIconOnMouseOver={true}
|
||||||
flipped={true}
|
flipped={true}
|
||||||
iconStyle={{marginTop: "28px"}}
|
iconStyle={{marginTop: "28px"}}
|
||||||
>
|
>
|
||||||
<img
|
<img
|
||||||
src={ingoingIcon}
|
src={ingoingIcon}
|
||||||
alt="Outgoing traffic"
|
alt="Ingoing traffic"
|
||||||
title="Outgoing"
|
title="Ingoing"
|
||||||
onClick={() => {
|
|
||||||
const query = `outgoing == false`;
|
|
||||||
setQuery(queryState ? `${queryState} and ${query}` : query);
|
|
||||||
}}
|
|
||||||
/>
|
/>
|
||||||
</Queryable>
|
</Queryable>
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -240,7 +240,7 @@ export const TrafficViewer: React.FC<TrafficViewerProps> = ({
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={TrafficViewerStyles.TrafficPage}>
|
<div className={TrafficViewerStyles.TrafficPage}>
|
||||||
{tappingStatus && isShowStatusBar && <StatusBar isDemoBannerView={isDemoBannerView}/>}
|
{tappingStatus && isShowStatusBar && <StatusBar disabled={ws?.current?.readyState !== WebSocket.OPEN} isDemoBannerView={isDemoBannerView}/>}
|
||||||
<div className={TrafficViewerStyles.TrafficPageHeader}>
|
<div className={TrafficViewerStyles.TrafficPageHeader}>
|
||||||
<div className={TrafficViewerStyles.TrafficPageStreamStatus}>
|
<div className={TrafficViewerStyles.TrafficPageStreamStatus}>
|
||||||
<img className={TrafficViewerStyles.playPauseIcon}
|
<img className={TrafficViewerStyles.playPauseIcon}
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import failIcon from 'assets/failed.svg';
|
|||||||
import successIcon from 'assets/success.svg';
|
import successIcon from 'assets/success.svg';
|
||||||
import {useRecoilValue} from "recoil";
|
import {useRecoilValue} from "recoil";
|
||||||
import tappingStatusAtom, {tappingStatusDetails} from "../../recoil/tappingStatus";
|
import tappingStatusAtom, {tappingStatusDetails} from "../../recoil/tappingStatus";
|
||||||
|
import Tooltip from "./Tooltip";
|
||||||
|
|
||||||
const pluralize = (noun: string, amount: number) => {
|
const pluralize = (noun: string, amount: number) => {
|
||||||
return `${noun}${amount !== 1 ? 's' : ''}`
|
return `${noun}${amount !== 1 ? 's' : ''}`
|
||||||
@@ -12,20 +13,22 @@ const pluralize = (noun: string, amount: number) => {
|
|||||||
|
|
||||||
interface StatusBarProps {
|
interface StatusBarProps {
|
||||||
isDemoBannerView: boolean;
|
isDemoBannerView: boolean;
|
||||||
|
disabled?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
export const StatusBar: React.FC<StatusBarProps> = ({isDemoBannerView}) => {
|
export const StatusBar: React.FC<StatusBarProps> = ({isDemoBannerView, disabled}) => {
|
||||||
const tappingStatus = useRecoilValue(tappingStatusAtom);
|
const tappingStatus = useRecoilValue(tappingStatusAtom);
|
||||||
const [expandedBar, setExpandedBar] = useState(false);
|
const [expandedBar, setExpandedBar] = useState(false);
|
||||||
const {uniqueNamespaces, amountOfPods, amountOfTappedPods, amountOfUntappedPods} = useRecoilValue(tappingStatusDetails);
|
const {uniqueNamespaces, amountOfPods, amountOfTappedPods, amountOfUntappedPods} = useRecoilValue(tappingStatusDetails);
|
||||||
return <div className={`${isDemoBannerView ? `${style.banner}` : ''} ${style.statusBar} ${(expandedBar ? `${style.expandedStatusBar}` : "")}`} onMouseOver={() => setExpandedBar(true)} onMouseLeave={() => setExpandedBar(false)} data-cy="expandedStatusBar">
|
return <div style={{opacity: disabled ? 0.4 : 1}} className={`${isDemoBannerView ? `${style.banner}` : ''} ${style.statusBar} ${(expandedBar && !disabled ? `${style.expandedStatusBar}` : "")}`} onMouseOver={() => setExpandedBar(true)} onMouseLeave={() => setExpandedBar(false)} data-cy="expandedStatusBar">
|
||||||
<div className={style.podsCount}>
|
<div className={style.podsCount}>
|
||||||
{tappingStatus.some(pod => !pod.isTapped) && <img src={warningIcon} alt="warning"/>}
|
{tappingStatus.some(pod => !pod.isTapped) && <img src={warningIcon} alt="warning"/>}
|
||||||
|
{disabled && <Tooltip title={"Tapping status is not updated when streaming is paused"} isSimple><img src={warningIcon} alt="warning"/></Tooltip>}
|
||||||
<span className={style.podsCountText} data-cy="podsCountText">
|
<span className={style.podsCountText} data-cy="podsCountText">
|
||||||
{`Tapping ${amountOfUntappedPods > 0 ? amountOfTappedPods + " / " + amountOfPods : amountOfPods} ${pluralize('pod', amountOfPods)} in ${pluralize('namespace', uniqueNamespaces.length)} ${uniqueNamespaces.join(", ")}`}
|
{`Tapping ${amountOfUntappedPods > 0 ? amountOfTappedPods + " / " + amountOfPods : amountOfPods} ${pluralize('pod', amountOfPods)} in ${pluralize('namespace', uniqueNamespaces.length)} ${uniqueNamespaces.join(", ")}`}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
{expandedBar && <div style={{marginTop: 20}}>
|
{expandedBar && !disabled && <div style={{marginTop: 20}}>
|
||||||
<table>
|
<table>
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
|
|||||||
Reference in New Issue
Block a user