Repository: cloudstack
Updated Branches:
  refs/heads/master b8795d887 -> acb68509f


CS-21121: UI for Baremetal RCT - (1) Global Settings > add new option 
"Baremetal Rack Configuration" in Select view dropdown. (2) implement "Add 
Baremetal Rack Configuration" action.


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/acb68509
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/acb68509
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/acb68509

Branch: refs/heads/master
Commit: acb68509f097d600849b1d9e5dc882c909f59585
Parents: b8795d8
Author: Jessica Wang <jessicaw...@apache.org>
Authored: Mon Sep 22 16:18:18 2014 -0700
Committer: Jessica Wang <jessicaw...@apache.org>
Committed: Mon Sep 22 16:18:28 2014 -0700

----------------------------------------------------------------------
 ui/scripts/globalSettings.js | 64 ++++++++++++++++++++++++++++++++++++++-
 1 file changed, 63 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/acb68509/ui/scripts/globalSettings.js
----------------------------------------------------------------------
diff --git a/ui/scripts/globalSettings.js b/ui/scripts/globalSettings.js
index 4cbfd07..2b121dd 100644
--- a/ui/scripts/globalSettings.js
+++ b/ui/scripts/globalSettings.js
@@ -234,7 +234,69 @@
                         }
                     }
                 }
-            },
+            },           
+            baremetalRct: {
+                type: 'select',
+                title: 'Baremetal Rack Configuration',
+                listView: {
+                    id: 'baremetalRct',
+                    label: 'Baremetal Rack Configuration',
+                    fields: {                       
+                        url: {
+                            label: 'label.url'
+                        }
+                    },
+                    dataProvider: function(args) {
+                        var data = {};
+                        listViewDataProvider(args, data);
+                        
+                        args.response.success({ data: [] });
+                    },
+                    actions: {
+                        add: {
+                            label: 'Add Baremetal Rack Configuration',
+                            messages: {                                
+                                notification: function(args) {
+                                    return 'Add Baremetal Rack Configuration';
+                                }
+                            },
+                            createForm: {
+                                title: 'Add Baremetal Rack Configuration',
+                                fields: {
+                                    url: {
+                                        label: 'label.url',
+                                        validation: {
+                                            required: true
+                                        }
+                                    }
+                                }
+                            },
+                            action: function(args) {                           
     
+                                $.ajax({
+                                       url: createURL("addBaremetalRct"),
+                                       data: {
+                                               baremetalrcturl: args.data.url
+                                       },
+                                       success: function(json) {               
                                
+                                               var jid = 
json.addbaremetalrctresponse.jobid
+                                               args.response.success({
+                                            _custom: {
+                                                jobId: jid,
+                                                getUpdatedItem: function(json) 
{                                                       
+                                                    return 
json.queryasyncjobresultresponse.jobresult.baremetalrct;
+                                                }
+                                            }
+                                        });
+                                       }
+                                });
+                            },
+                            notification: {
+                                poll: pollAsyncJobResult
+                            }
+                        }
+                    }
+                }
+            },            
             hypervisorCapabilities: {
                 type: 'select',
                 title: 'label.hypervisor.capabilities',

Reply via email to