Skip to content

Commit 44323bf

Browse files
committed
fix: the title style of top-k chart
1 parent 20c3ac4 commit 44323bf

File tree

7 files changed

+38
-36
lines changed

7 files changed

+38
-36
lines changed

package.json

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -31,20 +31,20 @@
3131
"@crowdin/crowdin-api-client": "^1.52.0",
3232
"@emotion/babel-plugin": "^11.13.5",
3333
"@emotion/css": "^11.13.5",
34-
"@rsdoctor/rspack-plugin": "^1.5.0",
35-
"@rspack/cli": "^1.7.3",
36-
"@rspack/core": "^1.7.3",
37-
"@swc/core": "^1.15.10",
34+
"@rsdoctor/rspack-plugin": "^1.5.2",
35+
"@rspack/cli": "^1.7.6",
36+
"@rspack/core": "^1.7.6",
37+
"@swc/core": "^1.15.11",
3838
"@swc/jest": "^0.2.39",
39-
"@types/chrome": "0.1.35",
39+
"@types/chrome": "0.1.36",
4040
"@types/decompress": "^4.2.7",
4141
"@types/jest": "^30.0.0",
42-
"@types/node": "^25.0.9",
42+
"@types/node": "^25.2.3",
4343
"@types/punycode": "^2.1.4",
4444
"@vue/babel-plugin-jsx": "^2.0.1",
4545
"babel-loader": "^10.0.0",
46-
"commitlint": "^20.3.1",
47-
"css-loader": "^7.1.2",
46+
"commitlint": "^20.4.1",
47+
"css-loader": "^7.1.3",
4848
"decompress": "^4.2.1",
4949
"husky": "^9.1.7",
5050
"jest": "^30.2.0",
@@ -54,7 +54,7 @@
5454
"postcss": "^8.5.6",
5555
"postcss-loader": "^8.2.0",
5656
"postcss-rtlcss": "^5.7.1",
57-
"puppeteer": "^24.35.0",
57+
"puppeteer": "^24.37.2",
5858
"ts-loader": "^9.5.4",
5959
"ts-node": "^10.9.2",
6060
"tsconfig-paths": "^4.2.0",
@@ -63,10 +63,10 @@
6363
"dependencies": {
6464
"@element-plus/icons-vue": "^2.3.2",
6565
"echarts": "^6.0.0",
66-
"element-plus": "2.13.1",
66+
"element-plus": "2.13.2",
6767
"punycode": "^2.3.1",
68-
"vue": "^3.5.27",
69-
"vue-router": "^4.6.4"
68+
"vue": "^3.5.28",
69+
"vue-router": "^5.0.2"
7070
},
7171
"engines": {
7272
"node": ">=22"

src/pages/app/Layout/menu/Side.tsx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -103,10 +103,9 @@ const _default = defineComponent(() => {
103103
>
104104
{collapsed.value
105105
? menus.flatMap(g => g.children).map(item => renderItem(item, router, curr))
106-
: menus.map(({ children, title }) => (
107-
<ElMenuItemGroup title={t(title)}>
108-
{children.map(item => renderItem(item, router, curr))}
109-
</ElMenuItemGroup>
106+
// Not export type of ElMenuItemGroup, so use h() directly
107+
: menus.map(({ children, title }) => h(ElMenuItemGroup, { title: t(title) },
108+
() => children.map(item => renderItem(item, router, curr))
110109
))}
111110
</ElMenu>
112111
</ElScrollbar>

src/pages/app/Layout/menu/item.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import { type I18nKey } from "@app/locale"
1010
import { ANALYSIS_ROUTE, MERGE_ROUTE } from "@app/router/constants"
1111
import { Aim, Connection, HelpFilled, Histogram, Memo, MoreFilled, Rank, SetUp, Stopwatch, Timer, View } from "@element-plus/icons-vue"
1212
import { getGuidePageUrl } from "@util/constant/url"
13-
import { type IconProps } from "element-plus"
13+
import { type Component } from 'vue'
1414
import About from "../icons/About"
1515
import Database from "../icons/Database"
1616
import Table from "../icons/Table"
@@ -20,7 +20,7 @@ import Whitelist from "../icons/Whitelist"
2020

2121
export type MenuItem = {
2222
title: I18nKey
23-
icon: IconProps | string
23+
icon: Component | string
2424
route?: string
2525
href?: string
2626
index?: string

src/pages/app/components/Dashboard/components/TopKVisit/Title/index.tsx

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -49,24 +49,26 @@ const Title = defineComponent(() => {
4949

5050
return () => (
5151
<Flex align="center" justify="space-between">
52-
<Flex align="center" wrap columnGap={3}>
52+
<Flex align="center" wrap columnGap={3} rowGap={2}>
5353
{tN(msg => msg.dashboard.topK.title, {
5454
k: <TitleSelect field="topK" values={[6, 8, 10, 12]} />,
5555
day: <TitleSelect field="dayNum" values={[7, 30, 90, 180]} />,
5656
})}
5757
</Flex>
58-
<ElRadioGroup
59-
v-show={!isXs.value}
60-
size="small"
61-
modelValue={filter.topKChartType}
62-
onChange={val => filter.topKChartType = val as TopKChartType}
63-
>
64-
{Object.entries(CHART_CONFIG).map(([k, v]) => (
65-
<ElRadioButton value={k} class={radioCls}>
66-
<ElIcon size={15}>{v}</ElIcon>
67-
</ElRadioButton>
68-
))}
69-
</ElRadioGroup>
58+
<Flex width={90} justify='end'>
59+
<ElRadioGroup
60+
v-show={!isXs.value}
61+
size="small"
62+
modelValue={filter.topKChartType}
63+
onChange={val => filter.topKChartType = val as TopKChartType}
64+
>
65+
{Object.entries(CHART_CONFIG).map(([k, v]) => (
66+
<ElRadioButton value={k} class={radioCls}>
67+
<ElIcon size={15}>{v}</ElIcon>
68+
</ElRadioButton>
69+
))}
70+
</ElRadioGroup>
71+
</Flex>
7072
</Flex>
7173
)
7274
})

src/pages/app/util/limit.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,7 @@ export function processVerification(option: timer.option.LimitOption, context?:
168168
// Double check
169169
const btn = (appendTo ?? document).querySelector(`.${okBtnClz}`)
170170
if (!btn) return
171+
if (typeof data === 'string') return
171172
const { value } = data
172173
if (value === answerValue) return resolve()
173174
ElMessage.error({ appendTo, message: incorrectMessage })

src/pages/components/Flex.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ type Props = {
1616
justify?: CSSProperties['justifyContent']
1717
gap?: string | number
1818
columnGap?: string | number
19+
rowGap?: string | number
1920
wrap?: CSSProperties['flexWrap'] | boolean
2021
href?: string
2122
target?: HTMLAnchorElement['target']
@@ -38,6 +39,7 @@ const Flex = defineComponent<Props>(props => {
3839
justifyContent: props.justify,
3940
flexWrap: cvtFlexWrap(props.wrap),
4041
columnGap: cvtPxScale(props.columnGap),
42+
rowGap: cvtPxScale(props.rowGap),
4143
gap: cvtPxScale(props.gap),
4244
...cvt2BaseStyle(props),
4345
}}
@@ -47,6 +49,6 @@ const Flex = defineComponent<Props>(props => {
4749
{defaultSlots && h(defaultSlots)}
4850
</Comp>
4951
)
50-
}, { props: [...ALL_BASE_PROPS, 'direction', 'column', 'flex', 'align', 'justify', 'gap', 'columnGap', 'wrap', 'as'] })
52+
}, { props: [...ALL_BASE_PROPS, 'direction', 'column', 'flex', 'align', 'justify', 'gap', 'columnGap', 'rowGap', 'wrap', 'as'] })
5153

5254
export default Flex

tsconfig.json

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
"module": "esnext",
44
"target": "esnext",
55
"lib": [
6-
"ES2023"
6+
"ES2023",
7+
"DOM",
78
],
89
"jsx": "preserve",
910
"jsxFactory": "h",
@@ -64,9 +65,6 @@
6465
]
6566
}
6667
},
67-
"lib": [
68-
"dom"
69-
],
7068
"exclude": [
7169
"node_modules",
7270
"dist"

0 commit comments

Comments
 (0)