1111 <div class =" title flex align-center" >
1212 <div class =" edit-avatar mr-12" >
1313 <el-avatar shape =" square" :size =" 32" style =" background : none " >
14- <img :src =" resetUrl(detail?.icon, resetUrl('./favicon.ico'))" alt =" " />
14+ <img :src =" resetUrl(detail?.icon, resetUrl('./favicon.ico'))" alt =" " />
1515 </el-avatar >
1616 </div >
1717
2222 <el-col :span =" 12" class =" mt-16" >
2323 <div class =" flex" >
2424 <el-text type =" info"
25- >{{ $t('views.applicationOverview.appInfo.publicAccessLink') }}
25+ >{{ $t('views.applicationOverview.appInfo.publicAccessLink') }}
2626 </el-text >
2727 <el-switch
2828 v-model =" accessToken.is_active"
5151 text
5252 style =" margin-left : 1px "
5353 >
54- <el-icon >
55- <RefreshRight />
56- </el-icon >
54+ <AppIcon iconName =" app-refresh" ></AppIcon >
5755 </el-button >
5856 </el-tooltip >
5957 </div >
9896 <el-col :span =" 12" class =" mt-16" >
9997 <div class =" flex" >
10098 <el-text type =" info"
101- >{{ $t('views.applicationOverview.appInfo.apiAccessCredentials') }}
99+ >{{ $t('views.applicationOverview.appInfo.apiAccessCredentials') }}
102100 </el-text >
103101 </div >
104102 <div class =" mt-4 mb-16 url-height" >
119117 </span >
120118
121119 <span class =" vertical-middle lighter break-all ellipsis-1" >{{
122- baseUrl + id
123- }}</span >
120+ baseUrl + id
121+ }}</span >
124122 <el-tooltip effect =" dark" :content =" $t('common.copy')" placement =" top" >
125123 <el-button type =" primary" text @click =" copyClick(baseUrl + id)" >
126124 <AppIcon iconName =" app-copy" ></AppIcon >
134132 v-if =" permissionPrecise.overview_api_key(id)"
135133 >
136134 <el-icon class =" mr-4" >
137- <Key />
135+ <Key />
138136 </el-icon >
139137 {{ $t('views.applicationOverview.appInfo.apiKey') }}
140138 </el-button >
148146 {{ $t('views.applicationOverview.monitor.monitoringStatistics') }}
149147 </h4 >
150148 <div class =" mb-16" >
151- <el-select
152- v-model =" history_day"
153- class =" mr-12 w-180"
154- @change =" changeDayHandle"
155-
156- >
149+ <el-select v-model =" history_day" class =" mr-12 w-180" @change =" changeDayHandle" >
157150 <el-option
158151 v-for =" item in dayOptions"
159152 :key =" item.value"
173166 />
174167 </div >
175168 <div v-loading =" statisticsLoading" >
176- <StatisticsCharts :data =" statisticsData" :token-usage =" tokenUsage"
177- :top-questions =" topQuestions" />
169+ <StatisticsCharts
170+ :data =" statisticsData"
171+ :token-usage =" tokenUsage"
172+ :top-questions =" topQuestions"
173+ />
178174 </div >
179175 </el-card >
180176 </div >
185181 :data =" detail"
186182 :api-input-params =" mapToUrlParams(apiInputParams)"
187183 />
188- <APIKeyDialog ref =" APIKeyDialogRef" />
184+ <APIKeyDialog ref =" APIKeyDialogRef" />
189185
190186 <!-- 社区版访问限制 -->
191- <component :is =" currentLimitDialog" ref =" LimitDialogRef" @refresh =" refresh" />
187+ <component :is =" currentLimitDialog" ref =" LimitDialogRef" @refresh =" refresh" />
192188 <!-- 显示设置 -->
193- <component :is =" currentDisplaySettingDialog" ref =" DisplaySettingDialogRef" @refresh =" refresh" />
189+ <component :is =" currentDisplaySettingDialog" ref =" DisplaySettingDialogRef" @refresh =" refresh" />
194190 </div >
195191</template >
196192<script setup lang="ts">
197- import {ref , computed , onMounted , shallowRef , nextTick } from ' vue'
198- import {useRoute } from ' vue-router'
193+ import { ref , computed , onMounted , shallowRef , nextTick } from ' vue'
194+ import { useRoute } from ' vue-router'
199195import EmbedDialog from ' ./component/EmbedDialog.vue'
200196import APIKeyDialog from ' ./component/APIKeyDialog.vue'
201197import LimitDialog from ' ./component/LimitDialog.vue'
202198import XPackLimitDrawer from ' ./xpack-component/XPackLimitDrawer.vue'
203199import DisplaySettingDialog from ' ./component/DisplaySettingDialog.vue'
204200import XPackDisplaySettingDialog from ' ./xpack-component/XPackDisplaySettingDialog.vue'
205201import StatisticsCharts from ' ./component/StatisticsCharts.vue'
206- import {nowDate , beforeDay } from ' @/utils/time'
207- import {MsgSuccess , MsgConfirm } from ' @/utils/message'
208- import {copyClick } from ' @/utils/clipboard'
209- import {resetUrl } from ' @/utils/common'
210- import {mapToUrlParams } from ' @/utils/application'
211- import {t } from ' @/locales'
212- import {EditionConst } from ' @/utils/permission/data'
213- import {hasPermission } from ' @/utils/permission/index'
202+ import { nowDate , beforeDay } from ' @/utils/time'
203+ import { MsgSuccess , MsgConfirm } from ' @/utils/message'
204+ import { copyClick } from ' @/utils/clipboard'
205+ import { resetUrl } from ' @/utils/common'
206+ import { mapToUrlParams } from ' @/utils/application'
207+ import { t } from ' @/locales'
208+ import { EditionConst } from ' @/utils/permission/data'
209+ import { hasPermission } from ' @/utils/permission/index'
214210import permissionMap from ' @/permission'
215- import {loadSharedApi } from ' @/utils/dynamics-api/shared-api'
211+ import { loadSharedApi } from ' @/utils/dynamics-api/shared-api'
216212
217213const route = useRoute ()
218214const {
219- params : {id },
215+ params : { id },
220216} = route as any
221217
222218const apiType = computed (() => {
@@ -311,7 +307,7 @@ function openDisplaySettingDialog() {
311307 }
312308 nextTick (() => {
313309 if (currentDisplaySettingDialog .value == XPackDisplaySettingDialog ) {
314- loadSharedApi ({type: ' application' , systemType: apiType .value })
310+ loadSharedApi ({ type: ' application' , systemType: apiType .value })
315311 .getApplicationSetting (id )
316312 .then ((ok : any ) => {
317313 DisplaySettingDialogRef .value ?.open (ok .data , detail .value )
@@ -354,18 +350,18 @@ function changeDayRangeHandle(val: string) {
354350}
355351
356352function getAppStatistics() {
357- loadSharedApi ({type: ' application' , systemType: apiType .value })
353+ loadSharedApi ({ type: ' application' , systemType: apiType .value })
358354 .getStatistics (id , daterange .value , statisticsLoading )
359355 .then ((res : any ) => {
360356 statisticsData .value = res .data
361357 })
362- loadSharedApi ({type: ' application' , systemType: apiType .value })
358+ loadSharedApi ({ type: ' application' , systemType: apiType .value })
363359 .getTokenUsage (id , daterange .value , statisticsLoading )
364360 .then ((res : any ) => {
365361 // [{'token_usage': 200, 'username': '张三'}, ...]
366362 tokenUsage .value = res .data
367363 })
368- loadSharedApi ({type: ' application' , systemType: apiType .value })
364+ loadSharedApi ({ type: ' application' , systemType: apiType .value })
369365 .topQuestions (id , daterange .value , statisticsLoading )
370366 .then ((res : any ) => {
371367 // [{'chat_record_count': 200, 'username': '张三'}, ...]
@@ -389,8 +385,7 @@ function refreshAccessToken() {
389385 const str = t (' views.applicationOverview.appInfo.refreshToken.refreshSuccess' )
390386 updateAccessToken (obj , str )
391387 })
392- .catch (() => {
393- })
388+ .catch (() => {})
394389}
395390
396391async function changeState(bool : boolean ) {
@@ -408,7 +403,7 @@ async function changeState(bool: boolean) {
408403}
409404
410405async function updateAccessToken(obj : any , str : string ) {
411- loadSharedApi ({type: ' application' , systemType: apiType .value })
406+ loadSharedApi ({ type: ' application' , systemType: apiType .value })
412407 .putAccessToken (id as string , obj , loading )
413408 .then ((res : any ) => {
414409 accessToken .value = res ?.data
@@ -425,15 +420,15 @@ function openDialog() {
425420}
426421
427422function getAccessToken() {
428- loadSharedApi ({type: ' application' , systemType: apiType .value })
423+ loadSharedApi ({ type: ' application' , systemType: apiType .value })
429424 .getAccessToken (id , loading )
430425 .then ((res : any ) => {
431426 accessToken .value = res ?.data
432427 })
433428}
434429
435430function getDetail() {
436- loadSharedApi ({type: ' application' , systemType: apiType .value })
431+ loadSharedApi ({ type: ' application' , systemType: apiType .value })
437432 .getApplicationDetail (id , loading )
438433 .then ((res : any ) => {
439434 detail .value = res .data
@@ -442,20 +437,20 @@ function getDetail() {
442437 .map ((v : any ) => {
443438 apiInputParams .value = v .properties .api_input_field_list
444439 ? v .properties .api_input_field_list .map ((v : any ) => {
445- return {
446- name: v .variable ,
447- value: v .default_value ,
448- }
449- })
440+ return {
441+ name: v .variable ,
442+ value: v .default_value ,
443+ }
444+ })
450445 : v .properties .input_field_list
451446 ? v .properties .input_field_list
452- .filter ((v : any ) => v .assignment_method === ' api_input' )
453- .map ((v : any ) => {
454- return {
455- name: v .variable ,
456- value: v .default_value ,
457- }
458- })
447+ .filter ((v : any ) => v .assignment_method === ' api_input' )
448+ .map ((v : any ) => {
449+ return {
450+ name: v .variable ,
451+ value: v .default_value ,
452+ }
453+ })
459454 : []
460455 })
461456 })
0 commit comments