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.
188 lines
11 KiB
188 lines
11 KiB
<HTML>
|
|
<!-- Copyright (c) Microsoft Corporation. All rights reserved.-->
|
|
<HEAD>
|
|
|
|
<TITLE>Dynamic Ip Setting Page</TITLE>
|
|
|
|
<SCRIPT LANGUAGE="VBScript">
|
|
<!--
|
|
Option Explicit
|
|
|
|
'Windows constants for key codes
|
|
Public Const EnterKey = 13
|
|
Public Const EscapeKey = 27
|
|
|
|
|
|
'Timer for idle timeout
|
|
Dim iIdleTimeOut
|
|
|
|
'Text for wait information
|
|
Dim strWaitText
|
|
|
|
'Auto Ip address error text
|
|
Dim strAutoIpErrorText
|
|
|
|
'Confirmation text for auto ip
|
|
Dim strConfirmAutoIpText
|
|
|
|
'Flag for intial status of the page
|
|
Dim bGettingAutoIp
|
|
|
|
'----------------------------------------------------------------------------
|
|
' Function: Window_OnLoad
|
|
' Description: Initialization routine for the page
|
|
' Input Variables: None
|
|
' Output Variables: None
|
|
' Return Values: None
|
|
' Global Variables: strWaitText,strAutoIpErrorText,strConfirmAutoIpText,bGettingAutoIp
|
|
'----------------------------------------------------------------------------
|
|
|
|
Sub Window_OnLoad()
|
|
|
|
'Localization manager object
|
|
Dim objLocMgr
|
|
|
|
'Replacement strings
|
|
Dim varReplacementStrings
|
|
|
|
'Resource ID for wait information text
|
|
Const WAIT_TEXT = "&H40020012"
|
|
|
|
'Resource ID for Ip address error text
|
|
Const CONFIRM_AUTO_TEXT = "&H40020006"
|
|
|
|
'Resource ID for Ip address error text
|
|
Const AUTOIP_ERROR_TEXT = "&H40020007"
|
|
|
|
|
|
On Error Resume Next
|
|
Err.Clear
|
|
|
|
bGettingAutoIp = true
|
|
|
|
'Create the localization manager
|
|
Set objLocMgr = CreateObject("ServerAppliance.LocalizationManager")
|
|
|
|
If Err.number = 0 Then
|
|
'Get the strings
|
|
strWaitText = objLocMgr.GetString("salocaluimsg.dll",WAIT_TEXT,varReplacementStrings)
|
|
strConfirmAutoIpText = objLocMgr.GetString("salocaluimsg.dll",CONFIRM_AUTO_TEXT,varReplacementStrings)
|
|
strAutoIpErrorText = objLocMgr.GetString("salocaluimsg.dll",AUTOIP_ERROR_TEXT,varReplacementStrings)
|
|
Set objLocMgr = Nothing
|
|
|
|
End If
|
|
|
|
Err.Clear
|
|
|
|
InformationText.innerText = strConfirmAutoIpText
|
|
|
|
'start the timer for idle timeout
|
|
iIdleTimeOut = window.SetTimeOut("IdleHandler()",300000)
|
|
|
|
On Error Resume Next
|
|
Err.Clear
|
|
'set the key codes for the page
|
|
Dim objKeypad
|
|
Set objKeypad = CreateObject("Ldm.SAKeypadController")
|
|
If Err.number = 0 Then
|
|
|
|
objKeypad.Setkey 0,0,TRUE
|
|
objKeypad.Setkey 1,0,FALSE
|
|
objKeypad.Setkey 2,0,FALSE
|
|
objKeypad.Setkey 3,0,FALSE
|
|
objKeypad.Setkey 4,EscapeKey,FALSE
|
|
objKeypad.Setkey 5,EnterKey,FALSE
|
|
|
|
Set objKeypad = Nothing
|
|
End If
|
|
|
|
End Sub
|
|
|
|
'----------------------------------------------------------------------------
|
|
' Function: IdleHandler
|
|
' Description: Goes back to main page when timeout expires
|
|
' Input Variables: None
|
|
' Output Variables: None
|
|
' Return Values: None
|
|
' Global Variables: None
|
|
'----------------------------------------------------------------------------
|
|
Sub IdleHandler()
|
|
|
|
window.history.go(-3)
|
|
|
|
End Sub
|
|
|
|
|
|
'----------------------------------------------------------------------------
|
|
' Function: KeyDown
|
|
' Description: Handles key presses
|
|
' Input Variables: None
|
|
' Output Variables: None
|
|
' Return Values: None
|
|
' Global Variables: None
|
|
'----------------------------------------------------------------------------
|
|
Sub KeyDown()
|
|
|
|
'SaHelper object pointer
|
|
Dim objSaHelper
|
|
|
|
On Error Resume Next
|
|
Err.Clear
|
|
|
|
'clear the timeout and restart it
|
|
window.clearTimeOut(iIdleTimeOut)
|
|
iIdleTimeOut = window.SetTimeOut("IdleHandler()",300000)
|
|
|
|
'If escape key is hit, go back to network page
|
|
If window.event.keycode = EscapeKey Then
|
|
window.history.go(-1)
|
|
End If
|
|
|
|
If bGettingAutoIp = false and window.event.keycode = EnterKey Then
|
|
window.history.go(-1)
|
|
End If
|
|
|
|
If bGettingAutoIp = true and window.event.keycode = EnterKey Then
|
|
|
|
bGettingAutoIp = false
|
|
|
|
InformationText.innerText = strWaitText
|
|
Set objSaHelper = CreateObject("ServerAppliance.SAHelper")
|
|
|
|
'If object is successfully created
|
|
If Err.Number = 0 Then
|
|
objSaHelper.SetDynamicIp
|
|
Set objSaHelper = Nothing
|
|
End If
|
|
|
|
'Ip address successfully retrieved from DHCP
|
|
If Err.Number = 0 Then
|
|
'start a timer to go back to tasks page
|
|
iIdleTimeOut = window.SetTimeOut("GoBackToTasksPages",300)
|
|
'Something failed, display error information
|
|
Else
|
|
InformationText.innerText = strAutoIpErrorText
|
|
End If
|
|
|
|
|
|
End If
|
|
|
|
|
|
End Sub
|
|
|
|
Sub GoBackToTasksPages()
|
|
window.history.go(-1)
|
|
End Sub
|
|
-->
|
|
</SCRIPT>
|
|
|
|
</HEAD>
|
|
<BODY RIGHTMARGIN=0 LEFTMARGIN=0 OnKeydown="KeyDown">
|
|
|
|
<A ID="InformationText" OnKeydown="KeyDown"
|
|
STYLE="position:absolute; top:0; left:0; font-size:10; font-family=arial;" >
|
|
</A>
|
|
|
|
</BODY>
|
|
|
|
</HTML>
|