-
Notifications
You must be signed in to change notification settings - Fork 2
/
index.html
54 lines (54 loc) · 2.12 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
<!DOCTYPE html>
<html>
<head>
<title>Storjshare Config Generator</title>
<script src="vue.js"></script>
<script src="storj.es6.js"></script>
<script src="main.js"></script>
<link href="styles.css" rel="stylesheet">
</head>
<body>
<div id="title">
<h1>Storj Share Config Generator</h1>
</div>
<div id="app">
<div id="left">
<div class="option" v-for="option in config">
<h3>{{option.title || option.key}}</h3>
<div v-if="!option.required" class="switch" v-on:click="option.enabled = !option.enabled">
<div class="slider" v-bind:slider="option.enabled"></div>
</div>
<div v-bind:class="{disabled: !option.required && !option.enabled}">
<p v-html="option.description"></p>
<input v-if="option.type === 'string'" v-model="option.value">
<input v-if="option.type === 'number'" type="number" v-model.number="option.value" v-bind:min="option.min || 0" v-bind:max="option.max || false">
<div v-if="option.type === 'boolean'">
<div class="switch" v-on:click="option.value = !option.value">
<div class="slider" v-bind:slider="option.value"></div>
</div>
</div>
<div class="array" v-if="option.type === 'array'">
<div v-for="(item, i) in option.value">
<input v-model="option.value[i]">
<button class="remove" v-on:click="option.value.splice(i, 1)">-</button>
</div>
<button v-on:click="option.value.push('')">+</button>
</div>
<div class="object" v-if="option.type === 'object'">
<div v-for="(value, key) in option.value">
<span>{{key}}</span>
<input v-model="option.value[key]">
</div>
</div>
</div>
</div>
</div>
<div id="right">
<pre id="output">{{configToJSON(config)}}</pre>
<p><a class="button" download="config.json" v-bind:href="'data:text/plain;charset=utf-8,' + encodeURIComponent(configToJSON(config))">Download Config</a></p>
<p><a class="button" v-on:click="generateNewPrivateKey()">Generate new private key</a></p>
<p>If you plan to use this generator to start a new drive share, all you have to do is enter your payment address and specify your data directory. Everything else is ready to go.</p>
</div>
</div>
</body>
</html>