forked from ipfs/js-ipfs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
239 lines (182 loc) · 5.72 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
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8"/>
<title><%= htmlWebpackPlugin.options.title %></title>
<style type="text/css">
body {
margin: 0;
padding: 0;
}
button {
font-size: 1.5em;
padding: 5px 10px;
}
#container {
height: calc(100vh - 60px);
padding: 20px;
border: 10px transparent;
}
#container.drag-over {
border: 10px dashed green;
}
#buttons {
height: 50px;
}
#display {
display: flex;
height: calc(100vh - 90px);
}
#log {
flex-grow: 2;
padding: 10px;
height: calc(100vh - 120px);
overflow: auto;
}
#log p {
font-family: "Lucida Console", Monaco, monospace;
margin: 0;
white-space: pre;
line-height: 1.4;
}
#log p.error {
color: red;
}
#log p.output {
color: green;
}
#files {
width: 50vw;
}
#files pre {
margin: 0;
line-height: 1.4;
}
#modal-screen {
position: absolute;
height: 100vh;
width: 100vw;
background-color: rgba(0, 0, 0, 0.4);
top: 0;
left: 0;
}
.modal {
-webkit-box-shadow: 0px 0px 92px -3px rgba(0, 0, 0, 0.4);
-moz-box-shadow: 0px 0px 92px -3px rgba(0, 0, 0, 0.4);
box-shadow: 0px 0px 92px -3px rgba(0, 0, 0, 0.4);
background-color: white;
position: absolute;
top: 50px;
width: 500px;
margin-left: 50%;
left: -250px;
padding: 20px;
display: none;
}
.modal h2 {
margin-top: 10px;
}
.modal input {
font-size: 1.5em;
padding: 5px 10px;
}
.modal label, .modal input, .modal checkbox, .modal button {
display: block;
margin: 10px 0;
}
</style>
</head>
<body>
<div id="container" ondrop="dropHandler(event)" ondragover="dragOverHandler(event)">
<div id="buttons">
<button id="button-cp" disabled>cp</button>
<button id="button-mkdir" disabled>mkdir</button>
<button id="button-mv" disabled>mv</button>
<button id="button-read" disabled>read</button>
<button id="button-rm" disabled>rm</button>
<button id="button-stat" disabled>stat</button>
</div>
<div id="display">
<div id="files"></div>
<div id="log"></div>
</div>
</div>
<div id="modal-screen"></div>
<div id="form-mkdir" class="modal">
<h2>mkdir</h2>
<label for="form-mkdir-path">path:</label>
<input type="text" id="form-mkdir-path" value="/" />
<label for="form-mkdir-parents">format:</label>
<input type="text" id="form-mkdir-format" value="dag-pb" />
<label for="form-mkdir-parents">hashAlg:</label>
<input type="text" id="form-mkdir-hashalg" value="sha2-256" />
<label for="form-mkdir-parents">parents:</label>
<input type="checkbox" id="form-mkdir-parents" checked />
<label for="form-mkdir-parents">flush:</label>
<input type="checkbox" id="form-mkdir-flush" checked />
<button id="button-form-mkdir-submit">Go!</button>
</div>
<div id="form-cp" class="modal">
<h2>cp</h2>
<label for="form-cp-path">path:</label>
<input type="text" id="form-cp-path" value="/" />
<label for="form-cp-dest">destination:</label>
<input type="text" id="form-cp-dest" value="/" />
<label for="form-cp-parents">format:</label>
<input type="text" id="form-cp-format" value="dag-pb" />
<label for="form-cp-parents">hashAlg:</label>
<input type="text" id="form-cp-hashalg" value="sha2-256" />
<label for="form-cp-parents">parents:</label>
<input type="checkbox" id="form-cp-parents" checked />
<label for="form-cp-parents">flush:</label>
<input type="checkbox" id="form-cp-flush" checked />
<button id="button-form-cp-submit">Go!</button>
</div>
<div id="form-mv" class="modal">
<h2>mv</h2>
<label for="form-mv-path">path:</label>
<input type="text" id="form-mv-path" value="/" />
<label for="form-mv-dest">destination:</label>
<input type="text" id="form-mv-dest" value="/" />
<label for="form-mv-parents">format:</label>
<input type="text" id="form-mv-format" value="dag-pb" />
<label for="form-mv-parents">hashAlg:</label>
<input type="text" id="form-mv-hashalg" value="sha2-256" />
<label for="form-mv-parents">parents:</label>
<input type="checkbox" id="form-mv-parents" checked />
<label for="form-mv-parents">flush:</label>
<input type="checkbox" id="form-mv-flush" checked />
<button id="button-form-mv-submit">Go!</button>
</div>
<div id="form-rm" class="modal">
<h2>rm</h2>
<label for="form-rm-path">path:</label>
<input type="text" id="form-rm-path" value="/" />
<label for="form-mkdir-recursive">recursive:</label>
<input type="checkbox" id="form-rm-recursive" checked />
<button id="button-form-rm-submit">Go!</button>
</div>
<div id="form-stat" class="modal">
<h2>stat</h2>
<label for="form-stat-path">path:</label>
<input type="text" id="form-stat-path" value="/" />
<label for="form-stat-hash">hash:</label>
<input type="checkbox" id="form-stat-hash" />
<label for="form-stat-size">size:</label>
<input type="checkbox" id="form-stat-size" />
<label for="form-stat-withlocal">withLocal:</label>
<input type="checkbox" id="form-stat-withlocal" checked />
<button id="button-form-stat-submit">Go!</button>
</div>
<div id="form-read" class="modal">
<h2>read</h2>
<label for="form-read-path">path:</label>
<input type="text" id="form-read-path" value="/" />
<label for="form-read-offset">offset:</label>
<input type="number" id="form-read-offset" value="" />
<label for="form-read-length">length:</label>
<input type="number" id="form-read-length" value="" />
<button id="button-form-read-submit">Go!</button>
</div>
</body>
</html>