Skip to content

Commit 64eeb43

Browse files
fix: Optimize the chart
1 parent 9fc1809 commit 64eeb43

File tree

6 files changed

+28
-12
lines changed

6 files changed

+28
-12
lines changed

ui/src/components/app-charts/components/BarCharts.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,8 @@ function initChart() {
5656
text: props.option?.title,
5757
textStyle: {
5858
fontSize: '16px',
59-
},
59+
color: '#1f2329',
60+
}
6061
},
6162
tooltip: {
6263
trigger: 'axis',

ui/src/components/app-charts/components/LineCharts.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ function initChart() {
5555
text: props.option?.title,
5656
textStyle: {
5757
fontSize: '16px',
58+
color: '#1f2329',
5859
},
5960
},
6061
tooltip: {

ui/src/components/workflow-dropdown-menu/application/index.vue

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,6 @@ function folderClickHandle(row: any) {
299299
}
300300
301301
async function handleClick(val: string) {
302-
console.log(val)
303302
if (val === 'tool') {
304303
await getToolFolder()
305304
getToolList()

ui/src/layout/app-main/index.vue

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,8 @@ import { useRoute } from 'vue-router'
1414
1515
const route = useRoute()
1616
17-
18-
1917
const cachedViews: any = ref([])
2018
onBeforeUpdate(() => {
21-
2219
const { name, meta } = route
2320
if (name && !cachedViews.value.includes(name)) {
2421
cachedViews.value.push(name)

ui/src/layout/layout-template/SimpleLayout.vue

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,11 @@ const {
1616
} = route as any
1717
const isShared = computed(() => {
1818
return (
19-
folderId === 'shared' ||
20-
from === 'systemShare' ||
21-
from === 'systemManage' ||
22-
route.path.includes('resource-management')
19+
(folderId === 'shared' ||
20+
from === 'systemShare' ||
21+
from === 'systemManage' ||
22+
route.path.includes('resource-management')) &&
23+
route.fullPath != '/application'
2324
)
2425
})
2526
</script>
@@ -35,6 +36,7 @@ const isShared = computed(() => {
3536
show-icon
3637
:closable="false"
3738
/>
39+
3840
<SystemHeader v-if="isShared"></SystemHeader>
3941
<UserHeader v-else />
4042
</div>

ui/src/views/application-overview/component/StatisticsCharts.vue

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,18 @@
6161
/>
6262
</el-select>
6363
<div class="p-8">
64-
<AppCharts height="316px" id="tokenUsageCharts" type="bar" :option="tokenUsageOption" />
64+
<AppCharts
65+
v-if="tokenUsage.length > 0"
66+
height="316px"
67+
id="tokenUsageCharts"
68+
type="bar"
69+
:option="tokenUsageOption"
70+
/>
71+
72+
<div v-else>
73+
<h4 class="ml-4">{{ tokenUsageOption.title }}</h4>
74+
<el-empty :description="$t('common.noData')" style="height: 316px" />
75+
</div>
6576
</div>
6677
</el-card>
6778
</el-col>
@@ -77,11 +88,16 @@
7788
</el-select>
7889
<div class="p-8">
7990
<AppCharts
91+
v-if="topQuestions.length > 0"
8092
height="316px"
8193
id="topQuestionsCharts"
8294
type="bar"
8395
:option="topQuestionsOption"
8496
/>
97+
<div v-else>
98+
<h4 class="ml-4">{{ topQuestionsOption.title }}</h4>
99+
<el-empty :description="$t('common.noData')" style="height: 316px" />
100+
</div>
85101
</div>
86102
</el-card>
87103
</el-col>
@@ -215,7 +231,7 @@ const tokenUsageOption = computed(() => {
215231
data: getAttrsArray(props.tokenUsage?.slice(0, tokenUsageCount.value), 'token_usage'),
216232
},
217233
],
218-
dataZoom: props.tokenUsage.length > 0,
234+
dataZoom: props.tokenUsage.length > 20,
219235
}
220236
})
221237
const topQuestionsOption = computed(() => {
@@ -230,7 +246,7 @@ const topQuestionsOption = computed(() => {
230246
),
231247
},
232248
],
233-
dataZoom: props.topQuestions.length > 0,
249+
dataZoom: props.topQuestions.length > 20,
234250
}
235251
})
236252
</script>

0 commit comments

Comments
 (0)