use of org.ovirt.engine.ui.common.presenter.CollapsiblePanelPresenterWidget in project ovirt-engine by oVirt.
the class UnassignedVNumaNodesPanelPresenterWidget method populateView.
public void populateView() {
getView().clear();
Collection<VNodeModel> unassignedNodeList = model.getUnassignedNumaNodes();
Map<VM, List<VNodeModel>> vmToNodeMap = new HashMap<>();
for (VM currentVM : this.model.getVmsWithvNumaNodeList()) {
List<VNodeModel> nodeModelList = new ArrayList<>();
vmToNodeMap.put(currentVM, nodeModelList);
}
for (VNodeModel vNodeModel : unassignedNodeList) {
VM currentVM = vNodeModel.getVm();
List<VNodeModel> nodeModels = vmToNodeMap.get(currentVM);
nodeModels.add(vNodeModel);
}
for (Map.Entry<VM, List<VNodeModel>> entry : vmToNodeMap.entrySet()) {
CollapsiblePanelPresenterWidget nodePanelPresenter = collapisblePanelProvider.get();
addToSlot(TYPE_RevealUnassignedPanels, nodePanelPresenter);
nodePanelPresenter.getView().setTitleWidget(getView().getNodePanelTitle(entry.getKey(), entry.getValue()));
nodePanelPresenter.getView().addContentWidget(getView().getNodePanelContent(entry.getKey(), entry.getValue(), model.getNumaNodeList()));
if (entry.getValue().isEmpty()) {
nodePanelPresenter.collapsePanel();
}
getView().addToUnassignedPanel(nodePanelPresenter.getView());
}
getView().addEmptyUnassignPanel();
}
use of org.ovirt.engine.ui.common.presenter.CollapsiblePanelPresenterWidget in project ovirt-engine by oVirt.
the class NumaSupportPopupPresenterWidget method populateHostSummary.
private void populateHostSummary() {
CollapsiblePanelPresenterWidget hostSummaryPanel = collapsiblePanelProvider.get();
setInSlot(TYPE_revealHostSummary, hostSummaryPanel);
List<VM> vmsWithVNuma = supportModel.getVmsWithvNumaNodeList();
int totalVNuma = 0;
for (VM vm : vmsWithVNuma) {
totalVNuma += vm.getvNumaNodeList().size();
}
VDS selectedVds = supportModel.getHosts().getSelectedItem();
hostSummaryPanel.getView().setTitleWidget(getView().getHostSummaryTitle(selectedVds.getCpuThreads(), selectedVds.getUsageCpuPercent(), selectedVds.getPhysicalMemMb(), selectedVds.getMemFree().intValue(), supportModel.getNumaNodeList().size(), totalVNuma));
hostSummaryPanel.getView().addContentWidget(getView().getHostSummaryContent(selectedVds, supportModel));
getView().setHostSummaryPanel(hostSummaryPanel);
}
Aggregations