Search in sources :

Example 1 with CollapsiblePanelPresenterWidget

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();
}
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 2 with CollapsiblePanelPresenterWidget

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);
}
Also used : VDS(org.ovirt.engine.core.common.businessentities.VDS) VM(org.ovirt.engine.core.common.businessentities.VM) CollapsiblePanelPresenterWidget(org.ovirt.engine.ui.common.presenter.CollapsiblePanelPresenterWidget)

Aggregations

VM (org.ovirt.engine.core.common.businessentities.VM)2 CollapsiblePanelPresenterWidget (org.ovirt.engine.ui.common.presenter.CollapsiblePanelPresenterWidget)2 ArrayList (java.util.ArrayList)1 HashMap (java.util.HashMap)1 List (java.util.List)1 Map (java.util.Map)1 VDS (org.ovirt.engine.core.common.businessentities.VDS)1 VNodeModel (org.ovirt.engine.ui.uicommonweb.models.hosts.numa.VNodeModel)1