Nice script Robert, thank you!

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Steve Busby
Information Technology Services
University of Nebraska Medical Center
985030 Nebraska Medical Center
[EMAIL PROTECTED]
402.559.9621

If Linux doesn't have the solution, you have the wrong problem.

***************University of Nebraska Medical Center E-mail Confidentiality
Disclaimer ***************
 The information in this e-mail is privileged and confidential, intended
only for the use of the addressee(s) above.
 Any unauthorized use or disclosure of this information is prohibited. If
you have received this e-mail by mistake
 please delete it and immediately contact the sender.


                                                                           
             "Kent, Robert"                                                
             <[EMAIL PROTECTED]                                             
             n.edu>                                                     To 
             Sent by:                  <[EMAIL PROTECTED]>   
             WhatsUp_Forum-own                                          cc 
             [EMAIL PROTECTED]                                             
             com                                                   Subject 
                                       RE: [WhatsUp Forum] Web page map    
                                       order                               
             12/19/2003 10:44                                              
             AM                                                            
                                                                           
                                                                           
             Please respond to                                             
             [EMAIL PROTECTED]                                             
              t.ipswitch.com                                               
                                                                           
                                                                           




Below is a modified topview.asp file with some JavaScript that orders the
list alphabetically, tested to work with Netscape, Opera, and IE.

Robert Kent
Network Technician
University of CT


<!--
 Whatsup Gold

 Top View
 ----------------
 main page. Displays a list of open
 maps and map status information.

-->


<HTML>

<%include% StandardPageHeader.asp>

<HEAD>
 <TITLE>WhatsUp Gold - Top View</TITLE>
 <META http-equiv="REFRESH" content="<%APPLICATION_SETTINGS%
WEB_REFRESH_RATE>">

<SCRIPT>
function createRowsArray (table) {
  var rows = new Array();
  var r = 0;
  if (table.tHead == null && table.tFoot == null)
    for (var r1 = 0; r1 < table.rows.length; r1++, r++)
      rows[r] = table.rows[r1];
  else
    for (var t = 0; t < table.tBodies.length; t++)
      for (var r1 = 0; r1 < table.tBodies[t].rows.length; r1++, r++)
        rows[r] = table.tBodies[t].rows[r1];
  return rows;
}
function insertSortedRows(table, rows) {
  if (document.all) var rowsCopy = new Array(rows.length);
  for (var r = 0; r < rows.length; r++) {
    if (document.all) rowsCopy[r] = rows[r].cloneNode(true);
    table.deleteRow(rows[r].rowIndex);
  }
  var tableSection = table.tBodies[table.tBodies.length - 1];
  for (var r = 0; r < rows.length; r++) {
    var row = document.all ? rowsCopy[r] : rows[r];
    tableSection.appendChild(row);
  }
}
function sortTable (table, sortFun) {
  var rows = createRowsArray(table);
  if (rows.length > 0) {
    rows.sort(sortFun);
    insertSortedRows(table, rows);
  }
}

function sortRowsLink (row1 , row2) {
  var column = sortRowsLink.col;
  var cell1 = findFirstLinkChild(row1.cells[column]).firstChild.nodeValue;
  var cell2 = findFirstLinkChild(row2.cells[column]).firstChild.nodeValue;
  return cell1 < cell2 ? - 1 : (cell1 == cell2 ? 0 : 1);
}
function findFirstLinkChild (el) {
  var child = el.firstChild;
  while (child.tagName != 'A')
    child = child.nextSibling;
  return child;
}

function SortTableLinks (table, col) {
  sortRowsLink.col = col;
  sortTable(table, sortRowsLink);
}
function findTableParent (node) {
  while (node.tagName.toUpperCase() != 'TABLE')
    node = node.parentNode;
  return node;
}


</SCRIPT>
<STYLE TYPE="text/css">
 .displayNone { display : none; }
</STYLE>

</HEAD>

<%IF% (%MATCH% (%URL_VALUE% ("ViewMode",0),"Detail"))>
<BODY>
<%ELSE%>
<BODY
ONLOAD="SortTableLinks(findTableParent(document.getElementById('SORT_COLUMN')),
 document.getElementById('SORT_COLUMN').cellIndex);
document.getElementById('table').className='';">
<%ENDIF%>

<H1> <%APPLICATION_SETTINGS% MAIN_TITLE> </H1>

