Source code of Windows XP (NT5)
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.

1240 lines
53 KiB

  1. <!--
  2. Copyright (c) 2000 Microsoft Corporation
  3. -->
  4. <HTML XMLNS:helpcenter>
  5. <!--
  6. Styles used by this web page and the saved web page. Some of these styles are already defined in
  7. PCHEALTH, but they are included here so the saved web page can inherite these styles.
  8. -->
  9. <STYLE id=idStyles>
  10. .sys-font-body
  11. {
  12. font : messagebox;
  13. }
  14. .sys-color-body
  15. {
  16. color : #000000;
  17. }
  18. .sys-color-body-alert
  19. {
  20. color : #FF0000;
  21. }
  22. .sys-color-body-ok
  23. {
  24. color : #009900;
  25. }
  26. .sys-toppane-header-color
  27. {
  28. color : #FFFFFF;
  29. }
  30. .Text-Caption
  31. {
  32. color : blue;
  33. font-family : Tahoma;
  34. font-size : 8pt;
  35. align-text : left
  36. }
  37. .Text-Comment
  38. {
  39. color : blue;
  40. font-family : Tahoma;
  41. font-size : 8pt;
  42. align-text : left
  43. }
  44. .Text-Data
  45. {
  46. color : black;
  47. font-family : Tahoma;
  48. font-size : 7pt;
  49. align-text : left
  50. }
  51. .Text-Loading
  52. {
  53. color : green;
  54. font-family : Tahoma;
  55. font-size : 8pt;
  56. align-text : center;
  57. font-weight : bold;
  58. }
  59. .Text-OptionDescription
  60. {
  61. color : green;
  62. font-family : Tahoma;
  63. font-size : 8pt;
  64. align-text : center;
  65. font-style : italic;
  66. margin-left : 50 px
  67. }
  68. .AlignCenter
  69. {
  70. text-align:"center"
  71. }
  72. .AlignRight
  73. {
  74. text-align:"right"
  75. }
  76. .AlignLeft
  77. {
  78. text-align:"Left"
  79. }
  80. </STYLE>
  81. <!--
  82. Include PCHEALTH's style sheets, so we can have the same look
  83. -->
  84. <META HTTP-EQUIV="MSThemeCompatible" CONTENT="Yes">
  85. <LINK ID=Stylesheet_Ref1 href="hcp://system/css/Behaviors.css" rel=STYLESHEET type=text/css>
  86. <LINK ID=Stylesheet_Ref2 href="hcp://system/css/Layout.css" rel=STYLESHEET type=text/css>
  87. <LINK ID=Stylesheet_Ref href="hcp://system/css/Shared.css" rel=STYLESHEET type=text/css>
  88. <STYLE>
  89. BODY
  90. {
  91. margin : 16px;
  92. margin-top : 11px;
  93. }
  94. .layout-description
  95. {
  96. margin-top : 3px;
  97. }
  98. .layout-arrow
  99. {
  100. position : relative;
  101. top : 7px;
  102. margin-right : 4px;
  103. width : 20px;
  104. height : 20px;
  105. }
  106. .LearnMore
  107. {
  108. margin-top: 1em
  109. }
  110. </STYLE>
  111. <BODY onbeforeunload="OnClose()" class="sys-rhp-color" >
  112. <TITLE id=idTitelTxt>Network Diagnostics</TITLE>
  113. <script id=shared_vbs language=VBS>
  114. '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  115. '' Shared VBS code. Both this page and the saved file uses these functions
  116. '' to navigate through the tree
  117. '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  118. ' This flag indicates if the results tree should be displayed in text mode (i.e. + and - signs)
  119. ' or in non text mode (with the + and - images). The text mode is used by the saved file
  120. ' so it can be an independent htm file (does not rely on the +/- images)
  121. g_bTextMode = TRUE
  122. ' +/- images used by the results tree
  123. g_ImagePath = "..\images\expando\"
  124. g_CollapseMouseRest = g_ImagePath & "expanded.gif"
  125. g_ExpandMouseRest = g_ImagePath & "collapsed.gif"
  126. g_EmptyMouseRest = g_ImagePath & "endnode.gif"
  127. '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  128. '' Toggle -
  129. '' Description - Expand and collapse a branch in the results tree
  130. '' Arguments - idButton - id of the + / - sign (Text or non text depending on the mode)
  131. '' divSub - id of the branch to expand or collapse
  132. '' Return - void
  133. '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  134. function toggle(idButton, divSub)
  135. select case idButton.value
  136. case 0
  137. ' Was expanded, now will be collapsed
  138. divSub.style.display = "none"
  139. idButton.value = 1
  140. idButton.innerHTML = GetTreeButtonImage(idButton.value,0)
  141. case 1
  142. ' Was collapsed, now will be expanded
  143. divSub.style.display = ""
  144. idButton.value = 0
  145. idButton.innerHTML = GetTreeButtonImage(idButton.value,0)
  146. case 2
  147. ' Does not change. It is a leaf, has nothing to expand of collapse
  148. idButton.value = 2
  149. idButton.innerHTML = GetTreeButtonImage(idButton.value,0)
  150. end select
  151. window.event.cancelBubble = true
  152. end function
  153. '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  154. '' Toggle -
  155. '' Description - Gets HTML code for the +/- sign.
  156. '' Arguments - bButtonState - State of the button (expanded, collapsed, none)
  157. '' Return - HTML code with the corresponding +/-
  158. '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  159. function GetTreeButtonImage(bButtonState, bMouseState)
  160. if g_bTextMode then
  161. ' Get the Text mode +/-
  162. select case bButtonState
  163. case 0
  164. strImg = "<SPAN style='font-family:Courier'> - </SPAN>"
  165. case 1
  166. strImg = "<SPAN style='font-family:Courier'> + </SPAN>"
  167. case else
  168. strImg = "<SPAN style='font-family:Courier'> &nbsp </SPAN>"
  169. end select
  170. GetTreeButtonImage = strImg
  171. else
  172. ' Get the non text mode +/-
  173. select case bButtonState
  174. case 0
  175. strImg = g_CollapseMouseRest
  176. case 1
  177. strImg = g_ExpandMouseRest
  178. case else
  179. strImg = g_EmptyMouseRest
  180. end select
  181. GetTreeButtonImage = "<img src='" & strImg & "'> "
  182. end if
  183. end function
  184. </script>
  185. <!--
  186. Display the Network Diagnostics Title and a description of what this page does
  187. -->
  188. <DIV id=idTitelTxt class="sys-font-heading3 sys-rhp-color-title">
  189. Network Diagnostics
  190. </DIV>
  191. <BR>
  192. <DIV id=idDescription class="sys-font-body sys-color-body">
  193. Network Diagnostics scans your system to gather information about your hardware, software, and network connections.
  194. <DIV class="LearnMore">
  195. <A TABINDEX=0 class="sys-font-body sys-link-normal" href="" onclick="ShowLearnMore('dglogshelp.htm');return false;" onkeypress="ShowLearnMore('dglogshelp.htm');return false;">
  196. <ID id=idLeanAboutText>Tell me about Network Diagnostics</ID>
  197. </A>
  198. </DIV>
  199. </DIV>
  200. <!--
  201. Load the Network Diagnostics ActiveX Object (DGLOGS.DLL). This ActiveX object collects all of the computer
  202. information, performs all the tests and hands the data back to this web page in an XML format
  203. -->
  204. <OBJECT id=Dglogs classid=clsid:76FF3452-E474-4032-BED5-BBE4E96B6D2F></OBJECT>
  205. <!--
  206. Display the Start scan and set options buttons
  207. -->
  208. <DIV class="layout-description">
  209. <A id=idScan class="sys-link-normal sys-font-body sys-color-body" href="" onclick="OnStart();return false;" onkeypress="OnStart();return false;">
  210. <helpcenter:bitmap class="layout-arrow" SRCNORMAL="hcp://system/images/16x16/arrow_green_normal_shadow.bmp"></helpcenter:bitmap>
  211. <ID id=idScanTxt> Scan your system </ID>
  212. </A>
  213. </DIV>
  214. <DIV class="layout-description">
  215. <A id=idSetOptions class="sys-link-normal sys-font-body sys-color-body" href="" onclick="OnSetOptions();return false;" onkeypress="OnSetOptions();return false;">
  216. <helpcenter:bitmap class="layout-arrow" SRCNORMAL="hcp://system/images/16x16/arrow_blue_normal_shadow.bmp"></helpcenter:bitmap>
  217. <ID id=idSetOptionTxt>Set scanning options</ID>
  218. </A>
  219. </DIV>
  220. <!--
  221. Displays the progress bar. Above the progress bar is the completion percentage. Below the progres bar
  222. is the message informing the user of what the program is currently doing.
  223. -->
  224. <DIV id=idProgress style='display:none AlignCenter'>
  225. <CENTER>
  226. <table width=50% height=60%>
  227. <tr><td class=AlignCenter>
  228. <DIV id=idLoadPercent class='text-loading'></DIV>
  229. <DIV id=idProgressBar></DIV>
  230. <DIV id=idLoadMsg class='text-loading'></DIV>
  231. <P>
  232. <INPUT class='sys-font-body AlignCenter' type="button" value="Cancel" id=idAbort onclick="OnAbort()">
  233. </td></tr>
  234. </table>
  235. </CENTER>
  236. </DIV>
  237. <!--
  238. Displays the options page.
  239. -->
  240. <DIV id=idOptions style='display:none'>
  241. <table width=100%>
  242. <tr><td class=AlignRight>
  243. <SPAN id=idBackButton><INPUT class=sys-font-body type="button" value="Back to Results Page" id=idBack onclick="OnBack()"></SPAN>
  244. <INPUT class=sys-font-body type="button" value="Save Options" id=idSaveOptions onclick="SaveState()" TITLE="Saves the scanning options you have chosen so that you can refer to them the next time you use Network Diagnostics.">
  245. </td></tr>
  246. <tr>
  247. <td class=AlignLeft bgcolor=darkblue>
  248. <DIV class="sys-font-body-bold sys-toppane-header-color">
  249. <ID id=idOptionsText> Options </ID>
  250. </DIV>
  251. </td>
  252. </tr>
  253. </table>
  254. <DIV id=idOptionSet class="sys-font-heading4 sys-rhp-color-title"> Actions </DIV>
  255. <SPAN id=idPingDescText title="Ping tries to contact a remote computer on the network. Successfully contacting the computer does not imply that the required network service is running." >
  256. <INPUT id=idPing CHECKED type=checkbox name=Ping>
  257. <SPAN class="sys-font-body sys-color-body">
  258. Ping
  259. </SPAN>
  260. </SPAN><BR>
  261. <SPAN id=idConnectDescTxt title="Connect checks whether a remote computer appears to be supporting a networking service. If the remote computer does appear to be supporting a networking service, it does not guarantee that the network service is operating correctly but does imply that it is running." >
  262. <INPUT id=idConnect CHECKED type=checkbox name=Connect>
  263. <SPAN class="sys-font-body sys-color-body">
  264. Connect
  265. </SPAN>
  266. </SPAN><BR>
  267. <SPAN id=idShowDescText title="Show gathers basic computer information for certain categories.">
  268. <INPUT id=idShow CHECKED type=checkbox name=Show>
  269. <SPAN class="sys-font-body sys-color-body">
  270. Show
  271. </SPAN>
  272. </SPAN><BR>
  273. <SPAN id=idVerboseDescText title="Verbose gathers advanced computer information for certain categories.">
  274. <INPUT id=idVerbose type=checkbox name=Verbose>
  275. <SPAN class="sys-font-body sys-color-body">
  276. Verbose
  277. </SPAN>
  278. </SPAN><BR>
  279. <SPAN id=idSaveDesktopDescText title="Save the file to the desktop.">
  280. <INPUT id=idSaveToDeskTop CHECKED type=checkbox name=SaveToDeskTop >
  281. <SPAN class="sys-font-body sys-color-body">
  282. Save to Desktop
  283. </SPAN>
  284. </SPAN><BR>
  285. <DIV class="sys-font-heading4 sys-rhp-color-title"><ID id=idCategoriesText>Categories</ID></DIV>
  286. <SPAN id=idMailDescTxt title="Displays the inbound and outbound mail server host name, port number, and mail type. The Actions that apply are Ping and Connect.">
  287. <INPUT id=idMail CHECKED type=checkbox name=Mail>
  288. <SPAN class="sys-font-body sys-color-body">
  289. Mail Service
  290. </SPAN>
  291. </SPAN><BR>
  292. <SPAN id=idNewsDescText title="Displays the default Outlook Express news server name and port number. The Actions that apply are Ping and Connect.">
  293. <INPUT id=idNews CHECKED type=checkbox name=News>
  294. <SPAN class="sys-font-body sys-color-body">
  295. News Service
  296. </SPAN>
  297. </SPAN><BR>
  298. <SPAN id=idProxyDescText title="Displays Internet Explorer's server name, port number, and whether the proxy is enabled. The Actions that apply are Ping and Connect.">
  299. <INPUT id=idProxy CHECKED type=checkbox name=IEProxy>
  300. <SPAN class="sys-font-body sys-color-body">
  301. Internet Proxy Server
  302. </SPAN>
  303. </SPAN><BR>
  304. <SPAN id=idComputerDescText title="Displays information about your local computer. The Actions that apply are Show and Verbose.">
  305. <INPUT id=idComputer CHECKED type=checkbox name=Computer>
  306. <SPAN class="sys-font-body sys-color-body">
  307. Computer Information
  308. </SPAN>
  309. </SPAN><BR>
  310. <SPAN id=idOSDescText title="Displays information about your operating system. The Actions that apply are Show and Verbose.">
  311. <INPUT id=idOS CHECKED type=checkbox name=OS>
  312. <SPAN class="sys-font-body sys-color-body">
  313. Operating System
  314. </SPAN>
  315. </SPAN><BR>
  316. <SPAN id=idVersionDescText title="Displays your Windows version information. The Actions that apply are Show and Verbose.">
  317. <INPUT id=idVersion CHECKED type=checkbox name=Version>
  318. <SPAN class="sys-font-body sys-color-body">
  319. Windows Version
  320. </SPAN>
  321. </SPAN><BR>
  322. <SPAN id=idModemsDescText title="Displays all modems. The Actions that apply are Show and Verbose.">
  323. <INPUT id=idModem CHECKED type=checkbox name=Modem>
  324. <SPAN class="sys-font-body sys-color-body">
  325. Modems
  326. </SPAN>
  327. </SPAN><BR>
  328. <SPAN id=idClientsDescText title="Displays all of your network clients. The Actions that apply are Show and Verbose.">
  329. <INPUT id=idClient CHECKED type=checkbox name=Client>
  330. <SPAN class="sys-font-body sys-color-body">
  331. Network Clients
  332. </SPAN>
  333. </SPAN><BR>
  334. <SPAN id=idAdapterDescText title="Displays all active and inactive adapters on your network. The Actions that apply are Ping, Show, and Verbose.">
  335. <INPUT id=idAdapter CHECKED type=checkbox name=Adapter>
  336. <SPAN class="sys-font-body sys-color-body">
  337. Network Adapters
  338. </SPAN>
  339. </SPAN><BR>
  340. <SPAN id=idDomainDescText title="Displays the Domain Name Servers for each network adapter. The Action that applies is Ping.">
  341. <INPUT id=idDns type=checkbox name=DNS>
  342. <SPAN class="sys-font-body sys-color-body">
  343. Domain Name System (DNS)
  344. </SPAN>
  345. </SPAN><BR>
  346. <SPAN id=idDHCPDescText title="Displays the DHCP servers for each network adapter. The Action that applies is Ping.">
  347. <INPUT id=idDhcp type=checkbox name=DHCP>
  348. <SPAN class="sys-font-body sys-color-body">
  349. Dynamic Host Configuration Protocol (DHCP)
  350. </SPAN>
  351. </SPAN><BR>
  352. <SPAN id=idGatewayDescText title="Displays the default gateway server for each network adapter. The Action that applies is Ping.">
  353. <INPUT id=idGateway type=checkbox name=Gateway>
  354. <SPAN class="sys-font-body sys-color-body">
  355. Default Gateways
  356. </SPAN>
  357. </SPAN><BR>
  358. <SPAN id=idIPDescText title="Displays the Internet Protocol Address for each network adapter. The Action that applies is Ping.">
  359. <INPUT id=idIP type=checkbox name=IP>
  360. <SPAN class="sys-font-body sys-color-body">
  361. Internet Protocol Address
  362. </SPAN>
  363. </SPAN><BR>
  364. <SPAN id=idWINSDescText title="Displays the primary and secondary WINS servers for each network adapter. The Action that applies is Ping.">
  365. <INPUT id=idWins type=checkbox name=Wins>
  366. <SPAN class="sys-font-body sys-color-body">
  367. Windows Internet Naming Service (WINS)
  368. </SPAN>
  369. </SPAN><BR>
  370. </DIV>
  371. <DIV id=idResults style="display:none">
  372. <table width=100%>
  373. <TR>
  374. <TD class=AlignRight>
  375. <A id=idShowSavedFiles href="" target="_blank" class="sys-link-normal sys-font-body sys-color-body">
  376. <ID id=idShowSavedFileText>Show Saved Files</ID>
  377. </A>
  378. <INPUT class=sys-font-body type="button" value='Save to file...' id=idSaveToFile onclick='OnSaveToFile()'>
  379. </TD>
  380. </TR>
  381. <tr><td>
  382. <DIV id=idData style="COLOR: black" ></DIV>
  383. <DIV id=idDataTxt style="display:none"></DIV>
  384. </td></tr>
  385. </table>
  386. </DIV>
  387. <!--
  388. Blank ID. Do not delete. Branches that are empty refrence this id. They need an id to refernce.
  389. -->
  390. <DIV id=idBlank></DIV>
  391. <SCRIPT Language=javascript>
  392. /* Make the dialog variable global and initialize it to null so you can test for its existence before calling showModelessDialog. e.g. when it exists it is not null. However, it must be set back to null when the dialog closes (see below). This ensures that only one instance of the Tell me dialog can exist at one time... */
  393. var g_oLearnMoreDlg = null;
  394. var sDlgFeatures = "help:no;status:no;resizable:no;dialogWidth:385px;dialogHeight:440px"
  395. function ShowLearnMore( sTopicURL )
  396. {
  397. if( null == g_oLearnMoreDlg )
  398. {
  399. //pass in a reference to this window so that script in the dialog can communicate with this page...
  400. g_oLearnMoreDlg = window.showModelessDialog( sTopicURL, window, sDlgFeatures );
  401. }
  402. }
  403. </SCRIPT>
  404. <SCRIPT LANGUAGE=VBS>
  405. ' The begining and end of the saved web page
  406. SavedFile_Head = "<BODY><HTML><SCRIPT Language=javascript></"
  407. SavedFile_Head = SavedFile_Head + "SCRIPT><DIV id=idBlank style='display:none'></DIV>"
  408. SavedFile_Tail = "</BODY></HTML>"
  409. ' Text that is displayed by the web page. Done so it can be localized.
  410. L_NetDiagSave_FileName = "Netdiag "
  411. L_NetDiagPath_FolderName = "\pchealth\helpctr\system\netdiag"
  412. L_Canceling_Text = "Canceling, please wait ..."
  413. L_DgnetLoadError_Text = "Unable to load ActiveX Control Dgnet.dll"
  414. L_Fail_Text = "FAILED"
  415. L_Pass_Text = "PASSED"
  416. L_FileSaved_Text = "File Saved:"
  417. L_DgnetOtherInstance_Text = "An other instance of this program is already running."
  418. L_FormatingResults_Text = "Formatting Results"
  419. L_NoFileSaved_Text = "File not saved. Select the save to desktop option, to save the file to the desktop."
  420. L_SaveToDesktop_Text = "To your desktop: "
  421. L_AndTo_Text = "and to "
  422. ' Constant values
  423. const FLAG_VERBOSE_LOW = 1
  424. const FLAG_VERBOSE_MEDIUM = 2
  425. const FLAG_VERBOSE_HIGH = 4
  426. const FLAG_CMD_PING = 8
  427. const FLAG_CMD_SHOW = 16
  428. const FLAG_CMD_CONNECT = 32
  429. ' Global variables
  430. g_bRunning = FALSE ' Indicates that the program is collecting data
  431. g_bTextMode = FALSE ' Indicates that the results tree should be displayed with images rather than +/- text
  432. g_FormatingData = FALSE ' Indicates that e program has finished collecting data and is now formating the results tree with the data
  433. g_strLastCategory = ""
  434. g_iIDCount = 0
  435. g_fso = NULL
  436. g_xmlDoc = NULL
  437. g_WshShell = NULL
  438. ' Initialize the web page
  439. call Initialize()
  440. '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  441. '' Initialize
  442. '' Description - Initialize the wbe page. Load the settings, Set the PCHEALTH link, create
  443. '' the filesystem and XML objects
  444. '' Arguments - void
  445. '' Return - void
  446. '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  447. function Initialize
  448. ' Load the option settings
  449. call LoadState()
  450. ' Get the PCHEALTH path and the Show Saved files link
  451. Set g_fso = CreateObject("Scripting.FileSystemObject")
  452. fname = g_fso.GetSpecialFolder(WindowsFolder) & L_NetDiagPath_FolderName
  453. idShowSavedFiles.href = fname
  454. ' Create the wshell object so we can get the desktop dir
  455. set g_WshShell = CreateObject("WScript.Shell")
  456. ' Create the XML parser object
  457. Set g_xmlDoc = CreateObject("microsoft.xmldom")
  458. g_xmlDoc.async = False
  459. ' Display the into page. i.e. nothing
  460. call SetDisplay(0)
  461. end function
  462. '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  463. '' OnShowSavedFiles
  464. '' Description - Opens a new window to display the saved files
  465. '' Arguments - void
  466. '' Return - void
  467. '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  468. function OnShowSavedFiles
  469. document.links
  470. end function
  471. '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  472. '' OnBack
  473. '' Description - Switches from the options page to the result page
  474. '' Arguments - void
  475. '' Return - void
  476. '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  477. function OnBack()
  478. if idData.innerHTML <> "" and not g_FormatingData then
  479. ' Only switch to the results view if the data has already been collected
  480. SetDisplay(3)
  481. end if
  482. end function
  483. '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  484. '' OnBack
  485. '' Description - Switches to the specified view
  486. '' 0 - Intro page (blank page)
  487. '' 1 - Options page
  488. '' 2 - Progress bar page
  489. '' 3 - Results page
  490. '' Arguments - iType - Page to switch to
  491. '' Return - void
  492. '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  493. function SetDisplay(iType)
  494. select case iType
  495. case 0 ' Intro
  496. idOptions.style.display = "none"
  497. idProgress.style.display = "none"
  498. idResults.style.display = "none"
  499. idScan.style.display = ""
  500. idSetOptions.style.display = ""
  501. case 1 'Options Display
  502. idOptions.style.display = ""
  503. idProgress.style.display = "none"
  504. idResults.style.display = "none"
  505. idScan.style.display = ""
  506. idSetOptions.style.display = "none"
  507. case 2 ' Progress display
  508. idOptions.style.display = "none"
  509. idProgress.style.display = ""
  510. idResults.style.display = "none"
  511. idScan.style.display = "none"
  512. idSetOptions.style.display = "none"
  513. case 3 ' Data display
  514. idOptions.style.display = "none"
  515. idProgress.style.display = "none"
  516. idResults.style.display = ""
  517. idScan.style.display = ""
  518. idSetOptions.style.display = ""
  519. end select
  520. end function
  521. '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  522. '' OnBack
  523. '' Description - Stops the dglogs query, and goes back to the results page
  524. '' Arguments - void
  525. '' Return - void
  526. '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  527. function OnClose()
  528. if g_bRunning = TRUE then
  529. idLoadMsg.innerHTML = L_Canceling_Text
  530. Dglogs.StopQuery
  531. g_bRunning = false
  532. SetDisplay(0)
  533. end if
  534. end function
  535. '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  536. '' OnAbort
  537. '' Description - If the web page is collecting data and the Cancel button
  538. '' is pressed, this function stops the query and tries to restore the old
  539. '' results. If the web page was formatting the results and the users press
  540. '' the cancel button, the old results can not be restored.
  541. '' Arguments - void
  542. '' Return - void
  543. '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  544. function OnAbort()
  545. call OnClose
  546. if idData.innerHTML <> "" and not g_FormatingData then
  547. ' We are able to restore the old results
  548. SetDisplay(3)
  549. end if
  550. end function
  551. '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  552. '' SaveState
  553. '' Description - Saves the options in a cookie. The user must press the Save Options button
  554. '' for the options to be saved.
  555. '' Arguments - void
  556. '' Return - void
  557. '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  558. function SaveState()
  559. strCatagory = ""
  560. strFlag = ""
  561. ' Get the selected (Checked) options/settings
  562. ' The flags are Ping, Connect, Verbose and save to desktop
  563. ' The rest are the categories
  564. set Catagories = idOptions.all.tags("INPUT")
  565. for each Catagory in Catagories
  566. if Catagory.checked then
  567. select case Catagory.name
  568. ' Not to be localized
  569. case "Verbose","Ping","Connect","Show"
  570. strFlag = strFlag + Catagory.name + ";"
  571. case else
  572. strCatagory = strCatagory + Catagory.name + ";"
  573. end select
  574. end if
  575. next
  576. ' Create the cookie. Note the expiration date is 1/1/1970. This is the only date
  577. ' I could use so that the cookie gets saved.
  578. cookie = escape( ";" & strCatagory & strFlag)
  579. document.cookie = "dglogs=" & cookie & "; expires=Thu, 01-Jan-70 00:00:01 GMT"
  580. end function
  581. '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  582. '' LoadState
  583. '' Description - Loads and sets the options/settings
  584. '' Arguments - void
  585. '' Return - void
  586. '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  587. function LoadState()
  588. ' Extract the settings from the cookie
  589. strState = document.cookie
  590. strState = unescape(strState)
  591. if strState <> "" then
  592. ' Set the options/settings
  593. strState = ";" + strState + ";"
  594. set Catagories = idOptions.all.tags("INPUT")
  595. for each Catagory in Catagories
  596. if InStr(strState,";" & Catagory.name & ";")<>0 then
  597. Catagory.checked = true
  598. else
  599. Catagory.checked = false
  600. end if
  601. next
  602. end if
  603. end function
  604. '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  605. '' GetSettings
  606. '' Description - Gets the options/settings that are checked
  607. '' Arguments - void
  608. '' Return - strCategory - list of the categories that are checked
  609. '' bFlag - the actions that are checked
  610. '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  611. function GetSettings(byref strCategory, byref bFlag)
  612. bFlag = 0
  613. strCategory = ""
  614. set Options = idOptions.all.tags("INPUT")
  615. for each id in Options
  616. if id.checked then
  617. select case id.name
  618. case "Verbose"
  619. bFlag = bFlag OR FLAG_VERBOSE_HIGH
  620. case "Ping"
  621. bFlag = bFlag OR FLAG_CMD_PING
  622. case "Connect"
  623. bFlag = bFlag OR FLAG_CMD_CONNECT
  624. case "Show"
  625. bFlag = bFlag OR FLAG_CMD_SHOW
  626. case else
  627. ' Get the selected categories
  628. strCategory = strCategory + id.name + ";"
  629. end select
  630. end if
  631. next
  632. end function
  633. '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  634. '' OnSetOptions
  635. '' Description - Displays the options page. If the user already collected data, the options
  636. '' page displays a button that enables the user to get back to the results page
  637. '' Arguments - void
  638. '' Return - void
  639. '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  640. function OnSetOptions
  641. if idData.innerHTML = "" then
  642. ' No data has been collected yet, do not display the back button
  643. idBackButton.style.display = "none"
  644. else
  645. ' The user collected data, display the back button
  646. idBackButton.style.display = ""
  647. end if
  648. ' Display the options page
  649. SetDisplay(1)
  650. end function
  651. '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  652. '' CStr2
  653. '' Description - Makes sure that a number is at least two digits i.e. 1 => 01
  654. '' Arguments - num = number to check
  655. '' Return - two digit number
  656. '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  657. public function CStr2(num)
  658. s = CStr(num)
  659. if num < 10 then
  660. CStr2 = "0" + s
  661. else
  662. CStr2 = s
  663. end if
  664. end function
  665. '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  666. '' SaveFile
  667. '' Description - Creates the saved file.
  668. '' Arguments - Object indicating where to save the file too
  669. '' Return - void
  670. '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  671. function SaveFile(MyFile)
  672. MyFile.WriteLine(SavedFile_Head)
  673. MyFile.WriteLine(shared_vbs.outerHTML)
  674. MyFile.WriteLine(idStyles.outerHTML)
  675. MyFile.WriteLine(idDataTxt.innerHtml)
  676. MyFile.WriteLine(SavedFile_Tail)
  677. MyFile.Close
  678. end function
  679. '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  680. '' OnSaveToFile
  681. '' Description - Saves the results to a file. The +/- images are converted into
  682. '' +/- text signs so the saved file does not depend on these images.
  683. '' its a pain to find them
  684. '' Arguments - void
  685. '' Return - void
  686. '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  687. function OnSaveToFile
  688. On Error Resume Next
  689. Dim MyFile
  690. Dim currentDate
  691. bFileSaved = false
  692. ' Convert the results into a texted based tree by changing the +/- images to text +/-
  693. ' The text tree is stored in idDataTxt so we do not alter the original results
  694. MakeTextTree()
  695. ' Create the filename (based on the date)
  696. currentDate = now()
  697. sDate = CStr2(day(currentDate)) + CStr2(month(currentDate)) + CStr2(year(currentDate)) + " " + CStr2(hour(currentDate)) + CStr2(minute(currentDate)) + CStr2(second(currentDate))
  698. fname = L_NetDiagSave_FileName + sDate + ".htm"
  699. ' strSavedTo tells the user where we saved the file
  700. strSavedTo = L_FileSaved_Text
  701. if idSaveToDeskTop.checked then
  702. ' Save the file to the desktop. (the user selected this option)
  703. strDesktop = g_WshShell.SpecialFolders("Desktop")
  704. set pchfolder = g_fso.GetFolder(strDesktop)
  705. Set MyFile = pchFolder.CreateTextFile(fname, True, True)
  706. if g_fso.FileExists(strDesktop & "\" & fname) then
  707. call SaveFile(MyFile)
  708. strSavedTo = strSavedTo & vbNewLine & L_SaveToDesktop_Text & fname 'vbNewLine & strDesktop & "\" & fname
  709. bFileSaved = true
  710. end if
  711. end if
  712. 'Save the file in the PC health dir
  713. set pchfolder = g_fso.GetSpecialFolder(WindowsFolder)
  714. fname = L_NetDiagPath_FolderName & "\" & fname
  715. Set MyFile = pchFolder.CreateTextFile(fname, True, True)
  716. if g_fso.FileExists(g_fso.GetSpecialFolder(WindowsFolder) & "\" & fname) then
  717. call SaveFile(MyFile)
  718. strSavedTo = strSavedTo & vbNewLine
  719. if bFileSaved=true then
  720. strSavedTo = strSavedTo & L_AndTo_Text
  721. end if
  722. strSavedTo = strSavedTo & g_fso.GetSpecialFolder(WindowsFolder) & "\" & fname
  723. bFileSaved = true
  724. end if
  725. if bFileSaved = false then
  726. strSavedTo = L_NoFileSaved_Text
  727. end if
  728. ' Clear the temp saved results so the ids do not conflict with each other
  729. idDataTxt.innerHTML = ""
  730. 'Let the user know that there information has been saved
  731. MsgBox strSavedTo
  732. end function
  733. '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  734. '' OnStart
  735. '' Description - Querys dgnet.dll (dglogs) for the specified data (the categories the user
  736. '' selected)
  737. '' Arguments - void
  738. '' Return - void
  739. '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  740. function OnStart
  741. if Dglogs is nothing then
  742. ' The dglogs object failed to be created
  743. Msgbox L_DgnetLoadError_Text
  744. else
  745. g_bRunning = TRUE
  746. ' Initialize the progress bar and set to the progress bar view
  747. call DrawProgressBar(idProgressBar,0,"")
  748. SetDisplay(2)
  749. ' Get the settings/options
  750. call GetSettings(strCategory,bFlag)
  751. ' Last category indicates which category was last displayed. Categories begin Internet Service, Network Adapters and
  752. ' Modems etc. g_iIDCount is the IDs
  753. g_strLastCategory = ""
  754. g_iIDCount = 0
  755. strRetVal = Dglogs.ExecQuery(strCategory, bFlag)
  756. if strRetVal = L_Fail_Text then
  757. Msgbox L_DgnetOtherInstance_Text
  758. g_bRunning = FALSE
  759. SetDisplay(3)
  760. end if
  761. end if
  762. end function
  763. '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  764. '' Dglogs_ProgressReport
  765. '' Description - Increments the progress bar and displays the messages dgnet.dll is
  766. '' reporting.
  767. '' Arguments - strMsg - The message reported by dgnet.dll
  768. '' n - the percentage completed.
  769. '' Return - void
  770. '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  771. function Dglogs_ProgressReport(strMsg,n)
  772. if n = -1 then
  773. ' Dgnet.dll is done. strMsg is the XML text containing the results
  774. ' g_FormatingData means that we are converting the data from XML to HTML
  775. ' we can not go back to the old results (i.e. cancel)
  776. g_FormatingData = TRUE
  777. ' Convert the XML text to HTML text
  778. call ConvertXMLToHtml(strMsg)
  779. ' Done formating data, display it
  780. g_FormatingData = FALSE
  781. SetDisplay(3)
  782. else
  783. ' Display the progress
  784. if n = 100 then
  785. ' The last % is for formatting the data
  786. call DrawProgressBar(idProgressBar,99,L_FormatingResults_Text)
  787. else
  788. ' display the status report
  789. call DrawProgressBar(idProgressBar,n,strMsg)
  790. end if
  791. end if
  792. end function
  793. '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  794. '' DrawProgressBar
  795. '' Description - Increments the progress bar and displays the messages dgnet.dll is
  796. '' reporting. The progress bar is a table with 2 columns.
  797. '' Arguments - strMsg - The message reported by dgnet.dll
  798. '' n - the percentage completed.
  799. '' Return - void
  800. '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  801. function DrawProgressBar(idTag, bCount, strMsg)
  802. if bCount <> -1 then
  803. idLoadPercent.innerHTML = bCount & "%"
  804. idLoadMsg.innerHTML = strMsg
  805. idTag.innerHtml = "<TABLE width=100% height='25' border=0>" & _
  806. "<TD width='" & bCount & "%' bgcolor=blue align=center></TD>" & _
  807. "<TD width='" & (100 - bCount) & "%'></TD>" & _
  808. "</TABLE>"
  809. end if
  810. window.status = strMsg
  811. end function
  812. '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  813. '' GetTreeButton
  814. '' Description - Get the +/- sign for the tree
  815. '' Arguments - strID - Button ID
  816. '' bType - Button state (expanded, collapsed, empty)
  817. '' Return - HTML code for the button
  818. '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  819. function GetTreeButton(strID, bType)
  820. GetTreeButton = "<SPAN value=" & bType & " id=tag" & strID & ">" & GetTreeButtonImage(bType,0) & "</SPAN>"
  821. end function
  822. '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  823. '' MakeTextTree
  824. '' Description - Convert the +/- images into +/- text. The idDataTxt stores the text tree
  825. '' Arguments - void
  826. '' Return - void
  827. '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  828. function MakeTextTree()
  829. g_bTextMode = TRUE
  830. ' Copy the tree
  831. idDataTxt.innerhtml = idData.innerhtml
  832. ' Get all the branches
  833. set Branches=idDataTxt.all.tags("SPAN")
  834. for each idBranch in Branches
  835. if "tag" = Left(idBranch.id,len("tag")) then
  836. ' Found a brach, convert it into a text +/-
  837. idBranch.innerHTML = GetTreeButtonImage(idBranch.value,0)
  838. end if
  839. next
  840. g_bTextMode = FALSE
  841. end function
  842. '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  843. '' GetNextID
  844. '' Description - Each branch needs a unique ID. This creates the id
  845. '' Arguments - void
  846. '' Return - unique ID
  847. '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  848. function GetNextID()
  849. GetNextID = g_iIDCount
  850. g_iIDCount = g_iIDCount + 1
  851. end function
  852. '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  853. '' ConvertXMLToHtml
  854. '' Description - Convert the XML text to HTML text
  855. '' Arguments - str - XML text
  856. '' Return - HTML Text
  857. '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  858. function ConvertXMLToHtml(str)
  859. g_xmlDoc.loadXML(str)
  860. strText = "<table width=100% border=0 valign='top'>"
  861. ' Extract the containers form the XML string
  862. Set ContainerList = g_xmlDoc.selectNodes("/Netdiag/Container")
  863. for each Container in ContainerList
  864. strText = strText + FormatContainer(Container)
  865. next
  866. strText = strText + "</table>"
  867. idData.innerHTML = strText
  868. end function
  869. '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  870. '' GetStatusClass
  871. '' Description - Gets the style of the status
  872. '' Arguments - strStatus - Status Text
  873. '' Return - Status Style
  874. '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  875. function GetStatusClass(strStatus)
  876. select case strStatus
  877. case L_Pass_Text
  878. GetStatusClass = "sys-color-body-ok sys-font-body"
  879. case L_Fail_Text
  880. GetStatusClass = "sys-color-body-alert sys-font-body"
  881. case else
  882. GetStatusClass = "sys-color-body sys-font-body"
  883. end select
  884. end function
  885. '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  886. '' CreateBranch
  887. '' Description - Creates a branch in the tree. With +/-
  888. '' Arguments - bBranchIsEmpty - Indicates if the branch contains any data
  889. '' strStyle - Text Format
  890. '' strText - Branch text
  891. '' strLeaf - Contents of branch
  892. '' Return - Branch
  893. '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  894. function CreateBranch(bBranchIsEmpty, strStyle, strText, byref strLeaf)
  895. iID = GetNextID()
  896. strDivButtonId = "TreeButton" & iID
  897. if bBranchIsEmpty then
  898. ' Branch is empty, empty bitmap blank ID
  899. iImageType = 2
  900. strDivBranchId = "idBlank"
  901. else
  902. ' Branch is not empty, + image and create a new ID
  903. iImageType = 1
  904. strDivBranchId = "TreeBranch" & iID
  905. end if
  906. ' Create the branch
  907. CreateBranch = "<DIV " & strStyle & ">" & _
  908. "<SPAN " & _
  909. "onclick='toggle(tag" & strDivButtonId & "," & strDivBranchId & ");' " & _
  910. "onkeypress='toggle(tag" & strDivButtonId & "," & strDivBranchId & ");'>" & _
  911. GetTreeButton(strDivButtonId,iImageType) & _
  912. strText & "</SPAN>"
  913. ' Create the leaf
  914. strLeaf = "<DIV id=" & strDivBranchId & " style='MARGIN-LEFT: 50px; display:none'>"
  915. end function
  916. '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  917. '' FormatContainer
  918. '' Description - Extract the container information and format it.
  919. '' Arguments - Container - Contains the name (i.e. IE Proxy, OE Mail, OE News etc)
  920. '' Caption summary property of the caption (i.e. IE Proxy server name)
  921. '' Category the group it belongs to (i.e. Internet Settings, Adapter and Network etc)
  922. '' Status of the tests
  923. '' Return - HTML formated container
  924. '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  925. function FormatContainer(Container)
  926. ' Extarct the values from the container
  927. strHeader = Container.attributes.getNamedItem("Name").nodeValue
  928. strCaption = Container.attributes.getNamedItem("Caption").nodeValue
  929. strCategory = Container.attributes.getNamedItem("Category").nodeValue
  930. Set Stat = Container.selectSingleNode("Status")
  931. strStatus = Stat.attributes.getNamedItem("Value").nodeValue
  932. Set ClassObjectEnumList = Container.selectNodes("ClassObjectEnum")
  933. if strCategory <> g_strLastCategory then
  934. ' We found a new category, create a new heading
  935. FormatContainer = "<tr>" & _
  936. "<td align=left bgcolor=darkblue colspan=3>" & _
  937. "<DIV class='sys-font-body-bold sys-toppane-header-color'>" & strCategory & "</DIV>" &_
  938. "</td></tr>"
  939. ' Memorize the last category we created
  940. g_strLastCategory = strCategory
  941. end if
  942. if ClassObjectEnumList.length > 0 then
  943. ' Container is empty
  944. iImageType = FALSE
  945. else
  946. ' Container is not empty
  947. iImageType = TRUE
  948. end if
  949. ' Create the Container HTML text
  950. strHeader = "<SPAN TABINDEX=0>" & strHeader & "</SPAN>"
  951. FormatContainer = FormatContainer & _
  952. "<tr>" & _
  953. "<td width=30%>" & CreateBranch(iImageType,"class='sys-font-body sys-color-body'",strHeader,strLeaf) & _
  954. "</td>" & _
  955. "<td width=50%><DIV class='Text-Caption'>" & strCaption & "</DIV></td>" & _
  956. "<td width=20%><DIV class='" & GetStatusClass(strStatus) & "'>" & strStatus & "</DIV></td>" & _
  957. "</tr>"
  958. if ClassObjectEnumList.length > 0 then
  959. ' Extract the container properties
  960. FormatContainer = FormatContainer & _
  961. "<tr><td colspan=3 width=100%>" & strLeaf
  962. Set ClassObjectEnumList = Container.selectNodes("ClassObjectEnum")
  963. for each ClassObjectEnum in ClassObjectEnumList
  964. FormatContainer = FormatContainer + FormatClassObjectEnum(ClassObjectEnum)
  965. next
  966. FormatContainer = FormatContainer + "</DIV>"
  967. end if
  968. end function
  969. '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  970. '' FormatStatusText
  971. '' Description - Format the status. If the status is not empty put () around it
  972. '' Arguments - strStatus - Status
  973. '' Return - HTML formated status
  974. '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  975. function FormatStatusText(strStatus)
  976. if strStatus <> "" then
  977. strStatusTxt = "(" & strStatus & ")"
  978. else
  979. strStatusTxt = strStatus
  980. end if
  981. FormatStatusText = "<SPAN class='" & GetStatusClass(strStatus) & "'> " & strStatusTxt & "</SPAN>"
  982. end function
  983. '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  984. '' FormatClassObjectEnum
  985. '' Description - Extract the instances from the container
  986. '' Not all containers have instances.
  987. '' Arguments - ClassObjectEnum - Contains name of the instance and status
  988. '' Return - HTML formated instance
  989. '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  990. function FormatClassObjectEnum(ClassObjectEnum)
  991. ' Extarct the instance name and status
  992. strCaption = ClassObjectEnum.attributes.getNamedItem("Name").nodeValue
  993. Set Stat = ClassObjectEnum.selectSingleNode("Status")
  994. StrStatus = Stat.attributes.getNamedItem("Value").nodeValue
  995. if strCaption <> "" then
  996. ' Create an instance branch
  997. strCaption = "<SPAN class='sys-font-body sys-color-body'>" & strCaption & "</SPAN>"
  998. strText = "<SPAN TABINDEX=0>" & strCaption & FormatStatusText(strStatus) & "</SPAN>"
  999. FormatClassObjectEnum = CreateBranch(FALSE,"",strText,strLeaf)
  1000. FormatClassObjectEnum = FormatClassObjectEnum & strLeaf
  1001. end if
  1002. ' Extact the properties from the instance
  1003. Set PropertyList = ClassObjectEnum.selectNodes("Property")
  1004. for each Prop in PropertyList
  1005. FormatClassObjectEnum = FormatClassObjectEnum & FormatProperty(Prop)
  1006. next
  1007. if strCaption <> "" then
  1008. ' Close the instance branch if it was opened.
  1009. FormatClassObjectEnum = FormatClassObjectEnum & "</DIV></DIV>"
  1010. end if
  1011. end function
  1012. '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  1013. '' FormatProperty
  1014. '' Description - Fromat the property
  1015. '' Arguments - Prop - Property
  1016. '' Return - HTML formated property
  1017. '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  1018. function FormatProperty(Prop)
  1019. ' Extract the values
  1020. strFieldName = Prop.attributes.getNamedItem("Name").nodeValue
  1021. Set PropStatus = Prop.selectSingleNode("Status")
  1022. strStatus = PropStatus.attributes.getNamedItem("Value").nodeValue
  1023. Set ValueList = Prop.selectNodes("PropertyValue")
  1024. if ValueList.length > 1 then
  1025. ' Property has an arrary of values
  1026. strFieldName = "<SPAN TABINDEX=0 class='sys-font-body sys-color-body'>" & strFieldName & "</SPAN>"
  1027. strText = strFieldName & FormatStatusText(strStatus)
  1028. FormatProperty = CreateBranch(FALSE,"",strText,strLeaf)
  1029. FormatProperty = FormatProperty & strLeaf
  1030. ' Extract the values
  1031. for each Value in ValueList
  1032. call GetPropertyValue(Value,strValue,strData,strComment,strStatus)
  1033. FormatProperty = FormatProperty & FormatProp("",strValue,strComment,strStatus,strData)
  1034. next
  1035. FormatProperty = FormatProperty & "</DIV></DIV>"
  1036. elseif ValueList.length <> 0 then
  1037. ' Property only has one value, extract it
  1038. Set Value = ValueList.Item(0)
  1039. call GetPropertyValue(Value,strValue,strData,strComment,strStatus)
  1040. FormatProperty = FormatProperty & FormatProp(strFieldName,strValue,strComment,strStatus,strData)
  1041. end if
  1042. end function
  1043. '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  1044. '' FormatProp
  1045. '' Description - Format the value
  1046. '' Arguments - strFieldName - Name of the property
  1047. '' strValue - Value of the property
  1048. '' strComment - value comment
  1049. '' strStatus - Status
  1050. '' strData - Data associated with value
  1051. '' Return - HTML formated property and value
  1052. '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  1053. function FormatProp(strFieldName, strValue, strComment, strStatus, strData)
  1054. ' Format field name
  1055. if strFieldName<>"" then
  1056. if strValue <> "" then
  1057. ' If there is a value add =
  1058. strFieldName = strFieldName & " = "
  1059. end if
  1060. strFieldName = "<SPAN class='sys-font-body sys-color-body'>" & strFieldName & " </SPAN>"
  1061. end if
  1062. ' Format the value, comment, status and data
  1063. strValue = "<SPAN class='sys-font-body sys-color-body'>" & strValue & "</SPAN>"
  1064. if strComment <>""then
  1065. strComment = "<SPAN class='Text-Comment'>(" & strComment & ")</SPAN>"
  1066. end if
  1067. if strData<>"" then
  1068. strData = "<SPAN class='Text-Data'>" & strData & "</SPAN>"
  1069. end if
  1070. strText = "<SPAN TABINDEX=0>" & strFieldName & strValue & strComment & FormatStatusText(strStatus) & "</SPAN>"
  1071. if strData<>"" then
  1072. ' No data
  1073. iImageType = FALSE
  1074. else
  1075. ' Has data
  1076. iImageType = TRUE
  1077. end if
  1078. FormatProp = CreateBranch(iImageType,"",strText,strLeaf)
  1079. if strData<>"" then
  1080. ' Close the data
  1081. FormatProp = FormatProp & strLeaf & strData & "</DIV>"
  1082. end if
  1083. FormatProp = FormatProp & "</DIV>"
  1084. end function
  1085. '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  1086. '' FormatProp
  1087. '' Description - Extract the property values
  1088. '' Arguments - strFieldName - Name of the property
  1089. '' strValue - Value of the property
  1090. '' strComment - value comment
  1091. '' strStatus - Status
  1092. '' strData - Data associated with value
  1093. '' Return - HTML formated property and value
  1094. '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  1095. function GetPropertyValue(Value, byref strValue, byref strData, byref strComment, byref strStatus)
  1096. strValue = Value.attributes.getNamedItem("Value").nodeValue
  1097. strData = Value.attributes.getNamedItem("Data").nodeValue
  1098. strComment = Value.attributes.getNamedItem("Comment").nodeValue
  1099. strStatus = Value.text
  1100. strData = Replace(strData,"|","<BR>")
  1101. end function
  1102. </SCRIPT>
  1103. </BODY>
  1104. </HTML>