Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

auto genrate license and display #4105

Merged
merged 5 commits into from
Jul 17, 2024
Merged
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 46 additions & 4 deletions docs/install/introduction.md
Original file line number Diff line number Diff line change
@@ -14,13 +14,55 @@ 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) {
GenerateLicense(data.submissionValues);
}
});
</script>

## One-Click Docker Installer
@@ -61,4 +103,4 @@ If you need assistance, request our complimentary Installation Service, and we w
portalId: "26586079",
formId: "22edc659-d098-4767-aeb1-6480daae41ad"
});
</script>
</script>