Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

258 lines
8.5 KiB

  1. <% '==================================================
  2. ' Microsoft Server Appliance
  3. '
  4. ' Status tab page
  5. '
  6. ' Copyright (c) 1999 - 2000 Microsoft Corporation. All rights reserved.
  7. '==================================================%>
  8. <!-- Copyright (c) 1999 - 2000 Microsoft Corporation. All rights reserved-->
  9. <!-- #include file="sh_page.asp" -->
  10. <!-- #include file="embed/resource_embed.asp" -->
  11. <!-- #include file="tabbar.asp" -->
  12. <%
  13. On Error Resume Next
  14. Set objLocMgr = Server.CreateObject("ServerAppliance.LocalizationManager")
  15. strSourceName = "sakitmsg.dll"
  16. if Err.number <> 0 then
  17. Response.Write "Error in localizing the web content "
  18. Response.End
  19. end if
  20. '-----------------------------------------------------
  21. 'START of localization content
  22. Dim L_PAGETITLE_TEXT
  23. Dim L_STATUSLBL_TEXT
  24. Dim L_NOSTATUS_MESSAGE
  25. Dim L_ALERTLBL_TEXT
  26. Dim L_NOALERTS_MESSAGE
  27. Dim L_ALERTDETAILS_MESSAGE
  28. L_PAGETITLE_TEXT = objLocMgr.GetString(strSourceName, "&H4001000C",varReplacementStrings)
  29. L_STATUSLBL_TEXT = objLocMgr.GetString(strSourceName, "&H4001000D",varReplacementStrings)
  30. L_NOSTATUS_MESSAGE = objLocMgr.GetString(strSourceName, "&H4001000E",varReplacementStrings)
  31. L_ALERTLBL_TEXT = objLocMgr.GetString(strSourceName, "&H4001000F",varReplacementStrings)
  32. L_NOALERTS_MESSAGE = objLocMgr.GetString(strSourceName, "&H40010010",varReplacementStrings)
  33. L_ALERTDETAILS_MESSAGE = objLocMgr.GetString(strSourceName, "&H40010011",varReplacementStrings)
  34. 'End of localization content
  35. '-----------------------------------------------------
  36. %>
  37. <HTML>
  38. <meta http-equiv="Content-Type" content="text/html; charset=<%=GetCharSet()%>">
  39. <HEAD>
  40. <TITLE><%=L_PAGETITLE_TEXT%></TITLE>
  41. <meta HTTP-EQUIV="Refresh" CONTENT="60">
  42. <LINK REL="stylesheet" TYPE="text/css" HREF="sh_page.css">
  43. <SCRIPT LANGUAGE="JavaScript" SRC="sh_page.js"></SCRIPT>
  44. </HEAD>
  45. <BODY marginWidth="0" marginHeight="0" onDragDrop="return false;" topmargin="0" LEFTMARGIN="0" oncontextmenu="return false;">
  46. <%
  47. ServePageWaterMarkNavIE
  48. ServeTabBar
  49. ServeResources
  50. ServeAlerts
  51. call ServePageWaterMarkEndNavIE( m_VirtualRoot & "images/status_water.gif", m_VirtualRoot & "images/oem_logo.gif", false)
  52. %>
  53. </BODY>
  54. </HTML>
  55. <%
  56. '----------------------------------------------------------------------------
  57. '
  58. ' Function : ServeResources
  59. '
  60. ' Synopsis : Serves the resources
  61. '
  62. ' Arguments: None
  63. '
  64. ' Returns : None
  65. '
  66. '----------------------------------------------------------------------------
  67. Function ServeResources
  68. on Error resume next
  69. ServeStandardLabelBar(L_STATUSLBL_TEXT)
  70. ServeElementBlock "RESOURCE", L_NOSTATUS_MESSAGE, True, False, False
  71. End Function
  72. '----------------------------------------------------------------------------
  73. '
  74. ' Function : ServeAlerts
  75. '
  76. ' Synopsis : Serves the messages
  77. '
  78. ' Arguments: None
  79. '
  80. ' Returns : None
  81. '
  82. '----------------------------------------------------------------------------
  83. Function ServeAlerts
  84. on Error resume next
  85. ServeStandardLabelBar(L_ALERTLBL_TEXT)
  86. call ServeAlertHTML()
  87. End Function
  88. '----------------------------------------------------------------------------
  89. '
  90. ' Function : ServeAlertHTML
  91. '
  92. ' Synopsis : Generate HTML for the messages
  93. '
  94. ' Arguments: None
  95. '
  96. ' Returns : None
  97. '
  98. '----------------------------------------------------------------------------
  99. Sub ServeAlertHTML()
  100. Dim objElement
  101. Dim objElementCol
  102. Dim objAlertElementCol
  103. Dim objAlertElement
  104. Dim objLocMgr
  105. Dim strElementID
  106. Dim strMsg
  107. Dim strAlertURL
  108. Dim strAlertSrc
  109. Dim intCaptionID
  110. Dim arrAlerts()
  111. Dim strViewer
  112. Dim strDefaultViewer
  113. Dim strReturnURL
  114. Dim varReplacementStrings
  115. Dim i, j
  116. Dim blnSameType
  117. On Error Resume Next
  118. %>
  119. <table border="0" width="500" cellspacing="0">
  120. <% Err.Clear
  121. Set objElementCol = GetElements("SA_Alerts")
  122. If objElementCol.Count=0 or Err.Number <> 0 Then
  123. Err.Clear %>
  124. <tr>
  125. <td width="30" height="28" VALIGN="middle">&nbsp;</td>
  126. <td width="25" HEIGHT="28" VALIGN="middle">&nbsp;</TD>
  127. <TD WIDTH="314" HEIGHT="28" VALIGN="middle" class="RESOURCE"><%=L_NOALERTS_MESSAGE%></TD>
  128. </tr>
  129. <% Else
  130. Set objAlertElementCol = GetElements("AlertDefinitions")
  131. Set objLocMgr = Server.CreateObject("ServerAppliance.LocalizationManager")
  132. i = 0
  133. blnSameType = True
  134. ReDim arrAlerts(objElementCol.Count, 3)
  135. For Each objElement in objElementCol
  136. strAlertSrc = objElement.GetProperty("AlertLog")
  137. strElementID = strAlertSrc & Hex(objElement.GetProperty("AlertID"))
  138. intCaptionID = 0
  139. strMsg = ""
  140. Err.Clear
  141. Set objAlertElement = objAlertElementCol.Item(strElementID)
  142. If Err <> 0 Then
  143. Set objAlertElement = Nothing
  144. Else
  145. intCaptionID = "&H" & objAlertElement.GetProperty("CaptionRID")
  146. varReplacementStrings = objElement.GetProperty("ReplacementStrings")
  147. strMsg = objLocMgr.GetString(strAlertSrc, intCaptionID, varReplacementStrings)
  148. End If
  149. arrAlerts(i, 0) = strMsg
  150. arrAlerts(i, 1) = objElement.GetProperty("Cookie")
  151. arrAlerts(i, 2) = objElement.GetProperty("AlertType")
  152. arrAlerts(i, 3) = Trim(objAlertElement.GetProperty("URL"))
  153. ' adjust alert types for the current display sort order
  154. Select Case arrAlerts(i, 2)
  155. Case 0
  156. arrAlerts(i, 2) = 2
  157. Case 1
  158. arrAlerts(i, 2) = 1
  159. Case 2
  160. arrAlerts(i, 2) = 3
  161. End Select
  162. If i > 0 Then
  163. If arrAlerts(i, 2) <> arrAlerts(i-1, 2) Then
  164. blnSameType = False
  165. End If
  166. End If
  167. i = i + 1
  168. Next
  169. ' sort by Type if needed
  170. If Not blnSameType Then
  171. QuickSort arrAlerts, LBound(arrAlerts,1), UBound(arrAlerts,1)-1, 2
  172. End If
  173. strDefaultViewer = m_VirtualRoot & "util/alert_view.asp"
  174. strReturnURL = "/" & GetScriptPath()
  175. For i = 0 To UBound(arrAlerts,1)
  176. strMsg = arrAlerts(i, 0)
  177. If strMsg <> "" Then
  178. If arrAlerts(i, 3) <> "" Then
  179. strViewer = arrAlerts(i, 3)
  180. Else
  181. strViewer = strDefaultViewer
  182. End If
  183. strAlertURL = strViewer & "?Cookie=" & arrAlerts(i, 1) & "&R=" & Rnd & "&ReturnURL=" & strReturnURL
  184. %>
  185. <tr>
  186. <td width="20" height="28" valign="middle">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>
  187. <td width="25" height="28" align=left>
  188. <img
  189. src="<% Select Case arrAlerts(i, 2)
  190. Case 2 ' 0 SA_ALERT_TYPE_MALFUNCTION,
  191. Response.Write m_VirtualRoot & "images/alert.gif"
  192. Case 1 '1 SA_ALERT_TYPE_FAILURE,
  193. Response.Write m_VirtualRoot & "images/critical_error.gif"
  194. Case 3 '2 SA_ALERT_TYPE_ATTENTION
  195. Response.Write m_VirtualRoot & "images/information.gif"
  196. Case Else
  197. Response.Write m_VirtualRoot & "images/alert.gif"
  198. End Select %>">
  199. </td>
  200. <td align=left valign=middle>
  201. <span class="ALERT">
  202. <A href="<% =strAlertURL %>"
  203. title="<% =L_ALERTDETAILS_MESSAGE %>"
  204. onMouseOver="window.status='<% =EscapeQuotes(L_ALERTDETAILS_MESSAGE) %>';return true;">
  205. <% =arrAlerts(i, 0) %>
  206. </A>
  207. </span>
  208. </td>
  209. </tr>
  210. <% End If
  211. Next
  212. End If
  213. Response.Write "</table>"
  214. Set objLocMgr = Nothing
  215. Set objElement = Nothing
  216. Set objElementCol = Nothing
  217. Set objAlertElement = Nothing
  218. Set objAlertElementCol = Nothing
  219. End Sub
  220. %>