This repository has been archived by the owner on Aug 30, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
index.html
308 lines (296 loc) · 13.5 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
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
<!DOCTYPE html>
<html>
<head>
<title>Eucalyptus JIRA exported issues</title>
<meta charset="utf-8" />
<link rel="icon" type="image/png" href="template/euca_icon.png" />
<link rel="stylesheet" href="template/foundation.min.css" type="text/css" media="screen" charset="utf-8" />
<link rel="stylesheet" href="template/foundation-icons.css" type="text/css" media="screen" charset="utf-8" />
<link rel="stylesheet" href="https://www.w3schools.com/w3css/4/w3.css">
<link rel="stylesheet" href="https://www.w3schools.com/lib/w3-theme-black.css">
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<link rel="stylesheet" href="template/magic_search.css" type="text/css"/>
<script type="text/javascript" src="template/modernizr.js"></script>
<script type="text/javascript" src="template/jquery-2.1.4.min.js"></script>
<script type="text/javascript" src="template/angular.min.js"></script>
<script type="text/javascript" src="template/foundation.min.js"></script>
<script type="text/javascript" src="template/magic_search.js"></script>
<style>
html,body,h1,h2,h3,h4,h5,h6,pre {font-family: "Roboto", sans-serif;}
html {
height:100%;
}
body {
height:100%;
}
a:hover {
color: #8bc34a;
}
table.issuetable {
border: 1px solid #8bc34a;
}
table.issuetable th {
text-align: left;
border: 0px;
}
table.issuetable td {
border: 0px;
padding: 4px;
}
table.issuetable tr:nth-child(even) {background-color: #f2f2f2}
.sidebar-margin-top {
margin-top:120px;
}
table.issuetable tr:hover {background-color: #d2d2d2}
.sidebar-margin-top {
margin-top:120px;
}
table.issuetable img {
vertical-align: text-top;
}
.top{position:fixed;z-index:2}
.bottom{position:fixed;z-index:2;bottom:0}
.nowrap{white-space:nowrap}
</style>
</head>
<body>
<table cellspacing="0" cellpadding="0" border="0" height="100%" width="100%">
<tr>
<td colspan="4" class="w3-theme-dark top" width="100%"><div class="w3-text-dark-grey"> Generated using JIRA REST export from https://eucalyptus.atlassian.net/</div></td>
</tr>
<tr>
<td width="200" valign="top" height="100%" class="w3-theme-light">
<!-- start side bar -->
<div class="w3-sidebar" style="margin-top: 32px">
<img src="template/euca.png" style="margin:4px">
<div class="w3-margin-left sidebar-margin-top">
<h3 class="w3-text-light-green">Issues</h3>
<a href="?project=gui">Console</a> <a href="?project=gui&status=10001&status=10003&status=1&status=10000">[open]</a><br/>
<a href="?project=doc">Documentation</a> <a href="?project=doc&status=10001&status=10003&status=1&status=10000">[open]</a><br/>
<a href="?project=euca">Eucalyptus</a> <a href="?project=euca&status=10001&status=10003&status=1&status=10000">[open]</a><br/>
<a href="?project=tools">Tools</a> <a href="?project=tools&status=10001&status=10003&status=1&status=10000">[open]</a><br/>
<h3 class="w3-text-light-green">Source</h3>
<a href="https://github.com/sjones4/eucalyptus-jira" target="_top">Github repo</a><br/>
<a href="https://github.com/eucalyptus/eucaconsole" target="_top">Console github</a><br/>
<a href="https://github.com/eucalyptus/documentation" target="_top">Doc github</a><br/>
<a href="https://github.com/eucalyptus/eucalyptus" target="_top">Eucalyptus github</a><br/>
<a href="https://github.com/eucalyptus/euca2ools" target="_top">Tools github</a><br/>
</div>
</div>
<!-- end side bar -->
</td>
<td width="10"></td>
<td valign="top">
<!-- start main content -->
<div style="margin-top: 32px"></div>
<h1 class="w3-text-light-green">Search for issues</h1>
<h3 class="w3-text-light-green">Search:</h3>
<div ng-app="Search" ng-controller="SearchCtrl as searchCtrl" ng-init="searchCtrl.init()">
<magic-search template="template/magic_search.html"
facets={{searchCtrl.facets}}
filter-keys='["key","summary"]'
strings="{'remove':'Remove facet', 'cancel':'Clear search', 'prompt':'Select facets or enter text', 'text':'Text'}">
</magic-search>
<br/>
<form name="resultsForm">
<label><h3 class="w3-text-light-green">Max results:</h3>
<input type="number" name="input" ng-model="searchCtrl.max_results" min="10" max="100000" required/>
</label>
</form>
<br/>
<h3 class="w3-text-light-green">Search results
<span ng-show="searchCtrl.filtered_data.length == 0"> - none</span>
<span ng-show="searchCtrl.filtered_data.length > 0"> {{ searchCtrl.filtered_data.length }} items</span>
<span ng-show="searchCtrl.filtered_data.length > searchCtrl.max_results">(first {{searchCtrl.max_results}} displayed)</span>
</h3>
<table class="issuetable" width="100%">
<tr>
<th>Key</th>
<th>Priority</th>
<th>Status</th>
<th>Summary</th>
</tr>
<tr ng-repeat="item in searchCtrl.filtered_data | limitTo: searchCtrl.max_results">
<td class="nowrap"><img src="{{::item.typeIconUrl}}" width="16" height="16"/> <a href="{{::item.url}}" target="_top">{{::item.key}}</a></td>
<td class="nowrap"><img src="{{::item.priorityIconUrl}}" width="16" height="16"/> {{::item.priorityLabel}}</td>
<td class="nowrap">{{::item.statusLabel}}</td>
<td>{{::item.summary}}</td>
</tr>
</table>
</div>
<script type="text/javascript">
var app = angular.module('Search', ['MagicSearch']);
app.config(['$compileProvider', function ($compileProvider) {
$compileProvider.debugInfoEnabled(false);
}]);
app.controller('SearchCtrl', function($scope, $timeout) {
var vm = this;
var optionMapper = function(item){ return {"key": item.id, "label": item.name}; };
var optionSorter = function(a,b){return a.label < b.label ? -1 : a.label > b.label;};
var idMapper = function(item){return item.id;};
var nameMapper = function(item){return item.name;};
vm.max_results = 100;
vm.facets = [];
$.getJSON("generated/facets.json", function(facetsJson){
vm.facets = [
{"name":"component", "label":"Component",
"options": facetsJson.components.map(optionMapper).sort(optionSorter)
},
{"name":"priority", "label":"Priority",
"options": facetsJson.priorities.map(optionMapper).sort(optionSorter)
},
{"name":"project", "label":"Project",
"options": facetsJson.projects.map(function(item){ return {"key": item.key.toLowerCase(), "label": item.name}; }).sort(optionSorter)
},
{"name":"status", "label":"Status",
"options": facetsJson.statuses.map(optionMapper).sort(optionSorter)
},
{"name":"resolution", "label":"Resolution",
"options": facetsJson.resolutions.map(optionMapper).sort(optionSorter)
},
{"name":"type", "label":"Type",
"options": facetsJson.issuetypes.map(optionMapper).sort(optionSorter)
},
{"name":"fixversion", "label":"Fix Version",
"options": $.unique(facetsJson.versions.map(nameMapper).sort()).reverse().map(function(item){return {"key": item, "label": item};})
},
{"name":"version", "label":"Affects Version",
"options": $.unique(facetsJson.versions.map(nameMapper).sort()).reverse().map(function(item){return {"key": item, "label": item};})
}
];
});
vm.data_set = [];
var projects = [ 'doc', 'euca', 'gui', 'tools' ];
projects.forEach(function(project, index) {
var dateFormatter = function(date){
var dateFormatted = date;
if (dateFormatted) {
if ( dateFormatted.charAt(dateFormatted.length-5) == '-' && dateFormatted.charAt(dateFormatted.length-3) != ':' ) {
dateFormatted = dateFormatted.substring( 0, dateFormatted.length-2 ) + ":" + dateFormatted.substring( dateFormatted.length-2 )
}
var dateVal = new Date(dateFormatted);
return dateVal.toDateString( ) + ", " + dateVal.toLocaleTimeString( );
} else {
return "";
}
};
$.getJSON("generated/" + project + "/index.json", function(issuesJson){
var iconPrefix = "export/" + project + "/icons/";
var issuePrefix = "generated/" + project + "/";
issuesJson.forEach(function(issue){
vm.data_set.push( {
"project": project,
"url": issuePrefix + issue.key + ".html",
"type": issue.issuetype.id,
"typeIconUrl": iconPrefix + "issuetype_icon_" + issue.issuetype.name + ".svg",
"key": issue.key,
"priority": issue.priority ? issue.priority.id : '',
"priorityLabel": issue.priority ? issue.priority.name : '',
"priorityIconUrl": iconPrefix + "priority_icon_" + ( issue.priority ? issue.priority.name : '' ) + ".svg",
"status": issue.status.id,
"statusLabel": issue.status.name,
"resolution": issue.resolution ? issue.resolution.id : '',
"resolutionLabel": issue.resolution ? issue.resolution.name : '',
"component": issue.components.map(idMapper),
"fixversion": issue.fixVersions.map(nameMapper),
"version": issue.versions.map(nameMapper),
"summary": issue.summary
} );
});
vm.init();
});
});
vm.faceted_data = []; // filterd by facets
vm.filtered_data = []; // filtered by facets and text
vm.init = function() {
vm.faceted_data = vm.data_set;
vm.filtered_data = vm.data_set;
// since we're not getting data from the server, do a client-filter based on URL
var query = window.location.href;
if (query.indexOf("?") > -1) {
query = query.split("?")[1];
$scope.$emit('searchUpdated', query);
}
$timeout(function() {
$(document).foundation('dropdown', 'reflow');
}, 500);
};
vm.filter_items = function() {
if (vm.filter_text === undefined || vm.filter_text === '') {
vm.filtered_data = vm.faceted_data;
return;
}
vm.filtered_data = vm.faceted_data.filter(function(item) {
for (var i=0; i<vm.filter_keys.length; i++) {
var prop = vm.filter_keys[i];
var val = item.hasOwnProperty(prop) && item[prop];
if (val.toLowerCase().indexOf(vm.filter_text) !== -1) {
return true;
}
}
});
$timeout(function () { $scope.$apply() });
};
$scope.$on('searchUpdated', function($event, query) {
// update url
var url = window.location.href;
if (url.indexOf("?") > -1) {
url = url.split("?")[0];
}
if (query.length > 0) {
url = url + "?" + query;
}
window.history.pushState(query, "", url);
if (query !== undefined && query.length !== 0) {
var tmp = query.split('&').sort();
var facets = {};
for (var i=0; i<tmp.length; i++) {
var facet = tmp[i].split('=');
if (facets[facet[0]] === undefined) {
facets[facet[0]] = [];
}
facets[facet[0]].push(facet[1]);
}
var results = vm.data_set;
for (var key in facets) {
results = results.filter(function(item) {
var val = item.hasOwnProperty(key) && item[key];
if ($.isArray(val)) {
for (var i=0; i<val.length; i++) {
if ($.inArray(val[i].toLowerCase(), facets[key]) > -1) {
return true;
}
}
} else if ($.inArray(val.toLowerCase(), facets[key]) > -1) {
return true;
}
});
}
vm.faceted_data = results;
}
else {
vm.faceted_data = vm.data_set.slice();
}
vm.filter_items();
$timeout(function () { $scope.$apply() });
});
$scope.$on('textSearch', function($event, text, filter_keys) {
vm.filter_text = text ? text.toLowerCase() : '';
vm.filter_keys = filter_keys;
vm.filter_items();
});
});
$(document).foundation();
</script>
<div style="margin-top: 32px"></div>
<!-- end main content -->
</td>
<td width="40"></td>
</tr>
<tr>
<td colspan="4" class="w3-theme-dark bottom" width="100%"><div class="w3-text-dark-grey"> Uses J2M [https://github.com/FokkeZB/J2M] and showdown [https://github.com/showdownjs] for text formatting</div></td>
</tr>
</table>
</body>
</html>