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

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

 <%--
   - 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
 --%>
21 22 23 24 25 26 27 28 29 30 31 32 33

<%  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
34
        <%  String name = sess.getAddress().getNode(); %>
35
            <a href="session-details.jsp?jid=<%= URLEncoder.encode(sess.getAddress().toString(), "UTF-8") %>" title="<fmt:message key="session.row.cliked" />"
36
            ><%= ((!sessionManager.isAnonymousRoute(sess.getUsername())) ? JID.unescapeNode(name): "<i>"+LocaleUtils.getLocalizedString("session.details.anonymous")+"</i>") %></a>
37 38
    </td>
    <td width="15%" nowrap>
39
        <%= StringUtils.escapeForXML(sess.getAddress().getResource()) %>
40
    </td>
Matt Tucker's avatar
Matt Tucker committed
41
    <td>
42 43 44
        <%  int _status = sess.getStatus();
            if (_status == Session.STATUS_CLOSED) {
        %>
45
            <fmt:message key="session.details.close" />
46 47 48

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

49
            <fmt:message key="session.details.connect" />
50 51 52

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

53
            <fmt:message key="session.details.streaming" />
54

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

57
            <fmt:message key="session.details.authenticated" />
58 59 60

        <%  } else { %>

61
            <fmt:message key="session.details.unknown" />
62 63 64

        <%  } %>
    </td>
Matt Tucker's avatar
Matt Tucker committed
65 66 67
    <%  if (sess.getConnection().isSecure()) { %>
        <td width="1%">
            <img src="images/lock.gif" width="16" height="16" border="0"
68
            title="<fmt:message key="session.row.cliked_ssl" />">
Matt Tucker's avatar
Matt Tucker committed
69 70 71 72
        </td>
     <% } else { %>
        <td width="1%"><img src="images/blank.gif" width="1" height="1"></td>
     <% } %>
73

Derek DeMoro's avatar
Derek DeMoro committed
74
    <%  Presence.Show _show = sess.getPresence().getShow();
75
        String _stat = sess.getPresence().getStatus();
Derek DeMoro's avatar
Derek DeMoro committed
76
        if (_show == Presence.Show.away) {
77 78
    %>
        <td width="1%"
Matt Tucker's avatar
Matt Tucker committed
79
            ><img src="images/im_away.gif" width="16" height="16" border="0" title="<fmt:message key="session.details.away" />"
80 81 82 83 84 85 86 87
            ></td>
        <td width="46%">
            <%  if (_stat != null) { %>

                <%= _stat %>

            <%  } else { %>

88
                <fmt:message key="session.details.away" />
89 90 91 92

            <%  } %>
        </td>

Derek DeMoro's avatar
Derek DeMoro committed
93
    <%  } else if (_show == Presence.Show.chat) { %>
94 95

        <td width="1%"
Matt Tucker's avatar
Matt Tucker committed
96
            ><img src="images/im_free_chat.gif" width="16" height="16" border="0" title="<fmt:message key="session.details.chat_available" />"
97 98
            ></td>
        <td width="46%">
99
            <fmt:message key="session.details.chat_available" />
100 101
        </td>

Derek DeMoro's avatar
Derek DeMoro committed
102
    <%  } else if (_show == Presence.Show.dnd) { %>
103 104

        <td width="1%"
Matt Tucker's avatar
Matt Tucker committed
105
            ><img src="images/im_dnd.gif" width="16" height="16" border="0" title="<fmt:message key="session.details.not_disturb" />"
106 107 108 109 110 111 112 113
            ></td>
        <td width="46%">
            <%  if (_stat != null) { %>

                <%= sess.getPresence().getStatus() %>

            <%  } else { %>

114
                <fmt:message key="session.details.not_disturb" />
115 116 117 118

            <%  } %>
        </td>

Derek DeMoro's avatar
Derek DeMoro committed
119
    <%  } else if (_show == null) { %>
120 121

        <td width="1%"
Matt Tucker's avatar
Matt Tucker committed
122
            ><img src="images/im_available.gif" width="16" height="16" border="0" title="<fmt:message key="session.details.online" />"
123 124
            ></td>
        <td width="46%">
125
            <fmt:message key="session.details.online" />
126 127
        </td>

Derek DeMoro's avatar
Derek DeMoro committed
128
    <%  } else if (_show == Presence.Show.xa) { %>
129 130

        <td width="1%"
Matt Tucker's avatar
Matt Tucker committed
131
            ><img src="images/im_away.gif" width="16" height="16" border="0" title="<fmt:message key="session.details.extended" />"
132 133 134 135 136 137 138 139
            ></td>
        <td width="46%">
            <%  if (_stat != null) { %>

                <%= sess.getPresence().getStatus() %>

            <%  } else { %>

140
                <fmt:message key="session.details.extended" />
141 142 143 144 145 146 147

            <%  } %>
        </td>

    <%  } else { %>

        <td colspan="2" width="46%">
148
            <fmt:message key="session.details.unknown" />
149 150 151 152
        </td>

    <%  } %>

153 154 155 156
    <td width="1%" nowrap>
        <%= sess.getPresence().getPriority() %>
    </td>

157 158 159 160
    <td width="1%" nowrap>
        <%= sess.getConnection().getInetAddress().getHostAddress() %>
    </td>

Bill Lynch's avatar
Bill Lynch committed
161
    <td width="1%" nowrap align="center" style="border-right:1px #ccc solid;">
Derek DeMoro's avatar
Derek DeMoro committed
162
        <a href="session-summary.jsp?jid=<%= URLEncoder.encode(sess.getAddress().toString(), "UTF-8") %>&close=true"
163 164
         title="<fmt:message key="session.row.cliked_kill_session" />"
         onclick="return confirm('<fmt:message key="session.row.confirm_close" />');"
Matt Tucker's avatar
Matt Tucker committed
165
         ><img src="images/delete-16x16.gif" width="16" height="16" border="0"></a>
166 167
    </td>
</tr>