From 44ef0bd5fe47a43e47aec5f7981b6c1d728dd9a8 Mon Sep 17 00:00:00 2001 From: Michele Calgaro Date: Sun, 2 Mar 2025 18:37:22 +0900 Subject: Restructure source files into 'src' subfolder Signed-off-by: Michele Calgaro --- src/plugins/webinterface/www/default/interface.php | 152 +++++++++++++++++++++ 1 file changed, 152 insertions(+) create mode 100644 src/plugins/webinterface/www/default/interface.php (limited to 'src/plugins/webinterface/www/default/interface.php') diff --git a/src/plugins/webinterface/www/default/interface.php b/src/plugins/webinterface/www/default/interface.php new file mode 100644 index 0000000..6432798 --- /dev/null +++ b/src/plugins/webinterface/www/default/interface.php @@ -0,0 +1,152 @@ + 'Not Started', + 1 => 'Seeding Complete', + 2 => 'Download Complete', + 3 => 'Seeding', + 4 => 'Downloading', + 5 => 'Stalled', + 6 => 'Stopped', + 7 => 'Allocating Diskspace', + 8 => 'Error', + 9 => 'Queued', + 10 => 'Checking Data' + ); + if (array_key_exists($status_id, $table)) return $table[$status_id]; + else return 'Not supported Status'; +} + +function generate_button_code($img, $alt, $href='') +{ + $img = ''.htmlspecialchars($alt).''; + if (empty($href)) return $img; + else return ''.$img.''; +} +?> + + + + + + + +<?php echo '(D:'.$globalinfo['download_speed'].') (U:'.$globalinfo['upload_speed'].') KTorrent'; ?> + + + +
WebInterface KTorrent plugin
+
+ + + +
+ + + + + + + + + + + + + +'."\n\t\t\t"; + + $torrent_name = str_replace("'", "\'", $torrent['torrent_name']); + if($torrent['total_bytes_to_download']!=0) $perc = round(100.0 - ($torrent['bytes_left_to_download'] / $torrent['total_bytes_to_download']) * 100.0, 2); + else $perc = 0; + if(strlen($torrent['torrent_name'])>30) $display_name=substr($torrent['torrent_name'], 0, 30)." ..."; + else $display_name=$torrent['torrent_name']; + if ($torrent['num_files']>1) $file_td_content = ''.$display_name.''; + else $file_td_content = $display_name; + + echo ''; + echo ""; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo "\n\t\t".''."\n"; + $a++; + } + ?> +
ActionsFileStatusDownloadedSizeUploadedDown SpeedUp SpeedPeersComplete
'; + echo generate_button_code('/stop.png', 'stop', ($torrent['running'])?'interface.php?stop='.$a:''); + echo generate_button_code('/start.png', 'start', ($torrent['running'])?'':'interface.php?start='.$a); + echo 'remove'; + echo '$file_td_content'.get_torrent_status_name($torrent['status']).''.$torrent['bytes_downloaded'].''.$torrent['total_bytes'].''.$torrent['bytes_uploaded'].''.$torrent['download_rate'].''.$torrent['upload_rate'].''.$torrent['num_peers'].''.$perc.'%
+
+ + + + -- cgit v1.2.3