/usr/share/pybit-web/static/job.htm is in pybit-web 1.0.0-3.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
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 | <!DOCTYPE html>
<html lang="en">
<head>
<META HTTP-EQUIV='PRAGMA' CONTENT='NO-CACHE'>
<META HTTP-EQUIV="Expires" CONTENT="-1">
<meta charset="utf-8">
<title>pyBit - Jobs </title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="">
<meta name="author" content="">
<link href="bootstrap/css/bootstrap.min.css" rel="stylesheet">
<link rel="shortcut icon" href="favicon.ico">
<link rel="apple-touch-icon" href="favicon.png" />
<style type="text/css">
body
{
padding-top : 60px; /* 60px to make the container go all the way
* to the bottom of the topbar */
padding-bottom : 40px;
}
</style>
<link href="bootstrap/css/bootstrap-responsive.min.css" rel="stylesheet">
<script src="{{protocol}}{{jqueryurl}}" type="text/javascript"></script>
<script src="{{protocol}}{{jqueryformurl}}" type="text/javascript"></script>
<script src="bootstrap/js/bootstrap.min.js" type="text/javascript"></script>
</head>
<body>
<div class="container-fluid">
<div class="row-fluid">
<div class="navbar navbar-inverse navbar-fixed-top">
<div class="navbar-inner">
<div class="container-fluid">
<a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse"> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </a>
<a class="brand" href="index.htm">pyBit</a>
<div class="nav-collapse collapse">
<ul class="nav">
<li>
<a href="index.htm">Home</a>
</li>
<li>
<a href="lookups.htm">Lookups</a>
</li>
<li>
<a href="package.htm">Packages</a>
</li>
<li>
<a href="packageinstance.htm">Package Instances</a>
</li>
<li class="active">
<a href="job.htm">Jobs</a>
</li>
<li>
<a href="buildd.htm">Build Boxes</a>
</li>
</ul>
</div>
<!--/.nav-collapse -->
</div>
</div>
</div>
</div>
<div class="span2">
<!--Sidebar content-->
<div class="well sidebar-nav">
<ul class="nav nav-list">
<li class="nav-header">
Navigation
</li>
<li>
<a href="index.htm">Home</a>
</li>
<li class="nav-header">
Lookups
</li>
<li>
<a href="arches.htm">Architectures</a>
</li>
<li>
<a href="statuses.htm">Statuses</a>
</li>
<li>
<a href="dists.htm">Dists</a>
</li>
<li>
<a href="formats.htm">Formats</a>
</li>
<li>
<a href="suites.htm">Suites</a>
</li>
<li>
<a href="envs.htm">Build Environments</a>
</li>
<li class="nav-header">
Packages
</li>
<li>
<a href="package.htm">All Packages</a>
</li>
<li>
<a href="packageinstance.htm">Package Instances</a>
</li>
<li class="nav-header">
Jobs
</li>
<li class="active">
<a href="job.htm">Jobs</a>
</li>
<li>
<a href="buildd.htm">BuildBoxes</a>
</li>
<li>
<a href="blacklist.htm">Blacklist Rules</a>
</li>
</ul>
</div>
<!--/.well -->
</div>
<div class="span10">
<!--Body content-->
<div class="container-fluid">
<h1>PyBit - python Buildd Integration Toolkit.</h1>
<h3>Jobs</h3>
<span class="help-block">Use this page to add or cancel jobs, as well as to view their status history and assigned Package and BuildBox.</span>
<div class="accordion" id="accordion1">
<div class="accordion-group">
<div class="accordion-heading">
<a class="accordion-toggle" data-toggle="collapse" data-parent="#accordion1" href="#collapseOne"> Click here to show the submit job form. </a>
</div>
<div id="collapseOne" class="accordion-body collapse">
<div class="accordion-inner">
<form class="form" method="POST" action="job" id="job_form" name="job_form">
<legend>
Submit a Job
</legend>
<span class="help-block">To submit a job, firstly choose a <strong>Existing</strong> Package, and PackageInstance. <br/> Next, enter the path to he source, the method to use to retrieve it (i.e. 'SVN') , and the VCS revision.</span>
<label for="package">Package Name: </label>
<select name="package" id="package" size="1" onclick="changePackage()" style="width: 480px; display: block;"></select>
<label for="packageinstance_id">Package Instance ID: </label>
<select name="packageinstance_id" id="packageinstance_id" size="1" style="width: 480px; display: block;"></select>
<label for='uri'>URI: </label>
<input type="text" name="uri" id="uri">
<label for='method'>Method: </label>
<input type="text" name="method" id="method">
<label for='revision'>Revision: </label>
<input type="text" name="vcs_id" id="vcs_id">
<br>
<button type="submit" class="btn btn-primary">
Submit
</button>
<button type="button" class="btn">
Cancel
</button>
</form>
</div>
</div>
</div>
</div>
<span class="help-block">Use this dropdown to filter the list of jobs (shown below), by their status.</span>
<select name="status_filter_element" id="status_filter_element" size="1" style="width: 480px; display: block;" onchange="status_filter()">
<option value='Unfinished'>Unfinished</option>
</select>
<table id="tbl_jobs" class="table table-bordered table-condensed">
<thead>
<tr>
<th colspan='6'>Current Jobs</th>
</tr>
</thead>
<tbody>
<tr>
<th>ID</th><th>Package Instance</th><th>Buildclient</th><th>Master</th><th>Status</th><th>Operations</th>
</tr>
</tbody>
</table>
<div class="accordion" id="accordion2">
<div class="accordion-group">
<div class="accordion-heading">
<a class="accordion-toggle" data-toggle="collapse" data-parent="#accordion2" href="#collapseTwo"> Click here to show the admin tools </a>
</div>
<div id="collapseTwo" class="accordion-body collapse">
<div class="accordion-inner">
<form class="form" method="GET" action="job/cancelall">
<button id="deleteall" name = "deleteall" type="submit" class="btn btn-danger">
<span class="help-block">Click the button below to cancel all build jobs</span>
<a href="/job/cancelall">DANGER: CANCEL *ALL* RUNNING JOBS</a>
</button>
</form>
</div>
</div>
</div>
</div>
<!-- Modal status dialog-->
<div id="myModal" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-header" id="history_header" name="history_header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">
×
</button>
</div>
<div class="modal-body">
<table class="table table-bordered table-condensed">
<tr>
<th colspan='3'>Jobs</th>
</tr>
<tr>
<th>Status</th><th>Buildclient</th><th>Time</th>
</tr>
<tbody id="history_body" name="history_body"></tbody>
</table>
</div>
<div class="modal-footer">
<button class="btn btn-primary" data-dismiss="modal" aria-hidden="true">
Close
</button>
</div>
</div>
<hr>
<footer>
<p>
© TCL 2012
</p>
</footer>
</div>
<!--/.fluid-container-->
<script type="text/javascript">
function cancel_click ( id )
{
$.ajax (
{
type : "GET" ,
url : "" + window.location.protocol.toString ( ) + "//" + window.location.host.toString ( ) + "/job/" + id + "/cancel" ,
error : function ( data )
{
alert ( 'Error cancelling job with id: ' + id + "\n" + data.responseText );
location.reload ( );
} ,
success : function ( data )
{
alert ( 'OK cancelling job with id: ' + id );
location.reload ( );
}
} );
}
function retry_click ( id )
{
$.ajax (
{
type : "GET" ,
url : "" + window.location.protocol.toString ( ) + "//" + window.location.host.toString ( ) + "/job/" + id + "/retry" ,
error : function ( data )
{
alert ( 'Error retrying job with id: ' + id + "\n" + data.responseText );
location.reload ( );
} ,
success : function ( data )
{
alert ( 'OK retrying job with id: ' + id );
location.reload ( );
}
} );
}
function changePackage()
{
var element = document.getElementById ( "package" );
$ ( "#packageinstance_id" ).empty();
if(element.options [ element.selectedIndex ] == null)
{
return;
}
else
{
packageName = element.options [ element.selectedIndex ].value;
var named_versions = "" + window.location.protocol.toString ( ) + "//" + window.location.host.toString ( ) + "/packageinstance/details/" + packageName
$.getJSON ( named_versions , function ( json2 )
{
$.each ( json2 , function ( j , field2 )
{
if (field2.build_env != null)
{
build_env = field2.build_env.name;
}
else
{
build_env = "";
}
$ ( "#packageinstance_id" ).append ( "<option value='" + field2.id + "'>" + field2.package.name + " " + field2.package.version + "." + field2.format.name + " - " + field2.distribution.name + "/" + field2.suite.name + "/" + build_env + " (" + field2.arch.name + ") </option>" );
} );
} );
}
}
function status_filter ( )
{
var element = document.getElementById ( "status_filter_element" );
$ ( '#tbl_jobs tbody' ).empty ( );
renderTable ( element.options [ element.selectedIndex ].value );
}
function show_history ( id )
{
var url = "" + window.location.protocol.toString ( ) + "//" + window.location.host.toString ( ) + "/job/" + id + "/status"
$.getJSON ( url , function ( json )
{
$ ( "#history_header" ).empty ( );
$ ( "#history_body" ).empty ( );
$ ( "#history_header" ).append ( "<h3 id='myModalLabel'>Job History for #" + id + "</h3>" );
$.each ( json , function ( i , field )
{
$ ( "#history_body" ).append ( "<tr><td>" + field.status + "</td><td>" + field.buildclient + "</td><td>" + field.time + "</td></tr>" );
} );
} );
}
function get_status_class ( status )
{
if ( status == "Building" )
{
return "success";
}
else
if ( status == "Blocked" )
{
return "warning";
}
else
if ( status == "Waiting" )
{
return "info";
}
else
if ( status == "Failed" )
{
return "error";
}
}
function renderTable ( status_query )
{
var packageinstances = "" + window.location.protocol.toString ( ) + "//" + window.location.host.toString ( ) + "/packageinstance";
$.getJSON ( packageinstances , function ( json )
{
$.each ( json , function ( i , field )
{
$ ( "#packageinstance_id" ).append ( "<option value='" + field.id + "'>" + field.package.name + " " + field.package.version + "." + field.format.name + " - " + field.distribution.name + "/" + field.suite.name + " (" + field.arch.name + ") </option>" );
} );
} );
var jobstatuses = new Object ( )
if ( ! status_query || status_query == "Unfinished" )
{
var url = "" + window.location.protocol.toString ( ) + "//" + window.location.host.toString ( ) + "/job/status"
}
else
{
var url = "" + window.location.protocol.toString ( ) + "//" + window.location.host.toString ( ) + "/job/status/" + status_query
}
$.getJSON ( url , function ( json )
{
$.each ( json , function ( i , field )
{
var url2 = "" + window.location.protocol.toString ( ) + "//" + window.location.host.toString ( ) + "/job/" + field.id + "/status";
var shortname = "";
$.getJSON ( url2 , function ( json2 )
{
var statuses = new Array ( )
$.each ( json2 , function ( i , field2 )
{
statuses.push ( field2.status );
} );
jobstatuses [ field.id ] = statuses [ statuses.length - 1 ];
master = "";
if (field.packageinstance.master) {
master = "\u2714";
}
if (field.packageinstance.build_env == null) {
env_name = ""
} else {
env_name = field.packageinstance.build_env.name
}
if ( field.buildclient )
{
bid = field.buildclient.id;
bname = field.buildclient.name;
_class = get_status_class ( jobstatuses [ field.id ] );
shortname = bname.replace ( "build_client_" , "" );
// TODO: HACKS
$ ( "#tbl_jobs tbody" ).append ( "<tr class='" + _class + "'><td>" + field.id + "</td><td><a href='" + window.location.protocol.toString ( ) + "//" + window.location.host.toString ( ) + "/packageinstance/" + field.packageinstance.id + "'>" + field.packageinstance.id + " - (" + field.packageinstance.package.name + " " + field.packageinstance.package.version + ")</a><br>" + field.packageinstance.distribution.name + "/" + field.packageinstance.suite.name + "/" + env_name + " (" + field.packageinstance.arch.name + " " + field.packageinstance.format.name + ")" + "</td><td><a href='" + window.location.protocol.toString ( ) + "//" + shortname + "/logs/pybitclient.log'>" + bname + "</a></td><td>" + master + "</td><td><a href='#myModal' role='button' data-toggle='modal' onclick='show_history(" + field.id + ")'>" + jobstatuses [ field.id ] + "</a></td><td><input id='cancel' class='.btn-small btn-danger' type='button' value='Cancel' onclick='cancel_click(" + field.id + ")'></input><br/><input id='retry' class='.btn-small btn-danger' type='button' value='Retry' onclick='retry_click(" + field.id +")'></input></td></tr>" );
}
else
{
_class = get_status_class ( jobstatuses [ field.id ] );
bid = "";
bname = "Unassigned";
shortname = bname.replace ( "build_client_" , "" );
// TODO: HACKS
$ ( "#tbl_jobs tbody" ).append ( "<tr class='" + _class + "'><td>" + field.id + "</td><td><a href='" + window.location.protocol.toString ( ) + "//" + window.location.host.toString ( ) + "/packageinstance/" + field.packageinstance.id + "'>" + field.packageinstance.id + " - (" + field.packageinstance.package.name + " " + field.packageinstance.package.version + ")</a><br>" + field.packageinstance.distribution.name + "/" + field.packageinstance.suite.name + "/" + env_name + " (" + field.packageinstance.arch.name + " " + field.packageinstance.format.name + ")" + "</td><td>" + bname + "</td><td>" + master + "</td><td><a href='#myModal' role='button' data-toggle='modal' onclick='show_history(" + field.id + ")'>" + jobstatuses [ field.id ] + "</a></td><td><input id='cancel' class='.btn-small btn-danger' type='button' value='Cancel' onclick='cancel_click(" + field.id + ")'></input><br/><input id='retry' class='.btn-small btn-danger' type='button' value='Retry' onclick='retry_click(" + field.id +")'></input></td></tr></tr>" );
}
} );
} );
} );
}
$ ( ).ready ( function ( )
{
var package_names = "" + window.location.protocol.toString ( ) + "//" + window.location.host.toString ( ) + "/package/names"
$.getJSON ( package_names , function ( json )
{
$.each ( json , function ( i , field )
{
$ ( "#package" ).append ( "<option value='" + field.name + "'>" + field.name + "</option>" );
} );
changePackage();
} );
// Populate dropdown
var url = "" + window.location.protocol.toString ( ) + "//" + window.location.host.toString ( ) + "/status"
$.getJSON ( url , function ( json )
{
$.each ( json , function ( i , field )
{
$ ( "#status_filter_element" ).append ( "<option value='" + field.name + "'>" + field.name + "</option>" );
} );
} );
$ ( '#job_form' ).ajaxForm ( function ( )
{
alert ( "Added job OK!" )
location.reload ( );
} );
renderTable ( );
} );
</script>
</div>
</div>
</body>
</html>
|