Re: "Get RDP File" Doesn't work first try if too fast

2011-04-08 Thread Josh Thompson
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Gerhard,

I created a JIRA issue https://issues.apache.org/jira/browse/VCL-444 and 
attached your code to it so that this feature will be in future releases.

Josh

On Thursday April 07, 2011, Hartl, Gerhard L. wrote:
> For anyone that has this issue, I came up with a temporary solution that is
> easy to implement. This will show a count down of 5 seconds then show the
> Get RDP File button.  This allows enough time for the VCL client to be
> configured.  Tested with IE and Firefox.  Use at own risk!
> 
> 
> Roughly around line 2217 (v2.2.1) on requests.php replace the Get RDP File
> form section with:
> 
> print "\n";
> print " .off {\n";
> print " visibility: hidden;\n";
> print " } .on {\n";
> print " visibility: visible;\n";
> print " }\n";
> print "\n";
> print "\n";
> print " window.onload = function() {\n";
> print " var timeInterval = 5;\n";
> print " if (typeof timeInterval === 'undefined' || parseInt(timeInterval)
> <= 0) {\n"; print " timeInterval = 1\n";
> print " }\n";
> print "document.getElementById('counter').innerHTML = \" Ready to connect
> in \" + timeInterval + \" seconds\";\n"; print "var si =
> setInterval(function() {\n";
> print "if (timeInterval === 0) {\n";
> print " clearInterval(si);\n";
> print " } else {\n";
> print "--timeInterval;\n";
> print "if (timeInterval !== 0) {\n";
> print " document.getElementById('counter').innerHTML = \" Ready to
> connect in \" + timeInterval + \" seconds\";\n"; print "} else {\n";
> print " document.getElementById('counter').className = 'off';
> //Hiding the counter area.\n"; print "
> document.getElementById('submit').className = 'on'; //Unhide the Submit
> button\n"; print "}\n";
> print "}\n";
> print "}, 1000);\n";
> print "setTimeout(function() {\n";
> print "}, timeInterval * 1000);\n";
> print "}\n";
> print "\n";
> 
> print "For automatic connection, you can download an RDP file that can ";
> print "be opened by the Remote Desktop Connection program.\n";
> print "";
> print "\n";
> print "  \n";
> print "\n";
> print "   id=\"connect\">\n"; $cdata = array('requestid' => $requestid,
>       'resid' => $requestData['reservations'][0]['reservationid']);
>   $expire = datetimeToUnix($requestData['end']) -
>   datetimeToUnix($requestData['start']) + 1800; # reservation time plus 
30
> min $cont = addContinuationsEntry('sendRDPfile', $cdata, $expire);
> print "  \n";
> print "   id=\"submit\">\n"; print "  \n";
> print "\n";
> print "  \n";
> print "\n";
> 
> 
> 
> 
> - Gerhard Hartl
> Old Dominion University
> Norfolk, VA
> 
> -Original Message-
> From: Andy Kurth [mailto:andy_ku...@ncsu.edu]
> Sent: Monday, April 04, 2011 1:33 PM
> To: vcl-user@incubator.apache.org
> Subject: Re: "Get RDP File" Doesn't work first try if too fast
> 
> I have seen the same issue myself.  It's a timing issue related to the
> 'reserved' state.  During this state, the vcld process loops until it
> detects a value in reservation.remoteIP which gets set when the user
> clicks 'Connect'.  There is a 5 second wait in between attempts.  This
> could be reduced but the downside would be a little more processing on the
> management node.
> 
> Once it detects the remote IP has been set, it can take 3-9 seconds for the
> firewall-opening commands to be executed.
> 
> Quickly looking at the code, I think some improvements can be made to
> reduce the lag time.  I created an issue for this:
> https://issues.apache.org/jira/browse/VCL-442
> 
> -Andy
> 
> On 4/1/2011 2:58 PM, Hartl, Gerhard L. wrote:
> > (disregard previous, forgot to retitle)
> > 
> > Since upgrading to 2.2, when a user browses to the 'connect' page, I've
> > noticed that the clients ip is captured and the management node then
> > ssh's to the vm and opens up the port for the clients ip on 3389.  
> > While I understand this is best practice, I have noticed that 

RE: "Get RDP File" Doesn't work first try if too fast

2011-04-07 Thread Hartl, Gerhard L.
For anyone that has this issue, I came up with a temporary solution that is 
easy to implement. This will show a count down of 5 seconds then show the Get 
RDP File button.  This allows enough time for the VCL client to be configured.  
Tested with IE and Firefox.  Use at own risk!


Roughly around line 2217 (v2.2.1) on requests.php replace the Get RDP File form 
section with:

print "\n";
print " .off {\n";
print " visibility: hidden;\n";
print " } .on {\n";
print " visibility: visible;\n";
print " }\n";
print "\n";
print "\n";
print " window.onload = function() {\n";
print " var timeInterval = 5;\n";
print " if (typeof timeInterval === 'undefined' || parseInt(timeInterval) <= 0) 
{\n";
print " timeInterval = 1\n";
print " }\n";
print "document.getElementById('counter').innerHTML = \" Ready to connect in \" 
+ timeInterval + \" seconds\";\n";
print "var si = setInterval(function() {\n";
print "if (timeInterval === 0) {\n";
print " clearInterval(si);\n";
print " } else {\n";
print "--timeInterval;\n";
print "if (timeInterval !== 0) {\n";
print " document.getElementById('counter').innerHTML = \" Ready to 
connect in \" + timeInterval + \" seconds\";\n";
print "} else {\n";
print " document.getElementById('counter').className = 'off'; //Hiding 
the counter area.\n";
print " document.getElementById('submit').className = 'on'; //Unhide 
the Submit button\n";
print "}\n";
print "}\n";
print "}, 1000);\n";
print "setTimeout(function() {\n";
print "}, timeInterval * 1000);\n";
print "}\n";
print "\n";

print "For automatic connection, you can download an RDP file that can ";
print "be opened by the Remote Desktop Connection program.\n";
print "";
print "\n";
print "  \n";
print "\n";
print "  \n";
$cdata = array('requestid' => $requestid,
'resid' => $requestData['reservations'][0]['reservationid']);
    $expire = datetimeToUnix($requestData['end']) -
datetimeToUnix($requestData['start']) + 1800; # reservation time plus 
30 min
$cont = addContinuationsEntry('sendRDPfile', $cdata, $expire);
print "  \n";
print "  \n";
print "  \n";
print "\n";
print "  \n";
print "\n";




- Gerhard Hartl
Old Dominion University
Norfolk, VA

-Original Message-
From: Andy Kurth [mailto:andy_ku...@ncsu.edu] 
Sent: Monday, April 04, 2011 1:33 PM
To: vcl-user@incubator.apache.org
Subject: Re: "Get RDP File" Doesn't work first try if too fast

I have seen the same issue myself.  It's a timing issue related to the 
'reserved' state.  During this state, the vcld process loops until it detects a 
value in reservation.remoteIP which gets set when the user clicks 'Connect'.  
There is a 5 second wait in between attempts.  This could be reduced but the 
downside would be a little more processing on the management node.

Once it detects the remote IP has been set, it can take 3-9 seconds for the 
firewall-opening commands to be executed.

Quickly looking at the code, I think some improvements can be made to reduce 
the lag time.  I created an issue for this:
https://issues.apache.org/jira/browse/VCL-442

-Andy

On 4/1/2011 2:58 PM, Hartl, Gerhard L. wrote:
> (disregard previous, forgot to retitle)
>
> Since upgrading to 2.2, when a user browses to the 'connect' page, I've 
> noticed that the clients ip is captured and the management node then ssh's to 
> the vm and opens up the port for the clients ip on 3389.   While I understand 
> this is best practice, I have noticed that if they user is to quick clicking 
> through the page that they sometimes have to click the "Get RDP File" twice 
> since the first time tries to connect prior to the port being opened up.  Is 
> there any way around this?
>
> - Gerhard Hartl
> Old Dominion University
> Norfolk, VA


--
BEGIN-ANTISPAM-VOTING-LINKS
--

Teach CanIt if this mail (ID 465117226) is spam:
Spam:
https://www.spamtrap.odu.edu/b.php?i=465117226&m=1354587fa689&t=20110404&c=s
Not spam:
https://www.spamtrap.odu.edu/b.php?i=465117226&m=1354587fa689&t=20110404&c=n
Forget vote: 
https://www.spamtrap.odu.edu/b.php?i=465117226&m=1354587fa689&t=20110404&c=f
--
END-ANTISPAM-VOTING-LINKS



Re: "Get RDP File" Doesn't work first try if too fast

2011-04-04 Thread Andy Kurth
I have seen the same issue myself.  It's a timing issue related to the 
'reserved' state.  During this state, the vcld process loops until it 
detects a value in reservation.remoteIP which gets set when the user 
clicks 'Connect'.  There is a 5 second wait in between attempts.  This 
could be reduced but the downside would be a little more processing on 
the management node.


Once it detects the remote IP has been set, it can take 3-9 seconds for 
the firewall-opening commands to be executed.


Quickly looking at the code, I think some improvements can be made to 
reduce the lag time.  I created an issue for this:

https://issues.apache.org/jira/browse/VCL-442

-Andy

On 4/1/2011 2:58 PM, Hartl, Gerhard L. wrote:

(disregard previous, forgot to retitle)

Since upgrading to 2.2, when a user browses to the 'connect' page, I've noticed that the 
clients ip is captured and the management node then ssh's to the vm and opens up the port 
for the clients ip on 3389.   While I understand this is best practice, I have noticed 
that if they user is to quick clicking through the page that they sometimes have to click 
the "Get RDP File" twice since the first time tries to connect prior to the 
port being opened up.  Is there any way around this?

- Gerhard Hartl
Old Dominion University
Norfolk, VA


"Get RDP File" Doesn't work first try if too fast

2011-04-01 Thread Hartl, Gerhard L.
(disregard previous, forgot to retitle)

Since upgrading to 2.2, when a user browses to the 'connect' page, I've noticed 
that the clients ip is captured and the management node then ssh's to the vm 
and opens up the port for the clients ip on 3389.   While I understand this is 
best practice, I have noticed that if they user is to quick clicking through 
the page that they sometimes have to click the "Get RDP File" twice since the 
first time tries to connect prior to the port being opened up.  Is there any 
way around this?

- Gerhard Hartl
Old Dominion University
Norfolk, VA