Skip to content

Commit

Permalink
Merge pull request #4105 from FlowFuse/auto-genrate-license
Browse files Browse the repository at this point in the history
auto genrate license and display
joepavitt authored Jul 17, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
2 parents 9567425 + fc12ca2 commit 913b744
Showing 1 changed file with 47 additions and 4 deletions.
51 changes: 47 additions & 4 deletions docs/install/introduction.md
Original file line number Diff line number Diff line change
@@ -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
@@ -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>

0 comments on commit 913b744

Please sign in to comment.