-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtokens.html
111 lines (100 loc) · 2.76 KB
/
tokens.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
<!doctype html>
<html>
<head>
<style>
* {
font-family: sans-serif;
}
table.form th {
text-align: left;
font-family: sans-serif;
}
th {
text-align: left;
}
h1,h2,h3,h4,h5 {
font-family: sans-serif;
}
tr.disabled-true td {
text-decoration: line-through;
color: #999;
}
.expired-true {
color: #f00;
font-weight: bold;
}
.most-recent-token {
padding: 1.5em 2em;
border: 1px solid #ccc;
background: #ff9;
word-wrap: break-word;
border-radius: 6px;
margin: 2em auto;
max-width: 400px;
}
</style>
</head>
<body>
<div ng-app="simplefin">
<div ng-controller="TokenCtrl">
<h1>SimpleFIN Tokens</h1>
<h2>Generate a new token</h2>
<table class="form">
<tr>
<th>Allow access to view:</th>
<td>
<select ng-model="accountChoice">
<option>All accounts</option>
<option ng-repeat="account in accounts" value="{{account.name}}">{{ account.name }} (#{{ account.number }})
</option>
</select>
</td>
</tr>
<tr>
<th>What will use this token?</th>
<td>
<input type="text" ng-model="description" placeholder="example.com">
</td>
</tr>
<tr>
<th>Token will expire:</th>
<td>
<input type="date" ng-model="expirationDate">
</td>
</tr>
<tr>
<td></td>
<td>
<button ng-click="createToken()">Generate Token</button>
</td>
</tr>
</table>
<div ng-show="mostRecentToken">
Below is your new SimpleFIN Setup Token. Share this token with a SimpleFIN Reader (by copying and pasting it) to grant access to view your account information:
<div class="most-recent-token">{{ mostRecentToken }}</div>
</div>
<h2>Existing tokens</h2>
<table width="100%">
<tr>
<th>Accessible Account</th>
<th>Description</th>
<th>Expires</th>
<th>Last used</th>
<th>Enabled</th>
<th></th>
</tr>
<tr ng-repeat="token in tokens" class="disabled-{{ !token.enabled }}">
<td>{{ token.accounts }}</td>
<td>{{ token.description }}</td>
<td class="expired-{{ isExpired(token) }}">{{ token.expirationDate }}</td>
<td>{{ token.last_used }} {{ token.last_used_ip }}</td>
<td><input type="checkbox" ng-model="token.enabled"></td>
<td><button ng-click="deleteToken(token)">Delete</button></td>
</tr>
</table>
</div>
</div>
<script src="vendor/angular.js"></script>
<script src="tokens.js"></script>
</body>
</html>