将DeveloperSettings.vue中三元表达式改为计算属性
This commit is contained in:
parent
2a6698db89
commit
65768b7a4c
@ -7,9 +7,7 @@
|
|||||||
<div class="flex items-center justify-between">
|
<div class="flex items-center justify-between">
|
||||||
<div class="text-xl font-semibold">{{ $t('API Access') }}</div>
|
<div class="text-xl font-semibold">{{ $t('API Access') }}</div>
|
||||||
<Button @click="showCreateSecretDialog = true">{{
|
<Button @click="showCreateSecretDialog = true">{{
|
||||||
$team.pg?.user_info?.api_key
|
apiKeyButtonLabel
|
||||||
? $t('Regenerate API Key')
|
|
||||||
: $t('Create New API Key')
|
|
||||||
}}</Button>
|
}}</Button>
|
||||||
</div>
|
</div>
|
||||||
<div v-if="$team.pg?.user_info?.api_key">
|
<div v-if="$team.pg?.user_info?.api_key">
|
||||||
@ -23,23 +21,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<Dialog
|
<Dialog
|
||||||
v-model="showCreateSecretDialog"
|
v-model="showCreateSecretDialog"
|
||||||
:options="{
|
:options="apiKeyDialogOptions"
|
||||||
title: $t('API Access'),
|
|
||||||
size: 'xl',
|
|
||||||
actions: [
|
|
||||||
{
|
|
||||||
label: $team.pg.user_info.api_key
|
|
||||||
? $t('Regenerate API Key')
|
|
||||||
: $t('Create New API Key'),
|
|
||||||
variant: 'solid',
|
|
||||||
disabled: createSecret.data,
|
|
||||||
loading: createSecret.loading,
|
|
||||||
onClick() {
|
|
||||||
createSecret.submit();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}"
|
|
||||||
>
|
>
|
||||||
<template #body-content>
|
<template #body-content>
|
||||||
<div v-if="createSecret.data">
|
<div v-if="createSecret.data">
|
||||||
@ -468,6 +450,30 @@ webhookListResource.reload();
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const apiKeyButtonLabel = computed(() => {
|
||||||
|
return $team.pg?.user_info?.api_key
|
||||||
|
? $t('Regenerate API Key')
|
||||||
|
: $t('Create New API Key');
|
||||||
|
});
|
||||||
|
|
||||||
|
const apiKeyDialogOptions = computed(() => ({
|
||||||
|
title: $t('API Access'),
|
||||||
|
size: 'xl',
|
||||||
|
actions: [
|
||||||
|
{
|
||||||
|
label: $team.pg.user_info.api_key
|
||||||
|
? $t('Regenerate API Key')
|
||||||
|
: $t('Create New API Key'),
|
||||||
|
variant: 'solid',
|
||||||
|
disabled: createSecret.data,
|
||||||
|
loading: createSecret.loading,
|
||||||
|
onClick() {
|
||||||
|
createSecret.submit();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}));
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
if (session.hasWebhookConfigurationAccess) {
|
if (session.hasWebhookConfigurationAccess) {
|
||||||
webhookListResource.fetch();
|
webhookListResource.fetch();
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user