refactor: clean up template and script formatting for improved readability
This commit is contained in:
parent
8f00184122
commit
e346137a48
@ -11,22 +11,10 @@
|
||||
<div class="title flex align-center">
|
||||
<div
|
||||
class="edit-avatar mr-12"
|
||||
@mouseenter="showEditIcon = true"
|
||||
@mouseleave="showEditIcon = false"
|
||||
>
|
||||
<el-avatar shape="square" :size="32" style="background: none">
|
||||
<img :src="resetUrl(detail?.icon, resetUrl('./favicon.ico'))" alt=""/>
|
||||
</el-avatar>
|
||||
|
||||
<el-avatar
|
||||
v-if="showEditIcon"
|
||||
shape="square"
|
||||
class="edit-mask"
|
||||
:size="32"
|
||||
@click="openEditAvatar"
|
||||
>
|
||||
<el-icon><EditPen /></el-icon>
|
||||
</el-avatar>
|
||||
</div>
|
||||
|
||||
<h4>{{ detail?.name || '-' }}</h4>
|
||||
@ -37,7 +25,8 @@
|
||||
<div class="flex">
|
||||
<el-text type="info">{{
|
||||
$t('views.applicationOverview.appInfo.publicAccessLink')
|
||||
}}</el-text>
|
||||
}}
|
||||
</el-text>
|
||||
<el-switch
|
||||
v-model="accessToken.is_active"
|
||||
class="ml-8"
|
||||
@ -65,7 +54,9 @@
|
||||
text
|
||||
style="margin-left: 1px"
|
||||
>
|
||||
<el-icon><RefreshRight /></el-icon>
|
||||
<el-icon>
|
||||
<RefreshRight/>
|
||||
</el-icon>
|
||||
</el-button>
|
||||
</el-tooltip>
|
||||
</div>
|
||||
@ -94,7 +85,9 @@
|
||||
</el-button>
|
||||
<!-- 访问限制 -->
|
||||
<el-button @click="openLimitDialog" v-if="permissionPrecise.overview_access(id)">
|
||||
<el-icon class="mr-4"><Lock /></el-icon>
|
||||
<el-icon class="mr-4">
|
||||
<Lock/>
|
||||
</el-icon>
|
||||
{{ $t('views.applicationOverview.appInfo.accessControl') }}
|
||||
</el-button>
|
||||
<!-- 显示设置 -->
|
||||
@ -102,7 +95,9 @@
|
||||
@click="openDisplaySettingDialog"
|
||||
v-if="permissionPrecise.overview_display(id)"
|
||||
>
|
||||
<el-icon class="mr-4"><Setting /></el-icon>
|
||||
<el-icon class="mr-4">
|
||||
<Setting/>
|
||||
</el-icon>
|
||||
{{ $t('views.applicationOverview.appInfo.displaySetting') }}
|
||||
</el-button>
|
||||
</div>
|
||||
@ -115,8 +110,10 @@
|
||||
</div>
|
||||
<div class="mt-4 mb-16 url-height">
|
||||
<div>
|
||||
<el-text>API {{ $t('common.fileUpload.document') }}:</el-text
|
||||
><el-button
|
||||
<el-text>API {{ $t('common.fileUpload.document') }}:
|
||||
</el-text
|
||||
>
|
||||
<el-button
|
||||
type="primary"
|
||||
link
|
||||
@click="toUrl(apiUrl)"
|
||||
@ -145,8 +142,11 @@
|
||||
@click="openAPIKeyDialog"
|
||||
v-if="permissionPrecise.overview_api_key(id)"
|
||||
>
|
||||
<el-icon class="mr-4"><Key /></el-icon>
|
||||
{{ $t('views.applicationOverview.appInfo.apiKey') }}</el-button
|
||||
<el-icon class="mr-4">
|
||||
<Key/>
|
||||
</el-icon>
|
||||
{{ $t('views.applicationOverview.appInfo.apiKey') }}
|
||||
</el-button
|
||||
>
|
||||
</div>
|
||||
</el-col>
|
||||
@ -308,6 +308,7 @@ function toUrl(url: string) {
|
||||
// 显示设置
|
||||
const DisplaySettingDialogRef = ref()
|
||||
const currentDisplaySettingDialog = shallowRef<any>(null)
|
||||
|
||||
function openDisplaySettingDialog() {
|
||||
// 企业版和专业版
|
||||
if (hasPermission([EditionConst.IS_EE, EditionConst.IS_PE], 'OR')) {
|
||||
@ -330,6 +331,7 @@ function openDisplaySettingDialog() {
|
||||
// 访问限制
|
||||
const LimitDialogRef = ref()
|
||||
const currentLimitDialog = shallowRef<any>(null)
|
||||
|
||||
function openLimitDialog() {
|
||||
// 企业版和专业版
|
||||
if (hasPermission([EditionConst.IS_EE, EditionConst.IS_PE], 'OR')) {
|
||||
@ -384,8 +386,10 @@ function refreshAccessToken() {
|
||||
const str = t('views.applicationOverview.appInfo.refreshToken.refreshSuccess')
|
||||
updateAccessToken(obj, str)
|
||||
})
|
||||
.catch(() => {})
|
||||
.catch(() => {
|
||||
})
|
||||
}
|
||||
|
||||
function changeState(bool: boolean) {
|
||||
const obj = {
|
||||
is_active: !bool,
|
||||
@ -410,9 +414,11 @@ async function updateAccessToken(obj: any, str: string) {
|
||||
function openAPIKeyDialog() {
|
||||
APIKeyDialogRef.value.open()
|
||||
}
|
||||
|
||||
function openDialog() {
|
||||
EmbedDialogRef.value.open(accessToken.value?.access_token)
|
||||
}
|
||||
|
||||
function getAccessToken() {
|
||||
application.asyncGetAccessToken(id, loading).then((res: any) => {
|
||||
accessToken.value = res?.data
|
||||
@ -463,6 +469,7 @@ onMounted(() => {
|
||||
<style lang="scss" scoped>
|
||||
.overview-card {
|
||||
position: relative;
|
||||
|
||||
.active-button {
|
||||
position: absolute;
|
||||
right: 16px;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user