2024-02-14 18:45:57 +01:00
|
|
|
<div class="resources">
|
|
|
|
|
2024-01-30 18:30:31 +01:00
|
|
|
<div class="form-group">
|
|
|
|
<label for="cpu" class="col-sm-3 control-label">CPU:</label>
|
|
|
|
<div class="col-sm-9">
|
2024-02-14 18:45:57 +01:00
|
|
|
{%- for cpu in cpus -%}
|
2024-01-31 11:20:56 +01:00
|
|
|
<div class="col-sm-2">
|
|
|
|
<input type="radio" name="cpu" id="cpu_{{loop.index0}}" value="{{loop.index0}}"
|
2024-02-14 10:02:07 +01:00
|
|
|
data-max-duration="{{cpu.max_duration}}"{% if loop.first %} checked{% endif %}>
|
2024-01-31 11:20:56 +01:00
|
|
|
<label for="cpu_{{loop.index0}}" class="btn btn-default btn-block">
|
|
|
|
{{ cpu.description }}
|
|
|
|
</label>
|
|
|
|
</div>
|
2024-01-30 18:30:31 +01:00
|
|
|
{% endfor -%}
|
|
|
|
</div>
|
|
|
|
</div>
|
2024-02-14 18:45:57 +01:00
|
|
|
|
2024-01-30 18:30:31 +01:00
|
|
|
<div class="form-group">
|
|
|
|
<label for="ram" class="col-sm-3 control-label">Memory:</label>
|
|
|
|
<div class="col-sm-9">
|
2024-02-14 18:45:57 +01:00
|
|
|
{%- for ram in rams -%}
|
2024-01-31 11:20:56 +01:00
|
|
|
<div class="col-sm-2">
|
|
|
|
<input type="radio" name="ram" id="ram_{{loop.index0}}" value="{{loop.index0}}"
|
2024-02-14 10:02:07 +01:00
|
|
|
data-max-duration="{{ram.max_duration}}"{% if loop.first %} checked{% endif %}>
|
2024-01-31 11:20:56 +01:00
|
|
|
<label for="ram_{{loop.index0}}" class="btn btn-default btn-block">
|
2024-02-08 16:37:20 +01:00
|
|
|
{{ ram.description }}
|
2024-01-31 11:20:56 +01:00
|
|
|
</label>
|
|
|
|
</div>
|
2024-01-30 18:30:31 +01:00
|
|
|
{% endfor -%}
|
|
|
|
</div>
|
|
|
|
</div>
|
2024-02-14 18:45:57 +01:00
|
|
|
|
2024-01-30 18:30:31 +01:00
|
|
|
<div class="form-group">
|
|
|
|
<label for="gpu" class="col-sm-3 control-label">GPU:</label>
|
|
|
|
<div class="col-sm-9">
|
2024-02-14 18:45:57 +01:00
|
|
|
{%- for gpu in gpus -%}
|
2024-01-31 11:20:56 +01:00
|
|
|
<div class="col-sm-2">
|
|
|
|
<input type="radio" name="gpu" id="gpu_{{loop.index0}}" value="{{loop.index0}}"
|
2024-02-14 10:02:07 +01:00
|
|
|
data-max-duration="{{gpu.max_duration}}"{% if loop.first %} checked{% endif %}>
|
2024-01-31 11:20:56 +01:00
|
|
|
<label for="gpu_{{loop.index0}}" class="btn btn-default btn-block">
|
2024-02-08 16:37:20 +01:00
|
|
|
{{ gpu.description }}
|
2024-01-31 11:20:56 +01:00
|
|
|
</label>
|
|
|
|
</div>
|
2024-01-30 18:30:31 +01:00
|
|
|
{% endfor -%}
|
|
|
|
</div>
|
|
|
|
</div>
|
2024-02-14 18:45:57 +01:00
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="form-group">
|
|
|
|
<label class="col-sm-3 control-label">Session duration:</label>
|
|
|
|
<div class="col-sm-9">
|
|
|
|
<div class="form-control-static"><span id="time-max-duration">24</span> h</div>
|
2024-01-30 18:30:31 +01:00
|
|
|
</div>
|
2024-01-30 16:15:18 +01:00
|
|
|
</div>
|
2024-01-30 18:30:31 +01:00
|
|
|
|
|
|
|
<script>
|
2024-01-31 11:20:56 +01:00
|
|
|
// Adjust time duration
|
2024-01-30 18:30:31 +01:00
|
|
|
var $reservations_dropdown = $("#time-max-duration");
|
|
|
|
|
2024-02-14 18:45:57 +01:00
|
|
|
$('.resources input[type=radio]').change(function () {
|
2024-01-30 18:30:31 +01:00
|
|
|
var cpu = $('input[name=cpu]:checked').data('max-duration');
|
|
|
|
var ram = $('input[name=ram]:checked').data('max-duration');
|
|
|
|
var gpu = $('input[name=gpu]:checked').data('max-duration');
|
|
|
|
|
|
|
|
$reservations_dropdown.text(Math.min(cpu, ram, gpu));
|
|
|
|
})
|
|
|
|
</script>
|