Skip to content

Commit

Permalink
Merge branch 'main' into 4174-simplified-sign-up
Browse files Browse the repository at this point in the history
  • Loading branch information
Steve-Mcl authored Jul 17, 2024
2 parents 4835852 + 5a3c176 commit 0776939
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 4 deletions.
51 changes: 47 additions & 4 deletions docs/install/introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,56 @@ the platform.

Experience the full capabilities of FlowFuse by obtaining a complimentary 30-day Enterprise license. This trial offers you an opportunity to thoroughly evaluate the features and functionalities of FlowFuse in your environment. To begin your trial, simply complete the form below.

<div id="license-message"></div>

<script charset="utf-8" type="text/javascript" src="//js-eu1.hsforms.net/forms/embed/v2.js"></script>
<script>
hbspt.forms.create({
function GenerateLicense(formData) {
if (formData) {
const jsonData = typeof formData === 'object' ? JSON.stringify(formData) : formData;

fetch('https://energetic-sanderling-4472.flowfuse.cloud/license/trial', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: jsonData
})
.then(response => {
if (!response.ok) {
throw new Error('Network response was not ok');
}
return response.json();
})
.then(data => {
const messageElement = document.getElementById('license-message');
if (messageElement) {
messageElement.innerHTML = `<p><strong>Thank you for requesting a trial license. Below is your license key. Please copy it and save it securely, as it will not be available again if you leave, come back, or refresh the screen:</strong></p><code style="display:block;overflow-wrap: anywhere;padding: 10px;border: 1px solid lightgray;margin-top: 10px;"">${data[0].license}</code>`;
} else {
console.error('Message element not found');
}
})
.catch(error => {
const messageElement = document.getElementById('license-message');
if (messageElement) {
messageElement.textContent = 'Error generating license. Please try again later.';
} else {
console.error('Message element not found');
}
});
}
}
hbspt.forms.create({
region: "eu1",
portalId: "26586079",
formId: "41e858e1-6756-45be-9082-3980237fa229"
});
formId: "41e858e1-6756-45be-9082-3980237fa229",
onFormSubmitted: function ($form, data) {
document.querySelector('.hbspt-form').style.display = 'none';
GenerateLicense(data.submissionValues);
}
});
</script>
## One-Click Docker Installer
Expand Down Expand Up @@ -61,4 +104,4 @@ If you need assistance, request our complimentary Installation Service, and we w
portalId: "26586079",
formId: "22edc659-d098-4767-aeb1-6480daae41ad"
});
</script>
</script>
3 changes: 3 additions & 0 deletions forge/housekeeper/tasks/telemetryMetrics/004-platform.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
module.exports = async (app) => {
let sharedLibraryEntries = 0
let blueprintCount = 0
if (app.license.active()) {
blueprintCount = await app.db.models.FlowTemplate?.count()
sharedLibraryEntries = await app.db.models.StorageSharedLibrary?.count()
}
const licenseType = () => {
Expand All @@ -27,6 +29,7 @@ module.exports = async (app) => {
'platform.counts.projectTemplates': await app.db.models.ProjectStack.count(),
'platform.counts.projectStacks': await app.db.models.ProjectTemplate.count(),
'platform.counts.libraryEntries': await app.db.models.StorageLibrary.count(),
'platform.counts.blueprints': blueprintCount,
'platform.counts.sharedLibraryEntries': sharedLibraryEntries,

'platform.config.driver': app.config.driver.type,
Expand Down

0 comments on commit 0776939

Please sign in to comment.