登录页加载态、日志动作补齐与绑定按钮禁用态
This commit is contained in:
@@ -204,6 +204,11 @@ const bindableProviders = computed(() => {
|
||||
return out
|
||||
})
|
||||
|
||||
/** 已绑定的 provider 集合;绑定入口按钮据此禁用,解绑后自动恢复 */
|
||||
const boundProviders = computed(
|
||||
() => new Set((identities.data.value?.items ?? []).map((it) => it.provider)),
|
||||
)
|
||||
|
||||
async function bindProvider(provider: string) {
|
||||
binding.value = provider
|
||||
try {
|
||||
@@ -507,9 +512,10 @@ async function deleteProvider(p: ProviderType) {
|
||||
:key="p"
|
||||
size="small"
|
||||
:loading="binding === p"
|
||||
:disabled="boundProviders.has(p)"
|
||||
@click="bindProvider(p)"
|
||||
>
|
||||
绑定 {{ displayNameOf(p) }}
|
||||
{{ boundProviders.has(p) ? '已绑定' : '绑定' }} {{ displayNameOf(p) }}
|
||||
</NButton>
|
||||
<span class="text-xs text-ink-3">将跳转到对应平台授权</span>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user