<%IF% IS_EVALUATION_VERSION>

 <%IF% (%GREATERTHAN% (%EVALUATION% DAYS_LEFT, 0))>
  <H3> Evaluation version - <%EVALUATION% DAYS_LEFT>&nbsp;day(s) remaining
</H3>
 <%ENDIF%>

<%ENDIF%>

<%INCLUDE% MainPagePrefix.asp>

<TABLE cellSpacing=0 cellPadding=3 width="98%" bgColor="#c0c0c0" border=2>
 <TR>
 <td align=left bgColor="#0080c0" colSpan=2>
      <TABLE width="100%" border=0>
        <TR>
          <TD><%APPLICATION_SETTINGS% MAIN_TITLE></TD>
          <TD align=right>
  <%IF% (%MATCH% (%URL_VALUE% ("ViewMode",0),"Detail"))>
    <A target=_NEW href="h_detailview.htm">Help</A>
  <%ELSE%>
    <A target=_NEW href="h_top.htm">Help</A>
  <%ENDIF%>
  </TD></TR>
  </TABLE>
 </td>
 </TR>


  <TR>
<%IF% (%MATCH% (%URL_VALUE% ("ViewMode",0),"Detail"))>
    <TD vAlign=top width="98%">
     <TABLE cellSpacing=2 cellPadding=0 width="100%" bgColor="#c0c0c0"
border=0>


       <TR>
   <TD width="20%"></TD>
          <TD width="40%"></TD>
          <TD width="40%"></TD>
   </TR>
      <TR>
          <TD><hr size="4"></TD>
          <TD><hr size="4"></TD>
          <TD><hr size="4"></TD>
   </TR>


   <%START_LOADED_MAP_LIST%>
  <tr>
  <td><a href="map.asp?map=<%URL_ENCODE% (%MAP% FILENAME)>"> <%MAP% NAME>
</A></td>
  <td>
  <table>
  <tr>
  <%IF% (%GREATERTHAN% (%MAP% TOTAL_DEVICES_UP,0))>
   <td bgcolor="#77ff77"><%MAP% TOTAL_DEVICES_UP>&nbsp;device(s) up</td>
  <%ELSE%>
   <td>No devices up!</td>
  <%ENDIF%>

  <%IF% (%GREATERTHAN% (%MAP% (TOTAL_DEVICES_DOWN),0))>
   <td bgcolor="#FF7777"><%MAP% TOTAL_DEVICES_DOWN>&nbsp;device(s)
down</td>
  <%ELSE%>
   <td>No devices down</td>
  <%ENDIF%>
  </tr>
  </table>
  </td>

  <%IF% (%GREATERTHAN% (%MAP% (TOTAL_SERVICES_DOWN),0))>
   <td bgcolor="#ff77ff"><%MAP% TOTAL_SERVICES_DOWN>&nbsp;service(s)
down</td>
  <%ELSE%>
   <td>No Services down</td>
  <%ENDIF%>
  </tr>

   <%START_DEVICE_LIST%>
   <TR>
     <TD>&nbsp;</TD>
     <TD><hr></TD>
     <TD><hr></TD>
    </TR>
   <TR>
     <TD><!-- Leave Map Blank --></TD>
      <TD>
   <%DEVICE% DISPLAY_NAME>

   <%IF% HAS_DEVICE_STATE_CHANGED>
    *
   <%ENDIF%>

   <%IF% IS_MAP_ACCESS_HOST>
    &nbsp;(<A href="device.asp?map=<%URL_ENCODE%(%MAP%
FILENAME)>&device=<%DEVICE% UNIQUE_ID>&MapViewMode=Summary"><%DEVICE%
IP_ADDRESS></A>)
   <%ELSE%>
    &nbsp;(<%DEVICE% IP_ADDRESS>)
   <%ENDIF%>
   </td>


        <TD bgColor="<%DEVICE% POLL_STATE_COLOR>"><%DEVICE% POLL_TYPE></TD>
  </TR>

  <%START_SERVICE_STATISTICS_LIST%>
  <TR>
     <TD><!-- Leave Map Blank --></TD>
     <TD><!-- Leave Name Blank --></TD>
        <TD bgColor="<%SERVICE_STATISTICS%
