Skip to content

Commit 76340be

Browse files
committed
fix: show openai_web gpt-4 usage
1 parent e24865b commit 76340be

File tree

6 files changed

+18
-11
lines changed

6 files changed

+18
-11
lines changed

frontend/src/api/status.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import axios from 'axios';
22

3-
import { ServerStatusSchema } from '@/types/schema';
3+
import { CommonStatusSchema } from '@/types/schema';
44

55
import ApiUrl from './url';
66

77
export function getServerStatusApi() {
8-
return axios.get<ServerStatusSchema>(ApiUrl.ServerStatus);
8+
return axios.get<CommonStatusSchema>(ApiUrl.ServerStatus);
99
}

frontend/src/locales/zh-CN.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,8 @@
297297
"rev_chat_status": "Chat 状态",
298298
"max_conv_count": "最大对话数量",
299299
"source": "来源",
300-
"plugins": "插件"
300+
"plugins": "插件",
301+
"gpt4_count_in_3_hours": "GPT-4 用量 / 3h"
301302
},
302303
"models": {
303304
"gpt_3_5": "GPT-3.5",

frontend/src/types/schema.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export type OpenaiApiSourceSettingSchema = components['schemas']['OpenaiApiSourc
1212
export type TimeWindowRateLimit = components['schemas']['TimeWindowRateLimit'];
1313
export type DailyTimeSlot = components['schemas']['DailyTimeSlot'];
1414

15-
export type ServerStatusSchema = components['schemas']['ServerStatusSchema'];
15+
export type CommonStatusSchema = components['schemas']['CommonStatusSchema'];
1616
export type OpenaiWebChatStatus = components['schemas']['OpenaiWebChatStatus'];
1717

1818
export type OpenaiWebChatModels = components['schemas']['OpenaiWebChatModels'];

frontend/src/views/admin/components/SystemInfoCard.vue

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
</n-button>
1313
</div>
1414
</template>
15-
<div class="grid grid-cols-3 md:grid-cols-5 gap-4">
15+
<div class="grid grid-cols-3 md:grid-cols-6 gap-4">
1616
<n-statistic v-for="item in statistics" :key="item.label" :label="item.label" :value="item.value">
1717
<template v-if="item.prefixIcon" #prefix>
1818
<n-icon :component="item.prefixIcon" />
@@ -32,12 +32,12 @@ import { RefreshFilled } from '@vicons/material';
3232
import { computed } from 'vue';
3333
import { useI18n } from 'vue-i18n';
3434
35-
import { ServerStatusSchema, SystemInfo } from '@/types/schema';
35+
import { CommonStatusSchema, SystemInfo } from '@/types/schema';
3636
const { t } = useI18n();
3737
3838
const props = defineProps<{
3939
systemInfo?: SystemInfo;
40-
serverStatus?: ServerStatusSchema;
40+
serverStatus?: CommonStatusSchema;
4141
}>();
4242
4343
const emits = defineEmits<{
@@ -68,6 +68,12 @@ const statistics = computed(() => {
6868
prefixIcon: null,
6969
suffix: `/ ${props.systemInfo?.total_conversation_count}`,
7070
},
71+
{
72+
label: t('labels.gpt4_count_in_3_hours'),
73+
value: props.serverStatus?.gpt4_count_in_3_hours,
74+
prefixIcon: null,
75+
suffix: '/ 25',
76+
},
7177
{
7278
label: t('commons.chatbotStatus'),
7379
value: props.serverStatus?.is_chatbot_busy ? t('commons.askingChatStatus') : t('commons.idlingChatStatus'),

frontend/src/views/admin/pages/system_manager.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,14 @@ import { useI18n } from 'vue-i18n';
1212
import { getServerStatusApi } from '@/api/status';
1313
import { getAskStatisticsApi, getRequestStatisticsApi, getSystemInfoApi } from '@/api/system';
1414
import { getAllUserApi } from '@/api/user';
15-
import { AskLogAggregation, RequestLogAggregation, ServerStatusSchema, SystemInfo, UserRead } from '@/types/schema';
15+
import { AskLogAggregation, CommonStatusSchema, RequestLogAggregation, SystemInfo, UserRead } from '@/types/schema';
1616
1717
import StatisticsCard from '../components/StatisticsCard.vue';
1818
import SystemInfoCard from '../components/SystemInfoCard.vue';
1919
const { t } = useI18n();
2020
2121
const systemInfo = ref<SystemInfo | undefined>();
22-
const serverStatus = ref<ServerStatusSchema | undefined>();
22+
const serverStatus = ref<CommonStatusSchema | undefined>();
2323
const requestStats = ref<RequestLogAggregation[] | undefined>();
2424
const askStats = ref<AskLogAggregation[] | undefined>();
2525
const users = ref<UserRead[] | undefined>();

frontend/src/views/conversation/components/StatusCard.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,9 @@ import { EventBusyFilled, QueueFilled } from '@vicons/material';
6565
import { ref } from 'vue';
6666
6767
import { getServerStatusApi } from '@/api/status';
68-
import { ServerStatusSchema } from '@/types/schema';
68+
import { CommonStatusSchema } from '@/types/schema';
6969
70-
const serverStatus = ref<ServerStatusSchema>({});
70+
const serverStatus = ref<CommonStatusSchema>({});
7171
7272
const isExpaned = ref(false);
7373

0 commit comments

Comments
 (0)