It looked something like this.
I altered some <div> and </div> tags.
Whitespace may vary from what was posted before.
IIrc, Bill McCormick is the author.
------------------------

This page displays all active CSP sessions and has a mechanism 
to set a session to terminate immediately - of course grace period still applies.
filename="Sessions.CSP".

<html>
<head>
<title> Sessions </title>
<link rel="stylesheet" href="isc.css" type="text/css">
</head>
<csp:class import="Webdev" INSERTBROKERAPPLET>
<body>
<csp:include page="Menu.csp">
<table>
<tr id="thead">
<th><csp:text textid="ID" domain="webdev"></csp:text></th>
<th><csp:text textid="FN" domain="webdev"></csp:text></th>
<th><csp:text textid="LN" domain="webdev"></csp:text></th>
<th><csp:text textid="AT" domain="webdev"></csp:text></th>
<th><csp:text textid="connections" domain="webdev"></csp:text></th>
<th><csp:text textid="sess" domain="webdev"></csp:text></th>
<th><csp:text textid="logged" domain="webdev"></csp:text></th>
</tr>
<script language="cache" runat="server">
 set sub="",sessarray=0
 kill lu
 for  {
        set sub=$o(^%cspSession(sub))
        q:sub=""
        if sub'=0 {
                set sessarray=sessarray+1
                set ref=##class(%CSP.Session).%OpenId(sub,0)
                set id=ref.Get("Userid")
                if id'="" {
                        set emp=##class(Webdev.Employee).%OpenId(id)
                        set sessarray(id)=""
                        set sessarray(id,"FName")=emp.FName
                        set sessarray(id,"LName")=emp.LName
                        set sessarray(id,"AppTimeout")=ref.AppTimeout
                        set sessarray(id,"Sessions",ref.%Id(),"In")=ref.Get("Login")
                }
        }
 }
 set sub="",count=0
 for  {
        set sub=$O(sessarray(sub))
        q:sub=""
        set count=count+1
        if count#2 {
                set row="trowodd"
        }
        else {
                set row="troweven"
        }
        set lu=$SYSTEM.License.ConnectionCount(sub)
        &html<
        <tr id=#(row)#>
        <td id="tdata">#(sub)#</td>
        <td id="tdata">#(sessarray(sub,"FName"))#</td>
        <td id="tdata">#(sessarray(sub,"LName"))#</td>
        <td id="tdata">#(sessarray(sub,"AppTimeout"))#</td>
        <td id="tdata">#(lu)#</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        </tr>
        >
        set sess=""
        for  {
                set sess=$O(sessarray(sub,"Sessions",sess))
                quit:sess=""
                set in=sessarray(sub,"Sessions",sess,"In")
                &html<
                <tr class="_row_">
                <td>&nbsp;</td>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
                <td id="tdata"><div id="#(sess)#" 
OnClick="SessionKill('#(sess)#');">#(sess)#</div></td>                        <td 
id="tdata">#($zt($P(in,",",2),4))#</td>
                </tr>
                >
        }
 }
</script>
<tr><td id="tdata" colspan=4><csp:text textid="SessText1" domain="webdev"></csp:text>: 
#(sessarray)#</td></tr>
<tr><td id="tdata" colspan=4><csp:text textid="SessText2" domain="webdev"></csp:text>: 
#($SYSTEM.License.LUConsumed())#</td></tr>
<tr><td id="tdata" colspan=4><csp:text textid="SessText3" domain="webdev"></csp:text> 
: #($SYSTEM.License.LUMaxConsumed())#</td></tr>
<tr><td id="tdata" colspan=4><csp:text textid="SessText4" domain="webdev"></csp:text>: 
#($SYSTEM.License.LUAvailable())#</td></tr>
<tr><td id="tdata" colspan=4><csp:text textid="SessText5" domain="webdev"></csp:text>: 
#($SYSTEM.License.LUMinAvailable())#</td></tr>
</table>
<script language="javascript">
function SessionKill(sessionid) {
        var kill='';
        kill=#server(Webdev.Employee.KillSession(sessionid))#;
        if (kill) {
                alert('#(%response.GetText(%response.Language,"webdev","kill",""))#');
                self.document.location.reload()
        }
        else {
                CSPstartClock(1);
        }
}
</script>
<timer location="timedout.html" 
message=#(%response.GetText(%response.Language,"webdev","sesswarn","Time remaining 
before session timeout"))#>
</body>
</html>

Reply via email to