-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
106 lines (99 loc) · 4.4 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Hellonext Demo</title>
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet"
integrity="sha384-BmbxuPwQa2lc/FVzBcNJ7UAyJxM6wuqIj61tLrc4wSX0szH/Ev+nYRRuWlolflfl" crossorigin="anonymous">
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js" integrity="sha384-MrcW6ZMFYlzcLA8Nl+NtUVF0sA7MsXsP1UyJoMp4YLEuNSfAP+JcXn/tWtIaxVXM" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/axios/dist/axios.min.js"></script>
</head>
<body>
<div class="container">
<ul class="nav navbar navbar-light bg-light">
<li class="nav-item">
<a class="nav-link active" aria-current="page" href="https://feedback.hellonext.co" target="_blank">Hellonext</a>
</li>
<li class="nav-item">
<div class="dropdown">
<a class="nav-link" id="dropdownMenuButton1" data-bs-toggle="dropdown" aria-expanded="false" href="#">
Boards ▼
</a>
<ul class="dropdown-menu" id="bucket-list" aria-labelledby="dropdownMenuButton1">
</ul>
</div>
</li>
</ul>
<div class="pt-5">
<div class="row">
<div class="col-md-4">
<div class="card" style="width: 18rem;">
<div class="card-body">
<h5 class="card-title">Public Board</h5>
<p class="card-text">
This is a <a href="https://phoenix.hellonext.co/b/Public-Board" target="_blank">public board</a>. Anyone can see it.
</p>
</p>
<a href="/demo1.html" class="btn btn-primary">Visit</a>
</div>
</div>
</div>
<div class="col-md-4">
<div class="card" style="width: 18rem;">
<div class="card-body">
<h5 class="card-title">Private Board</h5>
<p class="card-text">
This is a <a href="https://phoenix.hellonext.co/embed/b/Private-Board" target="_blank">public board</a>. Only those logged in as an admin, team member or board member can access it. This is how the embed looks when a JWT is not <i>passed</i> in. If you are logged in to Hellonext on another tab in the same browser, you can see the board.
</p>
<a href="/demo2.html" class="btn btn-primary">Visit</a>
</div>
</div>
</div>
<div class="col-md-4">
<div class="card" style="width: 18rem;">
<div class="card-body">
<h5 class="card-title">Private Board</h5>
<p class="card-text">This is the same private board, only with a valid JWT token authorizing it. You can access this board if you pass a valid token, even if you are not logged in to Hellonext on another tab in the same browser. You can read more about how to generate a JWT token on our <a href="https://hellonext.co/help/setting-up-sso" target="_blank">help page</a>.</p>
<a href="" id="tokenLink" class="btn btn-primary">Visit</a>
<input type="text" id="token" placeholder="token">
</div>
</div>
</div>
</div>
</div>
</div>
<script>
let tokenEl = document.getElementById("token");
let tokenLinkEl = document.getElementById("tokenLink");
tokenLinkEl.setAttribute("href", "/demo3.html");
tokenEl.addEventListener("input", function (e) {
let token = e.target.value;
let link = tokenLinkEl.getAttribute("href");
tokenLinkEl.setAttribute("href", link + "?token=" + token)
})
</script>
<script>
axios({
method: "GET",
url: "https://app.hellonext.co/api/v3/buckets",
headers: {
"API-KEY": "3IIlJZNFukq3BRh76_aw4Q",
}
}).then(function({ data }) {
let { buckets } = data;
let bucketListEl = document.getElementById("bucket-list");
let listItems = buckets.map(function(bucket) {
let listEl = document.createElement("li");
let anchorEl = document.createElement("a");
anchorEl.classList.add("dropdown-item");
anchorEl.href = "/demo1.html";
anchorEl.innerHTML = bucket.name;
listEl.appendChild(anchorEl);
bucketListEl.appendChild(listEl);
})
})
</script>
</body>
</html>