-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
98 lines (97 loc) · 3.67 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Raw Data API Metrics</title>
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/PapaParse/5.3.0/papaparse.min.js"></script>
<link rel="stylesheet" type="text/css" href="./style.css" />
<link
rel="stylesheet"
href="https://cdn.datatables.net/2.1.4/css/dataTables.dataTables.css"
/>
<script
type="text/javascript"
charset="utf8"
src="https://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.8.2.min.js"
></script>
<script src="https://cdn.datatables.net/2.1.4/js/dataTables.js"></script>
</head>
<body>
<div class="container">
<h1>Raw Data Metrics</h1>
<div id="loginSection">
<div id="loginForm">
<button onclick="generateAuthToken()">Generate Login Link</button>
<div id="loginMessage"></div>
<div class="form-group">
<label for="accessToken">Access Token:</label>
<input
type="text"
id="accessToken"
placeholder="Paste your access token here"
/>
</div>
<button onclick="login()">Login</button>
</div>
<div id="userInfo" style="display: none">
<img id="userImage" src="" alt="Profile Picture" />
<span id="userName"></span>
<button onclick="logout()" style="margin-left: 10px">Logout</button>
</div>
</div>
<div id="dataSection" style="display: none">
<div class="form-group">
<label for="quickDateSelect">Select Date Range:</label>
<select id="quickDateSelect" onchange="updateDateRange()">
<option value="day" selected>Last Day</option>
<option value="month">Last Month</option>
<option value="quarter">Last Quarter</option>
<option value="year">Last Year</option>
</select>
</div>
<div class="form-group">
<label for="startDate">Start Date:</label>
<input type="date" id="startDate" />
</div>
<div class="form-group">
<label for="endDate">End Date:</label>
<input type="date" id="endDate" />
</div>
<div class="form-group">
<label for="groupBy">Group By:</label>
<select id="groupBy">
<option value="day">Day</option>
<option value="month" selected>Month</option>
<option value="quarter">Quarter</option>
<option value="year">Year</option>
</select>
</div>
<div class="form-group">
<label for="folderSelect">Select Project:</label>
<select id="folderSelect">
<option value="all" selected>All</option>
<option value="default">Default</option>
<option value="TM">TM</option>
<option value="HDX">HDX</option>
<option value="ISO3">ISO3</option>
</select>
</div>
<button onclick="fetchData()" style="margin-bottom: 10px">
Fetch Data
</button>
<div class="form-group" id="chartmetricselector" style="display: none">
<label for="metricSelector">Select Metric to Display in Chart</label>
<select id="metricSelector" onchange="updateChart()"></select>
</div>
<div id="chartContainer"></div>
<div id="tableContainer"></div>
<button onclick="downloadCSV()" id="downloadBtn" style="display: none">
Download CSV
</button>
</div>
</div>
<script src="main.js"></script>
</body>
</html>