diff options
author | ivan <ivan> | 2005-01-27 10:21:18 +0000 |
---|---|---|
committer | ivan <ivan> | 2005-01-27 10:21:18 +0000 |
commit | 6cf964d0dc008621fb30fd2da28e2c44f29c6364 (patch) | |
tree | 74fd5536bb89960db22d03cc95b6374711de60ef /httemplate/misc | |
parent | e4ae5122522f2d45c68a38eaef337a82029f2fc1 (diff) |
DHTML progress bar for glacial rate adding and editing, closes: Bug#1100
Diffstat (limited to 'httemplate/misc')
-rw-r--r-- | httemplate/misc/progress.html | 88 |
1 files changed, 88 insertions, 0 deletions
diff --git a/httemplate/misc/progress.html b/httemplate/misc/progress.html new file mode 100644 index 000000000..cbff08b7b --- /dev/null +++ b/httemplate/misc/progress.html @@ -0,0 +1,88 @@ +<% + my( $jobnum ) = $cgi->param('jobnum'); + my( $url ) = $cgi->param('url'); + my $job = ''; + if ( $jobnum =~ /^(\d+)$/ ) { + $job = qsearchs('queue', { 'jobnum' => $jobnum } ); + } + if ( $job && $job->status ne 'failed' ) { +%> + +<HTML> + <HEAD> + <TITLE> + Please wait... + </TITLE> + <META HTTP-Equiv="Cache-Control" Content="no-cache"> + <META HTTP-Equiv="Pragma" Content="no-cache"> + <META HTTP-Equiv="Expires" Content="0"> + + <!-- could do more JSRS magic and avoid refreshing... but works for now --> + <META HTTP-Equiv="Refresh" Content="5"> + </HEAD> + <BODY BGCOLOR="#e8e8e8"> + <P ALIGN="center">Please wait... + <script TYPE="text/javascript" src="../elements/qlib/control.js"></script> + <script TYPE="text/javascript" src="../elements/qlib/imagelist.js"></script> + <script TYPE="text/javascript" src="../elements/qlib/progress.js"></script> + <P ALIGN="center"> + <script TYPE="text/javascript"> + // Create imagelist + SEGS = new QImageList(4, 23, "../images/progressbar-empty.png", "../images/progressbar-full.png"); + + // Create bars + bar1 = new QProgress(null, "bar1", SEGS, 100); + bar1.set(<%= $job->statustext %>); + // bar1.update; + </script> + <BR><%= $job->statustext %>% + <P ALIGN="center">(progress of job #<%= $jobnum %>) + </BODY> +</HTML> + +<% + } elsif ( !$job ) { #handle job gone case : job sucessful + # so close popup, redirect parent window... + #eidiot("write success handler (jobnum $jobnum)"); +%> + +<HTML> + <HEAD> + <TITLE> + Operation successful + </TITLE> + <META HTTP-Equiv="Cache-Control" Content="no-cache"> + <META HTTP-Equiv="Pragma" Content="no-cache"> + <META HTTP-Equiv="Expires" Content="0"> + + </HEAD> + <BODY BGCOLOR="#e8e8e8"> + <SCRIPT TYPE="text/javascript"> + top.opener.window.location.href = '<%= $cgi->param('url') %>'; + window.close(); + </SCRIPT> + </BODY> +</HTML> + +<% + } else { +%> + + <HEAD> + <TITLE> + Error + </TITLE> + <META HTTP-Equiv="Cache-Control" Content="no-cache"> + <META HTTP-Equiv="Pragma" Content="no-cache"> + <META HTTP-Equiv="Expires" Content="0"> + </HEAD> + <BODY BGCOLOR="#e8e8e8"> + <P ALIGN="center"><FONT COLOR="#ff0000">Error: <%= $job ? $job->statustext : $jobnum %></FONT> + <P ALIGN="center"><INPUT TYPE="button" onClick="top.opener.document.OneTrueForm.submit.disabled=false; window.close();" VALUE="OK"> + </BODY> +</HTML> + +<% } %> + + + |