Skip to content

Commit bed42de

Browse files
committed
CLOUDSTACK-4908: UI for report CPU sockets
-Adds socket info for hypervisors on infrastructure chart -Displays # of sockets, and # of hosts -Currently only dummy data set to 0 for all info
1 parent f0a8aa7 commit bed42de

5 files changed

Lines changed: 59 additions & 2 deletions

File tree

client/WEB-INF/classes/resources/messages.properties

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
# KIND, either express or implied. See the License for the
1515
# specific language governing permissions and limitations
1616
# under the License.
17+
label.sockets=Sockets
1718
label.root.disk.size=Root disk size
1819
label.s3.nfs.server=S3 NFS Server
1920
label.s3.nfs.path=S3 NFS Path

ui/dictionary.jsp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ under the License.
2525
<% long now = System.currentTimeMillis(); %>
2626
<script language="javascript">
2727
dictionary = {
28+
'label.sockets': '<fmt:message key="label.sockets" />',
2829
'label.root.disk.size': '<fmt:message key="label.root.disk.size" />',
2930
'label.s3.nfs.path': '<fmt:message key="label.s3.nfs.path" />',
3031
'label.s3.nfs.server': '<fmt:message key="label.s3.nfs.server" />',

ui/index.jsp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1126,6 +1126,11 @@
11261126
view-all-target="virtualRouters"><fmt:message key="label.view.all"/></span>
11271127
</li>
11281128
</ul>
1129+
1130+
<div class="socket-info">
1131+
<div class="title">Socket info</div>
1132+
<ul></ul>
1133+
</div>
11291134
</div>
11301135
</div>
11311136

ui/scripts/system.js

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -364,20 +364,47 @@
364364
return total;
365365
};
366366

367-
complete($.extend(data, {
367+
dataFns.socketInfo($.extend(data, {
368368
cpuCapacityTotal: capacityTotal(1, cloudStack.converters.convertHz),
369369
memCapacityTotal: capacityTotal(0, cloudStack.converters.convertBytes),
370370
storageCapacityTotal: capacityTotal(2, cloudStack.converters.convertBytes)
371371
}));
372372
}
373373
});
374374
} else {
375-
complete($.extend(data, {
375+
dataFns.socketInfo($.extend(data, {
376376
cpuCapacityTotal: cloudStack.converters.convertHz(0),
377377
memCapacityTotal: cloudStack.converters.convertBytes(0),
378378
storageCapacityTotal: cloudStack.converters.convertBytes(0)
379379
}));
380380
}
381+
},
382+
383+
socketInfo: function(args) {
384+
complete($.extend(args.data, {
385+
socketInfo: [
386+
{
387+
name: 'XenServer',
388+
hosts: 0,
389+
sockets: 0
390+
},
391+
{
392+
name: 'VMware',
393+
hosts: 0,
394+
sockets: 0
395+
},
396+
{
397+
name: 'KVM',
398+
hosts: 0,
399+
sockets: 0
400+
},
401+
{
402+
name: 'Hyper-V',
403+
hosts: 0,
404+
sockets: 0
405+
}
406+
]
407+
}));
381408
}
382409
};
383410

ui/scripts/ui-custom/physicalResources.js

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,29 @@
3838
var $elem = $dashboard.find('[data-item=' + key + ']');
3939
$elem.hide().html(value).fadeIn();
4040
});
41+
42+
// Socket info
43+
var $socketInfo = $dashboard.find('.socket-info ul');
44+
$(args.data.socketInfo).each(function() {
45+
var item = this;
46+
var name = item.name;
47+
var hosts = item.hosts;
48+
var sockets = item.sockets;
49+
50+
var $li = $('<li>').append(
51+
$('<div>').addClass('name').html(name),
52+
$('<div>').addClass('hosts').append(
53+
$('<div>').addClass('title').html(_l('label.hosts')),
54+
$('<div>').addClass('value').html(hosts)
55+
),
56+
$('<div>').addClass('sockets').append(
57+
$('<div>').addClass('title').html(_l('label.sockets')),
58+
$('<div>').addClass('value').html(sockets)
59+
)
60+
);
61+
62+
$li.appendTo($socketInfo);
63+
});
4164
}
4265
}
4366
});

0 commit comments

Comments
 (0)