-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
235 lines (161 loc) · 5.79 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
<html>
<head>
<title>Labchain campus demo</title>
<link rel="stylesheet" href="css/bootstrap.min.css">
<link rel="stylesheet" href="css/small-business.css">
<link rel="stylesheet" href="css/dropzone.css">
<script type="text/javascript" src="bower_components/web3/dist/web3.min.js"></script>
<script src="js/jquery.min.js"></script>
<script src="js/bootstrap.min.js"></script>
<script src="js/angular.min.js"></script>
<script src="js/jquery.min.js"></script>
<script src="app.js"></script>
<script src="js/connect.js"></script>
<script src="js/dropzone.js"></script>
<script src="js/jquery-ui.min.js"></script>
</head>
<style>
body {
padding-top: 180px;
}
@media (min-width: 992px) {
body {
padding-top: 200px;
}
}
</style>
<body ng-app ="labchainApp" ng-controller="labchainCtl">
<!-- Navigation -->
<nav class="navbar navbar-expand-lg navbar-dark bg-dark fixed-top">
<div class="container">
<a class="navbar-brand" href="#"><img src="LabchainLogoBig.png"></a>
<div class="collapse navbar-collapse" id="navbarResponsive">
<ul class="navbar-nav ml-auto">
<li class="nav-item active">
<a class="nav-link" href="#top">Home
<span class="sr-only">(current)</span>
</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#login">Login</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#send_tx">Send</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#get_tx">Find</a>
</li>
</ul>
</div>
</div>
</nav>
<div class="container">
<h2>
<p id="top">Node information</p>
</h2>
Node: {{nodeinfo}}<br>
Account: {{account}}<br>
Balance: {{balance}}<br>
Ltest block: {{blockNumber}}<br>
<hr>
<h2>
<p id="login">Authenticate</p>
</h2>
<button ng-click="perform_login()">Login with hardware key</button><br>
Public key: {{pk}}<br>
<hr>
<h2>
<p id="send_tx">Send transaction</p>
</h2>
<input type="text" ng-model="tx_message" </input>
<button ng-click="send_tx(tx_message)">Send 0.1 Ether with message: {{tx_message}}</button><br>
Transaction_ID: <a href="https://ropsten.etherscan.io/tx/{{tx}}" target="_blank">{{tx}}</a><br>
<hr>
<H2><p id="get_tx">Get transactions</p>
</H2>
<button ng-click="get_tx()">Search</button><br>
Status: {{status}}<br>
Latest transaction : {{txhash}}<br>
From : {{from}}<br>
To : {{to}}<br>
Value : {{value}}<br>
Timestamp (GMT) : {{timestamp}}<br>
Data: {{input}}
<hr>
<H2><p id="upload">Upload file</p>
</H2>
<form action="uploadproc.php" method="POST" class="dropzone" id="labchainzone" enctype="multipart/form-data" style="border:1px solid #000;">
</form><br>
<center> <button id="submit-all" style="height: 40px;">Distribute files</button> </center>
<script type="text/javascript">
Dropzone.options.labchainzone = {
autoProcessQueue : false,
maxFiles: 10,
addRemoveLinks: false,
dictDefaultMessage: "Drop here",
acceptedFiles: ".txt, .labc",
init : function() {
var submitButton = document.querySelector("#submit-all")
myDropzone = this; thisDropzone=this;
submitButton.addEventListener("click", function() {
myDropzone.processQueue(); // Tell Dropzone to process all queued files.
});
// scan dir om bestaande files te laten zien.
$.get('uploadproc.php', function(data) {
$.each(data, function(key,value){
if (value.name!='playlist.json'){
var mockFile = { name: value.name, size: value.size };
thisDropzone.emit("addedfile", mockFile);
thisDropzone.createThumbnailFromUrl(mockFile, value.path + '/' + value.name);
thisDropzone.emit("complete", mockFile);
}
});
});
// to handle the added file event
this.on("addedfile", function(file) {
var removeButton = Dropzone.createElement("<center><button>Delete</button></center>");
// Capture the Dropzone instance as closure.
var _this = this;
// Listen to the click event
removeButton.addEventListener("click", function(e) {
// Make sure the button click doesn't submit the form:
e.preventDefault();
e.stopPropagation();
// Remove the file preview.
_this.removeFile(file);
// If you want to the delete the file on the server as well,
// you can do the AJAX request here.
});
file.previewElement.appendChild(removeButton);
});
this.on("maxfilesexceeded", function(file) {
this.removeFile(file);
});
this.on("removedfile", function(file) {
$.ajax({
url: "delete.php",
type: "POST",
data: { 'name': file.name}
});
});
}
};
// sorteerfunctionaliteit
$(function(){
$(".dropzone").sortable({
items:'.dz-preview',
cursor: 'move',
opacity: 0.5,
containment: '.dropzone',
distance: 20,
tolerance: 'pointer'
});
});
</script>
</p>
<h2>Logbestand</h2>
<p>Transactiehistorie</p>
</div>
</div>
</body>
</html>