reserve-request.html 16.8 KB
Newer Older
1 2 3 4 5 6 7 8
<style>
.form-control-fake {
  display: block;
  width: 100%;
  height: 34px;
  padding: 7px 0px;
  font-size: 14px;
  line-height: 1.42857143;
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
 }
 .panel-heading-list {
     padding: 2px;
 }
 .panel-body-dashboard {
     padding: 2px;
 }
 .resgraph-size {
     max-height:350px;
     height:350px;
 }
 .resgraph-modal-size {
     max-height:600px;
     height:600px;
 }
 svg {
     display: block;
 } 
27
</style>  
28 29 30 31 32
<div class='row'>
  <div class='col-lg-7
              col-md-7'>
    <div class='panel panel-default'>
      <div class='panel-heading'>
33
        <h3 class='panel-title'>
34
	  <% if (editing) { %>Modify <% } %>Reservation Request
35 36 37 38 39
	  <a href='#' class='btn btn-xs' id="reservation-help-button"
	     data-toggle='tooltip'
	     data-container="body"
	     data-trigger="hover"
	     title='Click for more info'>
40 41
	    <span style='margin-bottom: 4px; margin-left: 0px;'
		  class='glyphicon glyphicon-question-sign'></span></a>
42 43
	</h3>
      </div>
Leigh B Stoller's avatar
Leigh B Stoller committed
44
      <div class='panel-body' style="padding-ttop: 0px;">
45 46 47 48 49 50 51 52 53 54 55 56 57
	<center id="unapproved-warning" class="hidden">
	  <span class="text-danger">
	    This reservation has been submitted but is unapproved!
	    <a href='#' class='btn btn-xs'
	       style="padding-left: 0px; margin-top: -3px; border-top: 0px;"
	       data-toggle='popover'
	       data-html='true'
	       data-content='This reservation needs to be approved
			     by an administrator.'>
	      <span class='glyphicon glyphicon-question-sign'></span>
	    </a>
	  </span>
	</center>
Leigh B Stoller's avatar
Leigh B Stoller committed
58
	<div style="margin-bottom: 10px;">
59 60 61 62 63 64 65 66 67 68
	  <center><span id="general_error" style="color:red;"></span></center>
	</div>
	<form id='reserve-request-form'
              class='form-horizontal' role='form'>
	  <% var d = new Date(); var offset = d.getTimezoneOffset(); %>
	  <input id="timezone" name="timezone" type="hidden"
		 value=<%- offset %>>
	  <input id="start" name="start" type="hidden">
	  <input id="end" name="end" type="hidden">
	  <% if (editing) { %>
69 70
	    <input id="uuid" name="uuid" type="hidden">
	    <input id="cluster" name="cluster" type="hidden">
71 72 73
	  <% } %>
	  <div class='row'>
	    <div class='col-sm-12'>
74 75 76 77 78 79 80 81 82
	      <% if (editing) { %>
		<div class="form-group">
		  <div class="form-control-fake format-me"
		       data-label="User"
		       id="reserve-requestor"
		       data-key="uid">
		  </div>
		</div>
	      <% } %>
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
	      <% if (1 || projects) { %>
	        <% if (projects.length == 1 || editing) { %>
		  <div class="form-group">
		    <input name="pid" readonly
			 id="pid"
			 value="<%- formfields.pid %>"
			 class="form-control format-me"
			 data-label="Project"
			 data-key="pid">
		  </div>
		<% } else { %>
		  <div class="form-group">
		    <select name="pid"
			    id="pid"
			    class='form-control format-me'
			    data-colsize="4"
			    data-key="pid"
			    data-label="Project"
			    placeholder='Please Select'>
		      <% _.each(projects, function(name) { %>
			<option 
			    <% if (_.has(formfields, 'pid') &&
			      formfields.pid == name) { %>
			    selected
			    <% } %>
			    value='<%= name %>'><%= name %>
			</option>
		      <% }); %>
		    </select>
		  </div>
	        <% } %>
	      <% } %>
	      <div class="form-group">
		<input name="count"
		       value="<%- formfields.count %>"
		       class="form-control format-me"
		       data-key="count"
		       data-label="Number of Nodes"
		       data-colsize="2"
		       type="text">
	      </div>
	      <div class="form-group">
		<div class="format-me"
126 127
		     data-label="Reservation Start<br>
				 <small>(Optional)</small>"
128 129 130 131 132
		     data-colsize="9"
		     data-key="start">
		  <div class="row">
		    <div class="col-xs-4">
		      <input name="start_day"
