diff options
author | Sawyer Bergeron <sbergeron@iol.unh.edu> | 2021-03-24 15:48:39 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@opnfv.org> | 2021-03-24 15:48:39 +0000 |
commit | e23127473b81bdbc1f4630036ddec3c46ee17dda (patch) | |
tree | e6171df583a6cace7ef966b0e22f298a64b09b7b /src/static/js | |
parent | b14e617edb86628f31648847c0b96206764ef44c (diff) | |
parent | e817c3203fde0ca9bfb66a00919050cbdd1179e8 (diff) |
Merge "Front end fixes for enforcing hostname"
Diffstat (limited to 'src/static/js')
-rw-r--r-- | src/static/js/dashboard.js | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/static/js/dashboard.js b/src/static/js/dashboard.js index efc0542..12d8ee6 100644 --- a/src/static/js/dashboard.js +++ b/src/static/js/dashboard.js @@ -388,21 +388,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(); } |