Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(overview): unit in tooltip #2971

Merged
merged 3 commits into from
Sep 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 22 additions & 1 deletion src/types/schemas/banned.schemas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,18 @@ export type PostBanned200 = {
data?: EmqxMgmtApiBannedBan[]
}

export type GetBanned400Code = typeof GetBanned400Code[keyof typeof GetBanned400Code]

// eslint-disable-next-line @typescript-eslint/no-redeclare
export const GetBanned400Code = {
BAD_REQUEST: 'BAD_REQUEST',
} as const

export type GetBanned400 = {
code?: GetBanned400Code
message?: string
}

export type GetBanned200 = {
data?: EmqxMgmtApiBannedBan[]
meta?: PublicMeta
Expand All @@ -40,6 +52,13 @@ export type PublicLimitParameter = number
export type GetBannedParams = {
page?: PublicPageParameter
limit?: PublicLimitParameter
clientid?: string
username?: string
peerhost?: string
like_clientid?: string
like_username?: string
like_peerhost?: string
like_peerhost_net?: string
}

export interface PublicMeta {
Expand All @@ -49,7 +68,9 @@ export interface PublicMeta {
hasnext: boolean
}

export type EmqxMgmtApiBannedBanUntil = number | string
export type EmqxMgmtApiBannedBanUntilOneOf = number | string

export type EmqxMgmtApiBannedBanUntil = EmqxMgmtApiBannedBanUntilOneOf | 'infinity'

export type EmqxMgmtApiBannedBanAt = number | string

Expand Down
2 changes: 2 additions & 0 deletions src/types/schemas/rules.schemas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,7 @@ export interface RuleEngineNodeMetrics {
'actions.failed'?: number
'actions.failed.out_of_service'?: number
'actions.failed.unknown'?: number
'actions.discarded'?: number
}

export interface RuleEngineMetrics {
Expand All @@ -350,6 +351,7 @@ export interface RuleEngineMetrics {
'actions.failed'?: number
'actions.failed.out_of_service'?: number
'actions.failed.unknown'?: number
'actions.discarded'?: number
}

export type RuleEngineCtxUnsubEventType =
Expand Down
10 changes: 6 additions & 4 deletions src/views/Dashboard/components/PolylineChart.vue
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ const drawChart = () => {
left: 24,
containLabel: true,
},
legend: props.yTitle.length > 1 ? { top: 4 } : undefined,
legend: props.yTitle.length > 1 ? { top: 4, data: props.yTitle } : undefined,
toolbox: {
feature: {
saveAsImage: {
Expand Down Expand Up @@ -244,7 +244,7 @@ const drawChart = () => {
return ''
}
const dataItemArr = params.reduce(
(arr, { axisValue, color, seriesName, value, dataIndex }, index) => {
(arr, { axisValue, color, seriesName, seriesIndex, value, dataIndex }) => {
let valueShowInTooltip = value
const isNoData = noYAxisDataMap[seriesName]?.includes(axisValue)
if (isNoData) {
Expand All @@ -256,7 +256,7 @@ const drawChart = () => {
let title = ''
const interval = getInterval(dataIndex)
const unitTextKey: string = Array.isArray(props.unitTextKey)
? props.unitTextKey[index]
? props.unitTextKey[seriesIndex]
: props.unitTextKey
if (!props.isInstantaneousValue && interval) {
title = t(unitTextKey, { interval: interval / 1000, n: value })
Expand All @@ -272,7 +272,9 @@ const drawChart = () => {
return createTooltip(params[0].axisValue, dataItemArr)
},
},
dataZoom: props.showFullScreen ? [{ type: 'inside' }, { type: 'slider' }] : undefined,
dataZoom: props.showFullScreen
? [{ type: 'inside' }, { type: 'slider', showDetail: false }]
: undefined,
xAxis: {
type: 'category',
boundaryGap: false,
Expand Down
Loading