133
			     style='position: relative;'
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
			     id='start_day'
			     value="<%- formfields.start %>"
			     class="form-control"
			     placeholder="MM/DD/YYYY"
			     type="text">
		    </div>
		    <div class="col-xs-4">
		      <select name="start_hour"
			      id='start_hour'
 			      value=""
			      class="form-control"
 			      type="text">
			<option value="">Start Time</option>
			<option value="0">12:00 AM</option>
			<option value="1">1:00 AM</option>
			<option value="2">2:00 AM</option>
			<option value="3">3:00 AM</option>
			<option value="4">4:00 AM</option>
			<option value="5">5:00 AM</option>
			<option value="6">6:00 AM</option>
			<option value="7">7:00 AM</option>
			<option value="8">8:00 AM</option>
			<option value="9">9:00 AM</option>
			<option value="10">10:00 AM</option>
			<option value="11">11:00 AM</option>
			<option value="12">12:00 PM</option>
			<option value="13">1:00 PM</option>
			<option value="14">2:00 PM</option>
			<option value="15">3:00 PM</option>
			<option value="16">4:00 PM</option>
			<option value="17">5:00 PM</option>
			<option value="18">6:00 PM</option>
			<option value="19">7:00 PM</option>
			<option value="20">8:00 PM</option>
			<option value="21">9:00 PM</option>
			<option value="22">10:00 PM</option>
			<option value="23">11:00 PM</option>
		      </select>
		    </div>
		    <div class="col-xs-1" style="padding:0px;">
		      <a href='#' class='btn btn-xs'
			 data-toggle='popover'
			 data-html='true'
			 data-delay='{"hide":1000}'
178 179 180
			 data-content='Times are in your local timezone.
				       Start day/time is optional, defaults
				       to the current day/time.'>
181 182 183 184 185 186 187 188 189 190 191 192 193
			<span class='glyphicon glyphicon-question-sign'></span>
		      </a>
		    </div>
		  </div>
		</div>
	      </div>
	      <div class="form-group">
		<div class="format-me"
		     data-label="Reservation End"
		     data-key="end">
		  <div class="row">
		    <div class="col-xs-6">
		      <input name="end_day"
194
			     style='position: relative;'
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
			     id='end_day'
			     value="<%- formfields.end %>"
			     class="form-control"
			     placeholder="MM/DD/YYYY"
			     type="text">
		    </div>
		    <div class="col-xs-6">
		      <select name="end_hour"
			      id='end_hour'
 			      value=""
			      class="form-control"
 			      type="text">
			<option value="">End Time</option>
			<option value="0">12:00 AM</option>
			<option value="1">1:00 AM</option>
			<option value="2">2:00 AM</option>
			<option value="3">3:00 AM</option>
			<option value="4">4:00 AM</option>
			<option value="5">5:00 AM</option>
			<option value="6">6:00 AM</option>
			<option value="7">7:00 AM</option>
			<option value="8">8:00 AM</option>
			<option value="9">9:00 AM</option>
			<option value="10">10:00 AM</option>
			<option value="11">11:00 AM</option>
			<option value="12">12:00 PM</option>
			<option value="13">1:00 PM</option>
			<option value="14">2:00 PM</option>
			<option value="15">3:00 PM</option>
			<option value="16">4:00 PM</option>
			<option value="17">5:00 PM</option>
			<option value="18">6:00 PM</option>
			<option value="19">7:00 PM</option>
			<option value="20">8:00 PM</option>
			<option value="21">9:00 PM</option>
			<option value="22">10:00 PM</option>
			<option value="23">11:00 PM</option>
		      </select>
		    </div>
		  </div>
		</div>
	      </div>
	      <div class="form-group">
		<% if (editing) { %>
239 240 241
		  <input name="cluster_id" readonly
			 id="cluster_id"
			 value="<%- formfields.cluster_id %>"
242 243
			 class="form-control format-me"
			 data-label="Cluster"
244
			 data-key="cluster_id">
245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265
		<% } else { %>
		  <select name="cluster"
			  id="cluster"
			  class='form-control format-me'
			  data-colsize="4"
			  data-key="cluster"
			  data-label="Cluster"
			  placeholder='Please Select'>
		    <option value=''>Please Select</option>
		    <% _.each(amlist, function(details, urn) { %>
		      <option
			  <% if (urn == formfields.cluster) { %>
			  selected
			  <% } %>
			  value='<%= urn %>'><%= details.name %>
		      </option>
		    <% }); %>
		  </select>
		<% } %>
	      </div>
	      <div class="form-group">
266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284
		<% if (editing) { %>
		  <input name="type" readonly
			 value="<%- formfields.type %>"
			 id="type"
			 class='form-control format-me'
			 data-key="type"
			 data-label="Hardware Type"
			 data-colsize="4">
		<% } else { %>
		  <select name="type"
			  id="type"
			  class='form-control format-me'
			  data-key="type"
			  data-label="Hardware Type"
			  placeholder='Please Select'
			  data-colsize="4">
		    <option value=''>Please Select</option>
		  </select>
		<% } %>
