You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by mt...@apache.org on 2015/09/19 03:31:41 UTC

[35/50] git commit: updated refs/heads/sf-plugins to 157efc3

Extending functionality related to virtual networks


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

Branch: refs/heads/sf-plugins
Commit: 589041df1c14ca983a91fc7335c3af43e57584b9
Parents: 80ab54c
Author: Mike Tutkowski <mi...@solidfire.com>
Authored: Tue Jul 21 17:32:51 2015 -0600
Committer: Mike Tutkowski <mi...@solidfire.com>
Committed: Fri Sep 18 19:28:22 2015 -0600

----------------------------------------------------------------------
 ui/plugins/sfAdministration/sfAdministration.js | 154 +++++++++++++++++++
 1 file changed, 154 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/589041df/ui/plugins/sfAdministration/sfAdministration.js
----------------------------------------------------------------------
diff --git a/ui/plugins/sfAdministration/sfAdministration.js b/ui/plugins/sfAdministration/sfAdministration.js
index cbabf39..158b714 100644
--- a/ui/plugins/sfAdministration/sfAdministration.js
+++ b/ui/plugins/sfAdministration/sfAdministration.js
@@ -468,6 +468,160 @@
                       }
                     }
                   }
+                },
+                action: function(args) {
+                  var data = {
+                    clustername: args.context.sfAdministration[0].name,
+                    name: args.data.name,
+                    tag: args.data.tag,
+                    startip: args.data.startip,
+                    size: 10, // Mike T. args.data.size,
+                    netmask: args.data.netmask,
+                    svip: args.data.svip,
+                    accountid: args.data.account
+                  };
+
+                  $.ajax({
+                    url: createURL('createSolidFireVirtualNetwork'),
+                    data: data,
+                    success: function(json) {
+                      var sfVirtualNetworkObj = json.createsolidfirevirtualnetworkresponse.apicreatesolidfirevirtualnetwork;
+
+                      args.response.success({
+                        data: sfVirtualNetworkObj
+                      });
+                    },
+                    error: function(json) {
+                      args.response.error(parseXMLHttpResponse(json));
+                    }
+                  });
+                }
+              }
+            },
+            detailView: {
+              name: 'label.details',
+              actions: {
+                edit: {
+                  label: 'label.edit',
+                  messages: {
+                    notification: function(args) {
+                      return 'Edit Virtual Network';
+                    }
+                  },
+                  action: function (args) {
+                    var params = [];
+
+                    params.push("&name=" + args.context.name);
+                    params.push("&tag=" + args.data.tag);
+                    params.push("&startip=" + args.data.startip);
+                    params.push("&size=" + "10"); // Mike T. args.data.size);
+                    params.push("&netmask=" + args.data.netmask);
+                    params.push("&svip=" + args.data.svip);
+
+                    $.ajax({
+                      url: createURL('updateSolidFireVirtualNetwork' + params.join("")),
+                      success: function(json) {
+                        var sfVirtualNetworkObj = json.updatesolidfirevirtualnetworkresponse.apiupdatesolidfirevirtualnetwork;
+
+                        args.response.success({
+                          data: sfVirtualNetworkObj
+                        });
+                      },
+                      error: function(json) {
+                        args.response.error(parseXMLHttpResponse(json));
+                      }
+                    });
+                  }
+                },
+                remove: {
+                  label: 'Delete Virtual Network',
+                  messages: {
+                    confirm: function(args) {
+                      return 'Are you sure you would like to delete this virtual network?';
+                    },
+                    notification: function(args) {
+                      return 'Delete Virtual Network';
+                    }
+                  },
+                  action: function(args) {
+                    $.ajax({
+                      url: createURL('deleteSolidFireVirtualNetwork&id=' + args.context.sfVirtualNetwork[0].id),
+                      success: function(json) {
+                        args.response.success();
+                      },
+                      error: function(json) {
+                        args.response.error(parseXMLHttpResponse(json));
+                      }
+                    });
+                  }
+                }
+              },
+              tabs: {
+                details: {
+                  title: 'label.details',
+                  preFilter: function(args) {
+                    return [];
+                  },
+                  fields: [
+                    {
+                      name: {
+                        label: 'label.name',
+                        isEditable: true
+                      }
+                    },
+                    {
+                      uuid: {
+                        label: 'label.id'
+                      },
+                      accountname: {
+                        label: 'label.account'
+                      },
+                      tag: {
+                        label: 'Tag',
+                        isEditable: true
+                      },
+                      physicalnetwork: {
+                        label: 'Physical Network'
+                      },
+                      networkoffering: {
+                        label: 'Network Offering'
+                      },
+                      gateway: {
+                        label: 'Gateway',
+                        isEditable: true
+                      },
+                      netmask: {
+                        label: 'Netmask',
+                        isEditable: true
+                      },
+                      startip: {
+                        label: 'Start IP',
+                        isEditable: true
+                      },
+                      endip: {
+                        label: 'End IP',
+                        isEditable: true
+                      },
+                      svip: {
+                        label: 'SVIP',
+                        isEditable: true
+                      }
+                    }
+                  ],
+                  dataProvider: function(args) {
+                    $.ajax({
+                      url: createURL("listSolidFireVirtualNetworks&id=" + args.context.sfVirtualNetwork[0].id),
+                      dataType: "json",
+                      async: true,
+                      success: function(json) {
+                        var jsonObj = json.listsolidfirevirtualnetworksresponse.sfvirtualnetwork[0];
+
+                        args.response.success({
+                          data: jsonObj
+                        });
+                      }
+                    });
+                  }
                 }
               }
             }