cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sanjaytripa...@apache.org
Subject [3/3] git commit: updated refs/heads/master to f3cf85b
Date Wed, 16 Apr 2014 10:35:27 GMT
CLOUDSTACK-6233: Add new tab "GPU" in Host detailView for gpu enabled hosts

Signed-off-by: Mihaela Stoica <mihaela.stoica@citrix.com>
Signed-off-by: Sanjay Tripathi <sanjay.tripathi@citrix.com>


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

Branch: refs/heads/master
Commit: f3cf85bb6248aee7d2d64cc8e766fcbb12f6f029
Parents: 3fbac14
Author: Mihaela Stoica <mihaela.stoica@citrix.com>
Authored: Fri Apr 11 16:01:27 2014 +0100
Committer: Sanjay Tripathi <sanjay.tripathi@citrix.com>
Committed: Wed Apr 16 16:09:41 2014 +0530

----------------------------------------------------------------------
 .../classes/resources/messages.properties       |  6 ++
 ui/css/cloudstack3.css                          | 46 +++++++++++
 ui/dictionary.jsp                               |  6 ++
 ui/scripts/system.js                            | 82 ++++++++++++++++++++
 4 files changed, 140 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/f3cf85bb/client/WEB-INF/classes/resources/messages.properties
----------------------------------------------------------------------
diff --git a/client/WEB-INF/classes/resources/messages.properties b/client/WEB-INF/classes/resources/messages.properties
index b58f952..c5409dd 100644
--- a/client/WEB-INF/classes/resources/messages.properties
+++ b/client/WEB-INF/classes/resources/messages.properties
@@ -1488,6 +1488,12 @@ label.allow=Allow
 label.deny=Deny
 label.default.egress.policy=Default egress policy
 label.xenserver.tools.version.61.plus=XenServer Tools Version 6.1\+
+label.gpu=GPU
+label.vgpu.type=vGPU type
+label.vgpu.video.ram=Video RAM
+label.vgpu.max.resolution=Max resolution
+label.vgpu.max.vgpu.per.gpu=vGPUs per GPU
+label.vgpu.remaining.capacity=Remaining capacity
 managed.state=Managed State
 message.acquire.new.ip.vpc=Please confirm that you would like to acquire a new IP for this
VPC.
 message.acquire.new.ip=Please confirm that you would like to acquire a new IP for this network.

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/f3cf85bb/ui/css/cloudstack3.css
----------------------------------------------------------------------
diff --git a/ui/css/cloudstack3.css b/ui/css/cloudstack3.css
index c0f7c00..06351d7 100644
--- a/ui/css/cloudstack3.css
+++ b/ui/css/cloudstack3.css
@@ -12908,3 +12908,49 @@ div.ui-dialog div.autoscaler div.field-group div.form-container form
div.form-it
   display: inline-block;
 }
 
+
+/*GPU*/
+div.gpugroups div.list-view div.fixed-header {
+    position: relative;
+    left: 12px !important;
+    top: 0px !important;
+}
+
+div.gpugroups div.list-view div.fixed-header table {
+    width: auto;
+}
+
+div.gpugroups div.list-view div.data-table table {
+    margin-top: 0;
+}
+
+div.gpugroups div.list-view {
+  position: relative;
+  height: auto !important;
+  margin-top: 0 !important;
+  border: none !important;
+}
+
+.gpugroups {
+    float: left;
+    height: 100%;
+    width: 100%;
+    overflow-x: hidden;
+    overflow-y: auto;
+}
+.gpugroups .gpugroup-container {
+    border: 1px solid #C8C2C2;
+    border-radius: 3px;
+    height: auto !important;
+    margin: 12px;
+    padding: 0;
+    position: relative;
+    float: left;
+    width: auto;
+}
+
+.gpugroups .gpugroup-container .title {
+    font-size: 13px;
+    font-weight: 100;
+    padding: 12px 12px 5px;
+}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/f3cf85bb/ui/dictionary.jsp
----------------------------------------------------------------------
diff --git a/ui/dictionary.jsp b/ui/dictionary.jsp
index 8155204..82812a7 100644
--- a/ui/dictionary.jsp
+++ b/ui/dictionary.jsp
@@ -1812,6 +1812,12 @@ dictionary = {
 'label.deny': '<fmt:message key="label.deny" />',
 'label.default.egress.policy': '<fmt:message key="label.default.egress.policy" />',
 'label.xenserver.tools.version.61.plus': '<fmt:message key="label.xenserver.tools.version.61.plus"
/>',
+'label.gpu': '<fmt:message key="label.gpu" />',
+'label.vgpu.type': '<fmt:message key="label.vgpu.type" />',
+'label.vgpu.video.ram': '<fmt:message key="label.vgpu.video.ram" />',
+'label.vgpu.max.resolution': '<fmt:message key="label.vgpu.max.resolution" />',
+'label.vgpu.max.vgpu.per.gpu': '<fmt:message key="label.vgpu.max.vgpu.per.gpu" />',
+'label.vgpu.remaining.capacity': '<fmt:message key="label.vgpu.remaining.capacity" />',
 'message.confirm.delete.ciscovnmc.resource': '<fmt:message key="message.confirm.delete.ciscovnmc.resource"
/>',
 'message.confirm.add.vnmc.provider': '<fmt:message key="message.confirm.add.vnmc.provider"
/>',
 'message.confirm.enable.vnmc.provider': '<fmt:message key="message.confirm.enable.vnmc.provider"
/>',

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/f3cf85bb/ui/scripts/system.js
----------------------------------------------------------------------
diff --git a/ui/scripts/system.js b/ui/scripts/system.js
index ce62936..67e01f1 100644
--- a/ui/scripts/system.js
+++ b/ui/scripts/system.js
@@ -14879,6 +14879,13 @@
                                 }
                             }
                         },
