|
Hi,
I wrote a script but I am not able to pass argument to the dialog box of my ssh-tectia.
<html>
<HEAD>
<TITLE>IPs</TITLE>
<link rel="stylesheet" href="style.css"/>
<script language="javascript">
<!--
var shell=new ActiveXObject("WScript.Shell");
function Execute(ipaddress,node) {
shell.Run("ssh-client-g3.exe /script /arg \" + ipaddress + \" /ARG \" + node + \" /ARG dinesh /ARG xxxxxx");
}
</script>
</HEAD>
<CENTER>
<FONT SIZE="+2">
IP's
</FONT>
</CENTER>
<BODY BGCOLOR="#ffffff" TEXT="#000000" LINK="#3a15ff" ALINK="#ff0000" VLINK="#ff282d">
<div id="wrapper">
<TABLE cellpadding="0" cellspacing="0" border="0" bgcolor="ffffcc" class="sortable" id="sorter">
<TR>
<TH><FONT FACE="Helvetica,Verdana,Arial">DEVICETYPE:</FONT></TH>
<TH><FONT FACE="Helvetica,Verdana,Arial">IPADDRESS:</FONT></TH>
</TR>
<TR>
<TD><FONT FACE="Helvetica,Verdana,Arial">4</FONT></TD>
<TD><FONT FACE="Helvetica,Verdana,Arial">
<a href="Javascript:void(0);"OnClick="Execute('100.101.20.204','dinesh1')">100.101.20.204</a></FONT></TD>
</TR>
<TR>
<TD><FONT FACE="Helvetica,Verdana,Arial">4</FONT></TD>
<TD><FONT FACE="Helvetica,Verdana,Arial">
<a href="Javascript:void(0);"OnClick="Execute('100.101.20.205','dinesh2')">100.101.20.205</a></FONT></TD>
</TR>
</TABLE>
</div>
</body>
</html>
I want some help on how to pass the arguments like ipaddress/hostname, username to the tectia dialog box and also the password is prompted only after getting the hostname and username
how to pass this?
Any ideas or suggestions please let me know.
Thanks
Dinesh
|
|
|
|
|
We need a little bit more precision. The tool you are mentioning ssh-client-g3.exe is not mentioned in the documentation I found here: Tectia-Client-6.2-User.pdf
[^] and you also forgot to tell us which version you are using.
Another thing is that none of the command line tools on that Tectia site use /ARG to signifiy any parameters. All parameters I saw are of the typical kind that are started with a - followed by one or more characters. The way you are constructing your command string is also faulty:
var command = "ssh-client-g3.exe /script /arg \" + ipaddress + \" /ARG \" + node + \" /ARG dinesh /ARG xxxxxx";
would yield this true:
command == "ssh-client-g3.exe /script /arg \" + ipaddress + \" /ARG \" + node + \" /ARG dinesh /ARG xxxxxx
you probably meant to say this:
var command = "ssh-client-g3.exe /script /arg " + ipaddress + " /ARG " + node + " /ARG dinesh /ARG xxxxxx"
which would yield true for an IP of 192.168.0.1 and a node named ERLM5ZGA
command == "ssh-client-g3.exe /script /arg 192.168.0.1 /ARG ERLM5ZGA /ARG dinesh /ARG xxxxxx"
Anyhow until you tell us your version of Tectia - Client you are using and the exact name of the command line tool, we won't be able to help you.
Regards,
Manfred
"With sufficient thrust, pigs fly just fine."
Ross Callon, The Twelve Networking Truths, RFC1925
|
|
|
|
|
Hi Ross,
Sorry for missing out that.
I wrongly typed the command. ssh tectia does not use the arg. I will briefly describe what I am trying to do.
1. I have a html file, which has valid ip address entries
2. When I click on this ip address it should call the tectia with the username and password.
3. Basically I want to automate the process of logging in.
4. I saw in tectia that it does not accept arguments like securecrt etc., so any way you think I can automate this process.
Thanks for any help.
|
|
|
|
|
Hi,
I did made some progress by following the below procedure
1. instead of using the html file I just created a .bat file
@echo off
cls
set username=root
ssh-client-g3.exe -h %username%@net.aspac.nsroot.net
Dim WshShell, scomputername
Set WshShell = WScript.CreateObject("WScript.Shell")
Set oNetwork = WScript.CreateObject( "WScript.Network" )
WshShell.sleep 10
WshShell.Sendkeys "C2008" & chr(13)
It works but it stops in password prompt not sure how to pass password to the dialog box.
Thanks for any help
|
|
|
|
|
You still haven't supplied the details that I asked for in my first answer to your question.
Which version are you using and why isn't the documentation I pointed to you not mentioníng anything about a ssh-client-g3.exe command line tool?
Please review your documentation and give us the details I asked for.
Besides that: Trying it out in a batchfile first is a good approach. You can still try later starting it from your HTML page.
Regards,
Manfred
"With sufficient thrust, pigs fly just fine."
Ross Callon, The Twelve Networking Truths, RFC1925
|
|
|
|
|
Ross?
Who is Ross? Reading carefully does not seem to.be one your traits.
Regards,
Manfred
"With sufficient thrust, pigs fly just fine."
Ross Callon, The Twelve Networking Truths, RFC1925
|
|
|
|
|
Sorry for the typo Manfred.
|
|
|
|
|
I presume it was less of a typo than a reado.
"With sufficient thrust, pigs fly just fine."
Ross Callon, The Twelve Networking Truths, RFC1925
|
|
|
|
|
OK it seems there is a ssh-client-g3.exe after all. Here is a link to the documentation: Using Command-Line Options of ssh-client-g3.exe
[^].
ssh-client-g3 [-r] [-p port] [-u user] [-h host] [profile]
The part highlighted in green is the name of a profile file which you can build with the SSH Tectia Configuration tool. Please read the details here: Defining Connection Profiles
[^]. On this page you can search for Defining Authentication which will describe how you can add authentication to a profile so it can be used non-interactively, just the way you wanted to.
Regards,
Manfred
P.S.: Keep us posted of your progress in this!
"With sufficient thrust, pigs fly just fine."
Ross Callon, The Twelve Networking Truths, RFC1925
|
|
|
|
|
Hi Manfred,
Though I use tectia 6.0.12.50, the software is customized in our environment so the "Password Authentication" part is completely removed. Why I wanted to automate because of some repetitive tasks of logging in various servers.
So, is it possible to store the keystore in a variable and then copy it to a clipboard and then paste when the prompts appear? But, I am not sure how to proceed with this idea.
Thanks for your help.
Dinesh
|
|
|
|
|
dineshbabub wrote: the software is customized in our environment so the "Password Authentication"
part is completely removed
You are talking about the profile file configuration tool I presume. If this is due to a company policy you'd better ask somebody if what you are trying to do is allowed by your company. Better be safe than sorry!
Cheers!
"With sufficient thrust, pigs fly just fine."
Ross Callon, The Twelve Networking Truths, RFC1925
|
|
|
|
|
I know in JavaScript I can display a date in the local format using toLocaleString() , is there an easy way to do this for a number?
Panic, Chaos, Destruction. My work here is done.
Drink. Get drunk. Fall over - P O'H
OK, I will win to day or my name isn't Ethel Crudacre! - DD Ethel Crudacre
I cannot live by bread alone. Bacon and ketchup are needed as well. - Trollslayer
Have a bit more patience with newbies. Of course some of them act dumb - they're often *students*, for heaven's sake - Terry Pratchett
|
|
|
|
|
The same function can be applied to numbers. See here: http://www.tutorialspoint.com/javascript/javascript_builtin_functions.htm[^].
Here an example:
<html>
<body>
Test number formatting with locale.
</body>
<script type="text/javascript">
var num = 100234.56789;
alert(num.toLocaleString());
</script>
</html>
In my browser with german settings the number is rendered as 100.234,56789, which is exactly the expected behaviour.
Regards,
Manfred
|
|
|
|
|
Thanks, I just could not find it; brain fart on my part.
Panic, Chaos, Destruction. My work here is done.
Drink. Get drunk. Fall over - P O'H
OK, I will win to day or my name isn't Ethel Crudacre! - DD Ethel Crudacre
I cannot live by bread alone. Bacon and ketchup are needed as well. - Trollslayer
Have a bit more patience with newbies. Of course some of them act dumb - they're often *students*, for heaven's sake - Terry Pratchett
|
|
|
|
|
Sh*t Farts happen from time to time!
Cheers!
"With sufficient thrust, pigs fly just fine."
Ross Callon, The Twelve Networking Truths, RFC1925
|
|
|
|
|
I am new to ExtJS.I tried in Sencha and got some Code but its Confuse to Implement the code.I want to do the code in Visual Studio-2010.and i don't know how to do this.Please explain how to start my ExtJS examples in visual studion-2010.Please explain step by step.
Thanks a lot in advance..
|
|
|
|
|
|
Hi
I have a problem: I have a div inside HTML page then I open/update with to javascript functions: it works fine until I put code inside another div, function open window div but is not the one I want, is just empty.
The following code work fine alone (I repet out of another div)
scrip to open div like window (work fine it's based on exterlan library)
function showdivrecord(ais)
{
return hs.htmlExpand(ais);
}
Once I show div (with function showdivrecord(ais)) - I fill div
function filldivrecord(idrow)
{
var divtxtElement = document.getElementById(idrow).value;
var mySplitResult = divtxtElement.split("|");
document.getElementById("divtxt").innerHTML = divtxtElement;
document.getElementById('picdiv').src= document.getElementById('pic'+idrow).value;
document.getElementById("divtxt").innerHTML = "<hr>0) " + mySplitResult[0] + "<hr>1) " + mySplitResult[1];
}
Sorry I am novice of javascript, by the way I think problem is parameter "this": what have to write to point other right DIV?? ( I guess).
Thank you in advance
|
|
|
|
|
Your question/code-snippet is incomplete.
I don't see another div, show-div detail, etc. Though you mention 'based on external library', what does hs.htmlExpand(ais) work like? When and where you call filldivrecords? It's all connected to troubleshoot and find the culprit.
Did you DEBUG and see? Put keyword 'debugger;' at the start of method showdivrecords(before return statement), enable Javascript debugging in your browser and then step through using F11 to see the execution.
|
|
|
|
|
Hi Mewara thank you for you reply i post full html page (I just removed php), the library
hs.graphicsDir = 'js/Photoview/highslide/graphics/';
hs.outlineType = 'rounded-white';
hs.wrapperClassName = 'draggable-header';
I use this function showdivrecord(ais) to have popup effect, I hope this can help you, sorry I am not a good programmer on javascript, ciao
<html>
<head>
<META NAME="ROBOTS" CONTENT="NOINDEX,NOFOLLOW">
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>ELENCO CASTING - ISCRITTI |</title>
<script type="text/javascript" language="javascript" src="js/media/js/jquery.js"></script>
<script type="text/javascript" language="javascript" src="js/media/js/jquery.dataTables.js"></script>
<script type="text/javascript" charset="utf-8">
$(document).ready(function() {
$('#example').dataTable();
} );
</script>
<script type="text/javascript" src="js/Photoview/highslide/highslide-with-html.js"></script>
<script type="text/javascript">
hs.graphicsDir = 'js/Photoview/highslide/graphics/';
hs.outlineType = 'rounded-white';
hs.wrapperClassName = 'draggable-header';
</script>
</head>
<body id="dt_example" onLoad="myonload();">
<form name="form1" method="post" action="">
| Cognome e Nome | Localita' | Provincia | Ruolo | Telefono | Email | <input type="checkbox" name="removeid" value="" id="removeid" = 10 ? 'disabled' : '';?> > | | | | | | | | | | | | | |
<input name="elimina" type="button" class="cella_form" id="elimina" value="Elimina" onClick="javascript:delthis(this);"><input name="aggiungi" type="button" class="cella_form" id="aggiungi" value="Aggiungi" onClick="javascript:nuovoiscritto();"><input name="reset" type="button" class="cella_form" id="slideshow" value="slideshow" onClick="javascript:showpic();"><input name="azzera" type="reset" class="cella_form" id="reset" value="Azzera" onClick="javascript:azzeraform();"><input name="browse" type="button" class="cella_form" id="browse" value="Agenda Casting" onClick="javascript:window.location='browse_casting_agenda.php';">
<input type="button" name="v1" id="v1" value="S1" onClick="javascript:showdivrecord(this)">
<script>
function showdivrecord(ais)
{
return hs.htmlExpand(ais);
}
</script>
<script>
function filldivrecord(idrow)
{
var divtxtElement = document.getElementById(idrow).value;
var mySplitResult = divtxtElement.split("|"); // parte da 0
document.getElementById("divtxt").innerHTML = divtxtElement;
document.getElementById('picdiv').src= document.getElementById('pic'+idrow).value;
document.getElementById("divtxt").innerHTML = " 0) " + mySplitResult[0] + " 1) " + mySplitResult[1];
//return hs.htmlExpand(ais);
}
</script>
</form>
</body>
</html>
|
|
|
|
|
I am trying to implement the double click event on a child element of an autocomplete text box. I can assign the ondblclick to the div but when I double click the innerHTML shows all of the child elements and not the one I double clicked on. See the code below:
var aStr2 = new Array("computer - Plain IA", "computer - Plain JSOC", "communication - Plain IA", "condor - Plain IA");
function AutoComplete(oText) {
// initialize member variables
this.oText = oText; // the text box
this.oDiv = document.getElementById("acdiv"); // oDiv; // a hidden for the popup auto-complete
this.nMaxSize = 30;
this.aStr = new Array(5);
this.aStrx = new Array(5);
this.aStr3 = aStr2;
// preprocess the texts for fast access
var i, n = this.oText.value.length;
for (i = 0; i < aStr2.length; i++) {
this.aStrx[i] = aStr2[i];
}
this.nCount = this.oText.value.length;
// if a suitable number then show the popup-div
if ((this.nMaxSize == -1) || ((this.nCount < this.nMaxSize) && (this.nCount > 0))) {
// clear the popup div.
while (this.oDiv.hasChildNodes())
this.oDiv.removeChild(this.oDiv.firstChild);
// get all the matching strings from the AutoCompleteDB
for (i = 0; this.aStr3[i] != null; i++) {
if (this.aStr3[i].indexOf(this.oText.value) == -1) {
delete this.aStrx[i];
}
}
// add each string to the popup-div
var i, n = aStrx.length;
for (i = 0; i < n; i++) {
var oDiv2 = document.createElement('div');
//debugger;
oDiv.appendChild(oDiv2);
if (aStrx[i] != null) {
oDiv2.innerHTML = aStrx[i];
}
oDiv2.onmousedown = AutoComplete.prototype.onDivMouseDown;
oDiv2.onmouseover = AutoComplete.prototype.onDivMouseOver;
oDiv2.onmouseout = AutoComplete.prototype.onDivMouseOut;
this.oDiv = oDiv2;
this.oDiv.style.visibility = "visible";
this.oDiv.style.color = "Black";
this.oDiv.style.background = "Yellow";
}
}
else // hide the popup-div
{
this.oDiv.innerHTML = "";
this.oDiv.style.visibility = "hidden";
}
}
AutoComplete.prototype.onblur = function () {
this.oDiv.style.visibility = "hidden";
}
function dblclick() {
// debugger
alert("hello");
}
|
|
|
|
|
Got it working. Just made the following class var global:
var first = true;
var aStrx = new Array(5);
var oDiv;
var indextext = 0;
Then added the event to each childelement:
var oDiv2 = document.createElement('div');
//debugger;
oDiv2.id = i;
oDiv2.setAttribute('ondblclick', 'dblclick("' + oDiv2.id + '")');
Finally, added the functions:
function dblclick(id) {
if (first == true) {
populateTxt(aStrx[id]);
first = false;
}
indextext++
if (indextext >= aStrx.length - 1) {
indextext = 0;
first = true;
}
}
function populateTxt(selectedtext) {
document.getElementById("txtSearch2").value = selectedtext;
indextext = 0;
oDiv = document.getElementById("acdiv");
oDiv.innerHTML = "";
oDiv.style.visibility = "hidden";
}
|
|
|
|
|
Hello,
I'm trying to move a picture around my screen randomly.
Here is my code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>JavaScript: Moving an Image</title>
<script type="text/javascript">
var i = 0;
function Init()
{
var elem = document.getElementById("ss");
var move = parseInt(elem.style.marginTop+10);
elem.setAttribute("style", "marginTop:" + move.toString() + "px");
elem.setAttribute("style", "marginLeft:" + move.toString() + "px");
elem.setAttribute("style", "marginBottom:" + move.toString() + "px");
elem.setAttribute("style", "marginRight:" + move.toString() + "px");
setInterval("Init()",1000);
}
function backToCenter()
{
var elem = document.getElementById("ss");
elem.style.marginTop="200px";
elem.style.marginRight="200px";
elem.style.marginBottom="200px";
elem.style.marginLeft="400px";
}
</script>
<style>
#box
{
width: 500px;
height: 300px;
position: relative;
margin: 20px auto 0px auto;
border: 5px outset #000;
overflow: hidden;
}
.image
{
position: absolute;
z-index: 100;
}
</style>
</head>
<body onload="Init()">
<div id="ss"style="height: 200px; width: 500px;"><img class="image" id="img1" src="beer-logo.jpg" height="50px" width="50px"/></div>
</body>
</html>
but the picture doesnt move, i cant figure out how to do this.
any help would be more than thankfull.
cheers.
|
|
|
|
|
Sir;
I think it's because of the lines (below) are overwriting each other.
elem.setAttribute("style", "marginTop:" + move.toString() + "px");
elem.setAttribute("style", "marginLeft:" + move.toString() + "px");
elem.setAttribute("style", "marginBottom:" + move.toString() + "px");
elem.setAttribute("style", "marginRight:" + move.toString() + "px");
Also, the value of the attribute style should be margin-top: npx not marginTop: nxp (we remove the '-' character from the javascript identifier marginTop).
Sir, lets begin with moving the picture down at speed of 10px/sec.
elem.style.marginTop = move.toString() + "px";
then you change the direction when the picture reaches the edge of the screen.
Help people,so poeple can help you.
|
|
|
|
|
Thanks for the help.
my problem is that i need to keep it moveing all the time, with your code the picture stays in the smae place.
My problem is in this area:
var x = parseInt(elem.style.marginTop);
x=x+10;
elem.style.marginTop = x+"px";
the compiler has an issue with this line:
elem.style.marginTop = x+"px";
I changed the code abit (lost the setAttribute and replaced it with what you gave me)
Hope you can help me out.
|
|
|
|