session-row.jspf 5.14 KB
Newer Older
1
<%@ page import="org.jivesoftware.messenger.Session,
2
                 org.xmpp.packet.Presence,
3 4
                 java.net.URLEncoder,
                 org.jivesoftware.util.LocaleUtils"%>
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
 <%--
  -	$RCSfile$
  -	$Revision$
  -	$Date$
--%>

<%--
  - 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
--%>

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

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

47
            <fmt:message key="session.details.connect" />
48 49 50

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

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

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

55
            <fmt:message key="session.details.authenticated" />
56 57 58

        <%  } else { %>

59
            <fmt:message key="session.details.unknown" />
60 61 62

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

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

                <%= _stat %>

            <%  } else { %>

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

            <%  } %>
        </td>

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

        <td width="1%"
94
            ><img src="images/bullet-green-14x14.gif" width="14" height="14" border="0" title="<fmt:message key="session.details.chat_available" />"
95 96
            ></td>
        <td width="46%">
97
            <fmt:message key="session.details.chat_available" />
98 99
        </td>

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

        <td width="1%"
103
            ><img src="images/bullet-red-14x14.gif" width="14" height="14" border="0" title="<fmt:message key="session.details.not_disturb" />"
104 105 106 107 108 109 110 111
            ></td>
        <td width="46%">
            <%  if (_stat != null) { %>

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

            <%  } else { %>

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

            <%  } %>
        </td>

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

        <td width="1%"
120
            ><img src="images/bullet-green-14x14.gif" width="14" height="14" border="0" title="<fmt:message key="session.details.online" />"
121 122
            ></td>
        <td width="46%">
123
            <fmt:message key="session.details.online" />
124 125
        </td>

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

        <td width="1%"
129
            ><img src="images/bullet-yellow-14x14.gif" width="14" height="14" border="0" title="<fmt:message key="session.details.extended" />"
130 131 132 133 134 135 136 137
            ></td>
        <td width="46%">
            <%  if (_stat != null) { %>

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

            <%  } else { %>

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

            <%  } %>
        </td>

    <%  } else { %>

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

    <%  } %>

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

Bill Lynch's avatar
Bill Lynch committed
155
    <td width="1%" nowrap align="center" style="border-right:1px #ccc solid;">
Derek DeMoro's avatar
Derek DeMoro committed
156
        <a href="session-summary.jsp?jid=<%= URLEncoder.encode(sess.getAddress().toString(), "UTF-8") %>&close=true"
157 158
         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
159
         ><img src="images/delete-16x16.gif" width="16" height="16" border="0"></a>
160 161
    </td>
</tr>