98 lines
3.1 KiB
HTML
98 lines
3.1 KiB
HTML
<!doctype html>
|
|
<html>
|
|
<head>
|
|
<title>Direktil Local Server</title>
|
|
<style>
|
|
@import url('./style.css');
|
|
@import url('./app.css');
|
|
</style>
|
|
<script src="js/jsonpatch.min.js" crossorigin="anonymous"></script>
|
|
<script src="js/app.js" type="module" defer></script>
|
|
<body>
|
|
|
|
<div id="app">
|
|
<header>
|
|
<div id="logo">
|
|
<img src="/favicon.ico" />
|
|
<span>Direktil Local Server</span>
|
|
</div>
|
|
<div class="utils">
|
|
<span id="login-hdr" v-if="session.token">
|
|
Logged in
|
|
<button class="link" @click="copyText(session.token)">🗐</button>
|
|
</span>
|
|
|
|
<span id="uiHash">ui <code>{{ uiHash || '-----' }}</code></span>
|
|
|
|
<span :class="publicState ? 'green' : 'red'">🗲</span>
|
|
</div>
|
|
</header>
|
|
|
|
<div class="error" v-if="error">
|
|
<button class="btn-close" @click="error=null">×</button>
|
|
<div class="code" v-if="error.code">{{ error.code }}</div>
|
|
<div class="message">{{ error.message }}</div>
|
|
</div>
|
|
|
|
<template v-if="!publicState">
|
|
<p>Not connected.</p>
|
|
</template>
|
|
<template v-else-if="publicState.Store.New">
|
|
<p>Store is new.</p>
|
|
<form @submit="unlockStore" action="/public/unlock-store">
|
|
<input type="password" v-model="forms.store.pass1" name="passphrase" required />
|
|
<input type="password" v-model="forms.store.pass2" required />
|
|
<input type="submit" value="initialize" :disabled="!forms.store.pass1 || forms.store.pass1 != forms.store.pass2" />
|
|
</form>
|
|
</template>
|
|
<template v-else-if="!publicState.Store.Open">
|
|
<p>Store is not open.</p>
|
|
<form @submit="unlockStore" action="/public/unlock-store">
|
|
<input type="password" name="passphrase" v-model="forms.store.pass1" required />
|
|
<input type="submit" value="unlock" :disabled="!forms.store.pass1" />
|
|
</form>
|
|
</template>
|
|
<template v-else-if="!state">
|
|
<p v-if="!session.token">Not logged in.</p>
|
|
<p v-else>Invalid token</p>
|
|
|
|
<form @submit="setToken">
|
|
<input type="password" v-model="forms.setToken" required />
|
|
<input type="submit" value="set token"/>
|
|
</form>
|
|
</template>
|
|
<template v-else>
|
|
<div id="store-infos">
|
|
<h2>Store</h2>
|
|
<a :href="'/public/store.tar?token='+state.Store.DownloadToken" target="_blank">download</a>
|
|
<form @submit="storeAddKey" action="/store/add-key">
|
|
<input type="password" v-model="forms.store.pass1" name="passphrase" autocomplete="new-password" required />
|
|
<input type="password" v-model="forms.store.pass2" autocomplete="new-password" required />
|
|
<input type="submit" value="add unlock phrase" :disabled="!forms.store.pass1 || forms.store.pass1 != forms.store.pass2" />
|
|
</form>
|
|
</div>
|
|
|
|
<div v-if="state.Clusters" id="clusters">
|
|
|
|
<h2>Clusters</h2>
|
|
|
|
<div class="sheets">
|
|
<Cluster v-for="c in state.Clusters" :cluster="c" :token="session.token" :state="state" />
|
|
</div>
|
|
</div>
|
|
|
|
<div v-if="state.Hosts" id="hosts">
|
|
<h2>Hosts</h2>
|
|
|
|
<div class="sheets">
|
|
<Host v-for="h in state.Hosts" :host="h" :token="session.token" :state="state" />
|
|
</div>
|
|
</div>
|
|
|
|
<pre v-if="false">{{ state }}</pre>
|
|
</template>
|
|
</div>
|
|
|
|
</body>
|
|
</html>
|