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.

176 lines
4.6 KiB

  1. <% '==================================================
  2. ' Module: NASServeStatusBar.asp
  3. '
  4. ' Synopsis: Create the NAS Appliance Status Bar HTML Content
  5. '
  6. ' Copyright (c) Microsoft Corporation. All rights reserved.
  7. '================================================== %>
  8. <%
  9. '
  10. ' Include the OEM provided STATUS content
  11. '
  12. %>
  13. <%
  14. Function SA_ServeStatusBar()
  15. Call ServeStatusBar(True, "", "")
  16. End Function
  17. Function NASServeStatusBar()
  18. Call ServeStatusBar(True, "", "")
  19. 'Call ServeStatusBar(False, "Status: Restarting", "StatusCritical")
  20. End Function
  21. Function StatusBarBreak()
  22. '
  23. ' Status Bar Seperator
  24. '
  25. Response.Write("<TABLE CELLPADDING='0' CELLSPACING='0' BORDER='0' WIDTH='100%' HEIGHT='1'>"+vbCrLf)
  26. Response.Write("<TR><TD><IMG SRC='" + m_VirtualRoot + "images/StatusBarBreak.gif' WIDTH='100%'></TD></TR>"+vbCrLf)
  27. Response.Write("</TABLE>"+vbCrLf)
  28. End Function
  29. Function ServeStatusBar(blnUpdateStatus, strStatusText, strCSSClass)
  30. on error resume next
  31. Dim objElements
  32. Dim objItem
  33. Dim blnEnabled
  34. Dim rc
  35. Dim iconPath
  36. Dim url
  37. Call EmitStatusBarHeader()
  38. StatusBarBreak()
  39. '
  40. ' Status bar table contains four (4) columns and one (1) row
  41. '
  42. Response.Write("<table class='StatusBar' cols=4 border=0 width='100%' height='50' cellspacing='0' cellpadding=0>"+vbCrLf)
  43. Response.Write("<tr>"+vbCrLf)
  44. '
  45. ' First column - OEM Logo
  46. '
  47. Response.Write("<td width=20 >")
  48. Set objElements = GetElements("OemLogo")
  49. For Each objItem in objElements
  50. url = objItem.GetProperty("URL")
  51. If ( 0 < Len(Trim(url)) ) Then
  52. iconPath = objItem.GetProperty("ElementGraphic")
  53. iconPath = m_VirtualRoot + iconPath
  54. Response.Write("<A target='_blank' HREF="+url+">"+vbCrLf)
  55. Response.Write("<IMG src=" & Chr(34) & iconPath & Chr(34) & " border=0></A></td>"+vbCrLf)
  56. Else
  57. iconPath = objItem.GetProperty("ElementGraphic")
  58. iconPath = m_VirtualRoot + iconPath
  59. Response.Write("<IMG src=" & Chr(34) & iconPath & Chr(34) & " border=0></td>"+vbCrLf)
  60. End If
  61. Exit For
  62. Next
  63. Set objElements = Nothing
  64. Set objItem = Nothing
  65. '
  66. ' Second column - Spacer
  67. '
  68. Response.Write("<td class='StatusBar' width='20'>")
  69. Response.Write("&nbsp;")
  70. Response.Write("</td>"+vbCrLf)
  71. '
  72. ' Third column - Server Name and OEM provided STATUS
  73. '
  74. Response.Write("<td width=40% class='StatusBar' align='left'>")
  75. Response.Write("<table align='left' cols=1 border='0' cellspacing='0' cellpadding='0'>")
  76. '
  77. ' Server Name
  78. '
  79. Response.Write("<tr align='left'>")
  80. Response.Write("<td class='StatusBar' align='left'>")
  81. Response.Write(Server.HTMLEncode(GetComputerNameEx()))
  82. Response.Write("</td>")
  83. Response.Write("</tr>"+vbCrLf)
  84. 'Response.Write("<br>"+vbCrLf)
  85. '
  86. ' OEM Provided STATUS
  87. '
  88. Response.Write("<tr align='left'>")
  89. Response.Write("<td width='100%' align='left'>")
  90. If (blnUpdateStatus) Then
  91. Set objElements = GetElements("STATUS")
  92. For Each objItem in objElements
  93. Dim strStatusURL
  94. strStatusURL = m_VirtualRoot & objItem.GetProperty("URL")
  95. Call SA_MungeURL(strStatusURL, SAI_FLD_PAGEKEY, SAI_GetPageKey())
  96. Response.Write("<iframe width='100%' height=25 frameborder=0 src='" & strStatusURL & "'></iframe>"+vbCrLf)
  97. Exit For
  98. Next
  99. Else
  100. Response.Write("<div class='" + strCSSClass + "'>" + strStatusText + "</div>")
  101. End If
  102. Response.Write("</td>")
  103. Response.Write("</tr>")
  104. Response.Write("</table>")
  105. Response.Write("</td>"+vbCrLf)
  106. '
  107. ' Fourth column - Windows Powered Branding
  108. '
  109. Dim winPowered
  110. Dim winPoweredURL
  111. winPowered = m_VirtualRoot + "images/WinPwr_h_R.gif"
  112. winPoweredURL = "http://go.microsoft.com/fwlink/?LinkId=10336"
  113. Response.Write("<td valign=middle align='right'>")
  114. Response.Write("<A target='_blank' HREF='"+winPoweredURL+"' >")
  115. Response.Write("<IMG src=" & Chr(34) & winPowered & Chr(34) & " border=0></A>")
  116. Response.Write("&nbsp;</td>")
  117. Response.Write("</tr>")
  118. Response.Write("</table>"+vbCrLf)
  119. StatusBarBreak()
  120. Call EmitStatusBarFooter()
  121. End Function
  122. Function EmitStatusBarHeader()
  123. %>
  124. <html>
  125. <head>
  126. <!-- Microsoft(R) Server Appliance Platform - Web Framework Status Bar
  127. Copyright (c) Microsoft Corporation. All rights reserved. -->
  128. <meta http-equiv="Content-Type" content="text/html; charset=<%=GetCharSet()%>">
  129. <%
  130. Call SA_EmitAdditionalStyleSheetReferences("")
  131. %>
  132. </head>
  133. <BODY>
  134. <%
  135. End Function
  136. Function EmitStatusBarFooter()
  137. %>
  138. </BODY>
  139. </html>
  140. <%
  141. End Function
  142. %>