STATE_COLOR>"><%SERVICE_STATISTICS% FULLNAME></TD>
  </tr>
  <%END_SERVICE_STATISTICS_LIST%>

  <%IF% (%GREATERTHAN% (%DEVICE% ALERT_COUNT, 0))>
   <TR>
     <TD>&nbsp;</TD>
     <TD>&nbsp;</TD>
     <TD><hr></TD>
    </TR>
   <%START_ALERT_LIST%>
    <TR>
       <TD><!-- Leave Map Blank --></TD>
       <TD><!-- Leave Name Blank --></TD>
       <TD><%DEVICE_ALERT% ALERT_NAME></TD>
    </TR>
   <%END_ALERT_LIST%>
  <%ENDIF%>

 <%END_DEVICE_LIST%>

    <TR>
      <TD>&nbsp;</TD>
      <TD>&nbsp;</TD>
      <TD>&nbsp;</TD>
  </TR>
    <TR>
      <TD><hr size="4"></TD>
      <TD><hr size="4"></TD>
      <TD><hr size="4"></TD>
  </TR>


 <%END_LOADED_MAP_LIST%>

  </TABLE>
  </TD>
<%ELSE%>
    <TD vAlign=top width="98%">
 <TABLE cellSpacing=2 cellPadding=0 width="100%" bgColor="#c0c0c0" border=0
ID="LIST">

 <THEAD>
        <TR>
    <TD width="40%" ID="SORT_COLUMN"></TD>
          <TD width="20%"></TD>
          <TD width="20%"></TD>
          <TD width="20%"></TD>
  </TR>
        <TR>
          <TH align=left>Map</TH>
          <TH align=right>Items<BR>Up</TH>
          <TH align=right>Items<BR>Down</TH>
   <TH align=right>Items with<br>Services Down</TH></TR>
 </THEAD>

 <TBODY ID="table" CLASS="displayNone">
   <%START_LOADED_MAP_LIST%>
  <tr >
  <td ><a href="map.asp?map=<%URL_ENCODE% (%MAP% FILENAME)>"> <%MAP% NAME>
</A></td>
  <%IF% (%GREATERTHAN% (%MAP% TOTAL_DEVICES_UP,0))>
   <td bgcolor="#77ff77" align=right><%MAP% TOTAL_DEVICES_UP></td>
  <%ELSE%>
   <td align=right><%MAP% TOTAL_DEVICES_UP></td>
  <%ENDIF%>

  <%IF% (%GREATERTHAN% (%MAP% (TOTAL_DEVICES_DOWN),0))>
   <td bgcolor="#FF7777" align=right><%MAP% TOTAL_DEVICES_DOWN></td>
  <%ELSE%>
   <td align=right> <%MAP% TOTAL_DEVICES_DOWN></td>
  <%ENDIF%>

  <%IF% (%GREATERTHAN% (%MAP% (TOTAL_SERVICES_DOWN),0))>
   <td bgcolor="#ff77ff" align=right><%MAP% TOTAL_SERVICES_DOWN></td>
  <%ELSE%>
   <td align=right><%MAP% TOTAL_SERVICES_DOWN></td>
  <%ENDIF%>
  </tr>

  <%END_LOADED_MAP_LIST%>
  </TBODY>
  </TABLE></TD>


     <!-- Check if we need to play the sound file -->
  <!-- This will iterate over every map if necessary -->
  <%IF% HAS_ANY_MAP_STATE_CHANGED>
   <%IF% IS_SOUND_ENABLED>
     <bgsound src="<%SOUND_TYPE% WEBDOWN>">
   <%ENDIF%>
  <%ENDIF%>

<%ENDIF%>

<%IF% (%MATCH% (%URL_VALUE% ("ViewMode",0),"Detail"))>
    <TD vAlign=top noWrap align=left>
   <TABLE width="100%" border=1>
     <TR>
          <TD noWrap align=center bgColor="#c0c0c0">
    <A href="TopView.asp?ViewMode=Summary">Top View</A></TD></TR></TABLE>
<%ELSE%>
    <TD vAlign=top noWrap align=left>
   <TABLE width="100%" border=1>
     <TR>
          <TD noWrap align=center bgColor="#c0c0c0">
    <A href="TopView.asp?ViewMode=Detail">Detail View</A></TD></TR></TABLE>
<%ENDIF%>

