- {list?.map((item, index) => {
- return (
+ {list?.map((item, index) => (
+
{
+ !item?.disabled && onChange(item.value, index)
+ }}
+ style={{
+ ...itemStyle,
+ ...(item?.disabled ? { color: '#f1f1f1' } : {}),
+ }}
+ >
{
- !item?.disabled && onChange(item.value, index)
- }}
- style={{
- ...itemStyle,
- ...(item?.disabled ? { color: '#f1f1f1' } : {}),
- }}
+ className={classNames(styles.normal, {
+ [styles.active]: current === item.value,
+ })}
+ style={
+ item?.disabled ? { color: '#999', cursor: 'not-allowed' } : {}
+ }
>
-
- {getDataType(item?.label) === 'String'
- ? t(item?.label as string)
- : item?.label}
-
+ {getDataType(item?.label) === 'String'
+ ? t(item?.label as string)
+ : item?.label}
- )
- })}
+
+ ))}
)
}
diff --git a/ui/src/components/yaml/index.tsx b/ui/src/components/yaml/index.tsx
index 053dd8f4..347cd515 100644
--- a/ui/src/components/yaml/index.tsx
+++ b/ui/src/components/yaml/index.tsx
@@ -1,13 +1,13 @@
import React, { useEffect, useRef } from 'react'
import type { LegacyRef } from 'react'
+import { Button, message } from 'antd'
+import { useTranslation } from 'react-i18next'
import hljs from 'highlight.js'
import yaml from 'js-yaml'
import 'highlight.js/styles/lightfair.css'
-import { yaml2json } from '../../utils/tools'
+import { yaml2json } from '@/utils/tools'
import styles from './styles.module.less'
-import { Button, message } from 'antd'
-import { useTranslation } from 'react-i18next'
// eslint-disable-next-line @typescript-eslint/no-var-requires
hljs.registerLanguage('yaml', require('highlight.js/lib/languages/yaml'))
diff --git a/ui/src/locales/de.json b/ui/src/locales/de.json
index 4fef3cce..2cee703e 100644
--- a/ui/src/locales/de.json
+++ b/ui/src/locales/de.json
@@ -109,5 +109,6 @@
"TotalResourceGroupRules": "Gesamte Ressourcegruppen-Regeln",
"TotalResources": "Alle Ressourcen",
"ClusterCount": "Anzahl der Kluster",
- "UnableCreateResourceGroupInReadOnly": "Im Nur-Lesen-Modus können keine Ressourcengruppen-Regeln erstellt werden."
+ "UnableCreateResourceGroupInReadOnly": "Im Nur-Lesen-Modus können keine Ressourcengruppen-Regeln erstellt werden.",
+ "PleaseEnterValidSQLStatement": "Bitte geben Sie eine gültige SQL-Anweisung ein."
}
diff --git a/ui/src/locales/en.json b/ui/src/locales/en.json
index b3f1bc72..b9dae828 100644
--- a/ui/src/locales/en.json
+++ b/ui/src/locales/en.json
@@ -109,5 +109,6 @@
"TotalResourceGroupRules": "Total ResourceGroupRules",
"TotalResources": "Total Resources",
"ClusterCount": "Cluster Count",
- "UnableCreateResourceGroupInReadOnly": "Unable to create resource group rules in read-only mode"
+ "UnableCreateResourceGroupInReadOnly": "Unable to create resource group rules in read-only mode",
+ "PleaseEnterValidSQLStatement": "Please enter a valid SQL statement"
}
diff --git a/ui/src/locales/pt.json b/ui/src/locales/pt.json
index da1d8d66..7de33eed 100644
--- a/ui/src/locales/pt.json
+++ b/ui/src/locales/pt.json
@@ -109,5 +109,6 @@
"TotalResourceGroupRules": "Regras de Recursos Totais do Grupo",
"TotalResources": "Recursos totais",
"ClusterCount": "Número de Clusters",
- "UnableCreateResourceGroupInReadOnly": "No modo de somente leitura, não é possível criar regras de grupo de recursos."
+ "UnableCreateResourceGroupInReadOnly": "No modo de somente leitura, não é possível criar regras de grupo de recursos.",
+ "PleaseEnterValidSQLStatement": "Por favor, insira uma declaração SQL válida."
}
diff --git a/ui/src/locales/zh.json b/ui/src/locales/zh.json
index f69468c9..ba9e3b6f 100644
--- a/ui/src/locales/zh.json
+++ b/ui/src/locales/zh.json
@@ -109,5 +109,6 @@
"TotalResourceGroupRules": "资源组规则数量",
"TotalResources": "资源总数",
"ClusterCount": "集群数量",
- "UnableCreateResourceGroupInReadOnly": "只读模式下不能创建资源组规则"
+ "UnableCreateResourceGroupInReadOnly": "只读模式下不能创建资源组规则",
+ "PleaseEnterValidSQLStatement": "请输入有效SQL语句"
}
diff --git a/ui/src/pages/cluster/add/index.tsx b/ui/src/pages/cluster/add/index.tsx
index f06f0219..c3a634df 100644
--- a/ui/src/pages/cluster/add/index.tsx
+++ b/ui/src/pages/cluster/add/index.tsx
@@ -14,12 +14,12 @@ import styles from './styles.module.less'
const { TextArea } = Input
const RegisterCluster = () => {
- const { isReadOnlyMode } = useSelector((state: any) => state.globalSlice)
+ const { t } = useTranslation()
const [form] = Form.useForm()
const navigate = useNavigate()
+ const { isReadOnlyMode } = useSelector((state: any) => state.globalSlice)
const [yamlContent, setYamlContent] = useState('')
const [loading, setLoading] = useState(false)
- const { t } = useTranslation()
async function onFinish(values: any) {
if (isReadOnlyMode) {
@@ -50,8 +50,8 @@ const RegisterCluster = () => {
message.error(
validateResponse?.message || t('KubeConfigDoesNotMeetTheRequirements'),
)
- setLoading(false)
}
+ setLoading(false)
}
function goBack() {
@@ -96,7 +96,7 @@ const RegisterCluster = () => {
- {t('RegisterCluster')}
+
{t('RegisterCluster')}
diff --git a/ui/src/pages/insightDetail/components/exceptionDrawer/index.tsx b/ui/src/pages/insightDetail/components/exceptionDrawer/index.tsx
index eb6b354a..1951d032 100644
--- a/ui/src/pages/insightDetail/components/exceptionDrawer/index.tsx
+++ b/ui/src/pages/insightDetail/components/exceptionDrawer/index.tsx
@@ -5,7 +5,7 @@ import { useTranslation } from 'react-i18next'
import { filterKeywordsOfArray, truncationPageData } from '@/utils/tools'
import { DEFALUT_PAGE_SIZE_10, SEVERITY_MAP } from '@/utils/constants'
import ExceptionStat from '../exceptionStat'
-import MultiTag from '../multiTag'
+import TagVariableSizeList from '../tagVariableSizeList'
import styles from './style.module.less'
@@ -131,14 +131,17 @@ const ExceptionDrawer = ({ open, onClose, exceptionList }: IProps) => {
-
onClickTable('All')}
>
{t('AllIssues')}
@@ -22,7 +26,9 @@ const ExceptionStat = ({ statData, onClickTable, currentKey }: IProps) => {
onClickTable('High')}
>
{t('High')}
@@ -31,7 +37,9 @@ const ExceptionStat = ({ statData, onClickTable, currentKey }: IProps) => {
onClickTable('Medium')}
>
{t('Medium')}
@@ -40,7 +48,9 @@ const ExceptionStat = ({ statData, onClickTable, currentKey }: IProps) => {
onClickTable('Low')}
>
{t('Low')}
diff --git a/ui/src/pages/insightDetail/components/k8sStat/index.tsx b/ui/src/pages/insightDetail/components/k8sStat/index.tsx
index d6b534c7..4f29b914 100644
--- a/ui/src/pages/insightDetail/components/k8sStat/index.tsx
+++ b/ui/src/pages/insightDetail/components/k8sStat/index.tsx
@@ -1,6 +1,7 @@
import React from 'react'
import { Badge } from 'antd'
import { useTranslation } from 'react-i18next'
+import classNames from 'classnames'
import styles from './style.module.less'
@@ -16,17 +17,17 @@ const K8sStat = ({ statData }: IProps) => {
{t('AllIssues')}
{statData?.all}
-
+
- {statData?.high || 5}
+ {statData?.high || '--'}
- {statData?.medium || 2}
+ {statData?.medium || '--'}
- {statData?.low || 1}
+ {statData?.low || '--'}
)
diff --git a/ui/src/pages/insightDetail/components/multiTag/index.tsx b/ui/src/pages/insightDetail/components/multiTag/index.tsx
deleted file mode 100644
index 8fe4d94f..00000000
--- a/ui/src/pages/insightDetail/components/multiTag/index.tsx
+++ /dev/null
@@ -1,82 +0,0 @@
-import React, { useState } from 'react'
-import { Tag, Popover } from 'antd'
-import { useTranslation } from 'react-i18next'
-import { DoubleLeftOutlined, DoubleRightOutlined } from '@ant-design/icons'
-
-import styles from './style.module.less'
-
-type IProps = {
- allTags: any
-}
-
-const MultiTag = ({ allTags }: IProps) => {
- const { t } = useTranslation()
- const [showAll, setShowAll] = useState(false)
- const defaultMaxCount = 5
-
- const toggleTags = () => {
- setShowAll(!showAll)
- }
-
- return (
-
- {allTags
- ?.slice(0, showAll ? allTags?.length : defaultMaxCount)
- ?.map((tag: any) => {
- const content = (
-
-
- Cluster:
- {tag?.cluster || '--'}
-
-
- APIVersion:
- {tag?.apiVersion || '--'}
-
-
- Kind:
- {tag?.kind || '--'}
-
-
- Namespace:
- {tag?.namespace || '--'}
-
-
- Name:
- {tag?.name || '--'}
-
-
- )
- return (
-
- )
- })}
- {allTags?.length > defaultMaxCount && !showAll && (
-
-
- {t('More')}
-
-
-
- )}
- {showAll && (
-
-
- {t('Less')}
-
-
-
- )}
-
- )
-}
-
-export default MultiTag
diff --git a/ui/src/pages/insightDetail/components/summaryCard/index.tsx b/ui/src/pages/insightDetail/components/summaryCard/index.tsx
index df25a6ab..24ba8f2e 100644
--- a/ui/src/pages/insightDetail/components/summaryCard/index.tsx
+++ b/ui/src/pages/insightDetail/components/summaryCard/index.tsx
@@ -147,9 +147,6 @@ const SummaryCard = ({ auditStat, summary }: SummaryCardProps) => {
Cluster
- {/*
+
+ Cluster:
+ {tag?.cluster || '--'}
+
+
+ APIVersion:
+ {tag?.apiVersion || '--'}
+
+
+ Kind:
+ {tag?.kind || '--'}
+
+
+ Namespace:
+ {tag?.namespace || '--'}
+
+
+ Name:
+ {tag?.name || '--'}
+
+
+ )
+ return (
+