First cluster is always selected when present
This commit is contained in:
parent
11d878cecf
commit
e3fda2c317
2 changed files with 14 additions and 8 deletions
|
@ -17,7 +17,8 @@
|
|||
<div class="col-sm-9 flex-container">
|
||||
{%- for cluster in sinfo.values() -%}
|
||||
<div class="flex-item-2 slurm-cluster" data-cluster="{{cluster}}">
|
||||
<input type="radio" name="cluster" id="cluster_{{cluster}}" value="{{cluster}}">
|
||||
<input type="radio" name="cluster" id="cluster_{{cluster}}" value="{{cluster}}"
|
||||
{% if loop.first %}checked{% endif %}>
|
||||
<label for="cluster_{{cluster}}" class="btn btn-default btn-block">
|
||||
{{ cluster | capitalize }}
|
||||
</label>
|
||||
|
@ -27,7 +28,7 @@
|
|||
</div>
|
||||
{% endif %}
|
||||
|
||||
<div class="form-group partitions{% if 'N/A' not in sinfo %} hidden{% endif %}">
|
||||
<div class="form-group partitions">
|
||||
<label for="partition" class="col-sm-3 control-label">Partition:</label>
|
||||
<div class="col-sm-9 flex-container">
|
||||
{%- for cluster in sinfo.values() -%}
|
||||
|
@ -125,9 +126,6 @@ not_enough_resources = function (err) {
|
|||
toggle_config = function() {
|
||||
var config = get_config();
|
||||
|
||||
if (config['cluster'] !== undefined) {
|
||||
$('.partitions').removeClass('hidden');
|
||||
}
|
||||
if (config['partition'] !== undefined) {
|
||||
$('.nodes').removeClass('hidden');
|
||||
}
|
||||
|
@ -140,6 +138,9 @@ toggle_config = function() {
|
|||
_toggle(el, config['cpu'], config['mem'], config['gpu'], config['cluster'], config['partition']);
|
||||
})
|
||||
|
||||
// Reload config
|
||||
config = get_config();
|
||||
|
||||
if ($partitions.not('.hidden').length == 0) {
|
||||
$('.partitions').addClass('hidden');
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue