1111 <div class =" title flex align-center" >
1212 <div
1313 class =" edit-avatar mr-12"
14- @mouseenter =" showEditIcon = true"
15- @mouseleave =" showEditIcon = false"
1614 >
1715 <el-avatar shape =" square" :size =" 32" style =" background : none " >
18- <img :src =" resetUrl(detail?.icon, resetUrl('./favicon.ico'))" alt =" " />
19- </el-avatar >
20-
21- <el-avatar
22- v-if =" showEditIcon"
23- shape =" square"
24- class =" edit-mask"
25- :size =" 32"
26- @click =" openEditAvatar"
27- >
28- <el-icon ><EditPen /></el-icon >
16+ <img :src =" resetUrl(detail?.icon, resetUrl('./favicon.ico'))" alt =" " />
2917 </el-avatar >
3018 </div >
3119
3624 <el-col :span =" 12" class =" mt-16" >
3725 <div class =" flex" >
3826 <el-text type =" info" >{{
39- $t('views.applicationOverview.appInfo.publicAccessLink')
40- }}</el-text >
27+ $t('views.applicationOverview.appInfo.publicAccessLink')
28+ }}
29+ </el-text >
4130 <el-switch
4231 v-model =" accessToken.is_active"
4332 class =" ml-8"
6554 text
6655 style =" margin-left : 1px "
6756 >
68- <el-icon ><RefreshRight /></el-icon >
57+ <el-icon >
58+ <RefreshRight />
59+ </el-icon >
6960 </el-button >
7061 </el-tooltip >
7162 </div >
9485 </el-button >
9586 <!-- 访问限制 -->
9687 <el-button @click =" openLimitDialog" v-if =" permissionPrecise.overview_access(id)" >
97- <el-icon class =" mr-4" ><Lock /></el-icon >
88+ <el-icon class =" mr-4" >
89+ <Lock />
90+ </el-icon >
9891 {{ $t('views.applicationOverview.appInfo.accessControl') }}
9992 </el-button >
10093 <!-- 显示设置 -->
10194 <el-button
10295 @click =" openDisplaySettingDialog"
10396 v-if =" permissionPrecise.overview_display(id)"
10497 >
105- <el-icon class =" mr-4" ><Setting /></el-icon >
98+ <el-icon class =" mr-4" >
99+ <Setting />
100+ </el-icon >
106101 {{ $t('views.applicationOverview.appInfo.displaySetting') }}
107102 </el-button >
108103 </div >
109104 </el-col >
110105 <el-col :span =" 12" class =" mt-16" >
111106 <div class =" flex" >
112107 <el-text type =" info"
113- >{{ $t('views.applicationOverview.appInfo.apiAccessCredentials') }}
108+ >{{ $t('views.applicationOverview.appInfo.apiAccessCredentials') }}
114109 </el-text >
115110 </div >
116111 <div class =" mt-4 mb-16 url-height" >
117112 <div >
118- <el-text >API {{ $t('common.fileUpload.document') }}:</el-text
119- ><el-button
113+ <el-text >API {{ $t('common.fileUpload.document') }}:
114+ </el-text
115+ >
116+ <el-button
120117 type =" primary"
121118 link
122119 @click =" toUrl(apiUrl)"
131128 </span >
132129
133130 <span class =" vertical-middle lighter break-all ellipsis-1" >{{
134- baseUrl + id
135- }}</span >
131+ baseUrl + id
132+ }}</span >
136133 <el-tooltip effect =" dark" :content =" $t('common.copy')" placement =" top" >
137134 <el-button type =" primary" text @click =" copyClick(baseUrl + id)" >
138135 <AppIcon iconName =" app-copy" ></AppIcon >
145142 @click =" openAPIKeyDialog"
146143 v-if =" permissionPrecise.overview_api_key(id)"
147144 >
148- <el-icon class =" mr-4" ><Key /></el-icon >
149- {{ $t('views.applicationOverview.appInfo.apiKey') }}</el-button
145+ <el-icon class =" mr-4" >
146+ <Key />
147+ </el-icon >
148+ {{ $t('views.applicationOverview.appInfo.apiKey') }}
149+ </el-button
150150 >
151151 </div >
152152 </el-col >
183183 />
184184 </div >
185185 <div v-loading =" statisticsLoading" >
186- <StatisticsCharts :data =" statisticsData" />
186+ <StatisticsCharts :data =" statisticsData" />
187187 </div >
188188 </el-card >
189189 </div >
194194 :data =" detail"
195195 :api-input-params =" mapToUrlParams(apiInputParams)"
196196 />
197- <APIKeyDialog ref =" APIKeyDialogRef" />
198- <EditAvatarDialog ref =" EditAvatarDialogRef" @refresh =" refreshIcon" />
197+ <APIKeyDialog ref =" APIKeyDialogRef" />
198+ <EditAvatarDialog ref =" EditAvatarDialogRef" @refresh =" refreshIcon" />
199199
200200 <!-- 社区版访问限制 -->
201- <component :is =" currentLimitDialog" ref =" LimitDialogRef" @refresh =" refresh" />
201+ <component :is =" currentLimitDialog" ref =" LimitDialogRef" @refresh =" refresh" />
202202 <!-- 显示设置 -->
203- <component :is =" currentDisplaySettingDialog" ref =" DisplaySettingDialogRef" @refresh =" refresh" />
203+ <component :is =" currentDisplaySettingDialog" ref =" DisplaySettingDialogRef" @refresh =" refresh" />
204204 </div >
205205</template >
206206<script setup lang="ts">
207- import { ref , computed , onMounted , shallowRef , nextTick } from ' vue'
208- import { useRoute } from ' vue-router'
207+ import {ref , computed , onMounted , shallowRef , nextTick } from ' vue'
208+ import {useRoute } from ' vue-router'
209209import EmbedDialog from ' ./component/EmbedDialog.vue'
210210import APIKeyDialog from ' ./component/APIKeyDialog.vue'
211211import LimitDialog from ' ./component/LimitDialog.vue'
@@ -215,15 +215,15 @@ import XPackDisplaySettingDialog from './xpack-component/XPackDisplaySettingDial
215215import EditAvatarDialog from ' ./component/EditAvatarDialog.vue'
216216import StatisticsCharts from ' ./component/StatisticsCharts.vue'
217217import applicationApi from ' @/api/application/application'
218- import { nowDate , beforeDay } from ' @/utils/time'
219- import { MsgSuccess , MsgConfirm } from ' @/utils/message'
220- import { copyClick } from ' @/utils/clipboard'
221- import { isAppIcon , resetUrl } from ' @/utils/common'
222- import { mapToUrlParams } from ' @/utils/application'
218+ import {nowDate , beforeDay } from ' @/utils/time'
219+ import {MsgSuccess , MsgConfirm } from ' @/utils/message'
220+ import {copyClick } from ' @/utils/clipboard'
221+ import {isAppIcon , resetUrl } from ' @/utils/common'
222+ import {mapToUrlParams } from ' @/utils/application'
223223import useStore from ' @/stores'
224- import { t } from ' @/locales'
225- import { EditionConst } from ' @/utils/permission/data'
226- import { hasPermission } from ' @/utils/permission/index'
224+ import {t } from ' @/locales'
225+ import {EditionConst } from ' @/utils/permission/data'
226+ import {hasPermission } from ' @/utils/permission/index'
227227import permissionMap from ' @/permission'
228228
229229const route = useRoute ()
@@ -235,9 +235,9 @@ const permissionPrecise = computed(() => {
235235 return permissionMap [' application' ][apiType .value ]
236236})
237237
238- const { user, application } = useStore ()
238+ const {user, application} = useStore ()
239239const {
240- params : { id },
240+ params : {id },
241241} = route as any
242242
243243const apiUrl = window .location .origin + ' /doc/chat/'
@@ -308,6 +308,7 @@ function toUrl(url: string) {
308308// 显示设置
309309const DisplaySettingDialogRef = ref ()
310310const currentDisplaySettingDialog = shallowRef <any >(null )
311+
311312function openDisplaySettingDialog() {
312313 // 企业版和专业版
313314 if (hasPermission ([EditionConst .IS_EE , EditionConst .IS_PE ], ' OR' )) {
@@ -330,6 +331,7 @@ function openDisplaySettingDialog() {
330331// 访问限制
331332const LimitDialogRef = ref ()
332333const currentLimitDialog = shallowRef <any >(null )
334+
333335function openLimitDialog() {
334336 // 企业版和专业版
335337 if (hasPermission ([EditionConst .IS_EE , EditionConst .IS_PE ], ' OR' )) {
@@ -384,8 +386,10 @@ function refreshAccessToken() {
384386 const str = t (' views.applicationOverview.appInfo.refreshToken.refreshSuccess' )
385387 updateAccessToken (obj , str )
386388 })
387- .catch (() => {})
389+ .catch (() => {
390+ })
388391}
392+
389393function changeState(bool : boolean ) {
390394 const obj = {
391395 is_active: ! bool ,
@@ -410,9 +414,11 @@ async function updateAccessToken(obj: any, str: string) {
410414function openAPIKeyDialog() {
411415 APIKeyDialogRef .value .open ()
412416}
417+
413418function openDialog() {
414419 EmbedDialogRef .value .open (accessToken .value ?.access_token )
415420}
421+
416422function getAccessToken() {
417423 application .asyncGetAccessToken (id , loading ).then ((res : any ) => {
418424 accessToken .value = res ?.data
@@ -427,20 +433,20 @@ function getDetail() {
427433 .map ((v : any ) => {
428434 apiInputParams .value = v .properties .api_input_field_list
429435 ? v .properties .api_input_field_list .map ((v : any ) => {
430- return {
431- name: v .variable ,
432- value: v .default_value ,
433- }
434- })
436+ return {
437+ name: v .variable ,
438+ value: v .default_value ,
439+ }
440+ })
435441 : v .properties .input_field_list
436442 ? v .properties .input_field_list
437- .filter ((v : any ) => v .assignment_method === ' api_input' )
438- .map ((v : any ) => {
439- return {
440- name: v .variable ,
441- value: v .default_value ,
442- }
443- })
443+ .filter ((v : any ) => v .assignment_method === ' api_input' )
444+ .map ((v : any ) => {
445+ return {
446+ name: v .variable ,
447+ value: v .default_value ,
448+ }
449+ })
444450 : []
445451 })
446452 })
@@ -463,6 +469,7 @@ onMounted(() => {
463469<style lang="scss" scoped>
464470.overview-card {
465471 position : relative ;
472+
466473 .active-button {
467474 position : absolute ;
468475 right : 16px ;
0 commit comments