use of org.apache.nutch.webui.model.NutchInstance in project nutch by apache.
the class AbstractBasePage method addInstancesMenuMenu.
protected Component addInstancesMenuMenu() {
IModel<String> instanceName = PropertyModel.of(currentInstance, "name");
DropDownButton instancesMenu = new NavbarDropDownButton(instanceName) {
/**
*/
private static final long serialVersionUID = 1L;
@Override
protected List<AbstractLink> newSubMenuButtons(String buttonMarkupId) {
List<NutchInstance> instances = instanceService.getInstances();
List<AbstractLink> subMenu = Lists.newArrayList();
for (NutchInstance instance : instances) {
subMenu.add(new Link<NutchInstance>(buttonMarkupId, Model.of(instance)) {
/**
*/
private static final long serialVersionUID = 1L;
@Override
public void onClick() {
currentInstance.setObject(getModelObject());
setResponsePage(DashboardPage.class);
}
}.setBody(Model.of(instance.getName())));
}
return subMenu;
}
}.setIconType(FontAwesomeIconType.gears);
return instancesMenu;
}
use of org.apache.nutch.webui.model.NutchInstance in project nutch by apache.
the class InstancesPage method populateInstanceRow.
private void populateInstanceRow(final Item<NutchInstance> item) {
item.add(new AjaxLink<NutchInstance>("editInstance") {
@Override
public void onClick(AjaxRequestTarget target) {
instancePanel.setModel(item.getModel());
target.add(instancePanel);
instancePanel.appendShowDialogJavaScript(target);
}
}.add(new Label("name")));
item.add(new Label("host"));
item.add(new Label("username"));
item.add(createStatusLabel());
item.add(new AjaxLink<NutchInstance>("instanceDelete", item.getModel()) {
@Override
public void onClick(AjaxRequestTarget target) {
instanceService.removeInstance(getModelObject().getId());
target.add(instancesTable);
}
});
}
Aggregations