blob: ee872f640e57302376eef09fd39ec43b713b8c1c [file] [log] [blame]
<!--
Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
Copyright (c) 2021 Contributors to the Eclipse Foundation
This program and the accompanying materials are made available under the
terms of the Eclipse Public License v. 2.0, which is available at
http://www.eclipse.org/legal/epl-2.0.
This Source Code may also be made available under the following Secondary
Licenses when the conditions for such availability set forth in the
Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
version 2 with the GNU Classpath Exception, which is available at
https://www.gnu.org/software/classpath/license.html.
SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
-->
<!-- cluster/clusters.jsf -->
<!initPage
setResourceBundle(key="i18nc" bundle="org.glassfish.common.admingui.Strings")
setResourceBundle(key="help_common" bundle="org.glassfish.common.admingui.Helplinks");
/>
<!composition template="/templates/default.layout"
guiTitle="$resource{i18nc.configurations.PageTitle}"
guiTemplateOnLoad="admingui.nav.refreshTree('treeForm:tree:configurations');"
>
<!define name="listTableDeleteButton">
<sun:button id="button1" text="$resource{i18n.button.Delete}" disabled="#{true}" primary="#{false}"
onClick="if (getConfirm(this,'$pageSession{confirmDeleteMsg}')) {submitAndDisable(this, '$resource{i18n.button.Processing}');}; return false;" >
<!command
getUIComponent(clientId="$pageSession{tableRowGroupId}", component=>$attribute{tableRowGroup});
getSelectedSingleMapRows(TableRowGroup="${tableRowGroup}" selectedRows=>$attribute{selectedRows});
foreach (var="row" list="${selectedRows}") {
setPageSessionAttribute(key="configName" value="#{row['name']}");
setPageSessionAttribute(key="deleteConfigUrl", value="#{sessionScope.REST_URL}/configs/config/#{pageSession.configName}/delete-config");
gf.restRequest(endpoint="#{pageSession.deleteConfigUrl}", method="post");
}
gf.redirect(page="#{pageSession.listLink}");
/>
</sun:button>
</define>
<!define name="content">
<event>
<!beforeCreate
setPageSessionAttribute(key="parentUrl" value="#{sessionScope.REST_URL}/configs");
setPageSessionAttribute(key="childType" value="config");
setPageSessionAttribute(key="rest-api" value="true");
setSessionAttribute(key="backPage" value="../../common/configuration/configurations");
gf.getChildList(parentEndpoint="#{pageSession.parentUrl}", childType="#{pageSession.childType}", result="#{requestScope.listOfRows}");
setPageSessionAttribute(key="confirmDeleteMsg" value="$resource{i18nc.msg.JS.confirmDeleteConfigs}");
setPageSessionAttribute(key="createLink" value="#{request.contextPath}/common/configuration/configurationNew.jsf");
setPageSessionAttribute(key="listLink" value="#{request.contextPath}/common/configuration/configurations.jsf");
setPageSessionAttribute(key="editLink" value="#{request.contextPath}/common/configuration/configuration.jsf");
gf.listInstances(optionKeys={"standaloneonly"} optionValues={"true"}, instances="#{pageSession.standaloneList}" statusMap="#{pageSession.standaloneStatusMap}");
setAttribute(key="one" value="$int{1}");
/>
</event>
" <script type="text/javascript">admingui.nav.selectTreeNodeById(admingui.nav.TREE_ID+":configurations");</script>
<sun:form id="propertyForm">
#include "/common/shared/alertMsg.inc"
<sun:title id="propertyContentPage" title="$resource{i18nc.configurations.PageTitle}"
helpText="$resource{i18nc.configurations.PageTitleHelp}" />
"<br />
<sun:table id="configs" title="$resource{i18nc.configurations.TableTitle}"
deselectMultipleButton="$boolean{true}"
deselectMultipleButtonOnClick="setTimeout('admingui.table.changeOneTableButton(\\\\\'#{pageSession.topActionGroup}\\\\\', \\\\\'#{pageSession.tableId}\\\\\');', 0)"
selectMultipleButton="$boolean{true}"
selectMultipleButtonOnClick="setTimeout('admingui.table.c(\\\\\'#{pageSession.topActionGroup}\\\\\', \\\\\'#{pageSession.tableId}\\\\\');', 0)" >
<!afterCreate
getClientId(component="$this{component}" clientId=>$page{tableId});
/>
#include "/common/shared/listTableButtons.inc"
<sun:tableRowGroup id="rowGroup1" selected="#{td.value.selected}" data={"$attribute{listOfRows}"} sourceVar="td">
<!afterCreate
getClientId(component="$this{component}" clientId=>$page{tableRowGroupId});
/>
<sun:tableColumn headerText="$resource{i18n.common.SelectHeader}" selectId="select" rowHeader="$boolean{false}" valign="top" id="col0">
<sun:checkbox id="select"
toolTip="$resource{i18n.common.select}"
selected="#{td.value.selected}"
selectedValue="$boolean{true}"
onClick="setTimeout('admingui.table.changeOneTableButton(\\\\\'#{pageSession.topActionGroup}\\\\\', \\\\\'#{pageSession.tableId}\\\\\'); admingui.table.initAllRows(\\\\\'#{pageSession.tableId}\\\\\');', 0);"
/>
</sun:tableColumn>
<sun:tableColumn headerText="$resource{i18n.common.name.header}" sort="name" rowHeader="$boolean{true}" valign="top" id="col1">
<event>
<!beforeEncode
setPageSessionAttribute(key="configName" value="#{td.value.name}");
/>
</event>
<sun:hyperlink id="link" text="#{td.value.name}"
url="#{request.contextPath}/common/configuration/configuration.jsf?configName=#{td.value.name}" />
</sun:tableColumn>
<sun:tableColumn
headerText="$resource{i18nc.configurations.instanceCol}"
rowHeader="$boolean{false}" id="col3">
<event>
<!beforeEncode
gf.listInstances(optionKeys={"id"} optionValues={"$pageSession{configName}"}, instances="#{requestScope.instanceList}" statusMap="#{requestScope.statusMap}");
if(#{pageSession.configName}=server-config){
listAdd(list="#{requestScope.instanceList}" value="server" index="0");
}
/>
</event>
<foreach key="instance" list="#{requestScope.instanceList}">
<event>
<!beforeEncode
setAttribute(key="isAdminServer" value="#{false}");
if (#{instance}=server){
setAttribute(key="iurl" value="#{request.contextPath}/common/appServer/serverInstGeneralPe.jsf");
setAttribute(key="isAdminServer" value="#{true}");
//TODO: need to check if restart is required.
setAttribute(key="status" value="RUNNING");
}
gf.getClusterNameForInstance(instanceName="#{instance}" clusterName="#{requestScope.clusterName}");
urlencode(value="#{requestScope.clusterName}" encoding="UTF-8" result="#{requestScope.encodedClusterName}");
if (!#{requestScope.isAdminServer}){
setAttribute(key="status" value="#{requestScope.statusMap['${instance}']}");
gf.containedIn(list="#{pageSession.standaloneList}" testStr="#{instance}" contain="#{requestScope.isStandalone}" );
if (#{requestScope.isStandalone}){
setAttribute(key="iurl" value="#{request.contextPath}/cluster/standalone/standaloneInstanceGeneral.jsf?clusterName=#{requestScope.encodedClusterName}&instanceName=#{instance}");
}
if ( !#{requestScope.isStandalone}){
setAttribute(key="iurl" value="#{request.contextPath}/cluster/cluster/clusterInstanceEdit.jsf?clusterName=#{requestScope.encodedClusterName}&instanceName=#{instance}" );
}
}
setAttribute(key="statusString" value="$resource{i18nc.status.$attribute{status}} &nbsp; $resource{i18nc.status.image.$attribute{status}}");
/>
</event>
<sun:hyperlink url="#{requestScope.iurl}" text="#{instance}" />
"&nbsp;&nbsp;&nbsp;
<staticText id="colStopped" value="#{requestScope.statusString}" />
"<br />
</foreach>
</sun:tableColumn>
</sun:tableRowGroup>
</sun:table>
<sun:hidden id="helpKey" value="$resource{help_common.configurations}" />
</sun:form>
#include "/common/shared/changeButtonsJS.inc"
</define>
</composition>