-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
79 lines (79 loc) · 2.15 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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
<!DOCTYPE html>
<html>
<head>
<title>xkpasswd</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1, maximum-scale=1, user-scalable=no"></meta>
<meta name="apple-mobile-web-app-capable" content="yes"></meta>
<link rel="stylesheet" href="css/bulma.min.css"></link>
<script src="lib/vue.min.js"></script>
<script src="lib/clipboard.min.js"></script>
<script src="dist/bundle.js"></script>
</head>
<body>
<div id="xk">
<section class="section">
<div class="columns">
<div class="column message">
<div class="message-header">xkpasswd <span>v0.1.0</span></div>
<div class="message-body">
<div class="field">
<label class="label" for="pattern">Pattern</label>
<input class="input" id="pattern" v-model="pattern"></input>
</div>
<div class="field">
<label class="label" for="number">Number</label>
<input class="input" id="number" v-model="number"></input>
</div>
<div class="field">
<button class="button is-link" v-on:click="generate()">Generate</button>
</div>
</div>
</div>
<div class="column">
<div class="message-header">Output</div>
<div class="message-body">
<table class="table is-striped is-fullwidth">
<tbody>
<tr v-for="line in output">
<td><button class="btn button is-light is-small" :data-clipboard-text=line>Copy</button></td>
<td>{{line}}</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</section>
</div>
<script>
var xk_app = new Vue({
el: '#xk',
data: {
output: [],
pattern: 'W-w-w-dd',
number: 3,
},
methods: {
generate: function () {
var outputarray = []
var options = {
pattern: this.pattern,
}
for (var i = 0; i < this.number; i++) {
output = genpasswd(options)
outputarray.push(output)
}
this.output = outputarray
}
}
})
var clipboard = new ClipboardJS('.btn')
clipboard.on('success', function(e) {
console.info('Action:', alert("Copied to clipboard"));
console.info('Text:', e.text);
console.info('Trigger:', e.trigger);
e.clearSelection();
});
</script>
</body>
</html>