-
Notifications
You must be signed in to change notification settings - Fork 1.1k
/
web_templates.go
695 lines (640 loc) · 22.4 KB
/
web_templates.go
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
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
// Copyright 2017 HootSuite Media Inc.
//
// Licensed under the Apache License, Version 2.0 (the License);
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an AS IS BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// Modified hereafter by contributors to runatlantis/atlantis.
package templates
import (
"html/template"
"io"
"time"
"github.com/runatlantis/atlantis/server/jobs"
)
//go:generate pegomock generate --package mocks -o mocks/mock_template_writer.go TemplateWriter
// TemplateWriter is an interface over html/template that's used to enable
// mocking.
type TemplateWriter interface {
// Execute applies a parsed template to the specified data object,
// writing the output to wr.
Execute(wr io.Writer, data interface{}) error
}
// LockIndexData holds the fields needed to display the index view for locks.
type LockIndexData struct {
LockPath string
RepoFullName string
PullNum int
Path string
Workspace string
LockedBy string
Time time.Time
TimeFormatted string
}
// ApplyLockData holds the fields to display in the index view
type ApplyLockData struct {
Locked bool
GlobalApplyLockEnabled bool
Time time.Time
TimeFormatted string
}
// IndexData holds the data for rendering the index page
type IndexData struct {
Locks []LockIndexData
PullToJobMapping []jobs.PullInfoWithJobIDs
ApplyLock ApplyLockData
AtlantisVersion string
// CleanedBasePath is the path Atlantis is accessible at externally. If
// not using a path-based proxy, this will be an empty string. Never ends
// in a '/' (hence "cleaned").
CleanedBasePath string
}
var IndexTemplate = template.Must(template.New("index.html.tmpl").Parse(`
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>atlantis</title>
<meta name="description" content="">
<meta name="author" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
<script src="{{ .CleanedBasePath }}/static/js/jquery-3.5.1.min.js"></script>
<script>
$(document).ready(function () {
if (document.URL.indexOf("discard=true") !== -1) {
$("p.js-discard-success").show();
setTimeout(function() {
$("p.js-discard-success").fadeOut('slow',function(){
window.location.href = "/";
})
}, 5000); // <-- time in milliseconds
}
});
</script>
<link rel="stylesheet" href="{{ .CleanedBasePath }}/static/css/normalize.css">
<link rel="stylesheet" href="{{ .CleanedBasePath }}/static/css/skeleton.css">
<link rel="stylesheet" href="{{ .CleanedBasePath }}/static/css/custom.css">
<link rel="icon" type="image/png" href="{{ .CleanedBasePath }}/static/images/atlantis-icon.png">
</head>
<body>
<div class="container">
<section class="header">
<a title="atlantis" href="{{ .CleanedBasePath }}/"><img class="hero" src="{{ .CleanedBasePath }}/static/images/atlantis-icon_512.png"/></a>
<p class="title-heading">atlantis</p>
<p class="js-discard-success"><strong>Plan discarded and unlocked!</strong></p>
</section>
<section>
{{ if .ApplyLock.GlobalApplyLockEnabled }}
{{ if .ApplyLock.Locked }}
<div class="twelve center columns">
<h6><strong>Apply commands are disabled globally</strong></h6>
<h6><code>Lock Status</code>: <strong>Active</strong></h6>
<h6><code>Active Since</code>: <strong>{{ .ApplyLock.TimeFormatted }}</strong></h6>
<a class="button button-primary" id="applyUnlockPrompt">Enable Apply Commands</a>
</div>
{{ else }}
<div class="twelve columns">
<h6><strong>Apply commands are enabled</strong></h6>
<a class="button button-primary" id="applyLockPrompt">Disable Apply Commands</a>
</div>
{{ end }}
{{ end }}
</section>
<br>
<br>
<br>
<section>
<p class="title-heading small"><strong>Locks</strong></p>
{{ $basePath := .CleanedBasePath }}
{{ if .Locks }}
<div class="lock-grid">
<div class="lock-header">
<span>Repository</span>
<span>Project</span>
<span>Workspace</span>
<span>Locked By</span>
<span>Date/Time</span>
<span>Status</span>
</div>
{{ range .Locks }}
<div class="lock-row">
<a class="lock-link" href="{{ $basePath }}{{.LockPath}}">
<span class="lock-reponame">{{.RepoFullName}} #{{.PullNum}}</span>
</a>
<a class="lock-link" tabindex="-1" href="{{ $basePath }}{{.LockPath}}">
<span class="lock-path">{{.Path}}</span>
</a>
<a class="lock-link" tabindex="-1" href="{{ $basePath }}{{.LockPath}}">
<span><code>{{.Workspace}}</code></span>
</a>
<a class="lock-link" tabindex="-1" href="{{ $basePath }}{{.LockPath}}">
<span class="lock-username">{{.LockedBy}}</span>
</a>
<a class="lock-link" tabindex="-1" href="{{ $basePath }}{{.LockPath}}">
<span class="lock-datetime">{{.TimeFormatted}}</span>
</a>
<a class="lock-link" tabindex="-1" href="{{ $basePath }}{{.LockPath}}">
<span><code>Locked</code></span>
</a>
</div>
{{ end }}
</div>
{{ else }}
<p class="placeholder">No locks found.</p>
{{ end }}
</section>
<br>
<br>
<br>
<section>
<p class="title-heading small"><strong>Jobs</strong></p>
{{ if .PullToJobMapping }}
<div class="lock-grid">
<div class="lock-header">
<span>Repository</span>
<span>Project</span>
<span>Workspace</span>
<span>Date/Time</span>
<span>Step</span>
<span>Description</span>
</div>
{{ range .PullToJobMapping }}
<div class="pulls-row">
<span class="pulls-element">{{ .Pull.RepoFullName }} #{{ .Pull.PullNum }}</span>
<span class="pulls-element">{{ if .Pull.Path }}<code>{{ .Pull.Path }}</code>{{ end }}</span>
<span class="pulls-element">{{ if .Pull.Workspace }}<code>{{ .Pull.Workspace }}</code>{{ end }}</span>
<span class="pulls-element">
{{ range .JobIDInfos }}
<div><span class="lock-datetime">{{ .TimeFormatted }}</span></div>
{{ end }}
</span>
<span class="pulls-element">
{{ range .JobIDInfos }}
<div><a href="{{ $basePath }}{{ .JobIDUrl }}" target="_blank">{{ .JobStep }}</a></div>
{{ end }}
</span>
<span class="pulls-element">
{{ range .JobIDInfos }}
<div>{{ .JobDescription }}</div>
{{ end }}
</span>
</div>
{{ end }}
</div>
{{ else }}
<p class="placeholder">No jobs found.</p>
{{ end }}
</section>
<div id="applyLockMessageModal" class="modal">
<!-- Modal content -->
<div class="modal-content">
<div class="modal-header">
<span class="close">×</span>
</div>
<div class="modal-body">
<p><strong>Are you sure you want to create a global apply lock? It will disable applies globally</strong></p>
<input class="button-primary" id="applyLockYes" type="submit" value="Yes">
<input type="button" class="cancel" value="Cancel">
</div>
</div>
</div>
<div id="applyUnlockMessageModal" class="modal">
<!-- Modal content -->
<div class="modal-content">
<div class="modal-header">
<span class="close">×</span>
</div>
<div class="modal-body">
<p><strong>Are you sure you want to release global apply lock?</strong></p>
<input class="button-primary" id="applyUnlockYes" type="submit" value="Yes">
<input type="button" class="cancel" value="Cancel">
</div>
</div>
</div>
</div>
<footer>
{{ .AtlantisVersion }}
</footer>
<script>
function applyLockModalSetup(lockOrUnlock) {
// Get the modal
switch( lockOrUnlock ) {
case "lock":
var modal = $("#applyLockMessageModal");
var btn = $("#applyLockPrompt");
$("#applyLockYes").click(function() {
$.ajax({
url: '{{ .CleanedBasePath }}/apply/lock',
type: 'POST',
success: function(result) {
window.location.replace("{{ .CleanedBasePath }}/");
}
});
});
break;
case "unlock":
var modal = $("#applyUnlockMessageModal");
var btn = $("#applyUnlockPrompt");
var btnApplyUnlock =
$("#applyUnlockYes").click(function() {
$.ajax({
url: '{{ .CleanedBasePath }}/apply/unlock',
type: 'DELETE',
success: function(result) {
window.location.replace("{{ .CleanedBasePath }}/");
}
});
});
break;
default:
throw("unsupported command " + lockOrUnlock)
}
return [modal, btn];
}
{{ if .ApplyLock.Locked }}
var [modal, btn] = applyLockModalSetup("unlock");
{{ else }}
var [modal, btn] = applyLockModalSetup("lock");
{{ end }}
// Get the <span> element that closes the modal
// using document.getElementsByClassName since jquery $("close") doesn't seem to work for btn click events
var span = document.getElementsByClassName("close")[0];
var cancelBtn = document.getElementsByClassName("cancel")[0];
// When the user clicks the button, open the modal
btn.click(function() {
modal.css("display", "block");
});
// When the user clicks on <span> (x), close the modal
span.onclick = function() {
modal.css("display", "none");
}
cancelBtn.onclick = function() {
modal.css("display", "none");
}
// When the user clicks anywhere outside of the modal, close it
window.onclick = function(event) {
if (event.target == modal) {
modal.css("display", "none");
}
}
</script>
</body>
</html>
`))
// LockDetailData holds the fields needed to display the lock detail view.
type LockDetailData struct {
LockKeyEncoded string
LockKey string
RepoOwner string
RepoName string
PullRequestLink string
LockedBy string
Workspace string
AtlantisVersion string
// CleanedBasePath is the path Atlantis is accessible at externally. If
// not using a path-based proxy, this will be an empty string. Never ends
// in a '/' (hence "cleaned").
CleanedBasePath string
}
var LockTemplate = template.Must(template.New("lock.html.tmpl").Parse(`
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>atlantis</title>
<meta name="description" content="">
<meta name="author" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="{{ .CleanedBasePath }}/static/css/normalize.css">
<link rel="stylesheet" href="{{ .CleanedBasePath }}/static/css/skeleton.css">
<link rel="stylesheet" href="{{ .CleanedBasePath }}/static/css/custom.css">
<link rel="icon" type="image/png" href="{{ .CleanedBasePath }}/static/images/atlantis-icon.png">
<script src="{{ .CleanedBasePath }}/static/js/jquery-3.5.1.min.js"></script>
</head>
<body>
<div class="container">
<section class="header">
<a title="atlantis" href="{{ .CleanedBasePath }}/"><img class="hero" src="{{ .CleanedBasePath }}/static/images/atlantis-icon_512.png"/></a>
<p class="title-heading">atlantis</p>
<p class="title-heading"><strong>{{.LockKey}}</strong> <code>Locked</code></p>
</section>
<div class="navbar-spacer"></div>
<br>
<section>
<div class="lock-detail-grid">
<div><strong>Repo Owner:</strong></div><div>{{.RepoOwner}}</div>
<div><strong>Repo Name:</strong></div><div>{{.RepoName}}</div>
<div><strong>Pull Request Link:</strong></div><div><a href="{{.PullRequestLink}}" target="_blank">{{.PullRequestLink}}</a></div>
<div><strong>Locked By:</strong></div><div>{{.LockedBy}}</div>
<div><strong>Workspace:</strong></div><div>{{.Workspace}}</div>
</div>
<br>
<a class="button button-primary" id="discardPlanUnlock">Discard Plan & Unlock</a>
</section>
</div>
<div id="discardMessageModal" class="modal">
<!-- Modal content -->
<div class="modal-content">
<div class="modal-header">
<span class="close">×</span>
</div>
<div class="modal-body">
<p><strong>Are you sure you want to discard the plan and unlock?</strong></p>
<input class="button-primary" id="discardYes" type="submit" value="Yes" data="{{.LockKeyEncoded}}">
<input type="button" class="cancel" value="Cancel">
</div>
</div>
</div>
<footer>
v{{ .AtlantisVersion }}
</footer>
<script>
// Get the modal
var modal = $("#discardMessageModal");
// Get the button that opens the modal
var btn = $("#discardPlanUnlock");
var btnDiscard = $("#discardYes");
var lockId = btnDiscard.attr('data');
// Get the <span> element that closes the modal
// using document.getElementsByClassName since jquery $("close") doesn't seem to work for btn click events
var span = document.getElementsByClassName("close")[0];
var cancelBtn = document.getElementsByClassName("cancel")[0];
// When the user clicks the button, open the modal
btn.click(function() {
modal.css("display", "block");
});
// When the user clicks on <span> (x), close the modal
span.onclick = function() {
modal.css("display", "none");
}
cancelBtn.onclick = function() {
modal.css("display", "none");
}
btnDiscard.click(function() {
$.ajax({
url: '{{ .CleanedBasePath }}/locks?id='+lockId,
type: 'DELETE',
success: function(result) {
window.location.replace("{{ .CleanedBasePath }}/?discard=true");
}
});
});
// When the user clicks anywhere outside of the modal, close it
window.onclick = function(event) {
if (event.target == modal) {
modal.css("display", "none");
}
}
</script>
</body>
</html>
`))
// ProjectJobData holds the data needed to stream the current PR information
type ProjectJobData struct {
AtlantisVersion string
ProjectPath string
CleanedBasePath string
}
var ProjectJobsTemplate = template.Must(template.New("blank.html.tmpl").Parse(`
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>atlantis</title>
<meta name="description" content>
<meta name="author" content>
<link rel="stylesheet" href="{{ .CleanedBasePath }}/static/css/xterm.css">
<link rel="stylesheet" href="{{ .CleanedBasePath }}/static/css/normalize.css">
<link rel="stylesheet" href="{{ .CleanedBasePath }}/static/css/skeleton.css">
<link rel="stylesheet" href="{{ .CleanedBasePath }}/static/css/custom.css">
<link rel="icon" type="image/png" href="{{ .CleanedBasePath }}/static/images/atlantis-icon.png">
<style>
#terminal {
position: fixed;
top: 0px;
left: 0px;
bottom: 0px;
right: 0px;
border: 5px solid white;
z-index: 10;
}
.terminal.xterm {
padding: 10px;
}
#watermark {
opacity: 0.5;
color: BLACK;
position: absolute;
bottom: 0;
padding-right: 30px;
padding-bottom: 15px;
right: 0;
z-index: 15;
}
</style>
</head>
<body>
<section id="watermark">
<a title="atlantis" href="{{ .CleanedBasePath }}/"><img class="hero" src="{{ .CleanedBasePath }}/static/images/atlantis-icon_512.png"/></a>
<p class="terminal-heading-white">atlantis</p>
<p class="title-heading"><strong></strong></p>
</section>
<section>
<div id="terminal"></div>
</section>
</div>
<footer class="footer-white">Initializing...
</footer>
<script src="{{ .CleanedBasePath }}/static/js/jquery-3.5.1.min.js"></script>
<script src="{{ .CleanedBasePath }}/static/js/xterm-4.9.0.js"></script>
<script src="{{ .CleanedBasePath }}/static/js/xterm-addon-attach-0.6.0.js"></script>
<script src="{{ .CleanedBasePath }}/static/js/xterm-addon-fit-0.4.0.js"></script>
<script src="{{ .CleanedBasePath }}/static/js/xterm-addon-search-0.7.0.js"></script>
<script src="{{ .CleanedBasePath }}/static/js/xterm-addon-search-bar.js"></script>
<script>
function updateTerminalStatus(msg) {
document.getElementsByTagName("footer")[0].innerText = msg;
}
var term = new Terminal({scrollback: 15000});
var socket = new WebSocket(
(document.location.protocol === "http:" ? "ws://" : "wss://") +
document.location.host +
document.location.pathname +
"/ws");
socket.onopen = function(event) {
updateTerminalStatus("Running...");
};
socket.onclose = function(event) {
updateTerminalStatus("Done");
};
window.addEventListener("unload", function(event) {
websocket.close();
})
var attachAddon = new AttachAddon.AttachAddon(socket);
var fitAddon = new FitAddon.FitAddon();
var searchAddon = new SearchAddon.SearchAddon();
var searchBarAddon = new SearchBarAddon.SearchBarAddon({searchAddon});
term.loadAddon(attachAddon);
term.loadAddon(fitAddon);
term.loadAddon(searchAddon);
term.loadAddon(searchBarAddon);
term.open(document.getElementById("terminal"));
searchBarAddon.show();
fitAddon.fit();
window.addEventListener("resize", () => fitAddon.fit());
</script>
</body>
</html>
`))
type ProjectJobsError struct {
AtlantisVersion string
ProjectPath string
CleanedBasePath string
}
var ProjectJobsErrorTemplate = template.Must(template.New("blank.html.tmpl").Parse(`
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>atlantis</title>
<meta name="description" content>
<meta name="author" content>
<link rel="stylesheet" href="{{ .CleanedBasePath }}/static/css/xterm.css">
<link rel="stylesheet" href="{{ .CleanedBasePath }}/static/css/normalize.css">
<link rel="stylesheet" href="{{ .CleanedBasePath }}/static/css/skeleton.css">
<link rel="stylesheet" href="{{ .CleanedBasePath }}/static/css/custom.css">
<link rel="icon" type="image/png" href="{{ .CleanedBasePath }}/static/images/atlantis-icon.png">
<style>
#terminal {
width: 100%;
height: 100%;
}
</style>
</head>
<body>
<div class="container">
<section class="header">
<a title="atlantis" href="{{ .CleanedBasePath }}"><img class="hero" src="{{ .CleanedBasePath }}/static/images/atlantis-icon_512.png"/></a>
<p class="title-heading">atlantis</p>
<p class="title-heading"><strong></strong></p>
</section>
<div class="spacer"></div>
<br>
<section>
<div id="terminal"></div>
</section>
</div>
<footer>
</footer>
<script src="{{ .CleanedBasePath }}/static/js/jquery-3.5.1.min.js"></script>
<script src="{{ .CleanedBasePath }}/static/js/xterm-4.9.0.js"></script>
<script src="{{ .CleanedBasePath }}/static/js/xterm-addon-attach-0.6.0.js"></script>
<script src="{{ .CleanedBasePath }}/static/js/xterm-addon-fit-0.4.0.js"></script>
<script>
var term = new Terminal();
var socket = new WebSocket(
(document.location.protocol === "http:" ? "ws://" : "wss://") +
document.location.host +
document.location.pathname +
"/ws");
var attachAddon = new AttachAddon.AttachAddon(socket);
var fitAddon = new FitAddon.FitAddon();
term.loadAddon(attachAddon);
term.loadAddon(fitAddon);
term.open(document.getElementById("terminal"));
term.write('Project Does Not Exist in PR')
fitAddon.fit();
window.addEventListener("resize", () => fitAddon.fit());
</script>
</body>
</html>
`))
// GithubSetupData holds the data for rendering the github app setup page
type GithubSetupData struct {
Target string
Manifest string
ID int64
Key string
WebhookSecret string
URL string
CleanedBasePath string
}
var GithubAppSetupTemplate = template.Must(template.New("github-app.html.tmpl").Parse(`
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>atlantis</title>
<meta name="description" content="">
<meta name="author" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="{{ .CleanedBasePath }}/static/css/normalize.css">
<link rel="stylesheet" href="{{ .CleanedBasePath }}/static/css/skeleton.css">
<link rel="stylesheet" href="{{ .CleanedBasePath }}/static/css/custom.css">
<style>
form {
width: 100%;
}
form button {
float: right;
}
textarea {
width: 100%;
height: 300px;
font-family: monospace;
}
.config {
display: flex;
flex-direction: row;
align-items: baseline;
border-bottom: 1px solid #eee;
}
.config strong {
width: 15%;
}
pre {
background-color: #eee;
padding: .5em;
width: 80%;
}
</style>
<link rel="icon" type="image/png" href="{{ .CleanedBasePath }}/static/images/atlantis-icon.png">
<script src="{{ .CleanedBasePath }}/static/js/jquery-3.5.1.min.js"></script>
</head>
<body>
<div class="container">
<section class="header">
<a title="atlantis" href="{{ .CleanedBasePath }}"><img class="hero" src="{{ .CleanedBasePath }}/static/images/atlantis-icon_512.png"/></a>
<p class="title-heading">atlantis</p>
<p class="github-app-msg"><strong>
{{ if .Target }}
Create a github app
{{ else }}
Github app created successfully!
{{ end }}
</strong></p>
</section>
<section>
{{ if .Target }}
<form action="{{ .Target }}" method="POST">
<textarea name="manifest">{{ .Manifest }}</textarea>
<button type="submit">Setup</button>
</form>
{{ else }}
<p>Visit <a href="{{ .URL }}/installations/new" target="_blank">{{ .URL }}/installations/new</a> to install the app for your user or organization, then <strong>update the following values</strong> in your config and <strong>restart Atlantis<strong>:</p>
<ul>
<li class="config"><strong>gh-app-id:</strong> <pre>{{ .ID }}</pre></li>
<li class="config"><strong>gh-app-key-file:</strong> <pre>{{ .Key }}</pre></li>
<li class="config"><strong>gh-webhook-secret:</strong> <pre>{{ .WebhookSecret }}</pre></li>
</ul>
{{ end }}
</section>
</div>
</body>
</html>
`))