session-row.jspf 6.37 KB
Newer Older
1 2 3 4 5
 <%--
  -	$Revision$
  -	$Date$
--%>

6
<%@ page import="org.jivesoftware.openfire.session.Session,
7
                 org.jivesoftware.openfire.session.LocalClientSession,
8
                 org.jivesoftware.util.LocaleUtils,
9 10 11 12 13
                 org.jivesoftware.util.StringUtils,
                 org.xmpp.packet.JID,
                 org.xmpp.packet.Presence"%>
 <%@ page import="java.net.URLEncoder"%>

14 15
 <%@ taglib uri="http://java.sun.com/jstl/fmt_rt" prefix="fmt" %>

16 17 18 19 20 21 22 23
 <%--
   - This page is meant to be included in other pages. It assumes 2 variables:
   -     * 'sess', a org.jivesoftware.xmpp.Session object
   -     * 'count', an int representing the row number we're on.
   -     * 'current', a boolean which indicates the current row the user is looking (pass in
   -       false if there is no current row.
   -     * 'linkURL', a String representing the JSP page to link to
 --%>
24 25 26 27 28 29 30 31 32 33 34 35 36

<%  if (current) { %>

    <tr class="jive-current">

<%  } else { %>

    <tr class="jive-<%= (((count % 2) == 0) ? "even" : "odd") %>">

<%  } %>

    <td width="1%" nowrap><%= count %></td>
    <td width="10%" nowrap>
Derek DeMoro's avatar
Derek DeMoro committed
37
        <%  String name = sess.getAddress().getNode(); %>
38
            <a href="session-details.jsp?jid=<%= URLEncoder.encode(sess.getAddress().toString(), "UTF-8") %>" title="<fmt:message key='session.row.cliked' />"
39
            ><%= ((!sessionManager.isAnonymousRoute(sess.getUsername())) ? JID.unescapeNode(name): "<i>"+LocaleUtils.getLocalizedString("session.details.anonymous")+"</i>") %></a>
40 41
    </td>
    <td width="15%" nowrap>
Sven Tantau's avatar
Sven Tantau committed
42
        <%= StringUtils.escapeHTMLTags(sess.getAddress().getResource()) %>
43
    </td>
44 45 46 47 48 49 50
    <td nowrap>
            <% if (sess instanceof LocalClientSession) { %>
             <fmt:message key="session.details.local" />
            <% } else { %>
             <fmt:message key="session.details.remote" />
            <% } %>
    </td>
Matt Tucker's avatar
Matt Tucker committed
51
    <td>
52 53 54
        <%  int _status = sess.getStatus();
            if (_status == Session.STATUS_CLOSED) {
        %>
55
            <fmt:message key="session.details.close" />
56 57 58

        <%  } else if (_status == Session.STATUS_CONNECTED) { %>

59
            <fmt:message key="session.details.connect" />
60

61
        <% } else if (_status == org.jivesoftware.openfire.session.Session.STATUS_AUTHENTICATED) { %>
62

63
            <fmt:message key="session.details.authenticated" />
64 65 66

        <%  } else { %>

67
            <fmt:message key="session.details.unknown" />
68 69 70

        <%  } %>
    </td>
71
    <%  if (sess.isSecure()) { %>
Matt Tucker's avatar
Matt Tucker committed
72 73
        <td width="1%">
            <img src="images/lock.gif" width="16" height="16" border="0"
74
            title="<fmt:message key='session.row.cliked_ssl' />" alt="<fmt:message key='session.row.cliked_ssl' />">
Matt Tucker's avatar
Matt Tucker committed
75 76
        </td>
     <% } else { %>
77
        <td width="1%"><img src="images/blank.gif" width="1" height="1" alt=""></td>
Matt Tucker's avatar
Matt Tucker committed
78
     <% } %>
79

Derek DeMoro's avatar
Derek DeMoro committed
80
    <%  Presence.Show _show = sess.getPresence().getShow();
81
        String _stat = sess.getPresence().getStatus();
82 83 84
        if (!sess.getPresence().isAvailable()) {
     %>
        <td width="1%"
85
            ><img src="images/user-clear-16x16.gif" width="16" height="16" border="0" title="<fmt:message key='user.properties.offline' />" alt="<fmt:message key='user.properties.offline' />"
86 87 88 89 90
            ></td>
        <td width="46%">
                <fmt:message key="user.properties.offline" />
        </td>
      <%  } else if (_show == Presence.Show.away) { %>
91
        <td width="1%"
92
            ><img src="images/im_away.gif" width="16" height="16" border="0" title="<fmt:message key='session.details.away' />" alt="<fmt:message key='session.details.away' />"
93 94 95 96
            ></td>
        <td width="46%">
            <%  if (_stat != null) { %>

Sven Tantau's avatar
Sven Tantau committed
97
                <%= StringUtils.escapeHTMLTags(_stat) %>
98 99 100

            <%  } else { %>

101
                <fmt:message key="session.details.away" />
102 103 104 105

            <%  } %>
        </td>

Derek DeMoro's avatar
Derek DeMoro committed
106
    <%  } else if (_show == Presence.Show.chat) { %>
107 108

        <td width="1%"
109
            ><img src="images/im_free_chat.gif" width="16" height="16" border="0" title="<fmt:message key='session.details.chat_available' />" alt="<fmt:message key='session.details.chat_available' />"
110 111
            ></td>
        <td width="46%">
112
            <fmt:message key="session.details.chat_available" />
113 114
        </td>

Derek DeMoro's avatar
Derek DeMoro committed
115
    <%  } else if (_show == Presence.Show.dnd) { %>
116 117

        <td width="1%"
118
            ><img src="images/im_dnd.gif" width="16" height="16" border="0" title="<fmt:message key='session.details.not_disturb' />" alt="<fmt:message key='session.details.not_disturb' />"
119 120 121 122
            ></td>
        <td width="46%">
            <%  if (_stat != null) { %>

Sven Tantau's avatar
Sven Tantau committed
123
                <%= StringUtils.escapeHTMLTags(sess.getPresence().getStatus()) %>
124 125 126

            <%  } else { %>

127
                <fmt:message key="session.details.not_disturb" />
128 129 130 131

            <%  } %>
        </td>

Derek DeMoro's avatar
Derek DeMoro committed
132
    <%  } else if (_show == null) { %>
133 134

        <td width="1%"
135
            ><img src="images/im_available.gif" width="16" height="16" border="0" title="<fmt:message key='session.details.online' />" alt="<fmt:message key='session.details.online' />"
136 137
            ></td>
        <td width="46%">
138
            <fmt:message key="session.details.online" />
139 140
        </td>

Derek DeMoro's avatar
Derek DeMoro committed
141
    <%  } else if (_show == Presence.Show.xa) { %>
142 143

        <td width="1%"
144
            ><img src="images/im_away.gif" width="16" height="16" border="0" title="<fmt:message key='session.details.extended' />" alt="<fmt:message key='session.details.extended' />"
145 146 147 148
            ></td>
        <td width="46%">
            <%  if (_stat != null) { %>

Sven Tantau's avatar
Sven Tantau committed
149
                <%= StringUtils.escapeHTMLTags(sess.getPresence().getStatus()) %>
150 151 152

            <%  } else { %>

153
                <fmt:message key="session.details.extended" />
154 155 156 157 158 159 160

            <%  } %>
        </td>

    <%  } else { %>

        <td colspan="2" width="46%">
161
            <fmt:message key="session.details.unknown" />
162 163 164 165
        </td>

    <%  } %>

166 167 168 169
    <td width="1%" nowrap>
        <%= sess.getPresence().getPriority() %>
    </td>

170
    <td width="1%" nowrap>
171
        <%= sess.getHostAddress() %>
172 173
    </td>

Bill Lynch's avatar
Bill Lynch committed
174
    <td width="1%" nowrap align="center" style="border-right:1px #ccc solid;">
Derek DeMoro's avatar
Derek DeMoro committed
175
        <a href="session-summary.jsp?jid=<%= URLEncoder.encode(sess.getAddress().toString(), "UTF-8") %>&close=true"
176 177
         title="<fmt:message key="session.row.cliked_kill_session" />"
         onclick="return confirm('<fmt:message key="session.row.confirm_close" />');"
178
         ><img src="images/delete-16x16.gif" width="16" height="16" border="0" alt=""></a>
179
    </td>
Sven Tantau's avatar
Sven Tantau committed
180
</tr>