Embed an NST Shell run command console.
The following parameters are recognized:
The commands (Bash style syntax) to run.
This optional setting is a file name prefix typically used with the Font Control NST File Viewer PDF title name or download file name.
This optional setting is intended for functions which generated run command output at run time (as opposed to compilation time). If you include this parameter - make sure it is a unique ID).
This optional setting specifies set of configuration parameters to pass to the FontControl(node, param) contstructor. This needs to be in the form of a JavaScript structure (JSON Object). ***Note: If this parameter is specified then the FILENAMEPREFIX parameter will not be honored. Include it in the PARAMS JSON object.
This optional setting specifies set of configuration parameters to pass to the NstShell.Console(id, coParams) contstructor. This needs to be in the form of a JavaScript structure (JSON Object).
This optional setting sets a progress text string.
This macro is used to Embed an NST Shell run command console into an NST WUI page.
Example of using the macro:
@nstShellRunCommand("/usr/bin/sudo /usr/bin/w 2>&1;","w")
Assuming the com.ccg.macros.at.All
class is within your CLASSPATH
and the
config/html.at
macros file has been
generated (Hint: run make atmacros in the
wui
directory), a developer should be able to
run the above example by copy/pasting from below:
[root@probe root]#
java com.ccg.macros.at.All <<EOF
@include("config/html.at",,"d")
@nstShellRunCommand("/usr/bin/sudo /usr/bin/w 2>&1;","w")
EOF
This macro is defined as:
@define("nst_shell_cnt","0","ifnew")@increment("nst_shell_cnt") <pre@htmlAttr("id","@ifEqual("@param(2)",,"nst_shell_run_cmd_id_@nst_shell_cnt()","@param(2)")")@htmlAttr("class","screen")></pre> @javascriptBegin() NstShell.runCommand("@ifEqual("@param(2)",,"nst_shell_run_cmd_id_@nst_shell_cnt()","@param(2)")", [ "@param(0)" ]@ifEqual("@param(3)",,", { fileNamePrefix: \"@fnb("@param(1)","nst-console")\" }",", @param(3)")@ifEqual("@param(4)",,", { showLineNum: true, showRc: true, gaps: 1, showFit: true, showClear: true, showRun: true, scrollTop: true, showInit: true, progressText: \"@ifEqual("@param(5)",,,"@param(5)")\" }",", @param(4)"));@javascriptEnd()