diff options
Diffstat (limited to 'src/static')
-rw-r--r-- | src/static/img/lfedge-logo.png | bin | 0 -> 6633 bytes | |||
-rw-r--r-- | src/static/js/dashboard.js | 11 |
2 files changed, 11 insertions, 0 deletions
diff --git a/src/static/img/lfedge-logo.png b/src/static/img/lfedge-logo.png Binary files differnew file mode 100644 index 0000000..689f09a --- /dev/null +++ b/src/static/img/lfedge-logo.png diff --git a/src/static/js/dashboard.js b/src/static/js/dashboard.js index 99f6717..dfbb157 100644 --- a/src/static/js/dashboard.js +++ b/src/static/js/dashboard.js @@ -242,6 +242,7 @@ class MultipleSelectFilterWidget { this.make_multiple_selection(node, selection_data); } this.currentLab = node; + this.available_resources = JSON.parse(node['available_resources']); } for( let node_id in initial_resources){ @@ -256,6 +257,7 @@ class MultipleSelectFilterWidget { this.make_multiple_selection(node, selection_data); } } + this.updateAvailibility(); } make_multiple_selection(node, selection_data){ @@ -406,21 +408,30 @@ class MultipleSelectFilterWidget { reserveResource(node){ const required_resources = JSON.parse(node['required_resources']); + let hostname = document.getElementById('id_hostname'); + let cnt = 0 + for(let resource in required_resources){ this.available_resources[resource] -= required_resources[resource]; + cnt += required_resources[resource]; } + if (cnt > 1) + hostname.readOnly = true; + this.updateAvailibility(); } releaseResource(node){ const required_resources = JSON.parse(node['required_resources']); + let hostname = document.getElementById('id_hostname'); for(let resource in required_resources){ this.available_resources[resource] += required_resources[resource]; } + hostname.readOnly = false; this.updateAvailibility(); } |