Search in sources :

Example 1 with VNodeModel

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);
    }
}
Also used : VNodeModel(org.ovirt.engine.ui.uicommonweb.models.hosts.numa.VNodeModel) OnlyToBeUsedInGeneratedCodeStringBlessedAsSafeHtml(com.google.gwt.safehtml.shared.OnlyToBeUsedInGeneratedCodeStringBlessedAsSafeHtml) SafeHtml(com.google.gwt.safehtml.shared.SafeHtml) OnlyToBeUsedInGeneratedCodeStringBlessedAsSafeHtml(com.google.gwt.safehtml.shared.OnlyToBeUsedInGeneratedCodeStringBlessedAsSafeHtml) HTML(com.google.gwt.user.client.ui.HTML)

Example 2 with VNodeModel

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();
}
Also used : VNodeModel(org.ovirt.engine.ui.uicommonweb.models.hosts.numa.VNodeModel) HashMap(java.util.HashMap) VM(org.ovirt.engine.core.common.businessentities.VM) ArrayList(java.util.ArrayList) ArrayList(java.util.ArrayList) List(java.util.List) CollapsiblePanelPresenterWidget(org.ovirt.engine.ui.common.presenter.CollapsiblePanelPresenterWidget) HashMap(java.util.HashMap) Map(java.util.Map)

Example 3 with VNodeModel

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())));
    }
}
Also used : VNodeModel(org.ovirt.engine.ui.uicommonweb.models.hosts.numa.VNodeModel) VdsNumaNode(org.ovirt.engine.core.common.businessentities.VdsNumaNode) HTML(com.google.gwt.user.client.ui.HTML)

Example 4 with VNodeModel

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;
}
Also used : VNodeModel(org.ovirt.engine.ui.uicommonweb.models.hosts.numa.VNodeModel) VmNumaNode(org.ovirt.engine.core.common.businessentities.VmNumaNode) VM(org.ovirt.engine.core.common.businessentities.VM) ArrayList(java.util.ArrayList)

Example 5 with VNodeModel

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;
}
Also used : VNodeModel(org.ovirt.engine.ui.uicommonweb.models.hosts.numa.VNodeModel)

Aggregations

VNodeModel (org.ovirt.engine.ui.uicommonweb.models.hosts.numa.VNodeModel)5 HTML (com.google.gwt.user.client.ui.HTML)2 ArrayList (java.util.ArrayList)2 VM (org.ovirt.engine.core.common.businessentities.VM)2 OnlyToBeUsedInGeneratedCodeStringBlessedAsSafeHtml (com.google.gwt.safehtml.shared.OnlyToBeUsedInGeneratedCodeStringBlessedAsSafeHtml)1 SafeHtml (com.google.gwt.safehtml.shared.SafeHtml)1 HashMap (java.util.HashMap)1 List (java.util.List)1 Map (java.util.Map)1 VdsNumaNode (org.ovirt.engine.core.common.businessentities.VdsNumaNode)1 VmNumaNode (org.ovirt.engine.core.common.businessentities.VmNumaNode)1 CollapsiblePanelPresenterWidget (org.ovirt.engine.ui.common.presenter.CollapsiblePanelPresenterWidget)1