index.jsp 6.6 KB
Newer Older
Bill Lynch's avatar
Bill Lynch committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
<%--
  -	$RCSfile$
  -	$Revision$
  -	$Date$
  -
  - Copyright (C) 2004 Jive Software. All rights reserved.
  -
  - This software is published under the terms of the GNU Public License (GPL),
  - a copy of which is included in this distribution.
--%>

<%@ page import="org.jivesoftware.util.*,
                 java.util.HashMap,
                 java.util.Map,
                 org.jivesoftware.messenger.*,
                 org.jivesoftware.messenger.user.*,
                 java.util.*,
                 java.text.*,
                 org.jivesoftware.admin.AdminPageBean"
20

Bill Lynch's avatar
Bill Lynch committed
21 22 23 24 25 26 27 28
%>

<%@ taglib uri="core" prefix="c" %>
<%@ taglib uri="fmt" prefix="fmt" %>

<%-- Define page bean for header and sidebar --%>
<jsp:useBean id="pageinfo" scope="request" class="org.jivesoftware.admin.AdminPageBean" />

Bill Lynch's avatar
Bill Lynch committed
29 30 31 32 33 34 35 36
<%  // Simple logout code
    if ("true".equals(request.getParameter("logout"))) {
        session.removeAttribute("jive.admin.authToken");
        response.sendRedirect("index.jsp");
        return;
    }
%>

Bill Lynch's avatar
Bill Lynch committed
37
<%-- Define Administration Bean --%>
38 39
<jsp:useBean id="webManager" class="org.jivesoftware.util.WebManager"  />
<% webManager.init(request, response, session, application, out); %>
Bill Lynch's avatar
Bill Lynch committed
40

41
<%  // Get parameters //
42
    boolean serverOn = (webManager.getXMPPServer() != null);
43 44
%>

Bill Lynch's avatar
Bill Lynch committed
45
<%  // Title of this page and breadcrumbs
46
    String title = "Server Properties";
Bill Lynch's avatar
Bill Lynch committed
47
    pageinfo.setTitle(title);
48
    pageinfo.setPageID("server-props");
Bill Lynch's avatar
Bill Lynch committed
49 50
%>

51 52
<%@ include file="top.jsp" %>

Bill Lynch's avatar
Bill Lynch committed
53 54
<jsp:include page="title.jsp" flush="true" />

55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75
<p>
Below are properties for this server. Click the "Edit Properties" button below to change
some of the server settings. Some settings can not be changed.
</p>

<div class="jive-table">
<table cellpadding="0" cellspacing="0" border="0" width="100%">
<thead>
    <tr>
        <th colspan="2">Server Properties</th>
    </tr>
</thead>
<tbody>

    <%  if (serverOn) { %>

         <tr>
            <td class="c1">Server Uptime:</td>
            <td>
                <%  DateFormat formatter = DateFormat.getDateTimeInstance(DateFormat.MEDIUM, DateFormat.MEDIUM);
                    long now = System.currentTimeMillis();
76
                    long lastStarted = webManager.getXMPPServer().getServerInfo().getLastStarted().getTime();
77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97
                    long uptime = (now - lastStarted) / 1000L;
                    String uptimeDisplay = null;
                    if (uptime < 60) {
                        uptimeDisplay = "Less than 1 minute";
                    }
                    else if (uptime < 60*60) {
                        long mins = uptime / (60);
                        uptimeDisplay = "Approx " + mins + ((mins==1) ? " minute" : " minutes");
                    }
                    else if (uptime < 60*60*24) {
                        long days = uptime / (60*60);
                        uptimeDisplay = "Approx " + days + ((days==1) ? " hour" : " hours");
                    }
                %>

                <%  if (uptimeDisplay != null) { %>

                    <%= uptimeDisplay %> --

                <%  } %>

98
                started <%= formatter.format(webManager.getXMPPServer().getServerInfo().getLastStarted()) %>
99 100 101 102 103 104 105 106 107
            </td>
        </tr>

    <%  } %>

    <tr>
        <td class="c1">Version:</td>
        <td class="c2">
            <fmt:message key="title" bundle="${lang}" />
