Embed an NST Shell run command console using a multi-line format with the Font control window size set to 'fit' mode.
The following parameters are recognized:
The javascript command array which includes linux commands 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 with the Font Control initially set to the 'Fit' mode. The commands are encapsulated in a javascript array using a multi-line format.
Example of using the macro:
@javascriptBegin() // // Multi-line NstShell command example... var cmd_multiline="@javaEscape(" h() { /bin/cat \"/etc/hosts\"; } echo \"Hosts file listing:\"; h; ")"; @javascriptEnd() @nstShellRunCommandMultiFit("cmd_multiline","cat hosts file")
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")
@javascriptBegin() // // Multi-line NstShell command example... var cmd_multiline="@javaEscape(" h() { /bin/cat \"/etc/hosts\"; } echo \"Hosts file listing:\"; h; ")"; @javascriptEnd() @nstShellRunCommandMultiFit("cmd_multiline","cat hosts file")
EOF
This macro is defined as:
@nstShellRunCommandMulti("@param(0)",,"@ifEqual("@param(2)",,,"@param(2)")","{ initMode: 'fit'@ifEqual("@param(1)",,,", fileNamePrefix: \"@fnb("@param(1)","nst-console")\"") }","@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)")")