fleet/website/views/pages/fleetctl-preview.ejs
Eric 867029e9c0
Website: Add Fleet Premium trial to get started questionnaire. (#21922)
Related to: #18869

Changes:
- Updated the /start questionnaire to generate a 30 day, 10 host trial
for Fleet Premium when users submit the step before the "Is it any
good?" step (Where the user is directed to try `fleetctl preview`) and
to save the details (license key and expiration timestamp) of the trial
to their user record.
- Added two new attributes to the User model:
- `fleetPremiumTrialLicenseKey`: A Fleet Premium license key that was
generated for the user when they progressed through the get started
questionnaire.
- `fleetPremiumTrialLicenseKeyExpiresAt`: A JS timestamp of when the
user's Fleet Premium trial license key expires.
- Updated the try-fleet page to have copyable terminal commands, and to
add the `--license_key` flag with the users license key to the command
to run `fleetctl preview`
2024-09-12 17:37:48 -05:00

191 lines
10 KiB
Text
Vendored

<div id="fleetctl-preview" v-cloak>
<div purpose="page-container" class="d-flex flex-column container">
<div purpose="page-title">
<h1>Try Fleet</h1>
<p>The quickest way to try Fleet Premium is to run a local demo with <a href="https://docs.docker.com/get-docker/" target="_blank">Docker</a>.</p>
<p class="mb-0">Follow the instructions below to test Fleet on your macOS, Windows, and Linux device.</p>
</div>
<div purpose="prerequisites">
<h2>Prerequisites</h2>
<p>An installation of Docker is required to try Fleet locally.</p>
<a purpose="docker-button" href="https://docs.docker.com/get-docker/" target="_blank"
style="color: #fff; background: #0073EC;" class="d-flex btn btn-md justify-content-center align-items-center mt-3 mt-sm-0">
<img alt="Docker logo" src="/images/logo-docker-51x36@2x.png"/>
Get Docker
</a>
</div>
<div purpose="installation-steps">
<h2>Install Fleet</h2>
<div purpose="platform-selector" class="d-flex flex-row justify-content-between justify-content-sm-start">
<div purpose="selector-tab" :class="[selectedPlatform === 'macos' ? 'selected' : '']" @click="selectedPlatform = 'macos'"><p>macOS</p></div>
<div purpose="selector-tab" :class="[selectedPlatform === 'windows' ? 'selected' : '']" @click="selectedPlatform = 'windows'"><p>Windows</p></div>
<div purpose="selector-tab" :class="[selectedPlatform === 'linux' ? 'selected' : '']" @click="selectedPlatform = 'linux'"><p>Linux</p></div>
<div purpose="selector-tab" :class="[selectedPlatform === 'npm' ? 'selected' : '']" @click="selectedPlatform = 'npm'"><p>NPM</p></div>
</div>
<%/* macOS install steps */%>
<div v-if="selectedPlatform === 'macos'">
<div purpose="numbered-steps">
<div purpose="step">
<p>Install the <code>fleetctl</code> command line tool:</p>
<div purpose="terminal-commands">
<div purpose="command-container">
<code>{{installCommands[selectedPlatform]}}</code>
</div>
<span purpose="install-copy-button" @click="clickCopyInstallCommand(selectedPlatform)"></span>
</div>
</div>
<div purpose="step">
<p>Run a local demo of the Fleet server:</p>
<div purpose="terminal-commands">
<div purpose="command-container">
<code v-if="trialLicenseKey && !userHasExpiredTrialLicense">{{fleetctlPreviewTerminalCommand[selectedPlatform]}} --license-key {{trialLicenseKey}}</code>
<code v-else>{{fleetctlPreviewTerminalCommand[selectedPlatform]}}</code>
</div>
<a purpose="command-copy-button" @click="clickCopyTerminalCommand(selectedPlatform)"></a>
</div>
<blockquote purpose="tip" v-if="userHasExpiredTrialLicense">
<img src="/images/icon-info-16x16@2x.png" alt="An icon indicating that this section has important information">
<div class="d-block">
<p>Your Fleet Premium trial license has expired. You can still run the free version of Fleet locally.</p>
</div>
</blockquote>
</div>
<div purpose="step">
<p>The Fleet UI is now available at <a href="http://localhost:1337" target="_blank">http://localhost:1337</a>. Use the credentials below to login:</p>
<p class="mb-2"><strong>Email</strong>: admin@example.com</p>
<p class="mb-0"><strong>Password</strong>: preview1337#</p>
</div>
</div>
</div>
<%/* Linux install steps */%>
<div v-else-if="selectedPlatform === 'linux'">
<div purpose="numbered-steps">
<div purpose="step">
<p>Install the <code>fleetctl</code> command line tool:</p>
<div purpose="terminal-commands">
<div purpose="command-container">
<code>{{installCommands[selectedPlatform]}}</code>
</div>
<span purpose="install-copy-button" @click="clickCopyInstallCommand(selectedPlatform)"></span>
</div>
</div>
<div purpose="step">
<p>Run a local demo of the Fleet server:</p>
<div purpose="terminal-commands">
<div purpose="command-container">
<code v-if="trialLicenseKey && !userHasExpiredTrialLicense">{{fleetctlPreviewTerminalCommand[selectedPlatform]}} --license-key {{trialLicenseKey}}</code>
<code v-else>{{fleetctlPreviewTerminalCommand[selectedPlatform]}}</code>
</div>
<a purpose="copy-button" @click="clickCopyTerminalCommand(selectedPlatform)"></a>
</div>
<blockquote purpose="tip" v-if="userHasExpiredTrialLicense">
<img src="/images/icon-info-16x16@2x.png" alt="An icon indicating that this section has important information">
<div class="d-block">
<p>Your Fleet Premium trial license has expired. You can still run the free version of Fleet locally.</p>
</div>
</blockquote>
</div>
<div purpose="step">
<p>The Fleet UI is now available at <a href="http://localhost:1337" target="_blank">http://localhost:1337</a>. Use the credentials below to login:</p>
<p class="mb-2"><strong>Email</strong>: admin@example.com</p>
<p class="mb-0"><strong>Password</strong>: preview1337#</p>
</div>
</div>
</div>
<%/* Windows install steps */%>
<div v-else-if="selectedPlatform === 'windows'">
<div purpose="numbered-steps">
<div purpose="step">
<p>Install the <code>fleetctl</code> command line tool:</p>
<div purpose="terminal-commands">
<div purpose="command-container">
<code>{{installCommands[selectedPlatform]}}</code>
</div>
<span purpose="install-copy-button" @click="clickCopyInstallCommand(selectedPlatform)"></span>
</div>
</div>
<div purpose="step">
<p>Run a local demo of the Fleet server:</p>
<div purpose="terminal-commands">
<div purpose="command-container">
<code v-if="trialLicenseKey && !userHasExpiredTrialLicense">{{fleetctlPreviewTerminalCommand[selectedPlatform]}} --license-key {{trialLicenseKey}}</code>
<code v-else>{{fleetctlPreviewTerminalCommand[selectedPlatform]}}</code>
</div>
<a purpose="command-copy-button" @click="clickCopyTerminalCommand(selectedPlatform)"></a>
</div>
<blockquote purpose="tip" v-if="userHasExpiredTrialLicense">
<img src="/images/icon-info-16x16@2x.png" alt="An icon indicating that this section has important information">
<div class="d-block">
<p>Your Fleet Premium trial license has expired. You can still run the free version of Fleet locally.</p>
</div>
</blockquote>
</div>
<div purpose="step">
<p>The Fleet UI is now available at <a href="http://localhost:1337" target="_blank">http://localhost:1337</a>. Use the credentials below to login:</p>
<p class="mb-2"><strong>Email</strong>: admin@example.com</p>
<p class="mb-0"><strong>Password</strong>: preview1337#</p>
</div>
</div>
</div>
<%/* NPM install steps */%>
<div v-else-if="selectedPlatform === 'npm'">
<div purpose="numbered-steps">
<div purpose="step">
<p>Install Node.js</p>
<a purpose="node-button" href="https://nodejs.org/en/download/" target="_blank" style="color: #fff; background: #333;" class="btn d-flex flex-row align-items-center justify-content-center">
<img alt="NodeJS logo" src="/images/logo-node-59x36@2x.png"/>
Find my Node installer
</a>
</div>
<div purpose="step">
<p>Install the <code>fleetctl</code> command line tool:</p>
<div purpose="terminal-commands">
<div purpose="command-container">
<code>{{installCommands[selectedPlatform]}}</code>
</div>
<span purpose="install-copy-button" @click="clickCopyInstallCommand(selectedPlatform)"></span>
</div>
</div>
<div purpose="step">
<p>Run a local demo of the Fleet server:</p>
<div purpose="terminal-commands">
<div purpose="command-container">
<code v-if="trialLicenseKey && !userHasExpiredTrialLicense">{{fleetctlPreviewTerminalCommand[selectedPlatform]}} --license-key {{trialLicenseKey}}</code>
<code v-else>{{fleetctlPreviewTerminalCommand[selectedPlatform]}}</code>
</div>
<a purpose="command-copy-button" @click="clickCopyTerminalCommand(selectedPlatform)"></a>
</div>
<blockquote purpose="tip" v-if="userHasExpiredTrialLicense">
<img src="/images/icon-info-16x16@2x.png" alt="An icon indicating that this section has important information">
<div class="d-block">
<p>Your Fleet Premium trial license has expired. You can still run the free version of Fleet locally.</p>
</div>
</blockquote>
</div>
<div purpose="step">
<p>The Fleet UI is now available at <a href="http://localhost:1337" target="_blank">http://localhost:1337</a>. Use the credentials below to login:</p>
<p class="mb-2"><strong>Email</strong>: admin@example.com</p>
<p class="mb-0"><strong>Password</strong>: preview1337#</p>
</div>
</div>
</div>
</div>
<div v-if="me">
<h2 class="pt-0">Need help?</h2>
<p><a purpose="contact-link" href="/contact">Get in touch</a> with us.</p>
</div>
<div v-else>
<h2 class="pt-0">Next steps</h2>
<div purpose="next-steps" class="d-flex flex-sm-row flex-column align-items-center">
<a purpose="docs-button" href="/docs" class="btn btn-primary">
Read the docs
</a>
<animated-arrow-button href="/docs/deploying" class="d-flex">
Deploy to production
</animated-arrow-button>
</div>
</div>
</div>
<parallax-city></parallax-city>
</div>
<%- /* Expose server-rendered data as window.SAILS_LOCALS :: */ exposeLocalsToBrowser() %>