diff --git a/client/WEB-INF/classes/resources/messages.properties b/client/WEB-INF/classes/resources/messages.properties
index b58f9521752..c5409dd2941 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.
diff --git a/ui/css/cloudstack3.css b/ui/css/cloudstack3.css
index c0f7c004407..06351d70783 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;
+}
diff --git a/ui/dictionary.jsp b/ui/dictionary.jsp
index 8155204d3ac..82812a79b86 100644
--- a/ui/dictionary.jsp
+++ b/ui/dictionary.jsp
@@ -1812,6 +1812,12 @@ dictionary = {
'label.deny': '',
'label.default.egress.policy': '',
'label.xenserver.tools.version.61.plus': '',
+'label.gpu': '',
+'label.vgpu.type': '',
+'label.vgpu.video.ram': '',
+'label.vgpu.max.resolution': '',
+'label.vgpu.max.vgpu.per.gpu': '',
+'label.vgpu.remaining.capacity': '',
'message.confirm.delete.ciscovnmc.resource': '',
'message.confirm.add.vnmc.provider': '',
'message.confirm.enable.vnmc.provider': '',
diff --git a/ui/scripts/system.js b/ui/scripts/system.js
index ce629365ffd..67e01f1cc96 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 = $('
').addClass('gpugroups');
+
+ $(gpugroups).each(function() {
+ var gpugroupObj = this;
+
+ var $groupcontainer = $('
').addClass('gpugroup-container');
+
+ //group name
+ $groupcontainer.append($('
').addClass('title')
+ .append($('
').html(gpugroupObj.gpugroupname)));
+ //vgpu details
+ var $groupdetails = $('').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;
+ }
}
}
}