diff --git a/web/client/src/sections/homePage/components/dataTop5.js b/web/client/src/sections/homePage/components/dataTop5.js index 37c102b..d3c3325 100644 --- a/web/client/src/sections/homePage/components/dataTop5.js +++ b/web/client/src/sections/homePage/components/dataTop5.js @@ -37,6 +37,27 @@ function DataTop5(props) { show: false, }, }, + tooltip: { + confine: true, + trigger: 'axis', + axisPointer: { + type: 'shadow', + }, + backgroundColor: 'rgba(13,30,44, 0.7)', + borderColor: 'rgba(3, 65, 118, 0.8)', + textStyle: { + color: '#fff', + }, + formatter: function (params) { + var name = params[0].name + if (name.length > 20) { + name = name.replace(/(.{20})/g, '$1
') // 每 30 个字符添加一个换行符 + } + var content = name + + return content + ' : ' + params[0].value + '万条' + } + }, grid: { top: 13, bottom: -10, @@ -57,14 +78,15 @@ function DataTop5(props) { }, formatter(value, index) { let str = '', num = 'TOP' + (index + 1) + let valueHandle = value.length > 10 ? value.substring(0, 10) + '...' : value if (index === 0) { - str = '{a| ' + num + '}{title| ' + value + '}' + str = '{a| ' + num + '}{title| ' + valueHandle + '}' } else if (index === 1) { - str = '{b| ' + num + '}{title| ' + value + '}' + str = '{b| ' + num + '}{title| ' + valueHandle + '}' } else if (index === 2) { - str = '{c| ' + num + '}{title| ' + value + '}' + str = '{c| ' + num + '}{title| ' + valueHandle + '}' } else { - str = '{d| ' + num + '}{title| ' + value + '}' + str = '{d| ' + num + '}{title| ' + valueHandle + '}' } return str }, diff --git a/web/client/src/sections/homePage/components/nodeResource.js b/web/client/src/sections/homePage/components/nodeResource.js index 101468d..e142a1e 100644 --- a/web/client/src/sections/homePage/components/nodeResource.js +++ b/web/client/src/sections/homePage/components/nodeResource.js @@ -5,7 +5,7 @@ import './style.less'; function NodeResource(props) { const { data: cluters = {} } = useFsRequest({ url: 'homepage/datatotal/cluters', - pollingInterval: 1000 * 10, + pollingInterval: 1000 * 20, }); const renderBody = () => { diff --git a/web/client/src/sections/homePage/components/style.less b/web/client/src/sections/homePage/components/style.less index d71fa30..e3274cb 100644 --- a/web/client/src/sections/homePage/components/style.less +++ b/web/client/src/sections/homePage/components/style.less @@ -123,7 +123,7 @@ .data_total { position: absolute; bottom: 13%; - right: 7%; + left: 79%; .data_number { line-height: 25px;