@tailButtonAutoRefresh(FILE, [LINES], [AUTO], [LABEL], [RETURN], [RETURN_LABEL], [TEXT_MODE], [DISPLAY_WIDTH], [LINE_NUMBER], [TITLE], [SYNCKEY], [BUTTONATTRS], [IEFORCEJUMP], [FORMATTRS])

Insert a single form button to auto-refresh and view end of file on server.

The following parameters are recognized:

FILE

The full path to the file to display (on the server).

[LINES]

The maximum number of lines to display, or "all" (the default) for entire file.

[AUTO]

The browser auto-refresh setting in seconds. Set to "0" to disable auto-refresh.

[LABEL]

The text the user clicks on. If omitted defaults to FILE.

[RETURN]

The URL to return to when user finishes browsing file. If omitted, returns to index page of WUI.

[RETURN_LABEL]

The label to put on the "Return" button. Defaults to "Return" if omitted.

[TEXT_MODE]

Can be used to force the displayed text mode to: "ASCII" or "Hex".

[DISPLAY_WIDTH]

Can be used to change the width of the text area box displaying the file content. It is expressed as a percentage of the browser's window width. A default value of 95 percent is used.

[LINE_NUMBER]

Used to add line numbers preceding each line of a file. Set the value to "checked" for line numbers or leave blank to disable.

[TITLE]

Optional title attribute to appear as a tooltip to the user when their mouse hovers over the button.

[SYNCKEY]

Used to set a unique ID you want returned. Useful for passing a parameter back to a calling cgi script. NOTE: You need to encode/escape the form parameter yourself.

[BUTTONATTRS]

Optional set of attributes to apply to input button entity.

[IEFORCEJUMP]

Used for jumping to an exact location on a page specific to the IE browser when returning from the NST File Viewer. Set this parameter to an "ID Tag Attribute" on the page as an anchor to jump to.

[FORMATTRS]

Optional set of attributes to apply to the form entity.

This macro is useful when you want to let the user browse a file on the system. The browser will auto-refresh the display and render any updates to the file. It uses a HTML form and you may use bash environment variables and functions as your parameters.

Example of using the macro:

@tailButtonAutoRefresh("/var/log/boot.log","${QUERY_lines}","2","boot.log",,"Boot Log","Hex","117","")

Assuming the com.ccg.macros.at.All class is within your CLASSPATH and the config/bash.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/bash.at",,"d")
@tailButtonAutoRefresh("/var/log/boot.log","${QUERY_lines}","2","boot.log",,"Boot Log","Hex","117","")
EOF

This macro is defined as:

<form@htmlAttr("action","@topDir()/cgi-bin/system/tail.cgi#button")@ifEqual("@param(13)","","","@param(13)")>
@wuiInputHidden("filename","@param(0)")
@wuiInputHidden("lines","@fnb("@param(1)","100")")
@wuiInputHidden("auto_refresh","@fnb("@param(2)","4")")
@wuiInputHidden("return","@fnb("@param(4)","@topDir()/index.cgi")")
@wuiInputHidden("return_label","@fnb("@param(5)","Return")")
@wuiInputHidden("prevtextmode","@fnb("@param(6)")")
@wuiInputHidden("displaywidth","@fnb("@param(7)","95")")
@wuiInputHidden("linenum","@fnb("@param(8)")")
@wuiInputHidden("synckey","@fnb("@param(10)")")
@wuiInputHidden("ieForceJump","@fnb("@param(12)")")
@wuiInputButton("submit","@fnb("@param(3)","Show @param(0)")","@fnb("@param(9)","@ttNSTFileViewer("@param(0)","$(calcDomTTLen "@param(0)" 50 300 1600)","@ttLine1px("@ttAction("Monitor") the @ttEmphasis("Contents","false") of this file:")")")","@fnb("@param(11)")")
</form>