use of org.ovirt.engine.ui.uicommonweb.models.hosts.numa.VNodeModel in project ovirt-engine by oVirt.
the class AssignedVNumaNodesPanel method setNodes.
public void setNodes(Collection<VNodeModel> virtualNodes, int numaNodeIndex, List<VdsNumaNode> numaNodeList) {
String myImageHtml = AbstractImagePrototype.create(resources.vNumaTitleIcon()).getHTML();
SafeHtml mySafeImageHtml = new OnlyToBeUsedInGeneratedCodeStringBlessedAsSafeHtml(myImageHtml);
if (virtualNodes == null) {
virtualNodes = new ArrayList<>();
}
SafeHtml title = titleTemplate.title(virtualNodes.size(), mySafeImageHtml, style.numaTitle());
collapsiblePanel.setTitleWidget(new HTML(title));
scrollPanel.setIndex(numaNodeIndex);
scrollPanel.clear();
for (VNodeModel nodeModel : virtualNodes) {
DraggableVirtualNumaPanel numaNodePanel = virtualNumaPanelProvider.get();
numaNodePanel.setModel(nodeModel, numaNodeList);
scrollPanel.add(numaNodePanel);
}
}
use of org.ovirt.engine.ui.uicommonweb.models.hosts.numa.VNodeModel 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.uicommonweb.models.hosts.numa.VNodeModel in project ovirt-engine by oVirt.
the class HostSummaryContentPanel method setModel.
public void setModel(List<VdsNumaNode> numaNodes, List<VNodeModel> vNodeModels) {
for (VNodeModel vNodeModel : vNodeModels) {
VirtualNumaPanel panel = virtualNumaPanelProvider.get();
panel.setModel(vNodeModel);
vNumaPanel.add(panel);
}
for (VdsNumaNode numaNode : numaNodes) {
numaPanel.add(new HTML(messages.numaNode(numaNode.getIndex())));
}
}
use of org.ovirt.engine.ui.uicommonweb.models.hosts.numa.VNodeModel in project ovirt-engine by oVirt.
the class NumaSupportPopupView method getHostSummaryContent.
@Override
public IsWidget getHostSummaryContent(VDS selectedItem, NumaSupportModel supportModel) {
HostSummaryContentPanel contentPanel = hostSummaryContentProvider.get();
List<VM> vmsWithVNuma = supportModel.getVmsWithvNumaNodeList();
List<VNodeModel> numaNodes = new ArrayList<>();
for (VM vm : vmsWithVNuma) {
for (VmNumaNode vmNumaNode : vm.getvNumaNodeList()) {
numaNodes.add(new VNodeModel(vm, vmNumaNode));
}
}
contentPanel.setModel(supportModel.getNumaNodeList(), numaNodes);
return contentPanel;
}
use of org.ovirt.engine.ui.uicommonweb.models.hosts.numa.VNodeModel in project ovirt-engine by oVirt.
the class UnassignedVNumaNodesPanelView method getNodePanelContent.
@Override
public IsWidget getNodePanelContent(VM vm, List<VNodeModel> virtualNodes, List<VdsNumaNode> numaNodeList) {
DragTargetScrollPanel scrollPanel = getScrollPanel();
scrollPanel.clear();
for (VNodeModel nodeModel : virtualNodes) {
DraggableVirtualNumaPanel numaNodePanel = virtualNumaPanelProvider.get();
numaNodePanel.setModel(nodeModel, numaNodeList);
scrollPanel.add(numaNodePanel);
}
if (virtualNodes.isEmpty()) {
scrollPanel.addStyleName(style.emptyPanel());
}
return scrollPanel;
}
Aggregations