|  | <!-- | 
|  |  | 
|  | Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved. | 
|  |  | 
|  | 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 | 
|  |  | 
|  | --> | 
|  |  | 
|  | <!initPage | 
|  | setResourceBundle(key="i18nc" bundle="org.glassfish.common.admingui.Strings") | 
|  | setResourceBundle(key="i18ncs" bundle="org.glassfish.cluster.admingui.Strings") | 
|  | setResourceBundle(key="help_cluster" bundle="org.glassfish.cluster.admingui.Helplinks"); | 
|  | /> | 
|  | <!composition template="/templates/default.layout"  guiTitle="" > | 
|  | #include "/cluster/shared/handlers.inc" | 
|  | <!define name="content"> | 
|  | <event> | 
|  | <!beforeCreate | 
|  | getRequestValue(key="instanceName" value="#{pageSession.instanceName}"); | 
|  | urlencode(value="#{pageSession.instanceName}" encoding="UTF-8" result="#{pageSession.encodedInstanceName}"); | 
|  | gf.isInstanceName(instanceName="#{pageSession.instanceName}" exists="#{requestScope.exists}" ); | 
|  | if (! #{requestScope.exists}){ | 
|  | gf.redirect("#{request.contextPath}/cluster/standalone/standaloneInstances.jsf"); | 
|  | } | 
|  | setSessionAttribute(key="standaloneInstanceTabs" value="general"); | 
|  | setPageSessionAttribute(key="selfPage" value="#{request.contextPath}/cluster/standalone/standaloneInstanceGeneral.jsf?instanceName=#{pageSession.encodedInstanceName}&alertType=${alertType}&alertSummary=${alertSummary}&alertDetail=${alertDetail}"); | 
|  | gfr.getStatusString(); | 
|  | gf.getEntityAttrs(endpoint="#{sessionScope.REST_URL}/servers/server/#{pageSession.encodedInstanceName}", valueMap="#{pageSession.vMap}"); | 
|  | setPageSessionAttribute(key="isStopped" value="#{false}"); | 
|  | if ("#{pageSession.status}=RUNNING"){ | 
|  | setAttribute(key="isRunning" value="#{true}"); | 
|  | } | 
|  | if ("#{pageSession.status}=NOT_RUNNING"){ | 
|  | setPageSessionAttribute(key="isStopped" value="#{true}"); | 
|  | } | 
|  | if ("#{pageSession.status}=REQUIRES_RESTART"){ | 
|  | setAttribute(key="isRestartRequired" value="#{true}"); | 
|  | } | 
|  | gfr.getInstanceDebugInfo(); | 
|  | /> | 
|  | </event> | 
|  | <sun:form id="propertyForm"> | 
|  |  | 
|  | #include "/cluster/standalone/standaloneInstanceTabs.inc" | 
|  | #include "/common/shared/alertMsg_1.inc" | 
|  |  | 
|  | <sun:title id="propertyContentPage" title="$resource{i18n.instance.GeneralTitle}" > | 
|  | <!facet pageButtonsTop> | 
|  | <sun:panelGroup id="topButtons"> | 
|  | <sun:button id="backButton" immediate="#{true}" text="$resource{i18n.button.Back}" primary="#{false}" > | 
|  | <!command | 
|  | gf.redirect(page="#{request.contextPath}/cluster/standalone/standaloneInstances.jsf"); | 
|  | /> | 
|  | </sun:button> | 
|  | </sun:panelGroup> | 
|  | </facet> | 
|  |  | 
|  | <sun:button id="startInstance" disabled="#{!pageSession.isStopped}" text="$resource{i18n.button.Start}"  primary="#{false}" | 
|  | onClick="if ( getConfirm(this,'$resource{i18n.msg.JS.confirmStartInstance}') ) | 
|  | { return submitAndDisable(this, '$resource{i18n.button.Processing}');}  else {return false;} " > | 
|  | <!command | 
|  | println("Staring instance ...."); | 
|  | println("#{sessionScope.REST_URL}/servers/server/#{pageSession.instanceName}/start-instance"); | 
|  | gf.restRequest(endpoint="#{sessionScope.REST_URL}/servers/server/#{pageSession.instanceName}/start-instance" ); | 
|  | gf.redirect("#{pageSession.selfPage}"); | 
|  | /> | 
|  | </sun:button> | 
|  |  | 
|  | <sun:button id="stopInstance" disabled="#{pageSession.isStopped}" text="$resource{i18n.button.Stop}" primary="#{false}" | 
|  | onClick="if ( getConfirm(this,'$resource{i18n.msg.JS.confirmStopInstance}') ) | 
|  | { return submitAndDisable(this, '$resource{i18n.button.Processing}');}  else {return false;} " > | 
|  | <!command | 
|  | println("Stopping instance ...."); | 
|  | println("#{sessionScope.REST_URL}/servers/server/#{pageSession.instanceName}/stop-instance"); | 
|  | gf.restRequest(endpoint="#{sessionScope.REST_URL}/servers/server/#{pageSession.instanceName}/stop-instance" ); | 
|  | gf.redirect("#{pageSession.selfPage}"); | 
|  | /> | 
|  | </sun:button> | 
|  |  | 
|  | <sun:button id="restartInstance" disabled="#{pageSession.isStopped}" text="$resource{i18n.button.Restart}" primary="#{false}" | 
|  | onClick="if ( getConfirm(this,'$resource{i18n.msg.JS.confirmRestartInstance}') ) | 
|  | { return submitAndDisable(this, '$resource{i18n.button.Processing}');}  else {return false;} " > | 
|  | <!command | 
|  | println("Restart Instance ..."); | 
|  | println("#{sessionScope.REST_URL}/servers/server/#{pageSession.instanceName}/restart-instance"); | 
|  | gf.restRequest(endpoint="#{sessionScope.REST_URL}/servers/server/#{pageSession.instanceName}/restart-instance" ); | 
|  | gf.redirect("#{pageSession.selfPage}"); | 
|  | /> | 
|  | </sun:button> | 
|  | <sun:button id="logViewer" text="$resource{i18n.button.logViewer}"  disabled="#{pageSession.isStopped}" primary="#{false}" | 
|  | onClick="javascript:var win=window.open('#{facesContext.externalContext.requestContextPath}/common/logViewer/logViewer.jsf?instanceName=#{instanceName}&loglevel=INFO&viewResults=true','LogViewerWindow','width='+(screen.width-300)+',height='+(screen.height-75)+',top=0,left=0,toolbar=no,status=no,menubar=no,scrollbars=yes,resizable=yes,directories=no,location=no');win.focus(); return false;" | 
|  | /> | 
|  | <sun:button id="logViewerRaw" text="$resource{i18n.button.logViewerRaw}"  disabled="#{pageSession.isStopped}" primary="#{false}" | 
|  | onClick="javascript:var win=window.open('#{facesContext.externalContext.requestContextPath}/common/logViewer/logViewerRaw.jsf?instanceName=#{instanceName}','LogViewerRawWindow','width='+(screen.width-300)+',height='+(screen.height-75)+',top=0,left=0,toolbar=no,status=no,menubar=no,scrollbars=yes,resizable=yes,directories=no,location=no');win.focus(); return false;" | 
|  | /> | 
|  |  | 
|  | <sun:button id="rotateLog" text="$resource{i18n.button.rotateLog}" primary="#{false}" disabled="#{pageSession.isStopped}" | 
|  | onClick="if ( getConfirm(this, '$resource{i18nc.msg.JS.confirmRotateLog}') ) | 
|  | { return submitAndDisable(this, '$resource{i18n.button.Processing}');} | 
|  | else {return false;} " > | 
|  | <!command | 
|  | createMap(result="#{requestScope.map}"); | 
|  | mapPut(map="#{requestScope.map}", key="target", value="#{pageSession.encodedInstanceName}"); | 
|  | gf.restRequest( | 
|  | endpoint="#{sessionScope.REST_URL}/rotate-log" | 
|  | attrs="#{requestScope.map}" | 
|  | method="POST" | 
|  | result="#{pageSession.props}"); | 
|  | gf.redirect("#{pageSession.selfPage}");/> | 
|  |  | 
|  | </sun:button> | 
|  | <sun:button id="recoverTrans" text="$resource{i18n.button.recoverTrans}" primary="#{false}" > | 
|  | <!command | 
|  | gf.redirect(page="standaloneRecoverTransactions.jsf?instanceName=$pageSession{instanceName}&isStopped=#{pageSession.isStopped}"); | 
|  | /> | 
|  | </sun:button> | 
|  | </sun:title> | 
|  |  | 
|  | <sun:propertySheet id="propertySheet" > | 
|  |  | 
|  | <sun:propertySheetSection id="serverGeneralPropSheet"> | 
|  | <!afterCreate | 
|  | getClientId(component="$this{component}" clientId=>$attribute{sheetId}); | 
|  | /> | 
|  | <sun:property id="hostName" labelAlign="left" noWrap="#{true}" overlapLabel="#{false}" label="$resource{i18n.inst.serverName}" > | 
|  | <sun:staticText id="hostName" text="#{pageSession.instanceName}" /> | 
|  | </sun:property> | 
|  | <sun:property id="status" labelAlign="left" noWrap="#{true}" overlapLabel="#{false}" label="$resource{i18n.common.Status}:" > | 
|  | <sun:staticText id="status" text="#{pageSession.statusString}" /> | 
|  | </sun:property> | 
|  | <sun:property id="jvmProp" labelAlign="left" noWrap="#{true}" overlapLabel="#{false}" label="$resource{i18n.inst.JVMLabel}"> | 
|  | <sun:hyperlink id="jvmlink" text="$resource{i18nc.inst.jvmReport}" | 
|  | onClick="javascript: | 
|  | var jvmWin = window.open('#{request.contextPath}/common/appServer/jvmReport.jsf?reportType=summary&instanceName=#{instanceName}','JVMReport','width='+(screen.width-300)+',height='+(screen.height-100)+',top=0,left=0,toolbar=no,status=no,menubar=no,scrollbars=yes,resizable=yes,directories=no,location=no'); | 
|  | jvmWin.focus(); return false;" /> | 
|  | </sun:property> | 
|  |  | 
|  | <sun:property id="nodeProp"  labelAlign="left" noWrap="#{true}" overlapLabel="#{false}" label="$resource{i18ncs.nodeLabel}"> | 
|  | <sun:hyperlink id="nodeLink" text="#{pageSession.vMap['nodeRef']}"  url="#{request.contextPath}/cluster/node/nodeEdit.jsf?nodeName=#{pageSession.vMap['nodeRef']}" /> | 
|  | </sun:property> | 
|  |  | 
|  | <sun:property id="configProp"  labelAlign="left" noWrap="#{true}" overlapLabel="#{false}" label="$resource{i18n.common.ConfigurationLabel}"> | 
|  | <sun:hyperlink id="configlink" text="#{pageSession.vMap['configRef']}"  url="#{request.contextPath}/common/configuration/configuration.jsf?configName=#{pageSession.vMap['configRef']}" /> | 
|  | </sun:property> | 
|  |  | 
|  | <sun:property id="debugProp"  labelAlign="left" noWrap="#{true}" overlapLabel="#{false}" label="$resource{i18n.inst.debugLabel}"> | 
|  | <sun:staticText id="debugEnabled" text="#{pageSession.instanceDebugInfo}" /> | 
|  | </sun:property> | 
|  |  | 
|  | </sun:propertySheetSection> | 
|  | <event> | 
|  | <!afterCreate | 
|  | getUIComponent(clientId="#{sheetId}"  component=>$attribute{component}) | 
|  | includeIntegrations(type="org.glassfish.admingui:serverInstGeneralPe" root="#{component}"); | 
|  | /> | 
|  | </event> | 
|  | </sun:propertySheet> | 
|  |  | 
|  | <sun:hidden id="helpKey" value="$resource{help_cluster.standaloneInstanceGeneral}" /> | 
|  |  | 
|  | </sun:form> | 
|  | </define> | 
|  | </composition> |