Skip to content

Commit 82b7288

Browse files
committed
fix: improve formatting and consistency in APIKeyDialog.vue
1 parent f8c5e7e commit 82b7288

File tree

2 files changed

+18
-15
lines changed

2 files changed

+18
-15
lines changed

ui/src/layout/layout-header/avatar/APIKeyDialog.vue

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
<template #default="{ row }">
5151
<div v-if="row.is_active" class="flex align-center">
5252
<el-icon class="color-success mr-8" style="font-size: 16px">
53-
<SuccessFilled />
53+
<SuccessFilled/>
5454
</el-icon>
5555
<span class="color-text-primary">
5656
{{ $t('common.status.enabled') }}
@@ -100,9 +100,9 @@
100100
<el-table-column :label="$t('common.operation')" align="left" width="130">
101101
<template #default="{ row }">
102102
<span @click.stop>
103-
<el-switch size="small" v-model="row.is_active" @change="changeState($event, row)" />
103+
<el-switch size="small" v-model="row.is_active" @change="changeState($event, row)"/>
104104
</span>
105-
<el-divider direction="vertical" />
105+
<el-divider direction="vertical"/>
106106
<span class="mr-4">
107107
<el-tooltip effect="dark" :content="$t('common.setting')" placement="top">
108108
<el-button type="primary" text @click.stop="settingApiKey(row)">
@@ -118,23 +118,23 @@
118118
</template>
119119
</el-table-column>
120120
</app-table>
121-
<SettingAPIKeyDialog ref="SettingAPIKeyDialogRef" @refresh="refresh" />
121+
<SettingAPIKeyDialog ref="SettingAPIKeyDialogRef" @refresh="refresh"/>
122122
</el-dialog>
123123
</template>
124124
<script setup lang="ts">
125-
import { ref, watch, reactive } from 'vue'
126-
import { useRoute } from 'vue-router'
127-
import { copyClick } from '@/utils/clipboard'
125+
import {ref, watch, reactive} from 'vue'
126+
import {useRoute} from 'vue-router'
127+
import {copyClick} from '@/utils/clipboard'
128128
import systemKeyApi from '@/api/system/api-key'
129-
import { datetimeFormat } from '@/utils/time'
130-
import { MsgSuccess, MsgConfirm } from '@/utils/message'
131-
import { t } from '@/locales'
129+
import {datetimeFormat} from '@/utils/time'
130+
import {MsgSuccess, MsgConfirm} from '@/utils/message'
131+
import {t} from '@/locales'
132132
import SettingAPIKeyDialog from '@/views/application-overview/component/SettingAPIKeyDrawer.vue'
133-
import { fromNowDate } from '@/utils/time'
133+
import {fromNowDate} from '@/utils/time'
134134
135135
const route = useRoute()
136136
const {
137-
params: { id },
137+
params: {id},
138138
} = route
139139
140140
const props = defineProps({
@@ -189,7 +189,8 @@ function deleteApiKey(row: any) {
189189
getApiKeyList()
190190
})
191191
})
192-
.catch(() => {})
192+
.catch(() => {
193+
})
193194
}
194195
195196
function changeState(bool: boolean, row: any) {
@@ -205,6 +206,7 @@ function changeState(bool: boolean, row: any) {
205206
206207
function createApiKey() {
207208
systemKeyApi.postAPIKey(loading).then((res) => {
209+
MsgSuccess(t('common.createSuccess'))
208210
getApiKeyList()
209211
})
210212
}
@@ -235,7 +237,7 @@ function getExpiryClass(expireTime: any) {
235237
}
236238
}
237239
238-
function handleSortChange({ prop, order }: { prop: string; order: string }) {
240+
function handleSortChange({prop, order}: { prop: string; order: string }) {
239241
orderBy.value = order === 'ascending' ? prop : `-${prop}`
240242
getApiKeyList()
241243
}
@@ -244,7 +246,7 @@ function refresh() {
244246
getApiKeyList()
245247
}
246248
247-
defineExpose({ open })
249+
defineExpose({open})
248250
</script>
249251
<style lang="scss" scoped>
250252
.api-key-container {

ui/src/views/application-overview/component/APIKeyDialog.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,7 @@ function createApiKey() {
205205
loadSharedApi({type: 'applicationKey', systemType: apiType.value})
206206
.postAPIKey(id as string, loading)
207207
.then(() => {
208+
MsgSuccess(t('common.createSuccess'))
208209
getApiKeyList()
209210
})
210211
}

0 commit comments

Comments
 (0)