Skip to content

Commit ddfc4b2

Browse files
authored
Merge pull request #594 from tapdata/feat/TAP-12019-cpu
feat(LeftSider.vue): add conditional rendering for CPU usage chart ba…
2 parents 07777e4 + 2498856 commit ddfc4b2

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

packages/dag/src/components/monitor/LeftSider.vue

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { IconButton } from '@tap/component/src/icon-button'
77
import TimeSelect from '@tap/component/src/TimeSelect.vue'
88
99
import { useI18n } from '@tap/i18n'
10-
import { calcTimeUnit, calcUnit } from '@tap/shared'
10+
import { calcTimeUnit, calcUnit, getSettingByKey } from '@tap/shared'
1111
import Time from '@tap/shared/src/time'
1212
import dayjs from 'dayjs'
1313
import { cloneDeep } from 'lodash-es'
@@ -324,6 +324,11 @@ const replicateLagData = computed(() => {
324324
}
325325
})
326326
327+
const showCpuUsageChart = computed(() => {
328+
const flag = getSettingByKey('cpu_mem_collector')
329+
return flag && flag !== 'false'
330+
})
331+
327332
const cpuUsageData = computed(() => {
328333
const data = props.quota?.samples?.lineChartData?.[0]
329334
const { time = [] } = props.quota as any
@@ -1118,7 +1123,7 @@ onMounted(() => {
11181123
</div>
11191124
</div>
11201125
</div>
1121-
<div class="py-2 px-4 info-box">
1126+
<div v-if="showCpuUsageChart" class="py-2 px-4 info-box">
11221127
<div class="line-chart__box mb-2">
11231128
<div class="flex align-center gap-2">
11241129
<span class="inline-flex align-items-center">

0 commit comments

Comments
 (0)