Skip to content

Commit

Permalink
PAYARA-2335 UX Issue on Data Grid Admin console (#2376)
Browse files Browse the repository at this point in the history
  • Loading branch information
MeroRai authored and smillidge committed Feb 13, 2018
1 parent 1a16703 commit 36dc30b
Show file tree
Hide file tree
Showing 2 changed files with 152 additions and 19 deletions.
@@ -0,0 +1,79 @@
/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
*
* Copyright (c) 2018 Payara Foundation and/or its affiliates. All rights reserved.
*
* The contents of this file are subject to the terms of either the GNU
* General Public License Version 2 only ("GPL") or the Common Development
* and Distribution License("CDDL") (collectively, the "License"). You
* may not use this file except in compliance with the License. You can
* obtain a copy of the License at
* https://github.com/payara/Payara/blob/master/LICENSE.txt
* See the License for the specific
* language governing permissions and limitations under the License.
*
* When distributing the software, include this License Header Notice in each
* file and include the License file at glassfish/legal/LICENSE.txt.
*
* GPL Classpath Exception:
* The Payara Foundation designates this particular file as subject to the "Classpath"
* exception as provided by the Payara Foundation in the GPL Version 2 section of the License
* file that accompanied this code.
*
* Modifications:
* If applicable, add the following below the License Header, with the fields
* enclosed by brackets [] replaced by your own identifying information:
* "Portions Copyright [year] [name of copyright owner]"
*
* Contributor(s):
* If you wish your version of this file to be governed by only the CDDL or
* only the GPL Version 2, indicate your decision by adding "[Contributor]
* elects to include this software in this distribution under the [CDDL or GPL
* Version 2] license." If you don't indicate a single choice of license, a
* recipient has the option to distribute your version of this file under
* either the CDDL, the GPL Version 2 or to extend the choice of license to
* its licensees as provided above. However, if you add GPL Version 2 code
* and therefore, elected the GPL Version 2 license, then the option applies
* only if the new code is made subject to such option by the copyright
* holder.
*/

<f:verbatim>
<script type="text/javascript">
updateClusterDiscoveryMode("#{pageSession.valueMap['clusterMode']}");

function updateClusterDiscoveryMode(selected) {
var multicastPortComponent = document.getElementById("#{pageSession.multicastPortTextId}");
var multicastGroupComponent = document.getElementById("#{pageSession.multicastGroupTextId}");
var tcpipMembersComponent = document.getElementById("#{pageSession.tcpipMembersTextId}");

var multicastPortProperty = document.getElementById("propertyForm:propertySheet:discovery:multicastPortProp");
var multicastGroupProperty = document.getElementById("propertyForm:propertySheet:discovery:multicastGroupProp");
var tcpipMembersProperty = document.getElementById("propertyForm:propertySheet:discovery:tcpipMembersProp");

if (selected === "tcpip") {
multicastPortProperty.style.display = "none";
multicastGroupProperty.style.display = "none";
tcpipMembersProperty.style.display = "table-row";
multicastPortComponent.value = "";
multicastGroupComponent.value = "";
tcpipMembersComponent.value = "#{pageSession.valueMap['tcpipMembers']}";
} else if (selected === "domain") {
multicastPortProperty.style.display = "none";
multicastGroupProperty.style.display = "none";
tcpipMembersProperty.style.display = "none";
multicastPortComponent.value = "";
multicastGroupComponent.value = "";
tcpipMembersComponent.value = "";
} else {
multicastPortProperty.style.display = "table-row";
multicastGroupProperty.style.display = "table-row";
tcpipMembersProperty.style.display = "none";
multicastPortComponent.value = "#{pageSession.valueMap['multicastPort']}";
multicastGroupComponent.value = "#{pageSession.valueMap['multicastGroup']}";
tcpipMembersComponent.value = "";
}
}
</script>
</f:verbatim>

@@ -1,20 +1,44 @@
<!--

DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.

Copyright (c) [2016-2018] Payara Foundation and/or its affiliates. All rights reserved.

The contents of this file are subject to the terms of either the GNU
General Public License Version 2 only ("GPL") or the Common Development
and Distribution License("CDDL") (collectively, the "License"). You
may not use this file except in compliance with the License. You can
obtain a copy of the License at
https://github.com/payara/Payara/blob/master/LICENSE.txt
See the License for the specific
language governing permissions and limitations under the License.

When distributing the software, include this License Header Notice in each
file and include the License file at glassfish/legal/LICENSE.txt.

GPL Classpath Exception:
The Payara Foundation designates this particular file as subject to the "Classpath"
exception as provided by the Payara Foundation in the GPL Version 2 section of the License
file that accompanied this code.

Modifications:
If applicable, add the following below the License Header, with the fields
enclosed by brackets [] replaced by your own identifying information:
"Portions Copyright [year] [name of copyright owner]"

Contributor(s):
If you wish your version of this file to be governed by only the CDDL or
only the GPL Version 2, indicate your decision by adding "[Contributor]
elects to include this software in this distribution under the [CDDL or GPL
Version 2] license." If you don't indicate a single choice of license, a
recipient has the option to distribute your version of this file under
either the CDDL, the GPL Version 2 or to extend the choice of license to
its licensees as provided above. However, if you add GPL Version 2 code
and therefore, elected the GPL Version 2 license, then the option applies
only if the new code is made subject to such option by the copyright
holder.

Copyright (c) 2016 Payara Foundation and/or its affiliatess.
All rights reserved.

The contents of this file are subject to the terms of the Common Development
and Distribution License("CDDL") (collectively, the "License"). You
may not use this file except in compliance with the License. You can
obtain a copy of the License at
https://glassfish.dev.java.net/public/CDDL+GPL_1_1.html
or packager/legal/LICENSE.txt. See the License for the specific
language governing permissions and limitations under the License.

When distributing the software, include this License Header Notice in each
file and include the License file at packager/legal/LICENSE.txt.
-->

<!initPage
Expand All @@ -38,9 +62,10 @@
setPageSessionAttribute(key="dynamic", value="false");
setPageSessionAttribute(key="clusterMode", value="#{pageSession.valueMap['clusterMode']}");
mapPut(map="#{pageSession.valueMap}" key="target" value="domain");
setAttribute(key="zero" value="$int{0}");
/>
</event>

#include"/hazelcast/hazelcast.js"
<sun:form id="propertyForm">
#include "/common/shared/alertMsg_1.inc"
#include "/hazelcast/hazelcastTabs.inc"
Expand All @@ -54,6 +79,23 @@
mapPut(map="#{pageSession.valueMap}" key="dynamic" value="#{pageSession.dynamic}");
mapPut(map="#{pageSession.valueMap}" key="clusterMode" value="#{pageSession.clusterMode}");
prepareSuccessfulMsg();

setPageSessionAttribute(key="isMulticastPortEmpty", value="#{empty pageSession.valueMap['multicastPort']}");
setPageSessionAttribute(key="isMulticastGroupEmpty", value="#{empty pageSession.valueMap['multicastGroup']}");
setPageSessionAttribute(key="isTcpipMembersEmpty", value="#{empty pageSession.valueMap['tcpipMembers']}");

if ('#{pageSession.isMulticastPortEmpty} = true') {
mapRemove(map="#{pageSession.valueMap}" key="multicastPort");
}

if ('#{pageSession.isMulticastGroupEmpty} = true') {
mapRemove(map="#{pageSession.valueMap}" key="multicastGroup");
}

if ('#{pageSession.isTcpipMembersEmpty} = true') {
mapRemove(map="#{pageSession.valueMap}" key="tcpipMembers");
}

gf.updateEntity(endpoint="#{sessionScope.REST_URL}/set-hazelcast-configuration" attrs="#{pageSession.valueMap}" convertToFalse="#{pageSession.convertToFalseList}");
/>
</sun:button>
Expand Down Expand Up @@ -100,20 +142,32 @@
</sun:propertySheetSection>
<sun:propertySheetSection id="discovery">
<sun:property id="discoveryModeProp" labelAlign="left" noWrap="#{true}" overlapLabel="#{false}" label="$resource{i18nhc.hazelcast.configuration.discoveryMode}" helpText="$resource{i18nhc.hazelcast.configuration.discoveryModeHelp}" visible="#{true}" >
<sun:dropDown id="clusterMode" selected="#{pageSession.clusterMode}" required="#{false}" value="#{pageSession.clusterMode}" labels={"domain","tcpip","multicast"} values={"domain","tcpip","multicast"} >
<sun:dropDown id="clusterMode" value="#{pageSession.clusterMode}" labels={"domain","tcpip","multicast"} values={"domain","tcpip","multicast"} selected="#{pageSession.clusterMode}" required="#{false}" onChange="updateClusterDiscoveryMode(this.value);">
</sun:dropDown>
</sun:property>
<sun:property id="multicastPortProp" labelAlign="left" noWrap="#{true}" overlapLabel="#{false}" label="$resource{i18nhc.hazelcast.configuration.multicastPort}" helpText="$resource{i18nhc.hazelcast.configuration.multicastPortHelp}">
<sun:textField id="multicastPort" styleClass="integer" columns="$int{40}" maxLength="30" text="#{pageSession.valueMap['multicastPort']}" />
<sun:textField id="multicastPort" styleClass="integer" columns="$int{40}" maxLength="30" text="#{pageSession.valueMap['multicastPort']}">
<!afterCreate
getClientId(component="$this{component}" clientId=>$page{multicastPortTextId});
/>
</sun:textField>
</sun:property>
<sun:property id="multicastGroupProp" labelAlign="left" noWrap="#{true}" overlapLabel="#{false}" label="$resource{i18nhc.hazelcast.configuration.multicastGroup}" helpText="$resource{i18nhc.hazelcast.configuration.multicastGroupHelp}">
<sun:textField id="multicastGroup" columns="$int{40}" maxLength="30" text="#{pageSession.valueMap['multicastGroup']}" />
<sun:textField id="multicastGroup" columns="$int{40}" maxLength="30" text="#{pageSession.valueMap['multicastGroup']}">
<!afterCreate
getClientId(component="$this{component}" clientId=>$page{multicastGroupTextId});
/>
</sun:textField>
</sun:property>
<sun:property id="tcpipMembersProp" labelAlign="left" noWrap="#{true}" overlapLabel="#{false}" label="$resource{i18nhc.hazelcast.configuration.tcpipMembers}" helpText="$resource{i18nhc.hazelcast.configuration.tcpipMembersHelp}">
<sun:textField id="tcpipMembers" columns="$int{40}" maxLength="300" text="#{pageSession.valueMap['tcpipMembers']}" />
<sun:textField id="tcpipMembers" columns="$int{40}" maxLength="300" text="#{pageSession.valueMap['tcpipMembers']}">
<!afterCreate
getClientId(component="$this{component}" clientId=>$page{tcpipMembersTextId});
/>
</sun:textField>
</sun:property>
</sun:propertySheetSection>
</sun:propertySheet>
</sun:propertySheet>
<sun:hidden id="helpKey" value="$resource{help_full.batchConfiguration}" />
</sun:form>
</define>
Expand Down

0 comments on commit 36dc30b

Please sign in to comment.