telebit-relay.js/lib/extensions/admin/account.html

64 lines
2.4 KiB
HTML

<html>
<head>
<title>Telebit Account</title>
</head>
<body>
<div class="v-app">
<div v-if="spinner" style="position: absolute; width: 100%; height: 100%; background-color: #ddd;">Loading... </div>
<div v-if="!hasAccount">
<h1>Login</h1>
<form class="js-auth-form" v-on:submit.prevent="login()">
<input class="js-auth-subject" v-model="newEmail" placeholder="email" type="email" required/>
<button class="js-auth-submit" type="submit">Login</button>
</form>
</div>
<div v-if="hasAccount">
<h1>Account</h1>
<button v-on:click.prevent.stop="logout()" type="click">Logout</button>
<form v-on:submit.prevent="challengeDns()">
Add a custom domain:
<input v-model="newDomain" placeholder="example.com" type="text" required/>
<button type="submit">Next</button>
</form>
<!-- not yet -->
<!--form v-on:submit.prevent="challengeEmail()">
Authorize another email:
<input v-model="newEmail" placeholder="jon@example.com" type="email" required/>
<button type="submit">Next</button>
</form-->
<h3>Claims</h3>
<p>If your DNS host supports ANAME records, please use those instead of CNAMEs.</p>
<p>If CNAMEs are not supported, set an A record to {{ site.deviceDomainA }}.</p>
<ol>
<li v-for="claim in claims">
<span>{{ claim.value }}</span>
<br>
<span v-if="'dns' === claim.type">CNAME <span v-if="claim.wildcard">*.</span>{{ claim.value }}: {{ site.deviceDomain }}</span>
<br>
<span v-if="'dns' === claim.type">TXT _claim-challenge.{{ claim.value }}: {{ claim.challenge }}</span>
<br>
<button v-on:click.prevent="checkDns(claim)">Check</button>
</li>
</ol>
<h3>Domains</h3>
<ol>
<li v-for="domain in domains">
<span v-if="domain.wildcard">*.</span>{{ domain.name }} <span v-if="domain.hostname">- {{domain.hostname}} ({{domain.os}} {{domain.arch}})</span>
</li>
</ol>
<pre><code v-text="token"></code></pre>
</div>
</div>
<!-- development version, includes helpful console warnings -->
<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
<script src="assets/oauth3.org/oauth3.core.js"></script>
<script src="js/account.js"></script>
</body>
</html>