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