diff --git a/packages/nc-gui/assets/img/placeholder/api-tokens.png b/packages/nc-gui/assets/img/placeholder/api-tokens.png new file mode 100644 index 0000000000..2e7020d8da Binary files /dev/null and b/packages/nc-gui/assets/img/placeholder/api-tokens.png differ diff --git a/packages/nc-gui/assets/img/placeholder/invite-team.png b/packages/nc-gui/assets/img/placeholder/invite-team.png new file mode 100644 index 0000000000..f9c7b5f77a Binary files /dev/null and b/packages/nc-gui/assets/img/placeholder/invite-team.png differ diff --git a/packages/nc-gui/assets/img/placeholder/link-records.png b/packages/nc-gui/assets/img/placeholder/link-records.png new file mode 100644 index 0000000000..28d4ec92fa Binary files /dev/null and b/packages/nc-gui/assets/img/placeholder/link-records.png differ diff --git a/packages/nc-gui/assets/img/placeholder/multi-field-editor.png b/packages/nc-gui/assets/img/placeholder/multi-field-editor.png new file mode 100644 index 0000000000..62dec5cae4 Binary files /dev/null and b/packages/nc-gui/assets/img/placeholder/multi-field-editor.png differ diff --git a/packages/nc-gui/assets/img/placeholder/table.png b/packages/nc-gui/assets/img/placeholder/table.png new file mode 100644 index 0000000000..182fa1dada Binary files /dev/null and b/packages/nc-gui/assets/img/placeholder/table.png differ diff --git a/packages/nc-gui/assets/img/placeholder/webhooks.png b/packages/nc-gui/assets/img/placeholder/webhooks.png new file mode 100644 index 0000000000..0bc49da858 Binary files /dev/null and b/packages/nc-gui/assets/img/placeholder/webhooks.png differ diff --git a/packages/nc-gui/components/account/Token.vue b/packages/nc-gui/components/account/Token.vue index 72fff9fe80..9c3d612fb0 100644 --- a/packages/nc-gui/components/account/Token.vue +++ b/packages/nc-gui/components/account/Token.vue @@ -45,6 +45,8 @@ const pagination = reactive({ pageSize: 10, }) +const isLoadingAllTokens = ref(true) + const setDefaultTokenName = () => { selectedTokenData.value.description = extractNextDefaultName( [...allTokens.value.map((el) => el?.description || '')], @@ -94,7 +96,7 @@ const updateAllTokens = (type: 'delete' | 'add', token: IApiTokenInfo) => { setDefaultTokenName() } -const loadTokens = async (page = currentPage.value, limit = currentLimit.value) => { +const loadTokens = async (page = currentPage.value, limit = currentLimit.value, hideShowNewToken = false) => { currentPage.value = page try { const response: any = await api.orgTokens.list({ @@ -103,18 +105,30 @@ const loadTokens = async (page = currentPage.value, limit = currentLimit.value) offset: searchText.value.length === 0 ? (page - 1) * limit : 0, }, } as RequestParams) - if (!response) return + if (!response) { + isLoadingAllTokens.value = false + return + } pagination.total = response.pageInfo.totalRows ?? 0 pagination.pageSize = 10 tokens.value = response.list as IApiTokenInfo[] + if (hideShowNewToken) { + showNewTokenModal.value = false + selectedTokenData.value = {} + } + if (!allTokens.value.length) { await loadAllTokens(pagination.total) } } catch (e: any) { message.error(await extractSdkResponseErrorMsg(e)) + } finally { + if (isLoadingAllTokens.value) { + isLoadingAllTokens.value = false + } } } @@ -159,11 +173,10 @@ const generateToken = async () => { if (!isValidTokenName.value) return try { const token = await api.orgTokens.create(selectedTokenData.value) - showNewTokenModal.value = false + // Token generated successfully // message.success(t('msg.success.tokenGenerated')) - selectedTokenData.value = {} - await loadTokens() + await loadTokens(currentPage.value, currentLimit.value, true) updateAllTokens('add', token as IApiTokenInfo) } catch (e: any) { @@ -216,7 +229,7 @@ const handleCancel = () => {