forked from worthless-man/GolosMultisig
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
323 lines (312 loc) · 14.3 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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
<!DOCTYPE html>
<html>
<head>
<!-- unsafe-eval and unsafe-inline for Vue.js -->
<meta http-equiv="Content-Security-Policy" content="default-src 'self'; connect-src 'self' wss://api.golos.blckchnd.com/ws wss://golos.lexa.host/ws wss://golos.solox.world/ws; script-src 'self' 'unsafe-eval'; child-src 'none'; style-src 'self' 'unsafe-inline'">
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>GolosMultisigInterface</title>
<link rel="stylesheet" href="./deps/css/bulma-pageloader.min.css">
<link rel="stylesheet" href="./deps/css/bulma.min.css">
<link rel="stylesheet" href="./deps/fontawesome/css/all.css">
<link rel="stylesheet" href="./deps/css/simplemde.min.css">
<script src="./deps/js/simplemde.min.js"></script>
<!-- версия для разработки, отображает полезные предупреждения в консоли -->
<script src="./deps/js/vue.js"></script>
<!-- production-версия, оптимизированная для размера и скорости
<script src="https://cdn.jsdelivr.net/npm/vue"></script>-->
<script src="./deps/js/golos.min.js"></script>
<script src="./deps/js/lodash.clonedeep.js"></script>
</head>
<body>
<div id="app">
<pageloader-component :active="state.pageLoading" title="Loading"></pageloader-component>
<section class="section has-background-primary">
<nav class="level is-centered">
<div class="level-item has-text-centered">
<p :class="{'is-active': state.page == 'main'}"><a class="link is-info" @click="updatePage('?page=main')">Main</a></p>
</div>
<div class="level-item has-text-centered">
<p :class="{'is-active': state.page == 'dashboard'}"><a class="link is-info" @click="updatePage('?page=dashboard')">Dashboard</a></p>
</div>
<div class="level-item has-text-centered">
<p :class="{'is-active': state.page == 'create'}"><a class="link is-info" @click="updatePage('?page=create')">Create proposal</a></p>
</div>
</nav>
</section>
<section v-if="state.page != 'main'" class="section notification has-background-white-ter" id="settings">
<label class="label has-text-centered">Settings</label>
<div v-if="state.settingsCollapsed == false">
<div class="columns">
<div class="column">
<div class="field">
<label class="label">Node</label>
<p class="control has-icons-left has-icons-right">
<input :class="['input', dynamicInputClass(state.node)]" type="text" v-model.lazy.trim="settings.node">
<span class="icon is-small is-left">
<i class="fas fa-server"></i>
</span>
<span class="icon is-small is-right">
<i :class="['fas', dynamicIconClass(state.node)]"></i>
</span>
</p>
</div>
</div>
<div class="column">
<div class="field">
<label class="label">
Multisig account
<span class="icon is-small" title="Not necessary a multisig account, but any account with transactions proposed to it">
<i class="fas fa-info-circle"></i>
</span>
</label>
<p class="control has-icons-left has-icons-right">
<input :class="['input', dynamicInputClass(state.account)]" type="text" v-model.lazy.trim="settings.account">
<span class="icon is-small is-left">
<i class="fas fa-user-circle"></i>
</span>
<span class="icon is-small is-right">
<i :class="['fas', dynamicIconClass(state.account)]"></i>
</span>
</p>
</div>
</div>
</div>
<div class="columns" v-if="state.page == 'dashboard'">
<div class="column">
<div class="field">
<label class="label">Signatory account</label>
<p class="control has-icons-left has-icons-right">
<input :class="['input', dynamicInputClass(state.signatory)]" type="text" v-model.lazy.trim="settings.signatory">
<span class="icon is-small is-left">
<i class="fas fa-user-circle"></i>
</span>
<span class="icon is-small is-right">
<i :class="['fas', dynamicIconClass(state.signatory)]"></i>
</span>
</p>
</div>
</div>
<div class="column">
<!-- Filtering settings -->
</div>
</div>
</div>
<br>
<button class="button is-small is-fullwidth" v-on:click="state.settingsCollapsed = !state.settingsCollapsed">
<i v-bind:class="['fas', state.settingsCollapsed ? 'fa-chevron-down' : 'fa-chevron-up']"></i>
</button>
</section>
<section class="section has-background-white-ter">
<div class="container">
<div v-if="state.page == 'main'" class="contaner">
<h1>Multisig interface</h1>
<br>
<br>
<h2>Settings</h2>
<p>В настройках указывается API-нода и аккаунты мультисига и подписанта</p>
<br>
<br>
<h2>Dashboard</h2>
<p>После указания аккаунта мультисига из блокчейна загрузятся существующие предложенные транзакции. Требующие подписи подписанта отображаются желтым цветом. Нетребующие - зеленым</p>
</div>
<div v-if="state.page == 'dashboard'">
<div class="tile is-ancestor">
<div class="tile is-vertical">
<div v-for="(item, index) in proposals" :key="index">
<component is="dashboard-proposal-component" :proposal="item" :signatory="settings.signatory" @click="updatePage('?page=review&author=' + item.author + '&title=' + item.title)">
</component>
</div>
</div>
</div>
</div>
<div v-else-if="state.page == 'create' || state.page == 'review'">
<div class="tile is-ancestor">
<div class="tile is-6 is-vertical">
<div class="tile is-parent">
<div class="tile is-child notification has-background-link">
<div>
<label class="label" title="Transaction will be completed at this time">Expiration time (in local time)</label>
<div class="field is-grouped is-grouped-multiline">
<p class="control has-icons-left is-expanded">
<input class="input" type="date" v-model.lazy="expiration_date" :disabled="!proposal_editable" min="2017-06-01T08:30">
<span class="icon is-small is-left">
<i class="fas fa-calendar"></i>
</span>
</p>
<p class="control has-icons-left is-expanded">
<input class="input" type="time" v-model.lazy="expiration_time" :disabled="!proposal_editable" min="2017-06-01T08:30">
<span class="icon is-small is-left">
<i class="fas fa-clock"></i>
</span>
</p>
</div>
<div class="field">
<label class="label">Title</label>
<p class="control has-icons-left">
<input class="input" type="text" v-model.lazy.trim="proposal.title" :disabled="!proposal_editable">
<span class="icon is-small is-left">
<i class="fas fa-book"></i>
</span>
</p>
</div>
<div class="field">
<label class="label">Memo</label>
<p class="control">
<textarea class="textarea" v-model.lazy.trim="proposal.memo" :disabled="!proposal_editable"></textarea>
</p>
</div>
</div>
</div>
</div>
<div v-if="state.page == 'create'">
<component v-for="(item, index) in proposal.proposed_operations" :key="index" :is="proposal.proposed_operations[index].op[0] + '-component'" v-model="proposal.proposed_operations[index].op[1]" :editable="proposal_editable" @delete-operation="deleteOperation(index)">
</component>
</div>
<div v-else>
<div v-for="(item, index) in proposal.proposed_operations">
<component :is="proposal.proposed_operations[index][0] + '-component'" v-model="proposal.proposed_operations[index][1]" :editable="proposal_editable">
</component>
</div>
</div>
<div class="tile is-parent" v-if="state.page == 'create'">
<div class="tile is-child">
<button class="button is-primary is-fullwidth" @click="state.chooseOperationModal = true">Add operation</button>
</div>
</div>
</div>
<div class="tile is-parent notification is-vertical is-6">
<div class="tile is-child">
<pre class="has-text-success has-background-dark" style="white-space: pre;">{{JSON.stringify(proposal, null, 2)}}</pre>
</div>
</div>
</div>
<div class="tile is-ancestor" v-if="state.page == 'create'">
<div class="tile is-vertical">
<div class="tile is-parent is-12">
<div class="tile is-child notification has-background-warning">
<div>
<label class="label">Author</label>
<div class="field">
<p class="control has-icons-left is-expanded">
<input class="input" type="text" v-model.lazy.trim="proposal.author" :disabled="!proposal_editable">
<span class="icon is-small is-left">
<i class="fas fa-user-circle"></i>
</span>
</p>
</div>
<div class="field">
<label class="label" title="Will be cleared after successful transaction submitting">Active key</label>
<p class="control has-icons-left">
<input class="input" type="password" v-model.lazy.trim="activeKey" :disabled="!proposal_editable">
<span class="icon is-small is-left">
<i class="fas fa-key"></i>
</span>
</p>
</div>
<div class="buttons is-centered">
<button class="button is-success" @click="submitProposal()">Submit proposal</button>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="tile is-ancestor" v-else>
<div class="tile is-vertical">
<div class="tile is-parent is-12">
<div class="tile is-child notification has-background-warning">
<div>
<label class="label">Signatory</label>
<div class="field">
<p class="control has-icons-left is-expanded">
<input class="input" type="text" v-model.lazy.trim="settings.signatory">
<span class="icon is-small is-left">
<i class="fas fa-user-circle"></i>
</span>
</p>
</div>
<div class="field">
<label class="label" title="Will be cleared after successful transaction submitting">{{ signatoryKeyRequirement }} key</label>
<p class="control has-icons-left">
<input class="input" type="password" v-model.lazy.trim="settings.signatoryKey">
<span class="icon is-small is-left">
<i class="fas fa-key"></i>
</span>
</p>
</div>
<div class="buttons is-centered">
<button class="button is-success" @click="approveProposal()">Approve proposal</button>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div :class="['modal', {'is-active': state.statusModal == true}]">
<div class="modal-background"></div>
<div class="modal-card">
<header class="modal-card-head">
<p class="modal-card-title">Modal title</p>
<button class="delete" aria-label="close"></button>
</header>
<section class="modal-card-body">
</section>
<footer class="modal-card-foot">
<button class="button is-success">Save changes</button>
<button class="button">Cancel</button>
</footer>
</div>
</div>
<modal-info-component :title="state.statusModalTitle" :active="state.statusModal" @close="state.statusModal = false">
<p>{{ state.statusModalContent }}</p>
</modal-info-component>
<modal-info-component title="Add new operation" :active="state.chooseOperationModal" @close="state.chooseOperationModal = false">
<aside class="menu">
<p class="menu-label">Account</p>
<ul class="menu-list">
<li><a @click="newOperation('account_update')">Account update</a></li>
</ul>
<p class="menu-label">Monetary</p>
<ul class="menu-list">
<li><a @click="newOperation('transfer')">Transfer</a></li>
<li><a @click="newOperation('transfer_to_vesting')">Transfer Golos to Golos Power</a></li>
<li><a @click="newOperation('withdraw_vesting')">Transfer Golos Power to Golos</a></li>
<li><a @click="newOperation('delegate_vesting_shares')">Delegate Golos Power</a></li>
<li><a @click="newOperation('convert')">Convert GBG</a></li>
<li><a @click="newOperation('limit_order_create')">Exchange order</a></li>
</ul>
<p class="menu-label">Government</p>
<ul class="menu-list">
<li><a @click="newOperation('account_witness_vote')">Witness vote</a></li>
</ul>
<p class="menu-label">Social</p>
<ul class="menu-list">
<li><a @click="newOperation('vote')">Vote</a></li>
<li><a @click="newOperation('comment')">Post</a></li>
</ul>
</aside>
</modal-info-component>
</div>
</section>
<footer class="footer has-background-primary">
</footer>
</div>
<script src="./components/dashboard-proposal-component.js"></script>
<script src="./components/simplemde-component.js"></script>
<script src="./components/modal-info-component.js"></script>
<script src="./components/pageloader-component.js"></script>
<script src="./components/convert-component.js"></script>
<script src="./components/comment-component.js"></script>
<script src="./components/vote-component.js"></script>
<script src="./components/limit_order_create-component.js"></script>
<script src="./components/account_witness_vote-component.js"></script>
<script src="./components/account_update-component.js"></script>
<script src="./components/transfer-component.js"></script>
<script src="./components/transfer_to_vesting-component.js"></script>
<script src="./components/withdraw_vesting-component.js"></script>
<script src="./components/delegate_vesting_shares-component.js"></script>
<script src="./index.js"></script>
</body>
</html>