mirror of
https://github.com/kubeshark/kubeshark.git
synced 2025-07-17 01:41:56 +00:00
Merge branch 'develop' into refactor_ws
This commit is contained in:
commit
978257f6b1
53
.github/workflows/static_code_analysis.yml
vendored
53
.github/workflows/static_code_analysis.yml
vendored
@ -15,6 +15,9 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
|
with:
|
||||||
|
fetch-depth: 2
|
||||||
|
|
||||||
- uses: actions/setup-go@v2
|
- uses: actions/setup-go@v2
|
||||||
with:
|
with:
|
||||||
go-version: '^1.17'
|
go-version: '^1.17'
|
||||||
@ -24,67 +27,117 @@ jobs:
|
|||||||
sudo apt update
|
sudo apt update
|
||||||
sudo apt install -y libpcap-dev
|
sudo apt install -y libpcap-dev
|
||||||
|
|
||||||
|
- name: Check Agent modified files
|
||||||
|
id: agent_modified_files
|
||||||
|
run: devops/check_modified_files.sh agent/
|
||||||
|
|
||||||
- name: Go lint - agent
|
- name: Go lint - agent
|
||||||
uses: golangci/golangci-lint-action@v2
|
uses: golangci/golangci-lint-action@v2
|
||||||
|
if: steps.agent_modified_files.outputs.matched == 'true'
|
||||||
with:
|
with:
|
||||||
version: latest
|
version: latest
|
||||||
working-directory: agent
|
working-directory: agent
|
||||||
args: --timeout=3m
|
args: --timeout=3m
|
||||||
|
|
||||||
|
- name: Check shared modified files
|
||||||
|
id: shared_modified_files
|
||||||
|
run: devops/check_modified_files.sh shared/
|
||||||
|
|
||||||
- name: Go lint - shared
|
- name: Go lint - shared
|
||||||
uses: golangci/golangci-lint-action@v2
|
uses: golangci/golangci-lint-action@v2
|
||||||
|
if: steps.shared_modified_files.outputs.matched == 'true'
|
||||||
with:
|
with:
|
||||||
version: latest
|
version: latest
|
||||||
working-directory: shared
|
working-directory: shared
|
||||||
args: --timeout=3m
|
args: --timeout=3m
|
||||||
|
|
||||||
|
- name: Check tap modified files
|
||||||
|
id: tap_modified_files
|
||||||
|
run: devops/check_modified_files.sh tap/
|
||||||
|
|
||||||
- name: Go lint - tap
|
- name: Go lint - tap
|
||||||
uses: golangci/golangci-lint-action@v2
|
uses: golangci/golangci-lint-action@v2
|
||||||
|
if: steps.tap_modified_files.outputs.matched == 'true'
|
||||||
with:
|
with:
|
||||||
version: latest
|
version: latest
|
||||||
working-directory: tap
|
working-directory: tap
|
||||||
args: --timeout=3m
|
args: --timeout=3m
|
||||||
|
|
||||||
|
- name: Check cli modified files
|
||||||
|
id: cli_modified_files
|
||||||
|
run: devops/check_modified_files.sh cli/
|
||||||
|
|
||||||
- name: Go lint - CLI
|
- name: Go lint - CLI
|
||||||
uses: golangci/golangci-lint-action@v2
|
uses: golangci/golangci-lint-action@v2
|
||||||
|
if: steps.cli_modified_files.outputs.matched == 'true'
|
||||||
with:
|
with:
|
||||||
version: latest
|
version: latest
|
||||||
working-directory: cli
|
working-directory: cli
|
||||||
args: --timeout=3m
|
args: --timeout=3m
|
||||||
|
|
||||||
|
- name: Check acceptanceTests modified files
|
||||||
|
id: acceptanceTests_modified_files
|
||||||
|
run: devops/check_modified_files.sh acceptanceTests/
|
||||||
|
|
||||||
- name: Go lint - acceptanceTests
|
- name: Go lint - acceptanceTests
|
||||||
uses: golangci/golangci-lint-action@v2
|
uses: golangci/golangci-lint-action@v2
|
||||||
|
if: steps.acceptanceTests_modified_files.outputs.matched == 'true'
|
||||||
with:
|
with:
|
||||||
version: latest
|
version: latest
|
||||||
working-directory: acceptanceTests
|
working-directory: acceptanceTests
|
||||||
args: --timeout=3m
|
args: --timeout=3m
|
||||||
|
|
||||||
|
- name: Check tap/api modified files
|
||||||
|
id: tap_api_modified_files
|
||||||
|
run: devops/check_modified_files.sh tap/api/
|
||||||
|
|
||||||
- name: Go lint - tap/api
|
- name: Go lint - tap/api
|
||||||
uses: golangci/golangci-lint-action@v2
|
uses: golangci/golangci-lint-action@v2
|
||||||
|
if: steps.tap_api_modified_files.outputs.matched == 'true'
|
||||||
with:
|
with:
|
||||||
version: latest
|
version: latest
|
||||||
working-directory: tap/api
|
working-directory: tap/api
|
||||||
|
|
||||||
|
- name: Check tap/extensions/amqp modified files
|
||||||
|
id: tap_amqp_modified_files
|
||||||
|
run: devops/check_modified_files.sh tap/extensions/amqp/
|
||||||
|
|
||||||
- name: Go lint - tap/extensions/amqp
|
- name: Go lint - tap/extensions/amqp
|
||||||
uses: golangci/golangci-lint-action@v2
|
uses: golangci/golangci-lint-action@v2
|
||||||
|
if: steps.tap_amqp_modified_files.outputs.matched == 'true'
|
||||||
with:
|
with:
|
||||||
version: latest
|
version: latest
|
||||||
working-directory: tap/extensions/amqp
|
working-directory: tap/extensions/amqp
|
||||||
|
|
||||||
|
- name: Check tap/extensions/http modified files
|
||||||
|
id: tap_http_modified_files
|
||||||
|
run: devops/check_modified_files.sh tap/extensions/http/
|
||||||
|
|
||||||
- name: Go lint - tap/extensions/http
|
- name: Go lint - tap/extensions/http
|
||||||
uses: golangci/golangci-lint-action@v2
|
uses: golangci/golangci-lint-action@v2
|
||||||
|
if: steps.tap_http_modified_files.outputs.matched == 'true'
|
||||||
with:
|
with:
|
||||||
version: latest
|
version: latest
|
||||||
working-directory: tap/extensions/http
|
working-directory: tap/extensions/http
|
||||||
|
|
||||||
|
- name: Check tap/extensions/kafka modified files
|
||||||
|
id: tap_kafka_modified_files
|
||||||
|
run: devops/check_modified_files.sh tap/extensions/kafka/
|
||||||
|
|
||||||
- name: Go lint - tap/extensions/kafka
|
- name: Go lint - tap/extensions/kafka
|
||||||
uses: golangci/golangci-lint-action@v2
|
uses: golangci/golangci-lint-action@v2
|
||||||
|
if: steps.tap_kafka_modified_files.outputs.matched == 'true'
|
||||||
with:
|
with:
|
||||||
version: latest
|
version: latest
|
||||||
working-directory: tap/extensions/kafka
|
working-directory: tap/extensions/kafka
|
||||||
|
|
||||||
|
- name: Check tap/extensions/redis modified files
|
||||||
|
id: tap_redis_modified_files
|
||||||
|
run: devops/check_modified_files.sh tap/extensions/redis/
|
||||||
|
|
||||||
- name: Go lint - tap/extensions/redis
|
- name: Go lint - tap/extensions/redis
|
||||||
uses: golangci/golangci-lint-action@v2
|
uses: golangci/golangci-lint-action@v2
|
||||||
|
if: steps.tap_redis_modified_files.outputs.matched == 'true'
|
||||||
with:
|
with:
|
||||||
version: latest
|
version: latest
|
||||||
working-directory: tap/extensions/redis
|
working-directory: tap/extensions/redis
|
||||||
|
@ -53,7 +53,16 @@ func representMapSliceAsTable(mapSlice []interface{}, selectorPrefix string) (re
|
|||||||
h := item.(map[string]interface{})
|
h := item.(map[string]interface{})
|
||||||
key := h["name"].(string)
|
key := h["name"].(string)
|
||||||
value := h["value"]
|
value := h["value"]
|
||||||
switch reflect.TypeOf(value).Kind() {
|
|
||||||
|
var reflectKind reflect.Kind
|
||||||
|
reflectType := reflect.TypeOf(value)
|
||||||
|
if reflectType == nil {
|
||||||
|
reflectKind = reflect.Interface
|
||||||
|
} else {
|
||||||
|
reflectKind = reflect.TypeOf(value).Kind()
|
||||||
|
}
|
||||||
|
|
||||||
|
switch reflectKind {
|
||||||
case reflect.Slice:
|
case reflect.Slice:
|
||||||
fallthrough
|
fallthrough
|
||||||
case reflect.Array:
|
case reflect.Array:
|
||||||
|
@ -61,7 +61,7 @@ const OasModal = ({ openModal, handleCloseModal, getOasServices, getOasByService
|
|||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
onSelectedOASService(null);
|
onSelectedOASService(null);
|
||||||
},[oasServices])
|
}, [oasServices])
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Modal
|
<Modal
|
||||||
@ -80,7 +80,7 @@ const OasModal = ({ openModal, handleCloseModal, getOasServices, getOasByService
|
|||||||
<div className={style.boxContainer}>
|
<div className={style.boxContainer}>
|
||||||
<div className={style.selectHeader}>
|
<div className={style.selectHeader}>
|
||||||
<div><img src={openApiLogo} alt="openAPI" className={style.openApilogo} /></div>
|
<div><img src={openApiLogo} alt="openAPI" className={style.openApilogo} /></div>
|
||||||
<div className={style.title}>OpenAPI</div>
|
<div className={style.title}>Service Catalog</div>
|
||||||
</div>
|
</div>
|
||||||
<div style={{ cursor: "pointer" }}>
|
<div style={{ cursor: "pointer" }}>
|
||||||
<img src={closeIcon} alt="close" onClick={handleCloseModal} />
|
<img src={closeIcon} alt="close" onClick={handleCloseModal} />
|
||||||
|
@ -1,18 +1,17 @@
|
|||||||
import React, { CSSProperties } from "react";
|
import React, { CSSProperties } from "react";
|
||||||
import infoImg from 'assets/info.svg';
|
|
||||||
import styles from "./style/InformationIcon.module.sass"
|
import styles from "./style/InformationIcon.module.sass"
|
||||||
|
|
||||||
const DEFUALT_LINK = "https://getmizu.io/docs"
|
const DEFUALT_LINK = "https://getmizu.io/docs"
|
||||||
|
|
||||||
export interface InformationIconProps{
|
export interface InformationIconProps {
|
||||||
link?: string,
|
link?: string,
|
||||||
style? : CSSProperties
|
style?: CSSProperties
|
||||||
}
|
}
|
||||||
|
|
||||||
export const InformationIcon: React.FC<InformationIconProps> = ({link,style}) => {
|
export const InformationIcon: React.FC<InformationIconProps> = ({ link, style }) => {
|
||||||
return <React.Fragment>
|
return <React.Fragment>
|
||||||
<a href={DEFUALT_LINK ? DEFUALT_LINK : link} style={style} className={styles.flex} title="documentation" target="_blank">
|
<a href={DEFUALT_LINK ? DEFUALT_LINK : link} style={style} className={styles.linkStyle} title="documentation" target="_blank">
|
||||||
<img className="headerIcon" src={infoImg} alt="Info icon"/>
|
<span>Docs</span>
|
||||||
</a>
|
</a>
|
||||||
</React.Fragment>
|
</React.Fragment>
|
||||||
}
|
}
|
||||||
|
@ -1,5 +0,0 @@
|
|||||||
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
||||||
<path d="M19 21H6.14286C5.07143 21 4 20.32 4 18.96C4 17.6 5.07143 16.92 6.14286 16.92H19V4H6.14286C5.07143 4 4 5.02 4 6.04V18.96M16.8571 17.6V20.32V17.6Z" stroke="#627EF7" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
|
|
||||||
<rect x="8" y="7" width="7" height="2" fill="#627EF7"/>
|
|
||||||
<rect x="8" y="11" width="4" height="2" fill="#627EF7"/>
|
|
||||||
</svg>
|
|
Before Width: | Height: | Size: 454 B |
@ -1,2 +1,8 @@
|
|||||||
.flex
|
.linkStyle
|
||||||
display: flex
|
display: flex
|
||||||
|
color: #18253d
|
||||||
|
text-decoration: none
|
||||||
|
font-family: "Ubuntu", sans-serif
|
||||||
|
font-style: normal
|
||||||
|
font-weight: 600
|
||||||
|
font-size: 14px
|
@ -4,7 +4,7 @@
|
|||||||
position: absolute
|
position: absolute
|
||||||
transform: translate(-50%, -3px)
|
transform: translate(-50%, -3px)
|
||||||
left: 50%
|
left: 50%
|
||||||
z-index: 9999
|
z-index: 100
|
||||||
min-width: 200px
|
min-width: 200px
|
||||||
background: $blue-color
|
background: $blue-color
|
||||||
color: rgba(255,255,255,0.75)
|
color: rgba(255,255,255,0.75)
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
import React, {useEffect, useState} from "react";
|
import React, { useState } from "react";
|
||||||
import { Button } from "@material-ui/core";
|
import { Button } from "@material-ui/core";
|
||||||
import Api, { MizuWebsocketURL } from "../../../helpers/api";
|
import Api, { MizuWebsocketURL } from "../../../helpers/api";
|
||||||
import debounce from 'lodash/debounce';
|
import debounce from 'lodash/debounce';
|
||||||
import {useSetRecoilState, useRecoilState} from "recoil";
|
import { useRecoilState } from "recoil";
|
||||||
import {useCommonStyles} from "../../../helpers/commonStyle"
|
import { useCommonStyles } from "../../../helpers/commonStyle"
|
||||||
import serviceMapModalOpenAtom from "../../../recoil/serviceMapModalOpen";
|
import serviceMapModalOpenAtom from "../../../recoil/serviceMapModalOpen";
|
||||||
import TrafficViewer from "@up9/mizu-common"
|
import TrafficViewer from "@up9/mizu-common"
|
||||||
import "@up9/mizu-common/dist/index.css"
|
import "@up9/mizu-common/dist/index.css"
|
||||||
@ -17,13 +17,13 @@ interface TrafficPageProps {
|
|||||||
|
|
||||||
const api = Api.getInstance();
|
const api = Api.getInstance();
|
||||||
|
|
||||||
export const TrafficPage: React.FC<TrafficPageProps> = ({setAnalyzeStatus}) => {
|
export const TrafficPage: React.FC<TrafficPageProps> = ({ setAnalyzeStatus }) => {
|
||||||
const commonClasses = useCommonStyles();
|
const commonClasses = useCommonStyles();
|
||||||
const setServiceMapModalOpen = useSetRecoilState(serviceMapModalOpenAtom);
|
const [serviceMapModalOpen, setServiceMapModalOpen] = useRecoilState(serviceMapModalOpenAtom);
|
||||||
const [openOasModal, setOpenOasModal] = useRecoilState(oasModalOpenAtom);
|
const [openOasModal, setOpenOasModal] = useRecoilState(oasModalOpenAtom);
|
||||||
const [openWebSocket, setOpenWebSocket] = useState(true);
|
const [openWebSocket, setOpenWebSocket] = useState(true);
|
||||||
|
|
||||||
const trafficViewerApi = {...api}
|
const trafficViewerApi = { ...api }
|
||||||
|
|
||||||
const handleOpenOasModal = () => {
|
const handleOpenOasModal = () => {
|
||||||
setOpenWebSocket(false)
|
setOpenWebSocket(false)
|
||||||
@ -44,29 +44,23 @@ const trafficViewerApi = {...api}
|
|||||||
className={commonClasses.outlinedButton + " " + commonClasses.imagedButton}
|
className={commonClasses.outlinedButton + " " + commonClasses.imagedButton}
|
||||||
style={{ marginRight: 25, textTransform: 'unset' }}
|
style={{ marginRight: 25, textTransform: 'unset' }}
|
||||||
onClick={handleOpenOasModal}>
|
onClick={handleOpenOasModal}>
|
||||||
OpenAPI Specs
|
Service Catalog
|
||||||
</Button>}
|
</Button>}
|
||||||
{window["isServiceMapEnabled"] && <Button
|
{window["isServiceMapEnabled"] && <Button
|
||||||
startIcon={<img src={serviceMap} className="custom" alt="service-map" style={{marginRight:"8%"}}></img>}
|
startIcon={<img src={serviceMap} className="custom" alt="service-map" style={{ marginRight: "8%" }}></img>}
|
||||||
size="large"
|
size="large"
|
||||||
variant="contained"
|
variant="contained"
|
||||||
className={commonClasses.outlinedButton + " " + commonClasses.imagedButton}
|
className={commonClasses.outlinedButton + " " + commonClasses.imagedButton}
|
||||||
onClick={openServiceMapModalDebounce}
|
onClick={openServiceMapModalDebounce}
|
||||||
style={{textTransform: 'unset'}}>
|
style={{ textTransform: 'unset' }}>
|
||||||
Service Map
|
Service Map
|
||||||
</Button>}
|
</Button>}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
return () => {
|
|
||||||
//closeSocket()
|
|
||||||
}
|
|
||||||
},[])
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<TrafficViewer setAnalyzeStatus={setAnalyzeStatus} webSocketUrl={MizuWebsocketURL} isCloseWebSocket={!openWebSocket}
|
<TrafficViewer setAnalyzeStatus={setAnalyzeStatus} webSocketUrl={MizuWebsocketURL} isCloseWebSocket={!openWebSocket}
|
||||||
trafficViewerApiProp={trafficViewerApi} actionButtons={actionButtons} isShowStatusBar={!openOasModal} isDemoBannerView={false}/>
|
trafficViewerApiProp={trafficViewerApi} actionButtons={actionButtons} isShowStatusBar={!(openOasModal || serviceMapModalOpen)} isDemoBannerView={false} />
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user