Your Cloudron trial ends soon
-To keep your Cloudron, just setup a payment method at cloudron.io or send us a mail.
+To keep your Cloudron, just setup a payment method at cloudron.io or send us an email.
diff --git a/src/cloudron.js b/src/cloudron.js index 02fc5f247..08a607c74 100644 --- a/src/cloudron.js +++ b/src/cloudron.js @@ -71,6 +71,7 @@ var NOOP_CALLBACK = function (error) { if (error) debug(error); }; var gUpdatingDns = false, // flag for dns update reentrancy gCloudronDetails = null, // cached cloudron details like region,size... + gAppstoreUserDetails = {}, gIsConfigured = null; // cached configured state so that return value is synchronous. null means we are not initialized yet function debugApp(app, args) { @@ -310,6 +311,7 @@ function getCloudronDetails(callback) { if (result.statusCode !== 200) return callback(new CloudronError(CloudronError.EXTERNAL_ERROR, util.format('%s %j', result.status, result.body))); gCloudronDetails = result.body.box; + gAppstoreUserDetails = result.body.user; return callback(null, gCloudronDetails); }); @@ -351,6 +353,7 @@ function getConfig(callback) { developerMode: developerMode, region: result.region, size: result.size, + billing: !!gAppstoreUserDetails.billing, memory: os.totalmem(), provider: config.provider(), cloudronName: cloudronName diff --git a/webadmin/src/index.html b/webadmin/src/index.html index ca4f8f43d..77da79579 100644 --- a/webadmin/src/index.html +++ b/webadmin/src/index.html @@ -170,10 +170,10 @@
diff --git a/webadmin/src/js/main.js b/webadmin/src/js/main.js index a710acd80..633c7df1a 100644 --- a/webadmin/src/js/main.js +++ b/webadmin/src/js/main.js @@ -128,21 +128,28 @@ angular.module('Application').controller('MainController', ['$scope', '$route', // wait till the view has loaded until showing a modal dialog Client.onConfig(function (config) { + if (!config.billing) { + setTimeout(function () { + $('.upgrade')[0].classList.remove('hide'); + + $('.upgrade .trigger').hover(function () { + $('.upgrade .content')[0].classList.add('active'); + $('.upgrade .trigger')[0].classList.add('active'); + }); + + $('.upgrade').hover(function () {}, function () { + $('.upgrade .content')[0].classList.remove('active'); + $('.upgrade .trigger')[0].classList.remove('active'); + }); + }, 2000); + } + // check if we are actually updating if (config.progress.update && config.progress.update.percent !== -1) { window.location.href = '/update.html'; } }); - $('.upgrade .trigger').hover(function () { - $('.upgrade .content')[0].classList.add('active'); - $('.upgrade .trigger')[0].classList.add('active'); - }); - - $('.upgrade').hover(function () {}, function () { - $('.upgrade .content')[0].classList.remove('active'); - $('.upgrade .trigger')[0].classList.remove('active'); - }); // setup all the dialog focus handling ['updateModal'].forEach(function (id) {