diff --git a/packages/api/src/utility/cloudIntf.js b/packages/api/src/utility/cloudIntf.js index 3e64de812..78d28a53a 100644 --- a/packages/api/src/utility/cloudIntf.js +++ b/packages/api/src/utility/cloudIntf.js @@ -266,9 +266,9 @@ async function callCloudApiPost(endpoint, body, signinHolder = null) { }, validateStatus: status => status < 500, }); - const { errorMessage } = resp.data; + const { errorMessage, isLicenseLimit } = resp.data; if (errorMessage) { - return { apiErrorMessage: errorMessage }; + return { apiErrorMessage: errorMessage, apiErrorIsLicenseLimit: isLicenseLimit }; } return resp.data; } diff --git a/packages/web/src/modals/LicenseLimitMessageModal.svelte b/packages/web/src/modals/LicenseLimitMessageModal.svelte new file mode 100644 index 000000000..624b632b5 --- /dev/null +++ b/packages/web/src/modals/LicenseLimitMessageModal.svelte @@ -0,0 +1,62 @@ + + + + + License limit error + + + + + + + + Cloud operation ended with error: + {message} + + + + This is a limitation of the free version of DbGate. To continue using cloud operations, please purchase DbGate + Premium. + + Free version limit: + + max 5 connections + plus max 5 files + + + + + + + + + + + + diff --git a/packages/web/src/utility/api.ts b/packages/web/src/utility/api.ts index 8b80c794a..96b88c060 100644 --- a/packages/web/src/utility/api.ts +++ b/packages/web/src/utility/api.ts @@ -15,6 +15,7 @@ import { isAdminPage, isOneOfPage } from './pageDefs'; import { openWebLink } from './simpleTools'; import { serializeJsTypesReplacer } from 'dbgate-tools'; import { cloudSigninTokenHolder } from '../stores'; +import LicenseLimitMessageModal from '../modals/LicenseLimitMessageModal.svelte'; export const strmid = uuidv1(); @@ -121,7 +122,13 @@ async function processApiResponse(route, args, resp) { // missingCredentials: true, // }; } else if (resp?.apiErrorMessage) { - showSnackbarError('API error:' + resp?.apiErrorMessage); + if (resp?.apiErrorIsLicenseLimit) { + showModal(LicenseLimitMessageModal, { + message: resp.apiErrorMessage, + }); + } else { + showSnackbarError('API error:' + resp?.apiErrorMessage); + } return { errorMessage: resp.apiErrorMessage, };
+ Cloud operation ended with error: + {message} +
+ This is a limitation of the free version of DbGate. To continue using cloud operations, please purchase DbGate + Premium. +
Free version limit: