-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
75 lines (71 loc) · 2.61 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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>Ipfs reurl app</title>
<style>
html, body {
margin: 0px;
background-color: #f4f6f8;
}
</style>
<link rel="stylesheet" href="https://unpkg.com/element-ui/lib/theme-chalk/index.css">
<script src="https://unpkg.com/ipfs/dist/index.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/vue"></script>
<script src="https://unpkg.com/element-ui/lib/index.js"></script>
</head>
<body>
<div id="app">
<el-menu
:default-active="mode"
class="el-menu-demo"
mode="horizontal"
@select="handleSelect"
background-color="#545c64"
text-color="#fff"
active-text-color="#ffd04b"
>
<el-menu-item index="url" style="left: 16">Url</el-menu-item>
<el-menu-item index="image">File</el-menu-item>
</el-menu>
<el-row :gutter="16">
<el-col style="text-align: center">
<h2>Hello from IPFS!</h2>
<h3>ID: {{ ipfs.id }}</h3>
<h3>Number of peers: {{ ipfs.peers }}</h3>
</el-col>
</el-row>
<el-row type="flex" justify="center">
<el-col span="6">
<el-progress :show-text="false" :percentage="peersPercentage"></el-progress></h3>
</el-col>
</el-row>
<el-row :gutter="16" v-if="isShowUrl" type="flex" justify="center" style="padding-top: 16px">
<el-col :span="8">
<el-input v-model="url" placeholder="Please enter url here... Start with http(s)://" @keyup.enter.native="handleAddUrlToIpfs">
<el-button type="primary" slot="append" v-on:click="handleAddUrlToIpfs">Go!</el-button>
</el-input>
</el-col>
</el-row>
<el-row :gutter="16" v-if="isShowImage" type="flex" justify="center" style="padding-top: 16px">
<el-col :span="8">
<input type="file" v-on:change="handleFiles"></input>
</el-col>
<el-col :span="2">
<el-button type="primary" v-on:click="addFileToIpfs">Upload</el-button>
</el-col>
</el-row>
<el-row :gutter="16" v-if="isDisplayingHash" type="flex" justify="center">
<el-col :span="20" style="text-align: center; padding-top: 32px;">
<h3><a>{{ reurl }}</a></h3>
<el-tooltip content="Copy url to clipboard" placement="bottom">
<el-button type="success" icon="el-icon-share" circle v-on:click="copyToClipboard"></el-button>
</el-tooltop>
</el-col>
</el-row>
</div>
<script src="app.js">
</script>
</body>
</html>