use of org.ovirt.engine.ui.uicommonweb.models.hosts.HostInterface in project ovirt-engine by oVirt.
the class HostNetworkInterfaceBondedListViewItem method createSlavesAdditionalInfo.
private IsWidget createSlavesAdditionalInfo() {
FlowPanel panel = new FlowPanel();
List<HostInterface> slaves = getEntity().getInterfaces();
slavesExpand = new ExpandableListViewItem(SafeHtmlUtils.fromString(messages.slaves(slaves.size())));
getClickHandlerRegistrations().add(slavesExpand.addClickHandler(this));
panel.add(slavesExpand);
return panel;
}
use of org.ovirt.engine.ui.uicommonweb.models.hosts.HostInterface in project ovirt-engine by oVirt.
the class HostNetworkInterfaceBondedListViewItem method createSlavesContainer.
private Container createSlavesContainer() {
Row content = new Row();
Column gridColumn = new Column(ColumnSize.SM_12);
content.add(gridColumn);
Container container = createItemContainerPanel(content);
CellTable<HostInterface> slavesTable = new CellTable<>(MAX_SLAVES, (Resources) GWT.create(CellTablePopupTableResources.class));
slavesTable.getElement().addClassName(Styles.TABLE);
slavesTable.getElement().addClassName(PatternflyConstants.PF_TABLE_STRIPED);
slavesTable.getElement().addClassName(PatternflyConstants.PF_TABLE_BORDERED);
ListDataProvider<HostInterface> logicalNetworkDataProvider = new ListDataProvider<>();
logicalNetworkDataProvider.addDataDisplay(slavesTable);
logicalNetworkDataProvider.setList(getEntity().getInterfaces());
// Setup columns
TextColumn<HostInterface> name = new TextColumn<HostInterface>() {
@Override
public String getValue(HostInterface hostInterface) {
return hostInterface.getName();
}
};
slavesTable.addColumn(name, constants.macInterface());
TextColumn<HostInterface> macAddress = new TextColumn<HostInterface>() {
@Override
public String getValue(HostInterface hostInterface) {
return hostInterface.getInterface().getMacAddress() != null ? hostInterface.getInterface().getMacAddress() : constants.unAvailablePropertyLabel();
}
};
slavesTable.addColumn(macAddress, constants.macInterface());
TextColumn<HostInterface> speed = new TextColumn<HostInterface>() {
@Override
public String getValue(HostInterface hostInterface) {
return hostInterface.getInterface().hasSpeed() ? String.valueOf(hostInterface.getInterface().getSpeed()) : constants.unAvailablePropertyLabel();
}
};
slavesTable.addColumn(speed, constants.speedInterface());
TextColumn<HostInterface> rxRate = new TextColumn<HostInterface>() {
@Override
public String getValue(HostInterface hostInterface) {
return rateRenderer.render(new Double[] { hostInterface.getRxRate(), hostInterface.getSpeed().doubleValue() });
}
};
slavesTable.addColumn(rxRate, templates.sub(constants.rxRate(), constants.mbps()));
TextColumn<HostInterface> txRate = new TextColumn<HostInterface>() {
@Override
public String getValue(HostInterface hostInterface) {
return rateRenderer.render(new Double[] { hostInterface.getTxRate(), hostInterface.getSpeed().doubleValue() });
}
};
slavesTable.addColumn(txRate, templates.sub(constants.txRate(), constants.mbps()));
TextColumn<HostInterface> rxTotal = new TextColumn<HostInterface>() {
@Override
public String getValue(HostInterface hostInterface) {
return totalRenderer.render(hostInterface.getRxTotal());
}
};
slavesTable.addColumn(rxTotal, templates.sub(constants.rxTotal(), constants.mbps()));
TextColumn<HostInterface> txTotal = new TextColumn<HostInterface>() {
@Override
public String getValue(HostInterface hostInterface) {
return totalRenderer.render(hostInterface.getTxTotal());
}
};
slavesTable.addColumn(txTotal, templates.sub(constants.txTotal(), constants.mbps()));
TextColumn<HostInterface> dropRate = new TextColumn<HostInterface>() {
@Override
public String getValue(HostInterface hostInterface) {
return String.valueOf(hostInterface.getRxDrop() + hostInterface.getTxDrop());
}
};
slavesTable.addColumn(dropRate, templates.sub(constants.dropsInterface(), constants.pkts()));
gridColumn.add(slavesTable);
return container;
}
use of org.ovirt.engine.ui.uicommonweb.models.hosts.HostInterface in project ovirt-engine by oVirt.
the class HostNetworkInterfaceBondedListViewItem method createActiveBondTooltipMessage.
private String createActiveBondTooltipMessage(Bond bond, HostInterfaceLineModel lineModel) {
List<String> bondProperties = new ArrayList<>();
String adPartnerMac = Objects.toString(bond.getAdPartnerMac(), "");
bondProperties.add(messages.bondAdPartnerMac(adPartnerMac));
String adAggregatorId = Objects.toString(bond.getAdAggregatorId(), "");
bondProperties.add(messages.bondAdAggregatorId(adAggregatorId));
for (HostInterface nic : lineModel.getInterfaces()) {
String nicName = nic.getName();
String nicAggregatorId = Objects.toString(nic.getInterface().getAdAggregatorId(), "");
bondProperties.add(messages.bondSlaveAdAggregatorId(nicName, nicAggregatorId));
}
// $NON-NLS-1$
return String.join("\n", bondProperties);
}
Aggregations