-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.html
278 lines (239 loc) · 15.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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
<!DOCTYPE html>
<html>
<head>
<title>Deltares TeamCity Build Viewer</title>
<meta charset="utf-8">
<meta name="author" content="Jeroen Noort, Robin van Westrenen">
<meta http-equiv="Cache-control" content="no-cache">
<link rel="stylesheet" href="css/main.css?v1.0.1.13" type="text/css" media="all">
<link rel="stylesheet" href="css/wrappers.css?v1.0.1.13" type="text/css" media="all">
<link rel="stylesheet" href="css/wrappersnocolor.css?v1.0.1.13" type="text/css" media="all">
<link rel="stylesheet" href="css/builds.css?v1.0.1.13" type="text/css" media="all">
<link rel="stylesheet" href="css/buildsnocolor.css?v1.0.1.13" type="text/css" media="all">
<script src="config/config.js?v1.1.0.0"></script>
<script src="config/fields.js?v1.1.0.0"></script>
<script src="src/data.js?v1.1.0.0"></script>
<script src="src/query.js?v1.1.0.0"></script>
<script src="src/render.js?v1.1.0.0"></script>
<script src="src/time.js?v1.1.0.0"></script>
<script src="src/user.js?v1.1.0.0"></script>
<script src="src/main.js?v1.1.0.0"></script>
</head>
<body>
<!-- Legend container to show what the icons are-->
<div id="legend" class="legend">
<div class="title">Build result:</div>
<div class="buildLegend">
<div class="testBorderSUCCESS"></div>
<div class="testIconSUCCESS"></div>
<div style="clear:both"></div>
</div><div>success</div>
<div class="buildLegend">
<div class="testBorderFAILURE"></div>
<div class="testIconFAILURE"></div>
<div style="clear:both"></div>
</div><div>failed</div>
<div class="buildLegend">
<div class="testBorderSUCCESS"></div>
<div class="testIconrunning"></div>
<div style="clear:both"></div>
</div><div>running success</div>
<div class="buildLegend">
<div class="testBorderFAILURE"></div>
<div class="testIconrunning"></div>
<div style="clear:both"></div>
</div><div>running failed</div>
<div class="buildLegend">
<div class="testBorderqueued"></div>
<div class="testIconqueued"></div>
<div style="clear:both"></div>
</div><div>queued</div>
<div class="buildLegend">
<div class="testBorderSUCCESS"></div>
<div class="testIconchanged"></div>
<div style="clear:both"></div>
</div><div>recovered</div>
<div class="buildLegend">
<div class="testBorderFAILURE"></div>
<div class="testIconchanged"></div>
<div style="clear:both"></div>
</div><div>changed</div>
<div class="buildLegend">
<div class="testBorderUNKNOWN"></div>
<div class="testIconUNKNOWN"></div>
<div style="clear:both"></div>
</div><div>unknown</div>
<div class="title">Tests failures:</div>
<div>🚩</div><div>new failed</div>
<div>🕵</div><div>investigating</div>
<div>🙈</div><div>uninvestigated</div>
<div>🙉</div><div>ignored</div>
<div>🙊</div><div>muted</div>
<div class="title">Other:</div>
<div>⏰</div><div>Est. finish time</div>
<div>📌</div><div>Tags</div>
</div>
<!-- Header with buttons for selection options etc. -->
<div id="header_wrap" class="header">
<div id="stats" class="stats">
<div> user:</div><div id="username">unknown</div>
<div>queue:</div><div id="queueCount">0</div>
</div>
<div id="deltares_logo" class="deltaresLogo">
<svg xmlns="http://www.w3.org/2000/svg" width="200px" height="40px" viewBox="0 0 200 40">
<path
d="M32.70053,19.40642C32.70053,6.23,25.28877.81818,13.28877.81818c-3.76471,0-7.41176,0-9.29412.11765S.93583,1.28877.93583,3.17112v36a104.5266,104.5266,0,0,0,10.70588.58824C23.877,39.75936,32.70053,32.58289,32.70053,19.40642Zm-7.88235.58823c0,8.47059-5.17647,13.52941-12.47059,13.52941a25.14218,25.14218,0,0,1-4-.29411V7.1123s2.11765-.17647,4.47059-.17647C21.28877,6.93583,24.81818,11.52406,24.81818,19.99465Zm11.88235,5.29412c0,9.64706,4.70589,14.47059,14.35294,14.47059A25.57074,25.57074,0,0,0,59.99465,38.23V32.70053a25.64113,25.64113,0,0,1-8,1.41177c-5.17647,0-8-2.70588-8-7.88235H58.46524c2.35294,0,3.29412-.58824,3.29412-2.2353V22.93583c0-7.05882-3.76471-12.58824-11.76471-12.58824-8.47059,0-13.29412,6.47059-13.29412,14.94118Zm13.05883-9.52941c3.05882,0,4.70588,2.11764,4.70588,5.64706H44.1123c.47059-3.52942,2.58823-5.64706,5.64706-5.64706ZM74.46524.93583h-4c-2.35294,0-3.29412.58823-3.29412,2.23529V30.46524c0,6.58823,2,9.29412,7.41177,9.29412a16.70005,16.70005,0,0,0,4.82353-.76471V33.64171a10.98823,10.98823,0,0,1-2.47059.35294c-1.47059,0-2.47059-.70588-2.47059-3.7647Zm16.70588,0H87.28877c-2.35294,0-3.29412.58823-3.29412,2.23529V30.46524c0,6.58823,2.11765,9.29426,8.2353,9.29426a21.5292,21.5292,0,0,0,5.7647-.76485V33.40642a15.40581,15.40581,0,0,1-3.41176.47059c-2.11765,0-3.41177-1.05883-3.41177-4.58824V16.58289h3.52941c2.35294,0,3.29412-.58824,3.29412-2.2353V10.93583H91.17112Zm10.35294,25.52941c0,9.64706,6.11765,13.29412,13.64706,13.29412a35.36986,35.36986,0,0,0,12.35294-2.11765V11.877a36.59976,36.59976,0,0,0-10.11764-1.52942C107.52406,10.34759,101.52406,16.81818,101.52406,26.46524Zm7.52941-.70588c0-6.82353,3.41177-9.76471,7.64707-9.76471a15.47072,15.47072,0,0,1,3.64706.41177v17a11.90114,11.90114,0,0,1-4.58824.70588c-4.70589,0-6.70589-3.17647-6.70589-8.35294Zm25.88235,13.41176H142.23V21.99465c0-4,1.05882-5.41176,3.88235-5.41176h.35294c2.11765,0,3.17647-.35294,3.17647-2.2353V10.93583h-4.47058c-8,0-10.23531,4.94118-10.23531,11.05882Zm16.35295-13.88235c0,9.64706,4.70589,14.47059,14.35294,14.47059A25.57074,25.57074,0,0,0,174.58289,38.23V32.70053a25.64118,25.64118,0,0,1-8,1.41177c-5.17647,0-8-2.70588-8-7.88235h14.47059c2.35294,0,3.29412-.58824,3.29412-2.2353V22.93583c0-7.05882-3.76471-12.58824-11.76471-12.58824C156.1123,10.34759,151.28877,16.81818,151.28877,25.28877Zm13.05883-9.52941c3.05882,0,4.70588,2.11764,4.70588,5.64706h-10.353c.4706-3.52942,2.58824-5.64706,5.64707-5.64706Zm16.47058,3.64706c0,9.41176,11.47059,6.82353,11.47059,11.7647,0,1.88235-1.82353,2.94118-4.64706,2.94118a23.5708,23.5708,0,0,1-6.05882-.82353l-.11765,5.88235a28.65,28.65,0,0,0,5.82353.58828c7.52941,0,12.52941-3.6471,12.52941-9.29416,0-9.17647-11.58823-7.29412-11.58823-11.76471,0-1.88235,1.64705-2.82352,4.23529-2.82352.94118,0,1.88236.05882,2.58824.05882,1.647,0,2.94118-.29412,2.94118-3.11765v-2a33.178,33.178,0,0,0-5.17648-.47059C184.81818,10.34759,180.81818,14.46524,180.81818,19.40642Z">
</path>
</svg>
</div>
<h1>TeamCity Build Viewer</h1>
<div id="buttonList" class="buttonList">
<button id="toggle_green" class="toggle green filter_button"
onclick="render.toggleGreen();this.classList.toggle('active')">Hide green</button>
<button id="toggle_unchanged" class="toggle statusChanged filter_button"
onclick="render.toggleUnchangedBuildTypes();this.classList.toggle('active')">Hide unchanged</button>
<button id="toggle_selection" class="toggle"
onclick="document.getElementById('selection').classList.toggle('hidden');this.classList.toggle('active')">Project Selection</button>
<button id="toggle_time" class="toggle"
onclick="document.getElementById('time').classList.toggle('hidden');this.classList.toggle('active')">Time Selection</button>
<button id="toggle_color" class="toggle"
onclick="document.body.classList.toggle('nocolor');this.classList.toggle('active')">Colorblind mode</button>
<button id="toggle_info" class="toggle"
onclick="
document.getElementById('info').classList.toggle('hidden')
this.classList.toggle('active')">
<span class="bigger">ⓘ</span>
</button>
</div>
<!-- LOGIN BOX -->
<div id="login" class="headerBox hidden">
<div class="topBox">Login</div>
<button onclick="window.open('https://build.avi.directory.intra/login.html','login','toolbar=no,menubar=no,width=600,height=600')">Click here to log in to TeamCity ⧉</button><br />
</div>
<!-- SELECTION BOX-->
<div id="selection" class="headerBox selectionBox hidden" style="overflow: auto">
<div class="wide" style="text-align: center; display: flex; flex-direction: column">
<div class="topBox" style="margin-bottom: 1em">
Managing your selection
</div>
<div style="display: block; margin: auto; text-align: left;background: white; color: black; padding: 2em 3em 1em 3em">
Behaviour:
<ol style="display:block; line-height: 150%; padding-left: 0px">
<li>When you have clicked 'Save selection to Cookie' before, your selection will be retrieved from your cookie.</li>
<li>When no cookie is found, the TeamCity API will be queried for your favorite projects.</li>
<li>When no favorite projects are found, the 'default_selection' variable from config.js is used.</li>
</ol>
</div>
</div>
<div class="topBox" style="grid-column: 1;">Edit selection:</div>
<div class="topBox" style="grid-column: 3;">Active selection:</div>
<div style="grid-column: 1;">
<form spellcheck="false">
<textarea id="selection_textarea" class="code" oninput="document.getElementById('namedSelection').selectedIndex = 0"></textarea>
</form>
</div>
<button class="filter_button"
onclick="main.edit_selection = JSON.parse(document.getElementById('selection_textarea').value)
main.run()" style="grid-column: 2">
Apply<br /><span style="font-size: 3em">⇒</span>
</button>
<div id="selection_code" class="code" style="grid-column: 3"></div>
<div class="topBox" style="grid-column: 1">Load selection from ...</div>
<div class="topBox" style="grid-column: 3">Save selection to ...</div>
<div style="grid-column: 1; display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 1em">
<button
onclick="main.selectFavorite()">
TeamCity API
</button>
<div style="display: grid; grid-template-columns: auto fit-content(25%);">
<select style="height: 100%" name="namedSelection" id="namedSelection" onchange="if (this.value == 'none') {return} main.edit_selection = main.named_selection[this.value]; render.updateSelectionForm(null, main.edit_selection)" disabled>
<option value="none">Named selection:</option>
</select>
<button
onclick="user.removeNamedSelection(document.getElementById('namedSelection').value)">
❌
</button>
</div>
<button
onclick='main.selectRunFile()'>
File
</button>
</div>
<div style="grid-column: 3; display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 1em">
<button
onclick="user.setCookie('tcSelection',JSON.stringify(main.selection),365)
alert('Selection saved to cookie!')">
Cookie
</button>
<button
onclick="let name = prompt('Name for this selection:',''); user.storeNamedSelection(name)">
Named selection
</button>
<!-- Create virtual anchor to attach file and let JavaScript click it. -->
<button
onclick='selectFile()'>
File
</button>
</div>
<button class="filter_button" style="grid-column: 1 / span 3; margin: 1em auto 0 auto;"
onclick="
document.getElementById('selection').classList.add('hidden')
document.getElementById('toggle_selection').classList.remove('active')
">close
</button>
</div>
<!-- TIME BOX -->
<div id="time" class="headerBox hidden">
<div class="wide" style="text-align: center; display: flex; flex-direction: column">
<div class="topBox" style="margin-bottom: 1em">
<button class="filter_button" style="margin-top:1em"
onclick="main.timeSelectReset(true)">Reset to default
</button>
<div class="topBox">Number of days</div>
<input type="number" id="build_cutoff_days" value="14" min="0" max="60" style="width: 3em"/>
<div class="topBox">Number of builds</div>
<input type="number" id="build_count" value="14" min="0" max="60" style="width: 3em"/>
<div class="topBox">Before</div>
<input type="datetime-local" id="end_time" value=""/><br />
<button class="filter_button" style="margin-top:1em"
onclick="main.applyTimeSelect()">Apply
</button>
<button class="filter_button" style="margin-top:1em"
onclick="
document.getElementById('time').classList.add('hidden')
document.getElementById('toggle_time').classList.remove('active')
">close
</button>
</div>
</div>
</div>
<!-- INFO BOX-->
<div id="info" class="headerBox hidden">
<div class="topBox">Source code</div>
<a target="_blank" href="https://github.com/Deltares/tcBuildViewer">https://github.com/Deltares/tcBuildViewer ⧉</a>
<div class="topBox">Bugs or suggestions</div>
<a target="_blank" href="https://github.com/Deltares/tcBuildViewer/issues">https://github.com/Deltares/tcBuildViewer/issues ⧉</a>
<br />
<button class="filter_button" style="margin:1em auto 0 auto;"
onclick="
document.getElementById('info').classList.add('hidden')
document.getElementById('toggle_info').classList.remove('active')
">close
</button>
</div>
</div>
<!-- Main container to append all projects and buildtypes data to-->
<div id="main_wrapper" class="main">
<div id="_important" class="listWrapper">
<div id="important_wrapper" class="importantWrapper"></div>
</div>
<div id="_projects" class="listWrapper">
</div>
</div>
</body>
<script>
// On page load initialize classes, and parameters
const main = new Main()
main.initialize()
main.run()
</script>