+                        tabFilter: function (args) {
+                            var hiddenTabs =[];
+                            if (args.context.hosts[0].gpugroup == null) {
+                                hiddenTabs.push("gpu");
+                            }
+                            return hiddenTabs;
+                        },
                         tabs: {
                             details: {
                                 title: 'label.details',
@@ -15072,6 +15079,81 @@
                                         }
                                     });
                                 }
+                            },
+                            gpu: {
+                                title: 'label.gpu',
+                                custom: function (args) {
+                                    var gpugroups = null;
+                                    $.ajax({
+                                        url: createURL("listHosts&id=" + args.context.hosts[0].id),
+                                        dataType: "json",
+                                        async: false,
+                                        success: function (json) {
+                                            var item = json.listhostsresponse.host[0];
+                                            if (item != null && item.gpugroup !=
null)
+                                                gpugroups = item.gpugroup;
+                                        }
+                                    });
+
+                                    var $tabcontent = $('<div>').addClass('gpugroups');
+
+                                    $(gpugroups).each(function() {
+                                        var gpugroupObj = this;
+
+                                        var $groupcontainer = $('<div>').addClass('gpugroup-container');
+
+                                        //group name
+                                        $groupcontainer.append($('<div>').addClass('title')
+                                                            .append($('<span>').html(gpugroupObj.gpugroupname)));
+                                        //vgpu details
+                                        var $groupdetails = $('<div>').listView({
+                                            context: args.context,
+                                            listView: {
+                                                id: 'gputypes',
+                                                hideToolbar: true,
+                                                fields: {
+                                                    vgputype: {
+                                                        label: 'label.vgpu.type'
+                                                    },
+                                                    maxvgpuperpgpu: {
+                                                        label: 'label.vgpu.max.vgpu.per.gpu',
+                                                        converter: function (args) {
+                                                            return (args == null || args
== 0) ? "" : args;
+                                                        }
+                                                    },
+                                                    videoram: {
+                                                        label: 'label.vgpu.video.ram',
+                                                        converter: function (args) {
+                                                            return (args == null || args
== 0) ? "" : cloudStack.converters.convertBytes(args);
+                                                        }
+                                                    },
+                                                    maxresolution: {
+                                                        label: 'label.vgpu.max.resolution'
+                                                    },
+                                                    remainingcapacity: {
+                                                        label: 'label.vgpu.remaining.capacity'
+                                                    }
+                                                },
+                                                dataProvider: function (args) {
+                                                    var items = gpugroupObj.vgpu.sort(function(a,
b) {
+                                                        return a.maxvgpuperpgpu >= b.maxvgpuperpgpu;
+                                                    });
+                                                    $(items).each(function () {
+                                                        this.maxresolution = (this.maxresolutionx
== null || this.maxresolutionx == 0
+                                                                || this.maxresolutiony ==
null || this.maxresolutiony == 0)
+                                                                ? "" : this.maxresolutionx
+ " x " + this.maxresolutiony;
+                                                    });
+                                                    args.response.success({
+                                                        data: items
+                                                    });
+                                                }
+                                            }
+                                        });
+                                        $groupcontainer.append($groupdetails);
+                                        $tabcontent.append($groupcontainer);
+                                    });
+                                    return $tabcontent;
+                                }
                             }
                         }
                     }


Mime
View raw message