Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ void init() {
table -> presenter.addSocketBinding(INBOUND)))
.button(mbuiContext.tableButtonFactory().remove(inboundTemplate,
table -> presenter.removeSocketBinding(INBOUND, table.selectedRow().getName())))
.column(NAME, (cell, type, row, meta) -> row.getName())
.nameColumn()
.column(PORT, (cell, type, row, meta) -> row.get(PORT).asString())
.column(new InlineAction<>(Names.CLIENT_MAPPINGS, row -> presenter.showClientMappings(row)))
.build();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@
import static org.jboss.hal.ballroom.LayoutBuilder.row;
import static org.jboss.hal.client.configuration.SystemPropertiesPresenter.ROOT_TEMPLATE;
import static org.jboss.hal.dmr.ModelDescriptionConstants.BOOT_TIME;
import static org.jboss.hal.dmr.ModelDescriptionConstants.NAME;
import static org.jboss.hal.dmr.ModelDescriptionConstants.VALUE;

public class SystemPropertiesView extends HalViewImpl implements SystemPropertiesPresenter.MyView {
Expand Down Expand Up @@ -74,7 +73,7 @@ public SystemPropertiesView(Environment environment, MetadataRegistry metadataRe
.button(tableButtonFactory.remove(Names.SYSTEM_PROPERTY, ROOT_TEMPLATE,
table -> table.selectedRow().getName(),
() -> presenter.reload()))
.column(NAME, (cell, type, row, meta) -> row.getName())
.nameColumn()
.column(VALUE);
if (!environment.isStandalone()) {
tb.column("boot-time");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ void init() {
SessionManagement.HOTROD.template,
table -> table.selectedRow().getName(),
() -> presenter.reload()))
.column("name", (cell, type, row, meta) -> row.getName())
.nameColumn()
.build();
hotRodSessionManagementAffinityElement = new AffinityElement(SessionManagement.HOTROD, mbuiContext.metadataRegistry(),
mbuiContext.resources());
Expand Down Expand Up @@ -197,7 +197,7 @@ void init() {
SessionManagement.INFINISPAN.template,
table -> table.selectedRow().getName(),
() -> presenter.reload()))
.column("name", (cell, type, row, meta) -> row.getName())
.nameColumn()
.build();
infinispanSessionManagementAffinityElement = new AffinityElement(SessionManagement.INFINISPAN,
mbuiContext.metadataRegistry(), mbuiContext.resources());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ private HTMLElement buildServicePanel(String baseId, AddressTemplate template, S

Table<NamedNode> table = new ModelNodeTable.Builder<NamedNode>(Ids.build(baseId, Ids.TABLE),
metadata)
.column(NAME, (cell, t, row, meta) -> row.getName())
.nameColumn()
.button(tableButtonFactory.add(Ids.build(baseId, Ids.ADD), type, template,
(name, address) -> presenter.reload()))
.button(tableButtonFactory.remove(type, template, (api) -> api.selectedRow().getName(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@
import static org.jboss.hal.dmr.ModelDescriptionConstants.DEFAULT_SFSB_CACHE;
import static org.jboss.hal.dmr.ModelDescriptionConstants.DEFAULT_SFSB_PASSIVATION_DISABLED_CACHE;
import static org.jboss.hal.dmr.ModelDescriptionConstants.DEFAULT_SLSB_INSTANCE_POOL;
import static org.jboss.hal.dmr.ModelDescriptionConstants.NAME;
import static org.jboss.hal.dmr.ModelDescriptionConstants.PASSIVATION_STORE;
import static org.jboss.hal.dmr.ModelDescriptionConstants.SERVICE;
import static org.jboss.hal.dmr.ModelDescriptionConstants.TYPE;
Expand Down Expand Up @@ -153,7 +152,7 @@ void init() {
(name, address) -> presenter.reload()))
.button(mbuiContext.tableButtonFactory().remove(Names.APPLICATION_SECURITY_DOMAIN, template,
(api) -> api.selectedRow().getName(), () -> presenter.reload()))
.column(NAME, (cell, type, row, meta) -> row.getName())
.nameColumn()
.build();

appSecurityDomainForm = new ModelNodeForm.Builder<NamedNode>(Ids.EJB3_APPLICATION_SECURITY_DOMAIN_FORM,
Expand Down Expand Up @@ -209,7 +208,7 @@ void init() {
.button(mbuiContext.tableButtonFactory().remove(rpTypeLabel, REMOTING_PROFILE_TEMPLATE,
table -> table.selectedRow().getName(),
() -> presenter.reload()))
.column(NAME, (cell, type, row, meta) -> row.getName())
.nameColumn()
.column(ejbReceiverPage.makeInlineAction(), "20em")
.column(httpConnectionPage.makeInlineAction(), "20em")
.build();
Expand Down Expand Up @@ -261,7 +260,7 @@ void init() {
.button(mbuiContext.tableButtonFactory().remove(RER_CHANNEL_CREATION_OPTIONS_TEMPLATE,
table -> presenter.removeRerChannelCreationOptions(ccoTypeLabel, table.selectedRow().getName(),
selectedRemotingProfile, selectedEjbReceiver)))
.column(NAME, (cell, type, row, meta) -> row.getName())
.nameColumn()
.columns(TYPE, VALUE)
.build();

Expand Down Expand Up @@ -426,7 +425,7 @@ public RemotingProfileSubpage(AddressTemplate template) {
.button(mbuiContext.tableButtonFactory().remove(template,
table -> presenter.removeRemotingProfileChild(label, table.selectedRow().getName(),
selectedRemotingProfile, childType, template)))
.column(NAME, (cell, t, row, meta) -> row.getName())
.nameColumn()
.columns(columnNames);

if (childType.equals(ER_TYPE)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ class HttpAuthenticationFactoryElement implements IsElement<HTMLElement>, Attach
metadata.getTemplate(), (n, a) -> presenter.reloadHttpAuthenticationFactories()))
.button(tableButtonFactory.remove(Names.HTTP_AUTHENTICATION_FACTORY, metadata.getTemplate(),
(table) -> table.selectedRow().getName(), () -> presenter.reloadHttpAuthenticationFactories()))
.column(NAME, (cell, type, row, meta) -> row.getName())
.nameColumn()
.column(new InlineAction<>(Names.MECHANISM_CONFIGURATIONS, this::showMechanismConfiguration), "15em")
.build();
factoryForm = new ModelNodeForm.Builder<NamedNode>(id(FORM), metadata)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ class JdbcRealmElement implements IsElement<HTMLElement>, Attachable, HasPresent
.button(tableButtonFactory.add(metadata.getTemplate(), table -> presenter.addJdbcRealm()))
.button(tableButtonFactory.remove(Names.JDBC_REALM, metadata.getTemplate(),
(table) -> table.selectedRow().getName(), () -> presenter.reloadJdbcRealms()))
.column(NAME, (cell, type, row, meta) -> row.getName())
.nameColumn()
.column(new InlineAction<>(Names.PRINCIPAL_QUERY, this::showPrincipalQuery))
.build();
HTMLElement jdbcRealmSection = section()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ class LdapKeyStoreElement implements IsElement<HTMLElement>, Attachable, HasPres
asList(DIR_CONTEXT, SEARCH_PATH), (n, a) -> presenter.reloadLdapKeyStores()))
.button(tableButtonFactory.remove(Names.LDAP_KEY_STORE, metadata.getTemplate(),
(table) -> table.selectedRow().getName(), () -> presenter.reloadLdapKeyStores()))
.column(NAME, (cell, type, row, meta) -> row.getName())
.nameColumn()
.build();

attributes = new ModelNodeForm.Builder<NamedNode>(id(FORM), metadata)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public class LdapRealmElement implements IsElement<HTMLElement>, Attachable, Has
.button(tableButtonFactory.add(metadata.getTemplate(), table -> presenter.addLdapRealm()))
.button(tableButtonFactory.remove(Names.LDAP_REALM, metadata.getTemplate(),
(table) -> table.selectedRow().getName(), () -> presenter.reloadLdapRealms()))
.column(NAME, (cell, type, row, meta) -> row.getName())
.nameColumn()
.column(new InlineAction<>(Names.IDENTITY_ATTRIBUTE_MAPPING, this::showIdentityAttributeMapping),
"15em")
.build();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@
import static org.jboss.hal.dmr.ModelDescriptionConstants.FROM;
import static org.jboss.hal.dmr.ModelDescriptionConstants.MAPPED_ROLE_MAPPER;
import static org.jboss.hal.dmr.ModelDescriptionConstants.MODULE;
import static org.jboss.hal.dmr.ModelDescriptionConstants.NAME;
import static org.jboss.hal.dmr.ModelDescriptionConstants.PERMISSIONS;
import static org.jboss.hal.dmr.ModelDescriptionConstants.ROLE_MAP;
import static org.jboss.hal.dmr.ModelDescriptionConstants.TABLE;
Expand Down Expand Up @@ -123,7 +122,7 @@ void init() {
Metadata metadata = mbuiContext.metadataRegistry().lookup(CONSTANT_PERMISSION_MAPPER_TEMPLATE);
constantPermissionMapperElement = new ResourceElement.Builder(Ids.ELYTRON_CONSTANT_PERMISSION_MAPPER,
CONSTANT_PERMISSION_MAPPER, metadata, mbuiContext)
.column(NAME, (cell, type, row, meta) -> row.getName())
.nameColumn()
.setComplexListAttribute(PERMISSIONS, asList(CLASS_NAME, MODULE), asList(CLASS_NAME, MODULE),
modelNode -> build(modelNode.get(CLASS_NAME).asString(), modelNode.get(MODULE).asString()))
.onCrud(() -> presenter.reload(CONSTANT_PERMISSION_MAPPER, this::updateConstantPermissionMapper))
Expand All @@ -148,7 +147,7 @@ void init() {
.button(mbuiContext.tableButtonFactory().remove(title, MAPPED_ROLE_MAPPER_TEMPLATE,
table -> table.selectedRow().getName(),
() -> presenter.reload()))
.column(NAME, (cell, type, row, meta) -> row.getName())
.nameColumn()
.build();

mappedRoleMapperForm = new ModelNodeForm.Builder<NamedNode>(build(mappedId, FORM), mappedMetadata)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ class SaslAuthenticationFactoryElement implements IsElement<HTMLElement>, Attach
metadata.getTemplate(), (n, a) -> presenter.reloadSaslAuthenticationFactories()))
.button(tableButtonFactory.remove(Names.SASL_AUTHENTICATION_FACTORY, metadata.getTemplate(),
(table) -> table.selectedRow().getName(), () -> presenter.reloadSaslAuthenticationFactories()))
.column(NAME, (cell, type, row, meta) -> row.getName())
.nameColumn()
.column(new InlineAction<>(Names.MECHANISM_CONFIGURATIONS, this::showMechanismConfiguration), "15em")
.build();
factoryForm = new ModelNodeForm.Builder<NamedNode>(id(FORM), metadata)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public class SimplePermissionMapperElement
SIMPLE_PERMISSION_MAPPER_TEMPLATE, (name, address) -> presenter.reloadSimplePermissionMapper()))
.button(tableButtonFactory.remove(Names.SIMPLE_PERMISSION_MAPPER, metadata.getTemplate(),
(table) -> table.selectedRow().getName(), () -> presenter.reloadSimplePermissionMapper()))
.column(NAME, (cell, type, row, meta) -> row.getName())
.nameColumn()
.column(new InlineAction<>(Names.PERMISSION_MAPPINGS, this::showPermissionMappings), "15em")
.build();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ private void initBackups(CacheType cacheType, MetadataRegistry metadataRegistry,
.button(tableButtonFactory.add(backupTemplate, table -> presenter.addBackup()))
.button(tableButtonFactory.remove(backupTemplate,
table -> presenter.removeBackup(table.selectedRow().getName())))
.column(NAME, (cell, type, row, meta) -> row.getName())
.nameColumn()
.build();

backupForm = new ModelNodeForm.Builder<NamedNode>(Ids.build(cacheType.baseId, BACKUPS, Ids.FORM),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ public RemoteCacheContainerView(MetadataRegistry metadataRegistry, TableButtonFa
.button(tableButtonFactory.add(REMOTE_CLUSTER_TEMPLATE, table -> presenter.addRemoteCluster()))
.button(tableButtonFactory.remove(REMOTE_CLUSTER_TEMPLATE,
table -> presenter.removeRemoteCluster(table.selectedRow().getName())))
.column(resources.constants().name(), (cell, type, row, meta) -> row.getName())
.nameColumn()
.column(Names.SOCKET_BINDINGS, (cell, type, row, meta) -> {
ModelNode socketBindings = row.get(SOCKET_BINDINGS);
if (socketBindings.isDefined()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ class ThreadPoolsEditor implements IsElement<HTMLElement>, Attachable, HasPresen
.button(tableButtonFactory.remove(WORKMANAGER_LRT_TEMPLATE,
table -> presenter.removeThreadPool(workmanagerTemplate, workmanager,
table.selectedRow())))
.column(NAME, (cell, type, row, meta) -> row.getName())
.nameColumn()
.column(resources.constants().type(), (cell, type, row, meta) -> row.getRunningMode())
.column(MAX_THREADS)
.build();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ interface AddressTemplates {
String SELECTED_CHANNEL_FORK_ADDRESS = JGROUPS_ADDRESS + "/channel={selected.channel}/fork=*";
String SELECTED_CHANNEL_FORK_PROTOCOL_ADDRESS = JGROUPS_ADDRESS
+ "/channel={selected.channel}/fork={selected.fork}/protocol=*";
String AUTH_TOKEN_ADDRESS = JGROUPS_ADDRESS + "/stack=*/protocol=AUTH/token=*";
String SELECTED_AUTH_TOKEN_ADDRESS = JGROUPS_ADDRESS + "/stack={selected.stack}/protocol=AUTH/token=*";

AddressTemplate JGROUPS_TEMPLATE = AddressTemplate.of(JGROUPS_ADDRESS);
AddressTemplate STACK_TEMPLATE = AddressTemplate.of(STACK_ADDRESS);
Expand All @@ -64,5 +66,7 @@ interface AddressTemplates {
AddressTemplate CHANNEL_FORK_PROTOCOL_TEMPLATE = AddressTemplate.of(CHANNEL_FORK_PROTOCOL_ADDRESS);
AddressTemplate SELECTED_CHANNEL_FORK_PROTOCOL_TEMPLATE = AddressTemplate.of(
SELECTED_CHANNEL_FORK_PROTOCOL_ADDRESS);
AddressTemplate AUTH_TOKEN_TEMPLATE = AddressTemplate.of(AUTH_TOKEN_ADDRESS);
AddressTemplate SELECTED_AUTH_TOKEN_TEMPLATE = AddressTemplate.of(SELECTED_AUTH_TOKEN_ADDRESS);

}
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@
import static org.jboss.hal.client.configuration.subsystem.jgroups.AddressTemplates.CHANNEL_FORK_PROTOCOL_TEMPLATE;
import static org.jboss.hal.client.configuration.subsystem.jgroups.AddressTemplates.CHANNEL_TEMPLATE;
import static org.jboss.hal.client.configuration.subsystem.jgroups.AddressTemplates.SELECTED_CHANNEL_FORK_PROTOCOL_TEMPLATE;
import static org.jboss.hal.dmr.ModelDescriptionConstants.NAME;

/** Element to configure the fork resource */
class ChannelElement implements IsElement<HTMLElement>, Attachable, HasPresenter<JGroupsPresenter> {
Expand Down Expand Up @@ -72,7 +71,7 @@ class ChannelElement implements IsElement<HTMLElement>, Attachable, HasPresenter
.button(tableButtonFactory.remove(CHANNEL_TEMPLATE,
table -> presenter.removeResource(CHANNEL_TEMPLATE, table.selectedRow().getName(),
Names.CHANNEL)))
.column(NAME, (cell, type, row, meta) -> row.getName())
.nameColumn()
.column(new InlineAction<>(Names.FORK, row -> {
selectedChannel = row.getName();
presenter.showForks(row);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
/*
* Copyright 2022 Red Hat
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jboss.hal.client.configuration.subsystem.jgroups;

import java.util.Set;

import org.jboss.elemento.InputType;
import org.jboss.hal.ballroom.wizard.WizardStep;
import org.jboss.hal.resources.Ids;
import org.jboss.hal.resources.Resources;
import org.jboss.hal.resources.UIConstants;

import elemental2.dom.HTMLElement;

import static org.jboss.elemento.Elements.div;
import static org.jboss.elemento.Elements.input;
import static org.jboss.elemento.Elements.label;
import static org.jboss.elemento.Elements.p;
import static org.jboss.elemento.Elements.span;
import static org.jboss.elemento.EventType.click;
import static org.jboss.hal.dmr.ModelDescriptionConstants.CUSTOM;
import static org.jboss.hal.resources.CSS.radio;

class ChooseProtocolStep extends WizardStep<ProtocolWizard.Context, ProtocolWizard.State> {

private final HTMLElement root;

ChooseProtocolStep(Resources resources, Set<String> protocolNames, ProtocolWizard wizard) {
super(resources.constants().chooseProtocol());
root = div()
.add(p().textContent(resources.messages().chooseProtocol(CUSTOM))).element();

for (String protocolName : protocolNames) {
String name = protocolName;
if (name.equals("*")) {
name = CUSTOM;
}
root.appendChild(div().css(radio)
.add(label()
.add(input(InputType.radio)
.id(Ids.build(Ids.JGROUPS_PROTOCOL, name))
.attr(UIConstants.NAME, Ids.JGROUPS_PROTOCOL)
.on(click, e -> wizard.setProtocol(protocolName)).element())
.add(span().textContent(name)))
.element());
}
}

@Override
public HTMLElement element() {
return root;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@
import static org.jboss.hal.client.configuration.subsystem.jgroups.AddressTemplates.CHANNEL_FORK_TEMPLATE;
import static org.jboss.hal.client.configuration.subsystem.jgroups.AddressTemplates.SELECTED_CHANNEL_FORK_TEMPLATE;
import static org.jboss.hal.client.configuration.subsystem.jgroups.ChannelElement.PROTOCOL_ID;
import static org.jboss.hal.dmr.ModelDescriptionConstants.NAME;

public class ForkElement implements IsElement<HTMLElement>, Attachable, HasPresenter<JGroupsPresenter> {

Expand All @@ -66,7 +65,7 @@ public class ForkElement implements IsElement<HTMLElement>, Attachable, HasPrese
.button(tableButtonFactory.remove(CHANNEL_FORK_TEMPLATE,
table -> presenter.removeResource(SELECTED_CHANNEL_FORK_TEMPLATE,
table.selectedRow().getName(), Names.FORK)))
.column(NAME, (cell, t, row, meta) -> row.getName())
.nameColumn()
.column(new InlineAction<>(Names.PROTOCOL, row -> {
presenter.showChannelProtocol(row);
presenter.showChannelInnerPage(PROTOCOL_ID);
Expand Down
Loading