-
Notifications
You must be signed in to change notification settings - Fork 1
/
HTMLsidebar.html
107 lines (95 loc) · 3.7 KB
/
HTMLsidebar.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
<!DOCTYPE html>
<html>
<head>
<base target="_top">
<style>
#form2 {
display: <?=message?>;
}
#deleteButton{
position:absolute;
bottom: 5%;
}
</style>
</head>
<body>
<form action="/action_page.php" name="form" id="form">
<div id="form1">
Enter your API Key. Don't know where to find it? <a href="https://monitoring.rigor.com\/settings"> Click Here </a> <br>
<br>
<input type="text" name="apikey"><br>
<br>
<!-- run getCheckDetails function when button clicked -->
<input type="button" value="RUN" onclick="formSubmit()" /> <br>
<br>
<br>
</div>
<!-- hidden until first section complete -->
<div id="form2">
Enter the ID of the test you would like to pull data for (Column A) <br>
<br>
<input type="text" name="testid"> <br>
<br>
Select data: <br>
<input type="checkbox" id="servertime" name="servertime" value="true"> Server Time <br>
<input type="checkbox" id="startrendertime" name="startrendertime" value="true"> Start Render Time <br>
<input type="checkbox" id="domloadtime" name="domloadtime" value="true"> DOM Load Time <br>
<input type="checkbox" id="onloadtime" name="onloadtime" value="true"> On Load Time <br>
<input type="checkbox" id="visuallycompletetime" name="visuallycompletetime" value="true"> Visually Complete Time <br>
<input type="checkbox" id="fullyloadedtime" name="fullyloadedtime" value="true"> Fully Loaded Time <br>
<input type="checkbox" id="speedindex" name="speedindex" value="true"> Speed Index <br>
<br>
Select timeframe for data <br>
<select name="timeframe" onchange="showDiv(this)">
<option value="last_hour">Last Hour</option>
<option value="last_4_hours">Last 4 Hours</option>
<option value="last_8_hours">Last 8 Hours</option>
<option value="last_12_hours">Last 12 Hours</option>
<option value="last_24_hours">Last 24 Hours</option>
<option value="last_week">Last Week</option>
<option value="custom">Custom</option>
</select> <br>
<br>
<!-- hidden unless "custom" timeframe selected" -->
<div id="form3" style="display: none;">
From <input type="date" name="fromDate"> <br>
To <input type="date" name="toDate">
<br>
<br>
</div>
<input type="button" value="RUN" onclick="dataPull()" />
</div>
<input id="deleteButton" type="button" value="Delete Reports" onclick="deleteSheets()" />
</form>
</body>
<script type="text/javascript">
function formSubmit() {
function onSuccessfunction2(test){
if(test != 'end'){
document.getElementById('form2').style.display = 'block';
}
}
google.script.run.withSuccessHandler(onSuccessfunction2).getCheckDetails(document.forms[0]);
}
function showDiv(elem){
if(elem.value == 'custom'){
document.getElementById('form3').style.display = "block";
}else {
document.getElementById('form3').style.display = "none";
}
}
//Get run data based on checkboxes
function dataPull(){
function onSuccessfunction(test){
if(test != 'end'){
google.script.run.getFormData(document.forms[0]);
}
}
google.script.run.withSuccessHandler(onSuccessfunction).checkTestID(document.forms[0]);
}
//Delete report sheets
function deleteSheets(){
google.script.run.deleteSheetsGAS();
}
</script>
</html>