wodssh and javascript html (wodWebServer / wodWebServer.NET)
Could someone show me a javascript sample that connects to a ssh server, executes a command ( ls -al ) and shows the result?
Re: wodssh and javascript html
Hi,
I'm not good in javascript.
Can you show me some snippet and I will try to do something.
BTW, I just wanted to let you know that I'm working on this.
Regards,
Alan
Re: wodssh and javascript html
I used your sample wodssh.html . And would like to have two samples:
1.) a linux cammand ls -al that is executed imediatly after the connect, with result shown to browser ssh terminal window
2.) add a button that executes a linux command when clicked.
Re: wodssh and javascript html
Hi,
I just finished with sample.
Can you contact me to techsupport@weonlydo.com
Regards,
Alan
Re: wodssh and javascript html
Hi,
You can try to add this code:
Under Button click you can add following code:
wodSSH1.Send( ls -al \r\n );
Maybe you have trouble with sending data ls -al , or sending enter/new line.
I think that ( \r - carriage return and \n new line) is most important thing in this code.
Of course you can call Send Method immediately after Connect Method, if you set Blocking Property to True.
Regards,
Alan
Re: wodssh and javascript html
Hi,
You can try to add this code:
Under Button click you can add following code:
wodSSH1.Send( ls -al \r\n );
Maybe you have trouble with sending data ls -al , or sending enter/new line.
I think that ( \r - carriage return and \n new line) is most important thing in this code.
Of course you can call Send Method immediately after Connect Method, if you set Blocking Property to True.
Regards,
Alan
Re: wodssh and javascript html
Sorry for the mistaken post.
I wanted to know if it is possible to have the window with the wodssh object scroll down automatically while new text arrives?
I use the wodssh object with a command tail -f logfilename.log to have it the log files on the linux server. Is it possible to have the window scroll don as the logfile grows?
Re: wodssh and javascript html
Marc,
but wodSSH doesn't have any windows of its own - it's just hidden send/receive engine. So, whatever is used to display the data is responsible for scrolling.
So, you should consult javascript docs to see if you can make textarea (or whatever is used for display) scroll. I think this is possible, but I can't give you exact solution.
Regards,
Kreso
Re: wodssh and javascript html
Hi again,
I have a question about “installing” the wodssh.ocx.
I do not want to use an installer for distribution of the wodssh.ocx. I tried to “distribute” it by specifying in the <OBJECT CODEBASE=”./wodssh.ocx” ….> in the html page (the wodssh.ocx was put onto the webserver).
It seams to be downloaded and “installed” but I get a “30 days evaluation expired” message even if it is not true, because it works on the machine where I used the installer.
So on a computer where I did not use your installer I get the expiration message on a computer I used the installer it works fine. My question is: Is it only a problem of the “Demo” version?
Will the licensed version work without using an installer and if so how would I “embed” the license key?
Thank you
Re: wodssh and javascript html
Hi Marc,
You cannot distribute DEMO version. Licensed version will work with CAB and LPK file. LPK file is instead of license key.
Would you be so kind to check out wodTelnetDLX helpfile Getting starte in HTML :
http://www.weonlydo.com/TelnetDLX/Help/GettingStarted_HTML.html
which explains how to do it - and then just change it to work with wodSSH.
Hope this helps.
Regards,
Drazen
Re: wodssh and javascript html
Hi,
is it possible to get the connection errors by javascript?
I managed to retrive the status text by the connected event,
(status = wodSSH1.StateText (wodSSH1.State);)but I would like to get also possible error messages while connecting. (for example: wrong password,....). I do see this messages in the javascript debugger, when clicking in the error simbol of the browsers status bar.
thank you
Re: wodssh and javascript html
Hi marcxroma,
I'm not sure that I can help you about this I'm not so good in javascript. Besides that I think you need to find out how to pull out that information from IE and put it in some pop up or something that you need. IE gives that information from Received Event, right?
So, I think some workaround about IE can accomplish that, but I haven't some direct answer.
If I find something, I'll let you know.
Regards,
Alan
Re: wodssh and javascript html
Ok, ifound the solution. Ipost it here, it might be useful.
...
...
try
{
wodSSH1.Connect();
}
catch (e)
{
//alert( e is: + e)
//alert( e.number is: + (e.number & 0xFFFF));
//alert( e.description is: + e.description);
//alert( e.name is: + e.name);
alert(e.message);
}
...
...
Re: wodssh and javascript html
Hi Marc,
We are glad that you solve your problem and share solution with us.
Maybe adding StateText or State Property under StateChange Event can help you also.
The StateChange Event is fired each time wodSSH's internal state changes.
The State property holds the state of the current connection between the wodSSH component and the remote server and StateText will returne a text description of a value given by the State Property.
Hope I helped.
Regards,
Drazen