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.

162 lines
4.9 KiB

  1. <%@ Language=VBScript %>
  2. <% Option Explicit %>
  3. <%
  4. '-------------------------------------------------------------------------
  5. ' Server Appliance Status Page
  6. ' Copyright (c) Microsoft Corporation. All rights reserved.
  7. '-------------------------------------------------------------------------
  8. %>
  9. <!-- #include file="inc_framework.asp" -->
  10. <%
  11. '-------------------------------------------------------------------------
  12. ' Global Variables
  13. '-------------------------------------------------------------------------
  14. Dim rc
  15. Dim page
  16. '-------------------------------------------------------------------------
  17. ' Global Form Variables
  18. '-------------------------------------------------------------------------
  19. '======================================================
  20. ' Entry point
  21. '======================================================
  22. Dim aPageTitle(2)
  23. aPageTitle(0) = GetLocString("sacoremsg.dll", "40200BC8", "")
  24. aPageTitle(1) = ""
  25. '
  26. ' Create Page
  27. Call SA_CreatePage( aPageTitle, "", PT_AREA, page )
  28. '
  29. ' Turnoff the automatic page indent attribute
  30. Call SA_SetPageAttribute(page, AUTO_INDENT, PAGEATTR_DISABLE)
  31. '
  32. ' Show page
  33. Call SA_ShowPage( page )
  34. '======================================================
  35. ' Web Framework Event Handlers
  36. '======================================================
  37. '---------------------------------------------------------------------
  38. ' Function: OnInitPage
  39. '
  40. ' Synopsis: Called to signal first time processing for this page. Use this method
  41. ' to do first time initialization tasks.
  42. '
  43. ' Returns: TRUE to indicate initialization was successful. FALSE to indicate
  44. ' errors. Returning FALSE will cause the page to be abandoned.
  45. '
  46. '---------------------------------------------------------------------
  47. Public Function OnInitPage(ByRef PageIn, ByRef EventArg)
  48. OnInitPage = TRUE
  49. End Function
  50. '---------------------------------------------------------------------
  51. ' Function: OnServeAreaPage
  52. '
  53. ' Synopsis: Called when the page needs to be served. Use this method to
  54. ' serve content.
  55. '
  56. ' Returns: TRUE to indicate not problems occured. FALSE to indicate errors.
  57. ' Returning FALSE will cause the page to be abandoned.
  58. '
  59. '---------------------------------------------------------------------
  60. Public Function OnServeAreaPage(ByRef PageIn, ByRef EventArg)
  61. Dim L_ALERTS_PANEL_TITLE
  62. Dim L_RESOURCE_PANEL_TITLE
  63. Dim sStatusDetailsURL
  64. sStatusDetailsURL = m_VirtualRoot + "sh_statusdetails.asp"
  65. L_ALERTS_PANEL_TITLE = GetLocString("sakitmsg.dll", "4001000F", "")
  66. L_RESOURCE_PANEL_TITLE = GetLocString("sacoremsg.dll", "40200BB8", "")
  67. %>
  68. <script>
  69. function Init()
  70. {
  71. }
  72. </script>
  73. <%
  74. If ( IsResourceStatusEnabled()) Then
  75. %>
  76. <table width=100% cellspacing=10 height=100% border=0>
  77. <tr>
  78. <td valign=top width=50%>
  79. <% Call SA_ServeAlertsPanel("AlertDefinitions", L_ALERTS_PANEL_TITLE, SA_DEFAULT, SA_DEFAULT, SA_DEFAULT) %>
  80. </td>
  81. <td valign=top width=50%>
  82. <% Call SA_ServeResourcesPanel(SA_DEFAULT, L_RESOURCE_PANEL_TITLE, SA_DEFAULT, SA_DEFAULT, SA_DEFAULT) %>
  83. </td>
  84. </tr>
  85. <tr>
  86. <td valign=top colspan=2 width=100%>
  87. <IFRAME src='<%=sStatusDetailsURL%>' border=0 frameborder=0 name=IFStatusContent width='100%' height='300px'></IFRAME>
  88. </td>
  89. </tr>
  90. </table>
  91. <%
  92. Else
  93. %>
  94. <table width=100% cellspacing=10 height=100% border=0>
  95. <tr>
  96. <td valign=top width=100%>
  97. <% Call SA_ServeAlertsPanel("AlertDefinitions", L_ALERTS_PANEL_TITLE, SA_DEFAULT, SA_DEFAULT, SA_DEFAULT) %>
  98. </td>
  99. </tr>
  100. <tr>
  101. <td valign=top width=100%>
  102. <IFRAME src='<%=sStatusDetailsURL%>' border=0 frameborder=0 name=IFStatusContent width='100%' height='300px'></IFRAME>
  103. </td>
  104. </tr>
  105. </table>
  106. <%
  107. End If
  108. %>
  109. <%
  110. OnServeAreaPage = TRUE
  111. End Function
  112. '======================================================
  113. ' Private Functions
  114. '======================================================
  115. Private Function IsResourceStatusEnabled()
  116. on error resume next
  117. Err.Clear
  118. Dim oContainer
  119. Dim oElement
  120. IsResourceStatusEnabled = FALSE
  121. Set oContainer = GetElements("ResourceTitle")
  122. If ( Err.Number <> 0 ) Then
  123. Call SA_TraceOut("STATUSPAGE", "IsResourceStatusEnabled encountered error in GetElements(ResourceTitle) :" + Err.Number + " " + Err.Description)
  124. Err.Clear
  125. Exit Function
  126. End If
  127. For each oElement in oContainer
  128. If ( Len(Trim(oElement.GetProperty("CaptionRID"))) > 0 ) Then
  129. If ( Err.Number <> 0 ) Then
  130. Call SA_TraceOut("STATUSPAGE", "IsResourceStatusEnabled encountered error in oElement.GetProperty(CaptionRID) :" + Err.Number + " " + Err.Description)
  131. Exit Function
  132. End If
  133. IsResourceStatusEnabled = TRUE
  134. End If
  135. Next
  136. Set oContainer = Nothing
  137. End Function
  138. %>