-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.php
184 lines (181 loc) · 7.61 KB
/
index.php
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
<?php
include_once('config/config.php');
$jen2SpinnakerVersion = trim(file_get_contents('backend/version'));
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title><?php echo $title; ?></title>
<link rel="shortcut icon" href="lib/favicon.png"/>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<link rel="stylesheet" href="lib/css/bootstrap-theme.min.css">
<link rel="stylesheet" href="lib/css/style.css">
</head>
<body>
<div class="container" style="padding-top: 20px">
<div class="col-md-12">
<div class="row">
<div class="form-group">
<h4 class="col-sm-2 control-label">Spinnaker Projects :</h4>
<div class="col-sm-2">
<select id="projectSelector" class="form-control"></select>
</div>
<div class="col-sm-6">
<button disabled class="btn btn-primary submitButton"><?php echo $JenkinsJobShortTitle; ?></button>
<button disabled class="btn btn-info bulkDeploySpinnaker">Bulk deploy to Spinnaker</button>
<button class="btn btn-default" data-toggle="modal" data-target="#importJSONModalId">Import tags via
JSON
</button>
</div>
</div>
</div>
<hr>
<div class="row">
<div class="col-md-12">
<p class="bg-danger col-md-9 text-center">Jenkins</p>
<p class="bg-info col-md-3 text-center">Spinnaker</p>
</div>
</div>
<div class="row">
<div class="col-md-2">
<label>Service Name </label> <span id="selectAllSvcId" class='glyphicon glyphicon-unchecked'></span>
</div>
<div class="col-md-1">
<label>Image Tag</label>
</div>
<div class="col-md-4" style="margin-right: -10px!important;">
<label>Image Group to be pushed</label>
</div>
<div class="col-md-1">
<label>Status</label>
</div>
<div class="col-md-1">
<label>Pushed</label> <span id="selectAllPushedId"
class='glyphicon glyphicon-unchecked disabled'></span>
</div>
<div class="col-md-2">
<label>Deploy to Spinnaker</label>
</div>
<div class="col-md-1">
<label>Logs</label>
</div>
</div>
<div class="form-group">
<div class="row" style="overflow-x: auto; max-height: 65vh; overflow-y: auto;">
<form id="serviceForm">
<div class="panel-group" id="accordion" role="tablist" aria-multiselectable="true">
<div class="progress" id="loadingArea">
<div id="progressDiv" class="progress-bar progress-bar-info" role="progressbar"
aria-valuenow="0" aria-valuemin="0" aria-valuemax="100" style="width: 0%">
<span>Loading</span>
</div>
</div>
<div id="serviceList" class="panel-body hidden"></div>
</div>
</form>
</div>
</div>
<div class="form-group">
<div class="row">
<button disabled class="btn btn-primary submitButton"><?php echo $JenkinsJobShortTitle; ?></button>
<button disabled class="btn btn-info bulkDeploySpinnaker">Bulk deploy to Spinnaker</button>
</div>
</div>
</div>
</div>
<div class="modal fade" tabindex="-1" role="dialog" id="logsModal">
<div class="modal-dialog modal-lg" role="document">
<div class="modal-content well" id="logArea"></div>
</div>
</div>
<div class="modal fade" id="connectingModalId" tabindex="-1" role="dialog">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-body">
<p class="text-center">Establishing connection with <strong>localhost:8084</strong></p>
</div>
</div>
</div>
</div>
<div class="modal fade" id="noConnectionModalId" tabindex="-1" role="dialog">
<div class="modal-dialog modal-sm">
<div class="modal-content">
<div class="modal-header modal-header-danger">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span>×</span>
</button>
<h4 class="modal-title"><strong>No Connection</strong></h4>
</div>
<div class="modal-body text-center">
<span>Make sure your connection tunnel with port <strong>8084</strong> to <strong>Spinnaker</strong> is working and then try again.</span>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
<div class="modal fade" id="importJSONModalId" tabindex="-1" role="dialog">
<div class="modal-dialog modal-md">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span>×</span>
</button>
<h4 class="modal-title"><strong>Import tags via JSON</strong></h4>
</div>
<div class="modal-body">
<form>
<div class="form-group">
<label for="jsonInputFile">Browse JSON file : </label>
<input type="file" class="form-control" id="jsonInputFile">
</div>
<button type="button" id="importJSONBtnId" class="btn btn-info">Import</button>
</form>
<br>
<span>JSON syntax example</span>
<pre>{
"demoservice1" : "1.2.1",
"demoservice2" : "1.2.1"
}</pre>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
<footer id="pageFooter">
<div class="container">
<p class="navbar-text">Jen2Spinnaker <?php echo $jen2SpinnakerVersion; ?></p>
<ul class="nav navbar-nav navbar-right">
<li><a href="https://github.com/vagharsh/Jen2Spinnaker" target="_blank">GitHub Project</a></li>
</ul>
</div>
</footer>
<script type="text/javascript" language="javascript" src="lib/js/jquery-3.7.0.min.js"></script>
<script type="text/javascript" language="javascript" src="lib/js/bootstrap.min.js"></script>
<script type="text/javascript" language="javascript" src="lib/js/functions.js"></script>
<script type="text/javascript" language="javascript" src="lib/js/triggers.js"></script>
<script>
$(document).ready(function () {
$('#connectingModalId').modal('show');
$.ajax({
url: 'http://localhost:8084//projects/',
type: 'HEAD'
}).success(function (message, text, jqXHR) {
$('#connectingModalId').modal('hide');
if (jqXHR.status === 200) {
getProjects();
} else {
$('#noConnectionModalId').modal('show');
}
}).error(function (message) {
if (message.statusText === 'error') {
$('#connectingModalId').modal('hide');
$('#noConnectionModalId').modal('show');
}
})
})
</script>
</body>
</html>