285 286 287 288 289 290 291 292 293 294 295 296 297
	      </div>
	      <div class="form-group">
		<textarea name="reason"
			  id="reason"
			  class='form-control format-me'
			  data-key="reason"
			  data-label="Reason"
			  rows="5"
			  data-colsize="9"
			  placeholder='Please provide a description of why you would like to reserve these resources. The better the description the more likely the reservation will be approved.'><%- formfields.reason %></textarea>
	      </div>
              <button class='btn btn-primary btn-sm pull-right' disabled
                      id='reserve-submit-button'
298
                      type='submit' name='submit'>Check</button>
299
	      <% if (editing) { %>
300
		<button class='btn btn-danger btn-sm pull-left' disabled
301 302 303
			style="margin-right: 10px"
			id='reserve-delete-button'
			type='submit' name='delete'>Delete</button>
304 305 306 307 308
		<button class='hidden btn btn-primary btn-sm pull-right'
			style="margin-right: 10px"
			id='reserve-approve-button'
			type='submit' name='submit'>Approve</button>
	      <% } %>
309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325
	    </div>
	  </div>
	</form>
      </div>
    </div>
  </div>
  <div class='col-lg-5
              col-md-5' id="reservation-lists">
  </div>
</div>
<!-- Confirm reservation -->
<div id='confirm-reservation' class='modal fade'>
  <div class='modal-dialog'>
    <div class='modal-content'>
      <div class='modal-body'>
        <button type='button' class='close' data-dismiss='modal'
                aria-hidden='true'>&times;</button>
326 327
        <center>
	  <h4>Would you like to submit this reservation request?</h4>
328 329 330 331 332
          <button style='margin-right: 20px;'
                  class='btn btn-primary btn-sm'
                  data-dismiss='modal' aria-hidden='true'>Cancel</button>
          <button class='btn btn-success btn-sm'
		  id='commit-reservation'
333
		  data-dismiss='modal' aria-hidden='true'>Submit</button>
334
	</center>
335 336 337 338
	<div style="margin-top: 5px;" class="needs-approval hidden">
	  NOTE: This reservation request can be accomodated, but the
	  size and/or duration means that the reservation needs to
	  be approved by an administrator before it is fully active.
Leigh B Stoller's avatar
Leigh B Stoller committed
339 340
	  The administrator will be notified when you submit this
	  request, and will act on this request as soon as possible.</div>
341 342 343 344 345 346 347 348 349 350 351
      </div>
    </div>
  </div>
</div>
<!-- Help -->
<div id='reservation-help-modal' class='modal fade'>
  <div class='modal-dialog'>
    <div class='modal-content'>
      <div class='modal-body'>
        <button type='button' class='close' data-dismiss='modal'
                aria-hidden='true'>&times;</button>
Leigh B Stoller's avatar
Leigh B Stoller committed
352
	<br>
353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368
	<p>
	  Use this form to request that resources be set aside for
	  your experiments at a future time. A reservation request
	  consists of these specific elements:
	  <ul>
	    <li> Project; what project your experiment is going to be
	    run in. If you are member of only one project, then do
	      not worry about this.</li>
	    <li> Count; How many nodes you need for your experiment. </li>
	    <li> Start date/time; when you would like the resources to
  	      be available for you to use.</li>
	    <li> End date/time; when you expect to be finished. This is
	      a <em>hard</em> deadline; if the resources have been
	      promised to another user you will not be allowed to keep
	      them past the end of the reservation (requests to extend
	      your experiment will be denied).</li>
369
	    <li> Cluster; at what cluster you want resources.</li>
370 371 372 373 374 375 376 377 378
	    <li> Node type; reservations are for specific node types. You
	      might not care what node type you get, but the reservation
	      system requires it.</li>
	    <li> Description; a reasonable explanation of why you need
	      these resources. Most reservations need administrator
	      approval, so the more details you provide, the better
	      the chances your request will be approved.
	    </li>
	  </ul>
379
	</p>
380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397
	  <p>
	    When you click on <b>Check</b> a preliminary query is made
	    to see if the request is <em>feasible</em> given the
	    current set of reservations at the cluster. If not, you can
	    modify your request and check again. Once you get to a
	    feasible reservation request, you will then want to <b>Submit</b>
	    it. The request might still fail, say if someone else got
	    in and captured those resources before you, but we expect
	    that to be very rare.
	  </p>
	  <p>
	    If your request is unusually large or long in duration, it
	    is possible that the reservation will be recorded in a
	    <em>pending</em> state; an administrator will need to
	    review the request and approve it. Your list of
	    reservations will indicate which requests are pending
	    approval. 
	  </p>
