Search in sources :

Example 21 with AddressTemplate

use of org.jboss.hal.meta.AddressTemplate in project console by hal.

the class ModclusterPresenter method prepareResetCustomLoadMetric.

public void prepareResetCustomLoadMetric(Form<NamedNode> form) {
    AddressTemplate template = CUSTOM_LOAD_METRIC_TEMPLATE.replaceWildcards(proxyName);
    Metadata metadata = metadataRegistry.lookup(CUSTOM_LOAD_METRIC_TEMPLATE);
    crud.reset(Names.CUSTOM_LOAD_METRIC, form.getModel().getName(), template, form, metadata, this::reload);
}
Also used : AddressTemplate(org.jboss.hal.meta.AddressTemplate) Metadata(org.jboss.hal.meta.Metadata)

Example 22 with AddressTemplate

use of org.jboss.hal.meta.AddressTemplate in project console by hal.

the class ModclusterPresenter method addCustomLoadMetric.

// =================== custom load metric
public void addCustomLoadMetric() {
    String id = Ids.build(CUSTOM_LOAD_METRIC, FORM, ADD);
    AddressTemplate template = CUSTOM_LOAD_METRIC_TEMPLATE.replaceWildcards(proxyName);
    crud.add(id, Names.CUSTOM_LOAD_METRIC, template, (name, address) -> reload());
}
Also used : AddressTemplate(org.jboss.hal.meta.AddressTemplate)

Example 23 with AddressTemplate

use of org.jboss.hal.meta.AddressTemplate in project console by hal.

the class RemoteActiveMQView method setPresenter.

@Override
public void setPresenter(RemoteActiveMQPresenter presenter) {
    super.setPresenter(presenter);
    // register the suggestion handlers here rather than in a @PostConstruct method
    // they need a valid presenter reference!
    List<AddressTemplate> connectors = asList(CONNECTOR_REMOTE_TEMPLATE, IN_VM_CONNECTOR_REMOTE_TEMPLATE, HTTP_CONNECTOR_REMOTE_TEMPLATE, REMOTE_CONNECTOR_REMOTE_TEMPLATE);
    connectionFactoryForm.getFormItem(CONNECTORS).registerSuggestHandler(new ReadChildrenAutoComplete(mbuiContext.dispatcher(), presenter.statementContext, connectors));
    connectionFactoryForm.getFormItem(DISCOVERY_GROUP).registerSuggestHandler(new ReadChildrenAutoComplete(mbuiContext.dispatcher(), presenter.statementContext, DISCOVERY_GROUP_REMOTE_TEMPLATE));
    pooledConnectionFactoryForm.getFormItem(CONNECTORS).registerSuggestHandler(new ReadChildrenAutoComplete(mbuiContext.dispatcher(), presenter.statementContext, connectors));
    pooledConnectionFactoryForm.getFormItem(DISCOVERY_GROUP).registerSuggestHandler(new ReadChildrenAutoComplete(mbuiContext.dispatcher(), presenter.statementContext, DISCOVERY_GROUP_REMOTE_TEMPLATE));
    connectorForm.getFormItem(SOCKET_BINDING).registerSuggestHandler(new ReadChildrenAutoComplete(mbuiContext.dispatcher(), statementContext(), SOCKET_BINDING_TEMPLATE));
    discoveryGroupForm.getFormItem(SOCKET_BINDING).registerSuggestHandler(new ReadChildrenAutoComplete(mbuiContext.dispatcher(), statementContext(), SOCKET_BINDING_TEMPLATE));
    remoteConnectorForm.getFormItem(SOCKET_BINDING).registerSuggestHandler(new ReadChildrenAutoComplete(mbuiContext.dispatcher(), statementContext(), SOCKET_BINDING_TEMPLATE));
    httpConnectorForm.getFormItem(SOCKET_BINDING).registerSuggestHandler(new ReadChildrenAutoComplete(mbuiContext.dispatcher(), statementContext(), SOCKET_BINDING_TEMPLATE));
}
Also used : AddressTemplate(org.jboss.hal.meta.AddressTemplate) ReadChildrenAutoComplete(org.jboss.hal.ballroom.autocomplete.ReadChildrenAutoComplete)

Example 24 with AddressTemplate

use of org.jboss.hal.meta.AddressTemplate in project console by hal.

the class ModclusterPresenter method saveLoadMetric.

public void saveLoadMetric(Form<NamedNode> form, Map<String, Object> changedValues) {
    AddressTemplate template = LOAD_METRIC_TEMPLATE.replaceWildcards(proxyName);
    crud.save(Names.LOAD_METRIC, form.getModel().getName(), template, changedValues, this::reload);
}
Also used : AddressTemplate(org.jboss.hal.meta.AddressTemplate)

Example 25 with AddressTemplate

use of org.jboss.hal.meta.AddressTemplate in project console by hal.

the class ModclusterPresenter method addLoadProviderSimple.

public void addLoadProviderSimple() {
    String id = Ids.build("load-provider-simple", FORM, ADD);
    AddressTemplate template = LOAD_PROVIDER_SIMPLE_TEMPLATE.replaceWildcards(proxyName);
    crud.addSingleton(id, Names.LOAD_PROVIDER_SIMPLE, template, address -> reload());
}
Also used : AddressTemplate(org.jboss.hal.meta.AddressTemplate)

Aggregations

AddressTemplate (org.jboss.hal.meta.AddressTemplate)90 Metadata (org.jboss.hal.meta.Metadata)43 ModelNode (org.jboss.hal.dmr.ModelNode)41 ResourceAddress (org.jboss.hal.dmr.ResourceAddress)36 ModelNodeForm (org.jboss.hal.core.mbui.form.ModelNodeForm)35 AddResourceDialog (org.jboss.hal.core.mbui.dialog.AddResourceDialog)29 Operation (org.jboss.hal.dmr.Operation)29 Form (org.jboss.hal.ballroom.form.Form)27 Ids (org.jboss.hal.resources.Ids)27 Names (org.jboss.hal.resources.Names)26 List (java.util.List)24 ModelDescriptionConstants (org.jboss.hal.dmr.ModelDescriptionConstants)24 Resources (org.jboss.hal.resources.Resources)24 HTMLElement (elemental2.dom.HTMLElement)22 LabelBuilder (org.jboss.hal.ballroom.LabelBuilder)22 StatementContext (org.jboss.hal.meta.StatementContext)21 EventBus (com.google.web.bindery.event.shared.EventBus)20 Inject (javax.inject.Inject)20 Dispatcher (org.jboss.hal.dmr.dispatch.Dispatcher)20 NamedNode (org.jboss.hal.dmr.NamedNode)19