<%IF% IS_WEBSERVER_CONFIGURATION_ENABLED> <!-- APPSETTINGS CONFIGURE -->
 <%IF% IS_USER_CONFIGURE_PROGRAM><!-- USER PROGRAM CONFIGURE -->
       <TABLE width="100%" border=1>
         <TR>
           <TD noWrap align=center bgColor="#c0c0c0">
         <a href="AppSettingsForm.asp">Settings </A></TD></TR></TABLE>
 <!--IF% ACCESS_DEFAULT_MAP -->
        <TABLE width="100%" border=1>
    <TR>
         <TD noWrap align=center bgColor="#c0c0c0">
      <a href="NewMap.asp">New Map</A></TD></TR></TABLE>
 <!--ENDIF%-->
   <TABLE width="100%" border=1>
          <TR>
           <TD noWrap align=center bgColor="#c0c0c0">
     <a href="LoadMapForm.asp">Load Map</A></TD></TR></TABLE>
       <TABLE width="100%" border=1>
         <TR>
           <TD noWrap align=center bgColor="#c0c0c0">
     <a href="UnloadMapForm.asp">Unload Map</A></TD></TR></TABLE>
    <TABLE width="100%" border=1>
         <TR>
           <TD noWrap align=center bgColor="#c0c0c0">
     <a href="ReloadMapForm.asp">Reload Map</A></TD></TR></TABLE>

  <%IF% IS_MAPS_DISPLAYED_CONFIGURABLE>
       <TABLE width="100%" border=1>
         <TR>
           <TD noWrap align=center bgColor="#c0c0c0">
     <a href="SaveMapForm.asp">Save Map</A></TD></TR></TABLE>
  <%ENDIF%>
  <TABLE width="100%" border=1>
     <TR>
   <TD noWrap align=center bgColor="#c0c0c0">
   <A href="notification.asp">Notifications</A></TD></TR></TABLE>
 <%ENDIF%>
<%ENDIF%>


<%IF% IS_CONFIGURE_REPORTS_ENABLED>
     <TABLE width="100%" border=1>
       <TR>
            <TD noWrap align=center bgColor="#c0c0c0">
      <A href="rcnotifylist.asp">Recurring
Notifications</A></TD></TR></TABLE>

   <%IF% IS_USER_ACCESS_LOG>
    <TABLE width="100%" border=1>
        <TR>
           <TD noWrap align=center bgColor="#c0c0c0">
     <A href="ReportPerformanceGraphs.asp">Performance
Graphs</A></TD></TR></TABLE>
   <%ENDIF%>
<%ENDIF%>
<%IF% IS_USER_CONFIGURE_USERS>
       <TABLE width="100%" border=1>
         <TR>
           <TD noWrap align=center bgColor="#c0c0c0">
     <A href="userlist.asp">Users</A></TD></TR></TABLE>
<%ENDIF%>
<%IF% IS_USER_ACCESS_LOG>
      <TABLE width="100%" border=1>
        <TR>
          <TD noWrap align=center bgColor="#c0c0c0">
    <A href="logview.asp">Log view</A></TD></TR></TABLE>
<%ENDIF%>

<%IF% IS_USER_ACCESS_TOOLS>
       <TABLE width="100%" border=1>
         <TR>
           <TD noWrap align=center bgColor="#c0c0c0">
     <A href="tools.asp">Tools</A></TD></TR></TABLE>
  <%ENDIF%>

 </TD></TR></TABLE>


<%INCLUDE% MainPageSuffix.asp>

<%include% StandardPageFooter.asp>
</BODY></HTML>
      -----Original Message-----
      From: [EMAIL PROTECTED]
      [mailto:[EMAIL PROTECTED] On Behalf Of Jason
      Humes
      Sent: Friday, December 19, 2003 8:10 AM
      To: '[EMAIL PROTECTED]'
      Subject: [WhatsUp Forum] Web page map order



      Hi
      I was wondering if there is any way to get the Top View to list the
      maps in a particular order.  Thanks


      Jason D. Humes

      Applied Computer Solutions Inc.
      3020 St. Etienne Blvd.
      Windsor, Ontario
      Phone: (519) 944-4300 x211
      Fax    : (519) 944-4247
      Email : [EMAIL PROTECTED]




      **********************************************************************



      Confidentiality Notice:


      The information contained in this e-mail and any attachments may be
      legally privileged and confidential. If you are not an intended
      recipient, you are hereby notified that any dissemination,
      distribution or copying of this e-mail and any attachments is
      strictly prohibited. If you received this e-mail in error, please
      notify the sender and permanently delete the e-mail and any
      attachments immediately. You should not retain, copy or use this
      e-mail or any attachment for any purpose, nor disclose all or any
      part of the contents to any other person.


      Thank you.







Please visit http://www.ipswitch.com/support/mailing-lists.html 
to be removed from this list.

An Archive of this list is available at:
http://www.mail-archive.com/whatsup_forum%40list.ipswitch.com/

Reply via email to