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
This commit is contained in:
Brian Federle 2013-10-29 14:16:25 -07:00
parent f0a8aa7f5e
commit bed42deb88
5 changed files with 59 additions and 2 deletions

View File

@ -14,6 +14,7 @@
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
label.sockets=Sockets
label.root.disk.size=Root disk size
label.s3.nfs.server=S3 NFS Server
label.s3.nfs.path=S3 NFS Path

View File

@ -25,6 +25,7 @@ under the License.
<% long now = System.currentTimeMillis(); %>
<script language="javascript">
dictionary = {
'label.sockets': '<fmt:message key="label.sockets" />',
'label.root.disk.size': '<fmt:message key="label.root.disk.size" />',
'label.s3.nfs.path': '<fmt:message key="label.s3.nfs.path" />',
'label.s3.nfs.server': '<fmt:message key="label.s3.nfs.server" />',

View File

@ -1126,6 +1126,11 @@
view-all-target="virtualRouters"><fmt:message key="label.view.all"/></span>
</li>
</ul>
<div class="socket-info">
<div class="title">Socket info</div>
<ul></ul>
</div>
</div>
</div>

View File

@ -364,7 +364,7 @@
return total;
};
complete($.extend(data, {
dataFns.socketInfo($.extend(data, {
cpuCapacityTotal: capacityTotal(1, cloudStack.converters.convertHz),
memCapacityTotal: capacityTotal(0, cloudStack.converters.convertBytes),
storageCapacityTotal: capacityTotal(2, cloudStack.converters.convertBytes)
@ -372,12 +372,39 @@
}
});
} else {
complete($.extend(data, {
dataFns.socketInfo($.extend(data, {
cpuCapacityTotal: cloudStack.converters.convertHz(0),
memCapacityTotal: cloudStack.converters.convertBytes(0),
storageCapacityTotal: cloudStack.converters.convertBytes(0)
}));
}
},
socketInfo: function(args) {
complete($.extend(args.data, {
socketInfo: [
{
name: 'XenServer',
hosts: 0,
sockets: 0
},
{
name: 'VMware',
hosts: 0,
sockets: 0
},
{
name: 'KVM',
hosts: 0,
sockets: 0
},
{
name: 'Hyper-V',
hosts: 0,
sockets: 0
}
]
}));
}
};

View File

@ -38,6 +38,29 @@
var $elem = $dashboard.find('[data-item=' + key + ']');
$elem.hide().html(value).fadeIn();
});
// Socket info
var $socketInfo = $dashboard.find('.socket-info ul');
$(args.data.socketInfo).each(function() {
var item = this;
var name = item.name;
var hosts = item.hosts;
var sockets = item.sockets;
var $li = $('<li>').append(
$('<div>').addClass('name').html(name),
$('<div>').addClass('hosts').append(
$('<div>').addClass('title').html(_l('label.hosts')),
$('<div>').addClass('value').html(hosts)
),
$('<div>').addClass('sockets').append(
$('<div>').addClass('title').html(_l('label.sockets')),
$('<div>').addClass('value').html(sockets)
)
);
$li.appendTo($socketInfo);
});
}
}
});