Files
cloudron-box/dashboard/setupaccount.html

160 lines
7.8 KiB
HTML

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width, height=device-height" />
<title>Cloudron Account Setup</title>
<meta name="description" content="Cloudron Account Setup">
<link id="favicon" href="/api/v1/cloudron/avatar" rel="icon" type="image/png">
<!-- contains all thing already using import statement -->
<script type="module" src="./src/modules.js"></script>
<!-- Theme CSS -->
<link type="text/css" rel="stylesheet" href="./src/theme.scss">
<!-- jQuery-->
<script type="text/javascript" src="/js/jquery.min.js"></script>
<!-- async -->
<script type="text/javascript" src="/js/async-3.2.0.min.js"></script>
<!-- Angularjs scripts -->
<script type="text/javascript" src="/js/angular.min.js"></script>
<script type="text/javascript" src="/js/angular-loader.min.js"></script>
<script type="text/javascript" src="/js/angular-cookies.min.js"></script>
<!-- Angular directives for bootstrap https://angular-ui.github.io/bootstrap/ -->
<script type="text/javascript" src="/js/ui-bootstrap-tpls-1.3.3.min.js"></script>
<!-- Showdown (markdown converter) -->
<script type="text/javascript" src="/js/showdown-1.9.1.min.js"></script>
<!-- Angular translate https://angular-translate.github.io/ -->
<script type="text/javascript" src="/js/angular-translate.min.js"></script>
<script type="text/javascript" src="/js/angular-translate-loader-static-files.min.js"></script>
<script type="text/javascript" src="/js/angular-translate-storage-cookie.min.js"></script>
<script type="text/javascript" src="/js/angular-translate-storage-local.min.js"></script>
<!-- Setup Application -->
<script type="text/javascript" src="/js/setupaccount.js?%VITE_CACHE_ID%"></script>
<script type="text/javascript" src="/js/utils.js?%VITE_CACHE_ID%"></script>
</head>
<body ng-app="Application" ng-controller="SetupAccountController">
<div class="layout-root" ng-show="initialized">
<div class="layout-content" ng-show="view === 'setup'">
<div class="card" style="padding: 20px; margin-top: 100px; max-width: 620px;">
<div class="row">
<div class="col-md-12" style="text-align: center;">
<img width="128" height="128" style="margin-top: -84px" src="/api/v1/cloudron/avatar"/>
<br/>
<h1><small>{{ 'setupAccount.welcomeTo' | tr }}</small> {{ branding.cloudronName || 'Cloudron' }}</h1>
<h3>{{ 'setupAccount.description' | tr }}</h3>
</div>
</div>
<br/>
<div class="row">
<div class="col-md-12">
<h4 class="has-error" ng-show="error">{{ error.message }}</h4>
</div>
</div>
<div class="row">
<div class="col-md-12">
<form name="setupAccountForm" ng-submit="onSubmit()" autocomplete="off">
<input type="password" style="display: none;">
<div class="form-group" ng-class="{ 'has-error': ((setupAccountForm.username.$dirty && setupAccountForm.username.$invalid) || (!setupAccountForm.username.$dirty && error.username))}">
<label class="control-label" for="inputUsername">{{ 'setupAccount.username' | tr }}</label>
<input type="text" class="form-control" ng-model="username" name="username" id="inputUsername" ng-disabled="profileLocked || existingUsername" required autofocus>
<div class="control-label" ng-show="setupAccountForm.username.$dirty && setupAccountForm.username.$invalid">
<small ng-show="setupAccountForm.username.$error.minlength">{{ 'setupAccount.errorUsernameTooShort' | tr }}</small>
<small ng-show="setupAccountForm.username.$error.maxlength">{{ 'setupAccount.errorUsernameTooLong' | tr }}</small>
<small ng-show="setupAccountForm.username.$dirty && setupAccountForm.username.$invalid">{{ 'setupAccount.errorUsernameInvalid' | tr }}</small>
</div>
</div>
<div class="form-group">
<label class="control-label" for="inputDisplayName">{{ 'setupAccount.fullName' | tr }}</label>
<input type="displayName" class="form-control" ng-model="displayName" name="displayName" id="inputDisplayName" ng-disabled="profileLocked" required>
</div>
<div class="form-group" ng-class="{ 'has-error': (setupAccountForm.password.$dirty && setupAccountForm.password.$invalid) }">
<label class="control-label" for="inputPassword">{{ 'setupAccount.password' | tr }}</label>
<input type="password" class="form-control" ng-model="password" name="password" id="inputPassword" ng-pattern="/^.{8,}$/" required password-reveal>
<div class="control-label" ng-show="setupAccountForm.password.$dirty && setupAccountForm.password.$invalid">
<small ng-show="setupAccountForm.password.$dirty && setupAccountForm.password.$invalid">{{ 'setupAccount.errorPassword' | tr }}</small>
</div>
</div>
<div class="form-group" ng-class="{ 'has-error': (setupAccountForm.passwordRepeat.$dirty && (password !== passwordRepeat)) }">
<label class="control-label" for="inputPasswordRepeat">{{ 'setupAccount.passwordRepeat' | tr }}</label>
<input type="password" class="form-control" ng-model="passwordRepeat" name="passwordRepeat" id="inputPasswordRepeat" required password-reveal>
<div class="control-label" ng-show="setupAccountForm.passwordRepeat.$dirty && (password !== passwordRepeat)">
<small ng-show="setupAccountForm.passwordRepeat.$dirty && (password !== passwordRepeat)">{{ 'setupAccount.errorPasswordNoMatch' | tr }}</small>
</div>
</div>
<button class="btn btn-primary btn-outline pull-right" type="submit" ng-disabled="busy || setupAccountForm.$invalid || password !== passwordRepeat"><i class="fa fa-circle-notch fa-spin" ng-show="busy"></i> {{ 'setupAccount.setupAction' | tr }}</button>
</form>
</div>
</div>
</div>
</div>
<div class="layout-content" ng-show="view === 'noUsername'">
<div class="card" style="padding: 20px; margin-top: 100px; max-width: 620px;">
<div class="row">
<div class="col-md-12" style="text-align: center;">
<img width="128" height="128" style="margin-top: -84px" src="/api/v1/cloudron/avatar"/>
<br/>
<h2>{{ 'setupAccount.noUsername.title' | tr }}</h2>
<br/>
<p>{{ 'setupAccount.noUsername.description' | tr }}</p>
</div>
</div>
</div>
</div>
<div class="layout-content" ng-show="view === 'invalidToken'">
<div class="card" style="padding: 20px; margin-top: 100px; max-width: 620px;">
<div class="row">
<div class="col-md-12" style="text-align: center;">
<img width="128" height="128" style="margin-top: -84px" src="/api/v1/cloudron/avatar"/>
<br/>
<h2>{{ 'setupAccount.invalidToken.title' | tr }}</h2>
<br/>
<p>{{ 'setupAccount.invalidToken.description' | tr }}</p>
</div>
</div>
</div>
</div>
<div class="layout-content" ng-show="view === 'done'">
<div class="card" style="padding: 20px; margin-top: 100px; max-width: 620px;">
<div class="row">
<div class="col-md-12" style="text-align: center;">
<img width="128" height="128" style="margin-top: -84px" src="/api/v1/cloudron/avatar"/>
<br/>
<h2>{{ 'setupAccount.success.title' | tr }}</h2>
<br/>
<a ng-href="dashboardUrl" class="btn btn-primary">{{ 'setupAccount.success.openDashboardAction' | tr }}</a>
</div>
</div>
</div>
</div>
<footer class="text-center ng-cloak">
<span class="text-muted" ng-bind-html="branding.footer | markdown2html"></span>
</footer>
</div>
</body>
</html>