Skip to content

Commit

Permalink
Merge pull request #1906 from yaklang/luoluo/feature/plugin-execute-r…
Browse files Browse the repository at this point in the history
…isk-by-runtimeId

Luoluo/feature/plugin execute risk by runtime
  • Loading branch information
b1rdfree authored Aug 14, 2024
2 parents 638e18c + 6870b52 commit 16d0fe3
Show file tree
Hide file tree
Showing 12 changed files with 600 additions and 302 deletions.
2 changes: 2 additions & 0 deletions app/protos/grpc.proto
Original file line number Diff line number Diff line change
Expand Up @@ -2950,6 +2950,8 @@ message QueryRisksRequest {
string IsRead = 12;
string Title = 13;
repeated int64 Ids = 14;

string RuntimeId = 15;
}

message QueryRisksResponse {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
.table-total-select {
display: flex;
align-items: center;
justify-content: flex-end;

.table-total-select-item {
display: flex;
align-items: center;

.table-total-select-text {
color: var(--yakit-helper-text-color);
font-size: 12px;
margin-right: 4px;
}

.table-total-select-number {
color: var(--yakit-primary-5);
font-size: 12px;
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import React from "react"
import styles from "./TableTotalAndSelectNumber.module.scss"
import {Divider} from "antd"

interface TableTotalAndSelectNumberProps {
total: number
selectNum?: number
}
export const TableTotalAndSelectNumber: React.FC<TableTotalAndSelectNumberProps> = React.memo((props) => {
const {total, selectNum} = props
return (
<div className={styles["table-total-select"]}>
<div className={styles["table-total-select-item"]}>
<span className={styles["table-total-select-text"]}>Total</span>
<span className={styles["table-total-select-number"]}>{total}</span>
</div>
{selectNum !== undefined && (
<>
<Divider type='vertical' />
<div className={styles["table-total-select-item"]}>
<span className={styles["table-total-select-text"]}>Selected</span>
<span className={styles["table-total-select-number"]}>{selectNum}</span>
</div>
</>
)}
</div>
)
})
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import {isEnpriTraceAgent} from "@/utils/envfile"
import cloneDeep from "lodash/cloneDeep"
import emiter from "@/utils/eventBus/eventBus"
import {YakitRoute} from "@/enums/yakitRoute"
import {TableTotalAndSelectNumber} from "@/components/TableTotalAndSelectNumber/TableTotalAndSelectNumber"

const {ipcRenderer} = window.require("electron")
const defLimit = 20
Expand Down Expand Up @@ -453,7 +454,8 @@ export const PortTable: React.FC<PortTableProps> = React.memo(
}
setSendPopoverVisible(false)
})
const onTableChange = useMemoizedFn((page: number, limit: number, sort: SortProps, filter: any) => {
const onTableChange = useMemoizedFn((page: number, limit: number, newSort: SortProps, filter: any) => {
let sort = {...newSort}
if (sort.order === "none") {
sort.order = "desc"
sort.orderBy = "id"
Expand Down Expand Up @@ -514,23 +516,7 @@ export const PortTable: React.FC<PortTableProps> = React.memo(
{tableTitle ? (
tableTitle
) : (
<div className={styles["virtual-table-heard-right"]}>
<div className={styles["virtual-table-heard-right-item"]}>
<span className={styles["virtual-table-heard-right-text"]}>Total</span>
<span className={styles["virtual-table-heard-right-number"]}>
{total}
</span>
</div>
<Divider type='vertical' />
<div className={styles["virtual-table-heard-right-item"]}>
<span className={styles["virtual-table-heard-right-text"]}>
Selected
</span>
<span className={styles["virtual-table-heard-right-number"]}>
{selectNum}
</span>
</div>
</div>
<TableTotalAndSelectNumber total={total} selectNum={selectNum} />
)}
<div className={styles["table-head-extra"]}>
<ExportExcel
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@
font-size: 12px;
font-weight: 400;
line-height: 16px; /* 133.333% */
.table-renderTitle-left {
@extend %display-flex-center;
gap: 8px;
}
}
.plugin-execute-result-tabBar {
display: inline-block;
Expand All @@ -39,10 +43,12 @@
}

.risks-table {
display: flex;
flex-direction: column;
@extend %display-column-center;
overflow: hidden;
height: 100%;
.risks-table-wrapper {
padding: 0;
}
}
.table-container {
border: 0 !important;
Expand Down
Loading

0 comments on commit 16d0fe3

Please sign in to comment.