mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-28 04:56:00 +00:00
refresh licenses
This commit is contained in:
@@ -62,6 +62,8 @@ module.exports = {
|
|||||||
const logoutUrl = storageConnectionError ? null : await authProvider.getLogoutUrl();
|
const logoutUrl = storageConnectionError ? null : await authProvider.getLogoutUrl();
|
||||||
const adminConfig = storageConnectionError ? null : await storage.readConfig({ group: 'admin' });
|
const adminConfig = storageConnectionError ? null : await storage.readConfig({ group: 'admin' });
|
||||||
|
|
||||||
|
storage.startRefreshLicense();
|
||||||
|
|
||||||
const isAdminPasswordMissing = !!(
|
const isAdminPasswordMissing = !!(
|
||||||
process.env.STORAGE_DATABASE &&
|
process.env.STORAGE_DATABASE &&
|
||||||
!process.env.ADMIN_PASSWORD &&
|
!process.env.ADMIN_PASSWORD &&
|
||||||
@@ -81,7 +83,7 @@ module.exports = {
|
|||||||
isElectron: platformInfo.isElectron,
|
isElectron: platformInfo.isElectron,
|
||||||
isLicenseValid,
|
isLicenseValid,
|
||||||
isLicenseExpired: checkedLicense?.isExpired,
|
isLicenseExpired: checkedLicense?.isExpired,
|
||||||
trialDaysLeft: checkedLicense?.isGeneratedTrial && !checkedLicense?.isExpired ? checkedLicense?.daysLeft : null,
|
trialDaysLeft: checkedLicense?.licenseTypeObj?.isTrial && !checkedLicense?.isExpired ? checkedLicense?.daysLeft : null,
|
||||||
checkedLicense,
|
checkedLicense,
|
||||||
configurationError,
|
configurationError,
|
||||||
logoutUrl,
|
logoutUrl,
|
||||||
|
|||||||
@@ -26,4 +26,6 @@ module.exports = {
|
|||||||
async readConfig({ group }) {
|
async readConfig({ group }) {
|
||||||
return {};
|
return {};
|
||||||
},
|
},
|
||||||
|
|
||||||
|
startRefreshLicense() {},
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -30,6 +30,12 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
// $: console.log('CONFIG', $config);
|
// $: console.log('CONFIG', $config);
|
||||||
|
|
||||||
|
$: {
|
||||||
|
if ($config?.isLicenseValid) {
|
||||||
|
internalRedirectTo('/');
|
||||||
|
}
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<FormProviderCore {values}>
|
<FormProviderCore {values}>
|
||||||
@@ -88,9 +94,18 @@
|
|||||||
<FormStyledButton
|
<FormStyledButton
|
||||||
value="Purchase DbGate Premium"
|
value="Purchase DbGate Premium"
|
||||||
on:click={async e => {
|
on:click={async e => {
|
||||||
|
// openWebLink(
|
||||||
|
// `https://auth.dbgate.eu/create-checkout-session-simple?source=trial-${isExpired ? 'expired' : (trialDaysLeft ?? 'no')}`
|
||||||
|
// );
|
||||||
|
|
||||||
|
// openWebLink(
|
||||||
|
// `https://auth-proxy.dbgate.udolni.net/redirect-to-purchase?product=${getElectron() ? 'premium' : 'teram-premium'}&source=trial-${isExpired ? 'expired' : (trialDaysLeft ?? 'no')}`
|
||||||
|
// );
|
||||||
|
|
||||||
openWebLink(
|
openWebLink(
|
||||||
`https://auth.dbgate.eu/create-checkout-session-simple?source=trial-${isExpired ? 'expired' : (trialDaysLeft ?? 'no')}`
|
`https://auth.dbgate.eu/redirect-to-purchase?product=${getElectron() ? 'premium' : 'teram-premium'}&source=trial-${isExpired ? 'expired' : (trialDaysLeft ?? 'no')}`
|
||||||
);
|
);
|
||||||
|
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user