/
timer.html
90 lines (85 loc) · 2.91 KB
/
timer.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
<!DOCTYPE html>
<html>
<head>
<base target="_top">
<link rel="stylesheet" href="https://ssl.gstatic.com/docs/script/css/add-ons.css">
<script>
function onClick(form) {
google.script.run.onTimerSetting(form);
google.script.host.close();
}
</script>
</head>
<body>
<? var everyList = [
//{"label": "hour", "value": "hour"},
{"label": "day", "value": "day"},
//{"label": "week", "value": "week"},
//{"label": "month", "value": "month"},
] ?>
<? var reportHourOfDayList = [
{"label": "midnight – 1 a.m.", "value": 0},
{"label": "1 a.m. – 2 a.m.", "value": 1},
{"label": "2 a.m. – 3 a.m.", "value": 2},
{"label": "3 a.m. – 4 a.m.", "value": 3},
{"label": "4 a.m. – 5 a.m.", "value": 4},
{"label": "5 a.m. – 6 a.m.", "value": 5},
{"label": "6 a.m. – 7 a.m.", "value": 6},
{"label": "7 a.m. – 8 a.m.", "value": 7},
{"label": "8 a.m. – 9 a.m.", "value": 8},
{"label": "9 a.m. – 10 a.m.", "value": 9},
{"label": "10 a.m. – 11 a.m.", "value": 10},
{"label": "11 a.m. – noon", "value": 11},
{"label": "noon – 1 p.m.", "value": 12},
{"label": "1 p.m. – 2 p.m.", "value": 13},
{"label": "2 p.m. – 3 p.m.", "value": 14},
{"label": "3 p.m. – 4 p.m.", "value": 15},
{"label": "4 p.m. – 5 p.m.", "value": 16},
{"label": "5 p.m. – 6 p.m.", "value": 17},
{"label": "6 p.m. – 7 p.m.", "value": 18},
{"label": "7 p.m. – 8 p.m.", "value": 19},
{"label": "8 p.m. – 9 p.m.", "value": 20},
{"label": "9 p.m. – 10 p.m.", "value": 21},
{"label": "10 p.m. – 11 p.m.", "value": 22},
{"label": "11 p.m. – midnight", "value": 23},
] ?>
<form name="myForm">
<p>
<label>
<? if (form.enable) { ?>
<input type="checkbox" value="1" name="enable" checked="checked">
<? } else { ?>
<input type="checkbox" value="1" name="enable">
<? } ?>
タイマーを有効にする
</label>
</p>
<hr>
<p>レポート抽出のスケジュール:
<select name="every">
<? everyList.forEach(function (v) { ?>
<? if (v.value == form.every) { ?>
<option value="<?= v.value ?>" selected="selected"><?= v.label ?></option>
<? } else { ?>
<option value="<?= v.value ?>"><?= v.label ?></option>
<? } ?>
<? }); ?>
</select>
between
<select id="hourOfDay" name="hourOfDay">
<? reportHourOfDayList.forEach(function (v) { ?>
<? if (v.value == form.hourOfDay) { ?>
<option value="<?= v.value ?>" selected="selected"><?= v.label ?></option>
<? } else { ?>
<option value="<?= v.value ?>"><?= v.label ?></option>
<? } ?>
<? }); ?>
</select>
</p>
<p>非サンプリングレポートのチェック間隔: 1時間に1度</p>
<p>
<button type="button" onClick="onClick(this.form)">設定する</button>
</p>
</form>
</body>
</html>