forked from travcorp/tc-radiate
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
224 lines (217 loc) · 14 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
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width" />
<title>Builds</title>
<link href="Content/Style.css" rel="stylesheet" />
</head>
<body>
<div class="page-loading" data-bind="showHide: isFirstLoad() && !builds().length"></div>
<div class="page-content" data-bind="showHide: !isFirstLoad() || builds().length">
<div id="left-panel">
<ul data-bind="foreach: { data: builds }">
<li data-bind="attr: { class: lowerStatus() }, css: { running: isRunning(), investigated: $data.investigations() && $data.investigations.isInvestigated() },
event: {
contextmenu: function () {
if (confirm('Are you sure you want to stop monitoring this branch?\n(Right click on the big picture to show them all again)'))
$root.excludedBuilds.push($data);
}
}">
<span class="build-project"><span data-bind="text: buildType().projectName"></span> >
</span>
<a data-bind="attr: { href: buildType().webUrl }" target="_blank"><span class="build-type" data-bind="text: buildType"></span></a>
<!-- ko if: $data.branchName -->
<div class="build-branch"> > <i class="build-branch-name" data-bind="text: branchName"></i> branch</div>
<!-- /ko -->
<a data-bind="attr: { href: webUrl }" target="_blank"><span class="build-number">#<span data-bind="text: number"></span></span></a>
<div class="clear"></div>
<time data-bind="
attr: { datetime: moment(($data.finishDate && finishDate()) || startDate(), 'YYYYMMDDTHHmmssZ').format() },
afterHtmlRender: $($element).timeago()
"></time>
<div class="build-status" data-bind="text: isRunning() ? '' : status"></div>
<div class="clear"></div>
<!-- ko if: hasProgress() -->
<div class="progress-container" data-bind="attr: { 'data-progress' : percentageComplete() }"></div>
<!-- /ko -->
</li>
</ul>
</div>
<div id="right-panel" data-bind="event: {
contextmenu: function () {
if ($root.excludedBuilds.length && confirm('Are you sure you want to show all excluded branches?\n(Right click on a build to exclude it again)'))
$root.excludedBuilds.removeAll();
}
}">
<div class="page-loading" data-bind="showHide: isFirstLoad()"></div>
<!-- ko with: mainBuild -->
<div id="main-build" data-bind="css: lowerStatus() + ' ' + ($data.investigations && $data.investigations.isInvestigated() ? 'investigated' : '')">
<img data-bind="
attr: { src: $root.getImageForStatus(lowerStatus()) },
event: {
error: function () {
console.error({ message: 'Possibly need to change a link to an image. Falling back to a different image because of an error trying to display ' + $element.src, errorEventArgs: arguments });
$element.src = ''; $element.src = $root.getImageForStatus(lowerStatus())();
}
}
" style="max-height: 60%; bottom: 0; position: absolute; margin-left: auto; margin-right: auto; left: 0; right: 0;"/>
<div style="position: absolute; margin-left: auto; margin-right: auto; left: 0; right: 0;">
<div id="main-branch-status" class="highlight" data-bind="text: status"></div>
<!-- ko if: Settings.mainBranch || status() !== 'SUCCESS' -->
<audio controls data-bind="
attr: { autoplay: isNew },
afterHtmlRender: function () {
var soundInfo = Sounds.Failures.getRandom();
if (soundInfo.time) {
if (soundInfo.time.startSecond)
$element.addEventListener('canplaythrough', function() {
if (soundInfo.url !== this.src)
return;
if (this.currentTime < soundInfo.time.startSecond)
this.currentTime = soundInfo.time.startSecond;
});
if (soundInfo.time.endSecond)
$element.addEventListener('timeupdate', function() {
if (soundInfo.url !== this.src)
return;
if (this.currentTime > soundInfo.time.endSecond) {
this.currentTime = 0;
this.pause();
}
});
}
$element.src = soundInfo.url;
$element.volume = $root.audio.volume();
$element.muted = $root.audio.isMuted();
},
event: {
volumechange: function () { $root.audio.volume($element.volume); $root.audio.isMuted($element.muted); },
error: function () {
console.error({ message: 'Possibly need to change link to a sound. Falling back to a local sound because of an error trying to play ' + $element.src, errorEventArgs: arguments });
$element.src = Sounds.Failures.getRandomLocal().url;
}
},
"></audio>
<div id="main-branch-name">
<span class="build-project" data-bind="text: buildType.projectName"></span> > <a data-bind="attr: { href: buildType.webUrl }" target="_blank"><span class="build-type" data-bind="text: buildType.name"></span></a> >
<!-- ko if: $data.branchName -->
<span class="build-branch"><i class="build-branch-name" data-bind="text: branchName"></i> branch</span> >
<!-- /ko -->
<a data-bind="attr: { href: webUrl }" target="_blank">Build <span class="build-number" class="highlight" data-bind="text: number"></span></a>
</div>
<div id="main-branch-investigated-by" style="margin-bottom: .5em" data-bind="with: $data.investigations">
<!-- ko if: length -->
<!-- ko if: $parent.investigations.isInvestigated -->
Investigated by
<!-- /ko -->
<ul class="inlineSentenceList" data-bind="foreach: $data">
<li>
<span class="highlight"><!-- ko if: state !== 'GIVEN_UP' --><!-- ko text: assignee.name --><!-- /ko --><!-- /ko --><!-- ko if: assignment && assignment.text --> 💬: <i style="font-weight: normal" data-bind="text: assignment.text"></i><!-- /ko --></span>
</li>
</ul>
<!-- /ko -->
</div>
<div id="main-branch-changed-by" data-bind="with: _($data.changes()).uniq(function (c) { return c.username; })">
<!-- ko if: length -->
Last changes by
<ul class="inlineSentenceList" data-bind="foreach: $data">
<!-- ko if: username -->
<li><a class="highlight" data-bind="text: username"></a></li>
<!-- /ko -->
</ul>
<!-- /ko -->
</div>
<div id="main-branch-triggered-by" data-bind="if: !$data.changes().length && $data.triggeredBy">
Triggered by <a class="highlight" data-bind="text: triggeredBy, attr: { href: webUrl }"></a>
</div>
<!-- /ko -->
</div>
</div>
<!-- /ko -->
</div>
</div>
<div class="error-box" style="display: none" data-bind="showHide: errorsInfo, with: errorsInfo">
<!-- ko if: $data.code === 'CONNECTION_ERROR' && !$parent.hasConnectionWorked() -->
<div>
<h1>Sorry! I can't access the TeamCity web service.</h1>
<style>
.error-box .resolutions > * {
list-style-position:inside;
margin-top: 1.8em;
font-size: 1.1em;
}
.error-box .resolutions .question {
font-weight: bold;
}
</style>
<ol class="resolutions">
<li><span class="question">Are you sure that <a href="" data-bind="attr: { href: Settings.teamCityUrl }" target="_blank"><!-- ko text: Settings.teamCityUrl --><!-- /ko --></a> is the address for your TeamCity server?</span>
<br/>(tinker with your address bar to change the address temporarily)
</li>
<li>
<span class="question">Have you specified valid TeamCity credentials?</span><br/>
(your TeamCity username and password will do)
</li>
<!-- ko if: location.host -->
<li>
<span class="question">Have you created your fork and configured your TeamCity to allow your monitor to use the TeamCity services?</span><br/>
Fork your own tc-radiate <a href="https://github.com/travcorp/tc-radiate">from here</a> and open your fork's Github Pages, so that there is your username in this hostname here: '<!-- ko text: location.host --><!-- /ko -->'. Then go to <a href="" data-bind="attr: { href: Settings.teamCityUrl + '/admin/admin.html?item=diagnostics&tab=properties' }" target="_blank">Administration > Diagnostics > Internal Properies</a> and add an 'Internal property' of:
<br/><i>rest.cors.origins=http://<!-- ko text: location.host --><!-- /ko -->,https://<!-- ko text: location.host --><!-- /ko --></i><br/>
(if that page doesn't allow you to edit internal properties, see <a href="https://confluence.jetbrains.com/display/TCD9/Configuring+TeamCity+Server+Startup+Properties#ConfiguringTeamCityServerStartupProperties-TeamCityinternalpropertiesinternal.properties" target="_blank">TC documentation</a>).
</li>
<!-- /ko -->
</ol>
<h2 style="margin-top: 4em">Alternatively:</h2>
<ul class="resolutions">
<!-- ko ifnot: location.host -->
<li>
<span class="question">Running the monitors from your local filesystem?</span><br/>
See <a href="https://github.com/travcorp/tc-radiate/#testing-local-changes" target="_blank">this section</a> of the Project's Readme.
</li>
<!-- /ko -->
<li>
<span class="question">Just trying out? Or no admin rights to TeamCity?</span>
<br/>Use a browser plugin to disable Cross-Domain security. (But if you do, don't visit any other pages with that browser process!)<br/>
(...or, if you're really desperate, <a href="https://github.com/travcorp/tc-radiate/#proxy" target="_blank">host your own 'security-stripping' proxy</a>)
</li>
</ul>
</div>
<!-- /ko -->
<div>
<!-- ko if: $data.code === 'CONNECTION_ERROR' && $parent.hasConnectionWorked() -->
<h1 style="font-size: 5em">🔌<br />Connection to TeamCity seems to have gone down :(</h1>
<!-- /ko -->
<!-- ko ifnot: $data.code === 'CONNECTION_ERROR' -->
<h1>🐛<br />Can't get data from TeamCity. Might be a bug :(</h1>
<h2>Error: <!-- ko text: $data.allErrors[0].errorText --><!-- /ko --></h2>
<!-- /ko -->
<!-- ko if: $parent.hasConnectionWorked() -->
<h2>Last checked on <!-- ko text: new Date() --><!-- /ko --></h2>
<!-- /ko -->
</div>
</div>
<div class="error-box" style="display: none;" data-bind="showHide: !isFirstLoad() && builds().length === 0 && !errorsInfo()">
<div>There's no builds!? Better crack on with some work!</div>
</div>
<script src="Script/Libraries/underscore.js"></script>
<script src="Script/Libraries/knockout.js"></script>
<script src="Script/Libraries/knockout.bindings.afterHtmlRender.js"></script>
<script src="Script/Libraries/knockout.mapping-2.4.1.js"></script>
<script src="Script/Libraries/jquery-2.0.0.min.js"></script>
<script src="Script/Libraries/jquery.timeago.js"></script>
<script src="Script/Libraries/jquery-ui.min.js"></script>
<script src="Script/Libraries/moment.js"></script>
<script src="Script/Utils.js"></script>
<script src="Settings.js"></script>
<script src="Script/Init.js"></script>
<script src="Script/Libraries/Class.js"></script>
<script src="Script/ViewModels/BaseBuild.js"></script>
<script src="Script/ViewModels/SingleBuildViewModel.js"></script>
<script src="Script/ViewModels/MainBuildViewModel.js"></script>
<script src="Script/ViewModels/BuildScreenViewModel.js"></script>
<script src="Script/SoundsApi.js"></script>
<script src="Content/sounds/!List.js"></script>
<script src="Script/ImagesApi.js"></script>
<script src="Content/images/!List.js"></script>
</body>
</html>