diff options
Diffstat (limited to 'groups.pl')
-rwxr-xr-x | groups.pl | 15 |
1 files changed, 9 insertions, 6 deletions
@@ -5,6 +5,8 @@ use CGI qw(:standard); use CGI::Carp 'fatalsToBrowser'; use local::nzbget; use local::db; +use local::user; +my $user = new local::user($ENV{REMOTE_USER}); use CGI::Ajax; @@ -26,6 +28,7 @@ sub get_download_table my $html; my $cli = new local::nzbget; my $row = $cli->send_request('listgroups') or die "Can't connect to nubget"; + $html.= CGI::start_table(); foreach my $value ( @$row) { my ($download) = local::db::download->retrieve($value->{NZBNicename}->value) or die ' Error in groups'; @@ -34,12 +37,15 @@ sub get_download_table my $percent = int(100-100*$remaining/$total); $download->size($total); $download->update(); - $html.= Tr(td([$download->category->name,$download->name,$download->owner->name,$percent.'%'])); + my $cancel; + $cancel=a({href=>'/cgi-bin/nzbget/cancel.pl?id='.$value->{NZBNicename}->value},'Abbrechen') if ($download->owner->owner_id() eq $user->get_id()); + $html.= Tr(td([$download->category->name,$download->name,$download->owner->name,$percent.'%',$cancel])); #foreach my $key (keys %$value) #{ # $html.= Tr(td([$key,$value->{$key}->value])); #} } + $html.= CGI::end_table(); return $html; } @@ -51,8 +57,7 @@ sub Show_HTML $html.= <<LALALA <script type="text/javascript" language="JavaScript"><!-- - window.setInterval("get_download_speed( [], ['speed'] );", 2000); - window.setInterval("get_download_table( [], ['dltable'] );", 2000); + window.setInterval("get_download_speed( [], ['speed'] ); get_download_table( [], ['dls'] );", 2000); //--></script> LALALA ; @@ -62,9 +67,7 @@ LALALA $html.= CGI::end_table(); $html.= hr(); - $html.= CGI::start_table(id=>'dltable'); - $html.= get_download_table(); - $html.= CGI::end_table(); + $html.= div({id=>'dls'},get_download_table()); $html.= $menu->end_html(); return $html |