summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHiroyuki Eguchi <h-eguchi@az.jp.nec.com>2017-03-24 12:31:36 +0900
committerHiroyuki Eguchi <h-eguchi@az.jp.nec.com>2017-03-24 12:34:10 +0900
commit312a5742ea54a2b174d054260fb48607d185b53b (patch)
tree5d5b3b810103842ccf3e22b6dbf8c72497748966
parent8a6330d1f5fafa88a393c0490da77415174f0753 (diff)
Change the field type of flavor
Change the field type of flavor from input to select box. User can select flavor without specifying manually. Change-Id: I6dfb2a567d39cf621c545ce43272a3b691029817
Notes
Notes (review): Code-Review+2: Hiroyuki Eguchi <h-eguchi@az.jp.nec.com> Workflow+1: Hiroyuki Eguchi <h-eguchi@az.jp.nec.com> Verified+2: Jenkins Submitted-by: Jenkins Submitted-at: Fri, 24 Mar 2017 03:47:35 +0000 Reviewed-on: https://review.openstack.org/449418 Project: openstack/meteos-ui Branch: refs/heads/master
-rw-r--r--meteos_ui/static/dashboard/machine_learning/templates/create/spec/spec.html18
-rw-r--r--meteos_ui/static/dashboard/machine_learning/templates/create/spec/template.spec.controller.js11
2 files changed, 19 insertions, 10 deletions
diff --git a/meteos_ui/static/dashboard/machine_learning/templates/create/spec/spec.html b/meteos_ui/static/dashboard/machine_learning/templates/create/spec/spec.html
index 6f467d1..0294551 100644
--- a/meteos_ui/static/dashboard/machine_learning/templates/create/spec/spec.html
+++ b/meteos_ui/static/dashboard/machine_learning/templates/create/spec/spec.html
@@ -34,10 +34,11 @@
34 <translate>Master Flavor</translate> 34 <translate>Master Flavor</translate>
35 <span class="hz-icon-required fa fa-asterisk"></span> 35 <span class="hz-icon-required fa fa-asterisk"></span>
36 </label> 36 </label>
37 <input name="template-master-flavor-id" type="text" class="form-control" id="template-master-flavor-id" 37 <select class="form-control"
38 ng-model="model.newTemplateSpec.master_flavor_id" 38 ng-model="model.newTemplateSpec.master_flavor_id"
39 ng-required="true" 39 ng-required="true"
40 placeholder="{$ 'Flavor ID of Master Node.'|translate $}"> 40 ng-options="flavor.id as flavor.id + ':' + flavor.name for flavor in ctrl.flavors">
41 </select>
41 </div> 42 </div>
42 </div> 43 </div>
43 <div class="col-xs-12"> 44 <div class="col-xs-12">
@@ -58,10 +59,11 @@
58 <translate>Worker Flavor</translate> 59 <translate>Worker Flavor</translate>
59 <span class="hz-icon-required fa fa-asterisk"></span> 60 <span class="hz-icon-required fa fa-asterisk"></span>
60 </label> 61 </label>
61 <input name="template-worker-flavor-id" type="text" class="form-control" id="template-worker-flavor-id" 62 <select class="form-control"
62 ng-model="model.newTemplateSpec.worker_flavor_id" 63 ng-model="model.newTemplateSpec.worker_flavor_id"
63 ng-required="true" 64 ng-required="true"
64 placeholder="{$ 'Flavor ID of Worker Node.'|translate $}"> 65 ng-options="flavor.id as flavor.id + ':' + flavor.name for flavor in ctrl.flavors">
66 </select>
65 </div> 67 </div>
66 </div> 68 </div>
67 <div class="col-xs-12"> 69 <div class="col-xs-12">
diff --git a/meteos_ui/static/dashboard/machine_learning/templates/create/spec/template.spec.controller.js b/meteos_ui/static/dashboard/machine_learning/templates/create/spec/template.spec.controller.js
index 1ffe76b..1c96c47 100644
--- a/meteos_ui/static/dashboard/machine_learning/templates/create/spec/template.spec.controller.js
+++ b/meteos_ui/static/dashboard/machine_learning/templates/create/spec/template.spec.controller.js
@@ -29,12 +29,14 @@
29 createTemplateSpecController.$inject = [ 29 createTemplateSpecController.$inject = [
30 '$scope', 30 '$scope',
31 'horizon.framework.util.i18n.gettext', 31 'horizon.framework.util.i18n.gettext',
32 'horizon.app.core.openstack-service-api.neutron' 32 'horizon.app.core.openstack-service-api.neutron',
33 'horizon.app.core.openstack-service-api.nova'
33 ]; 34 ];
34 35
35 function createTemplateSpecController($scope, gettext, neutron) { 36 function createTemplateSpecController($scope, gettext, neutron, nova) {
36 var ctrl = this; 37 var ctrl = this;
37 ctrl.networks = []; 38 ctrl.networks = [];
39 ctrl.flavors = [];
38 40
39 ctrl.templateVersionOptions = [ 41 ctrl.templateVersionOptions = [
40 { label: gettext('1.6.0'), value: '1.6.0' } 42 { label: gettext('1.6.0'), value: '1.6.0' }
@@ -44,11 +46,16 @@
44 46
45 function init() { 47 function init() {
46 neutron.getNetworks().success(onGetNetworks); 48 neutron.getNetworks().success(onGetNetworks);
49 nova.getFlavors().success(onGetFlavors);
47 } 50 }
48 51
49 function onGetNetworks(response) { 52 function onGetNetworks(response) {
50 ctrl.networks = response.items; 53 ctrl.networks = response.items;
51 } 54 }
52 55
56 function onGetFlavors(response) {
57 ctrl.flavors = response.items;
58 }
59
53 } 60 }
54})(); 61})();