108
            <%= webManager.getXMPPServer().getServerInfo().getVersion().getVersionString() %>
109 110 111 112 113 114 115 116 117 118 119 120 121
        </td>
    </tr>
    <tr>
        <td class="c1">Messenger Home:</td>
        <td class="c2">
            <%= JiveGlobals.getMessengerHome() %>
        </td>
    </tr>
    <tr>
        <td class="c1">
            Server Name:
        </td>
        <td class="c2">
122
            <c:out value="${webManager.serverInfo.name}" />
123 124
        </td>
    </tr>
125
    <c:if test="${!empty webManager.multiUserChatServer}">
126 127 128 129 130
        <tr>
            <td class="c1">
                Group Chat Service Name:
            </td>
            <td class="c2">
131
                <c:out value="${webManager.multiUserChatServer.serviceName}" />
132 133 134
            </td>
        </tr>
    </c:if>
Bill Lynch's avatar
Bill Lynch committed
135 136 137 138 139 140 141 142
</tbody>
<thead>
    <tr>
        <th colspan="2">Server Ports</th>
    </tr>
</thead>
<tbody>
    <%  int i=0; %>
143
    <c:forEach var="port" items="${webManager.serverInfo.serverPorts}">
Bill Lynch's avatar
Bill Lynch committed
144
        <%  i++; %>
145 146
        <tr>
            <td class="c1">
Bill Lynch's avatar
Bill Lynch committed
147
                <%= i %>: IP:Port, Security:
148 149
            </td>
            <td class="c2">
Bill Lynch's avatar
Bill Lynch committed
150
                <c:out value="${port.IPAddress}" />:<c:out value="${port.port}" />,
151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167
                <c:choose>
                    <c:when test="${empty port.securityType}">
                        NORMAL
                    </c:when>
                    <c:otherwise>
                        <c:choose>
                            <c:when test="${port.securityType == 'TLS'}">
                                TLS (SSL)
                            </c:when>
                            <c:otherwise>
                                <c:out value="${port.securityType}" />
                            </c:otherwise>
                        </c:choose>
                    </c:otherwise>
                </c:choose>
            </td>
        </tr>
Bill Lynch's avatar
Bill Lynch committed
168 169 170 171 172 173 174 175 176 177 178 179
        <tr valign="top">
            <td class="c1">
                <nobr>&nbsp;&nbsp;&nbsp; Domain Name(s):</nobr>
            </td>
            <td class="c2">
                <c:set var="sep" value="" />
                <c:forEach var="name" items="${port.domainNames}">
                    <c:out value="${sep}" /><c:out value="${name}" />
                    <c:set var="set" value=", " />
                </c:forEach>
            </td>
        </tr>
180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213
    </c:forEach>
</tbody>
<thead>
    <tr>
        <th colspan="2">Environment</th>
    </tr>
</thead>
<tbody>
    <tr>
        <td class="c1">JVM Version and Vendor:</td>
        <td class="c2">
            <%= System.getProperty("java.version") %> <%= System.getProperty("java.vendor") %>
        </td>
    </tr>
    <tr>
        <td class="c1">Appserver:</td>
        <td class="c2">
            <%= application.getServerInfo() %>
        </td>
    </tr>
    <tr>
        <td class="c1">OS / Hardware:</td>
        <td class="c2">
            <%= System.getProperty("os.name") %> / <%= System.getProperty("os.arch") %>
        </td>
    </tr>
    <tr>
        <td class="c1">Locale / Timezone:</td>
        <td class="c2">
            <%= JiveGlobals.getLocale() %> / <%= JiveGlobals.getTimeZone().getDisplayName(JiveGlobals.getLocale()) %>
            (<%= (JiveGlobals.getTimeZone().getRawOffset()/1000/60/60) %> GMT)
        </td>
    </tr>
</tbody>
Bill Lynch's avatar
Bill Lynch committed
214 215
</table>
</div>
216 217 218
<br>

<form action="server-props.jsp">
Bill Lynch's avatar
Bill Lynch committed
219
<input type="submit" value="Edit Properties">
220
</form>
Bill Lynch's avatar
Bill Lynch committed
221 222

<jsp:include page="bottom.jsp" flush="true" />