cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bfede...@apache.org
Subject git commit: updated refs/heads/ui-vpc-redesign to 392d55d
Date Tue, 07 May 2013 19:47:01 GMT
Updated Branches:
  refs/heads/ui-vpc-redesign b29449b4b -> 392d55dea


Add base VPC chart


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

Branch: refs/heads/ui-vpc-redesign
Commit: 392d55dead6cf7825e96a4c9c25acc63bb40a651
Parents: b29449b
Author: Brian Federle <brian.federle@citrix.com>
Authored: Tue May 7 12:46:37 2013 -0700
Committer: Brian Federle <brian.federle@citrix.com>
Committed: Tue May 7 12:46:37 2013 -0700

----------------------------------------------------------------------
 ui/modules/modules.js  |    1 +
 ui/modules/vpc/vpc.css |  100 +++++++++++++++++++++++++++++++++++++++++++
 ui/modules/vpc/vpc.js  |   70 ++++++++++++++++++++++++++++++
 3 files changed, 171 insertions(+), 0 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/392d55de/ui/modules/modules.js
----------------------------------------------------------------------
diff --git a/ui/modules/modules.js b/ui/modules/modules.js
index 490749f..ee553fd 100644
--- a/ui/modules/modules.js
+++ b/ui/modules/modules.js
@@ -16,5 +16,6 @@
 // under the License.
 (function($, cloudStack) {
   cloudStack.modules = [
+    'vpc'
   ];
 }(jQuery, cloudStack));

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/392d55de/ui/modules/vpc/vpc.css
----------------------------------------------------------------------
diff --git a/ui/modules/vpc/vpc.css b/ui/modules/vpc/vpc.css
new file mode 100644
index 0000000..2022c22
--- /dev/null
+++ b/ui/modules/vpc/vpc.css
@@ -0,0 +1,100 @@
+/*[fmt]1C20-1C0D-E*/
+/*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements.  See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership.  The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License.  You may obtain a copy of the License at
+*
+*   http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied.  See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*/
+.vpc-network-chart {
+}
+
+.vpc-network-chart .tiers {
+}
+
+.vpc-network-chart .tier-item {
+  border: 1px solid #477FB4;
+  overflow: hidden;
+  width: 326px;
+  height: 182px;
+  margin: 18px;
+  /*+border-radius:4px;*/
+  -moz-border-radius: 4px;
+  -webkit-border-radius: 4px;
+  -khtml-border-radius: 4px;
+  border-radius: 4px;
+  background: #8DB1D3;
+}
+
+.vpc-network-chart .tier-item .header {
+  padding: 7px 0 6px;
+  /*+box-shadow:inset 0px 1px 1px #FFFFFF;*/
+  -moz-box-shadow: inset 0px 1px 1px #FFFFFF;
+  -webkit-box-shadow: inset 0px 1px 1px #FFFFFF;
+  -o-box-shadow: inset 0px 1px 1px #FFFFFF;
+  box-shadow: inset 0px 1px 1px #FFFFFF;
+  background: #69839D;
+  border-bottom: 1px solid #40639E;
+}
+
+.vpc-network-chart .tier-item .header .title {
+  margin-left: 9px;
+  max-width: 268px;
+  overflow: hidden;
+}
+
+.vpc-network-chart .tier-item .header .title span {
+  font-size: 20px;
+  color: #FFFFFF;
+  /*+text-shadow:0px 1px 1px #000000;*/
+  -moz-text-shadow: 0px 1px 1px #000000;
+  -webkit-text-shadow: 0px 1px 1px #000000;
+  -o-text-shadow: 0px 1px 1px #000000;
+  text-shadow: 0px 1px 1px #000000;
+}
+
+.vpc-network-chart .tier-item .content {
+  width: 100%;
+  height: 83%;
+  /*+box-shadow:inset 0px 1px 1px #FFFFFF;*/
+  -moz-box-shadow: inset 0px 1px 1px #FFFFFF;
+  -webkit-box-shadow: inset 0px 1px 1px #FFFFFF;
+  -o-box-shadow: inset 0px 1px 1px #FFFFFF;
+  box-shadow: inset 0px 1px 1px #FFFFFF;
+  border-bottom: 1px solid #8DB1D3;
+}
+
+.vpc-network-chart .tier-item .content .dashboard {
+  height: 117px;
+}
+
+.vpc-network-chart .tier-item .content .info {
+  padding: 7px 0 10px 9px;
+}
+
+.vpc-network-chart .tier-item .content .info .cidr-label {
+  font-size: 10px;
+  color: #1860A7;
+}
+
+.vpc-network-chart .tier-item .content .info .cidr {
+  color: #364553;
+  font-size: 10px;
+  /*+text-shadow:0px 1px #C7D8E9;*/
+  -moz-text-shadow: 0px 1px #C7D8E9;
+  -webkit-text-shadow: 0px 1px #C7D8E9;
+  -o-text-shadow: 0px 1px #C7D8E9;
+  text-shadow: 0px 1px #C7D8E9;
+}
+

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/392d55de/ui/modules/vpc/vpc.js
----------------------------------------------------------------------
diff --git a/ui/modules/vpc/vpc.js b/ui/modules/vpc/vpc.js
new file mode 100644
index 0000000..065a91d
--- /dev/null
+++ b/ui/modules/vpc/vpc.js
@@ -0,0 +1,70 @@
+(function($, cloudStack) {
+  var elems = {
+    chart: {
+      tier: function(args) {
+        var tier = args.tier;
+        var $tier = $('<div>').addClass('tier-item');
+        var $header = $('<div>').addClass('header');
+        var $title = $('<div>').addClass('title').append($('<span>'));
+        var $content = $('<div>').addClass('content');
+        var $dashboard = $('<div>').addClass('dashboard');
+        var $info = $('<div>').addClass('info');
+        var $cidrLabel = $('<span>').addClass('cidr-label');
+        var $cidr = $('<span>').addClass('cidr');
+
+        $cidrLabel.html('CIDR: ');
+        $cidr.html(tier.cidr);
+        $title.find('span').html(tier.displayname ? tier.displayname : tier.name);
+        $header.append($title);
+        $info.append($cidrLabel, $cidr);
+        $content.append($dashboard, $info);
+        $tier.append($header, $content);
+
+        return $tier;
+      }
+    }
+  };
+
+  cloudStack.modules.vpc = function(module) {
+    var vpc = cloudStack.vpc;
+    var vpcSection = cloudStack.sections.network.sections.vpc;
+    var listConfigureAction = vpcSection.listView.actions.configureVpc.action;
+    var detailsConfigureAction = vpcSection.listView.detailView.actions.configureVpc.action;
+
+    var vpcChart = function(args) {
+      var context = args.context;
+      var vpcItem = context.vpc[0];
+      var $chart = $('<div>').addClass('vpc-network-chart');
+      var $tiers = $('<div>').addClass('tiers');
+
+      $tiers.appendTo($chart);
+      
+      // Get tiers
+      vpc.tiers.dataProvider({
+        context: context,
+        response: {
+          success: function(data) {
+            var tiers = data.tiers;
+
+            $(tiers).map(function(index, tier) {
+              var $tier = elems.chart.tier({ tier: tier });
+
+              $tier.appendTo($tiers);
+            });
+          }
+        }
+      });
+      
+      $('#browser .container').cloudBrowser('addPanel', {
+        title: vpcItem.displaytext ? vpcItem.displaytext : vpcItem.name,
+        maximizeIfSelected: true,
+        complete: function($panel) {
+          $chart.appendTo($panel);
+        }
+      });
+    };
+
+    listConfigureAction.custom = vpcChart;
+    detailsConfigureAction.custom = vpcChart;
+  };
+}(jQuery, cloudStack));


Mime
View raw message