398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415
	  <p>
	    More info can be found in the
	    <a id="reservation-faq-button" href="#">reservation FAQ.</a>
	  </p>
      </div>
    </div>
  </div>
</div>
<!-- FAQ -->
<div id='reservation-faq-modal' class='modal fade'>
  <div class='modal-dialog'>
    <div class='modal-content'>
      <div class='modal-body'>
        <button type='button' class='close' data-dismiss='modal'
                aria-hidden='true'>&times;</button>
	<div class="clearfix"></div>
	<center><h4>Reservation FAQ</h4></center>
	<div class="faq-contents"></div>
416 417 418 419
      </div>
    </div>
  </div>
</div>
420 421 422 423 424 425 426
<!-- Graph Help -->
<div id='resgraph-help-modal' class='modal fade'>
  <div class='modal-dialog'>
    <div class='modal-content'>
      <div class='modal-body'>
        <button type='button' class='close' data-dismiss='modal'
                aria-hidden='true'>&times;</button>
Leigh B Stoller's avatar
Leigh B Stoller committed
427
	<br>
428 429 430 431 432 433 434 435 436 437 438 439 440 441
	<p>
	  The reservation graphs tell you how many of each node type
	  are available to reserve at a specific time. Use the graphs to
	  guide your requests to ensure you are asking for a reservation
	  that is possible to accommodate. Here are some helpful
	  features of the graphs:
	  <ul>
	    <li> Click on a node type label to turn off that type's
	      line. This will rescale the other lines, sometimes
	      making it easier to see those other lines.</li>
	    <li> Hover over and move around the graph to show a
	      tooltip that will provide the date and time, and the free
	      count for all of the node types at the time stamp you are
	      hovering over.</li>
442 443 444 445
	    <li> Use the <em>focus</em> bar under the graph to expand,
	      contract, and move the window. This will make it easier
	      to see ranges that have a lot of activity (such as the
	      first week).</li>
446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467
	    <li> Clicking on a graph at a specific date and time while
	      hovering, will copy the date and time to the form. The
	      cluster will also be selected in the form.</li>
	    <li> Beyond the right side of the X-axis there are no
	      longer any changes in the number of nodes, so you can
	      request nodes further out in time (no guarantees that
	      your request will be approved).</li>
	    <li> Click on the full screen
	      (<span class='glyphicon glyphicon-fullscreen'></span>)
	      icon to pop up a larger version of the graph.</li>
	    <li> Questions or suggestions, please let us know!</li>
	  </ul>
	</p>
      </div>
    </div>
  </div>
</div>
<div class='modal fade' id="resgraph-modal">
  <div class='modal-dialog'>
    <div class='modal-content'>
      <div class='modal-body'>
	<div class='panel panel-default'>
Leigh B Stoller's avatar
Leigh B Stoller committed
468
	  <div class="panel-heading">
469 470 471 472 473 474 475 476
            <button type='button' class='close' data-dismiss='modal'
                    aria-hidden='true'>&times;</button>
	    <center>
	      <h5>
		<span class="cluster-name"></span> Availability
	      </h5>
	    </center>
	  </div>
Leigh B Stoller's avatar
Leigh B Stoller committed
477
	  <div class='panel-body'>
478 479 480 481 482 483 484
	    <svg style="height: 80%; padding: 0px;"></svg>
	  </div>
	</div>
      </div>
    </div>
  </div>
</div>
485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501
<div id='delete-reservation-modal' class='modal fade'>
  <div class='modal-dialog'>
    <div class='modal-content'>
      <div class='modal-body'>
        <button type='button' class='close' data-dismiss='modal'
                aria-hidden='true'>&times;</button>
        <center><h4>Confirm to Delete Reservation</h4>
	  <% if (window.ISADMIN) { %>
	    Message to send to user
	    <div>
	      <textarea id='delete-reason'
			class='form-control'
			rows=5></textarea>
	    </div>
	  <% } %>
	  <br>
          <button class='btn btn-danger btn-sm'
502
		  id='confirm-delete'>Confirm</a></button>
503 504 505 506 507
	</center>
      </div>
    </div>
  </div>
</div>
508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527
<div id='approve-modal' class='modal fade'>
  <div class='modal-dialog'>
    <div class='modal-content'>
      <div class='modal-body'>
        <button type='button' class='close' data-dismiss='modal'
                aria-hidden='true'>&times;</button>
        <center><h4>Confirm to Approve Reservation</h4>
	  Additional text to send with approval (no text is okay):
	  <div>
	    <textarea class='form-control user-message'
		      rows=5></textarea>
	  </div>
	  <br>
          <button class='btn btn-danger btn-sm'
		  id='confirm-approve'>Confirm</a>
	</center>
      </div>
    </div>
  </div>
</div>