setprogress - Update the status page for a job, based on command-line
parameters.
A job's status page is a page which automatically reloads itself every few
seconds to display to the user the status of a CGIBurn job. setprogress
updates that page.
setprogress -j job-id [-ic] [-p percentage] [-r refresh-time]
[-m message] [-f]
-j: Operate on status file for job-id
-i: Initialize job status page
-c: Job was canceled
-p: Job is "percentage" done.
-r: Refresh page after "refresh-time" seconds.
-m: Display "message" to user.
-f: Final status page; don't auto-refresh anymore.
setprogress uses the template setprogress.tpl as setprogress.
- All templates
-
All templates have access to all
:const variables from
CGIBurn::Conf.
All templates also have access to the following special variables:
- JOB_ID
-
The job ID of the job whose log we are watching.
- JOB_STATUSURL
-
The URL to the status page for the job whose log we are watching.
- REFRESH_TIME
-
How often the page should be refreshed.
- TIME
-
The current time, in ctime(3) format.
- MESSAGE
-
The progress message.
- PROGRESS_PERCENT
-
The percentage that this job has reached towards completion.
- setprogress/pagestart
-
- setprogress/pagestart_norefresh
-
The very first thing that should be displayed if the page should
auto-refresh (when the job is not done yet) or should not (if it has
finished), respectively.
- setprogress/progressstart
-
If a progress percentage is available, this is displayed first. If you
don't need multiple progress sections, you can put all of your progress
HTML here, and leave
setprogress/progressblock and
setprogress/progressnotyet empty (although they must exist).
- setprogress/progressblock
-
- setprogress/progressnotyet
-
- setprogress/progresscancel
-
If a job is in progress or finished, setprogress figures out how many
``progress blocks'' should be displayed based on the value of the
PERCENT_BLOCKS setting; otherwise, it displays
$PERCENT_BLOCKS
``cancellation blocks''.. Then it figures out how many of those should be
filled with a ``progress-indicating graphic'' and how many with a
``non-progress indicating graphic'' (or fills all of them with cancellation
blocks). It then calls setprogress/progressblock once for each progress graphic, and setprogress/progressnotyet for each non-progress graphic (or calls setprogress/progresscancel for all blocks).
The end result is a progress bar being drawn.
This is kinda a hack. If you don't want to use it, just put all of your
code in setprogress/progresstart. That won't work for cancellations right now, though.
- setprogress/progressend
-
If a progress percentage is available, this is displayed after
setprogress/progressstart and a series of blocks.
- setprogress/status
-
This section will be displayed if a message is provided to setprogress.
- setprogress/normalbuttons
-
This section is displayed for still-running jobs, to display buttons
allowing the user to cancel this job, or watch its logfile.
- setprogress/donebuttons
-
This section is displayed for finished jobs, to display buttons allowing
the user to clean up after this job, or display its complete logfile.
- setprogress/jobtoolbar
-
This section is always displayed, for displaying a brief toolbar allowing
the user to access a few other pages quickly.
- setprogress/pageend
-
This section is always displayed last.
logprogress,
CGIBurn::Conf,
CGIBurn::Job,
CGIBurn::CGITools,
TEMPLATES.