summaryrefslogtreecommitdiffstats
path: root/plugins/webinterface/www/mobile
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/webinterface/www/mobile')
-rw-r--r--plugins/webinterface/www/mobile/Makefile.am8
-rw-r--r--plugins/webinterface/www/mobile/favicon.icobin0 -> 1406 bytes
-rw-r--r--plugins/webinterface/www/mobile/interface.php113
-rw-r--r--plugins/webinterface/www/mobile/ktorrentwebinterfacelogo.pngbin0 -> 97320 bytes
-rw-r--r--plugins/webinterface/www/mobile/login.html24
-rw-r--r--plugins/webinterface/www/mobile/remove.pngbin0 -> 1039 bytes
-rw-r--r--plugins/webinterface/www/mobile/settings.php44
-rw-r--r--plugins/webinterface/www/mobile/start.pngbin0 -> 868 bytes
-rw-r--r--plugins/webinterface/www/mobile/stop.pngbin0 -> 711 bytes
-rw-r--r--plugins/webinterface/www/mobile/torrent.php91
10 files changed, 280 insertions, 0 deletions
diff --git a/plugins/webinterface/www/mobile/Makefile.am b/plugins/webinterface/www/mobile/Makefile.am
new file mode 100644
index 0000000..3aae8b4
--- /dev/null
+++ b/plugins/webinterface/www/mobile/Makefile.am
@@ -0,0 +1,8 @@
+INCLUDES = -I$(srcdir)/../../libktorrent $(all_includes)
+METASOURCES = AUTO
+
+ktdatadir = $(kde_datadir)/ktorrent/www/mobile
+
+
+
+ktdata_DATA = favicon.ico interface.php ktorrentwebinterfacelogo.png login.html remove.png start.png stop.png settings.php torrent.php
diff --git a/plugins/webinterface/www/mobile/favicon.ico b/plugins/webinterface/www/mobile/favicon.ico
new file mode 100644
index 0000000..3213b23
--- /dev/null
+++ b/plugins/webinterface/www/mobile/favicon.ico
Binary files differ
diff --git a/plugins/webinterface/www/mobile/interface.php b/plugins/webinterface/www/mobile/interface.php
new file mode 100644
index 0000000..57582de
--- /dev/null
+++ b/plugins/webinterface/www/mobile/interface.php
@@ -0,0 +1,113 @@
+<html>
+<head>
+<title>KTorrent WebInterface</title>
+</head>
+<body>
+<table width="100%">
+ <tbody>
+ <tr>
+ <td align="center"><IMG src="ktorrentwebinterfacelogo.png" width="340" height="150" align="top" border="0"></td>
+
+ <td><strong>ktorrent</strong>->transfers</td>
+
+ <td><td><a href="interface.php" >refresh</a></td>
+ </tr>
+ </tbody>
+</table>
+<hr>
+<table width="100%">
+ <tbody>
+ <?php
+ $stats=downloadStatus();
+ $a = 0;
+ foreach ($stats as $torrent) {
+ echo "<tr>";
+ $perc = round(100.0 - ($torrent['bytes_left_to_download'] / $torrent['total_bytes_to_download']) * 100.0, 2);
+ echo "<td><a href=\"torrent.php?id=$a\" >{$torrent['torrent_name']}</a></td>";
+ switch ($torrent['status']) {
+ case 0:
+ echo "<td>Not Started</td>";
+ break;
+ case 1:
+ echo "<td>Seeding Complete</td>";
+ break;
+ case 2:
+ echo "<td>Download Complete</td>";
+ break;
+ case 3:
+ echo "<td>Seeding</td>";
+ break;
+ case 4:
+ echo "<td>Downloading</td>";
+ break;
+ case 5:
+ echo "<td>Stalled</td>";
+ break;
+ case 6:
+ echo "<td>Stopped</td>";
+ break;
+ case 7:
+ echo "<td>Allocating Diskspace</td>";
+ break;
+ case 8:
+ echo "<td>Error</td>";
+ break;
+ case 9:
+ echo "<td>Queued</td>";
+ break;
+ case 10:
+ echo "<td>Checking Data</td>";
+ break;
+ default:
+ echo "<td>Not supported Status</td>";
+ }
+ echo "<td>$perc%</td>";
+ $a=$a+1;
+ echo "</tr>";
+ }
+ ?>
+
+ <tr>
+ <td>&nbsp;</td>
+ <td><hr></td>
+ <td>&nbsp;</td>
+ </tr>
+
+ <tr>
+ <?php
+ $globalinfo=globalInfo();
+ echo "<td><strong>Speed</strong></td>";
+ echo "<td>Down: {$globalinfo['download_speed']}</td>";
+ echo "<td>Up: {$globalinfo['upload_speed']}</td>";
+ ?>
+ </tr>
+ <tr>
+ <td>&nbsp;</td>
+ <td><hr></td>
+ <td>&nbsp;</td>
+ </tr>
+ <tr>
+ <td><a href="interface.php?startall=startall" ><strong>Start All</strong></a></td>
+ <td>&nbsp;</td>
+ <td><a href="interface.php?stopall=stopall" ><strong>Stop All</strong></a></td>
+ </tr>
+ <tr>
+ <td>&nbsp;</td>
+ <td><a href="settings.php" ><strong>Settings</strong></a></td>
+ <td>&nbsp;</td>
+ </tr>
+
+ </tbody>
+</table>
+<FORM method="GET">
+<INPUT type="text" name="load_torrent">
+<INPUT type="submit" name="Load torrent" value="Load torrent"></tr>
+</FORM>
+<FORM method="post" enctype="multipart/form-data" action="interface.php">
+Local File:<INPUT type="file" name="load_torrent">
+<INPUT type="submit" name="Upload Torrent" value="Upload Torrent"></tr>
+</FORM>
+
+</body>
+</html>
+
diff --git a/plugins/webinterface/www/mobile/ktorrentwebinterfacelogo.png b/plugins/webinterface/www/mobile/ktorrentwebinterfacelogo.png
new file mode 100644
index 0000000..bc235b5
--- /dev/null
+++ b/plugins/webinterface/www/mobile/ktorrentwebinterfacelogo.png
Binary files differ
diff --git a/plugins/webinterface/www/mobile/login.html b/plugins/webinterface/www/mobile/login.html
new file mode 100644
index 0000000..359c44c
--- /dev/null
+++ b/plugins/webinterface/www/mobile/login.html
@@ -0,0 +1,24 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+
+<head>
+ <title>KTorrent WebInterface - Login</title>
+ <meta name="GENERATOR" content="Quanta Plus">
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+</head>
+<body>
+<TABLE align="center" >
+<tr><td><IMG src="ktorrentwebinterfacelogo.png" width="687" height="300" align="left" border="0"></td></tr>
+</TABLE>
+<TABLE align="center" >
+<FORM action="interface.php" method="POST">
+
+ <tr><td>Username</td><td><INPUT type="text" name="username"></td></tr>
+ <tr><td>Password</td><td><INPUT type="password" name="password"></td></tr>
+<tr><td></td><td><INPUT type="submit" name="Login"></td></tr>
+
+</FORM>
+</TABLE>
+
+</body>
+</html>
diff --git a/plugins/webinterface/www/mobile/remove.png b/plugins/webinterface/www/mobile/remove.png
new file mode 100644
index 0000000..a7080ac
--- /dev/null
+++ b/plugins/webinterface/www/mobile/remove.png
Binary files differ
diff --git a/plugins/webinterface/www/mobile/settings.php b/plugins/webinterface/www/mobile/settings.php
new file mode 100644
index 0000000..b763bb1
--- /dev/null
+++ b/plugins/webinterface/www/mobile/settings.php
@@ -0,0 +1,44 @@
+<html>
+<head>
+<title>KTorrent WebInterface</title>
+</head>
+<body>
+<table width="100%">
+ <tbody>
+ <tr>
+ <td align="center"><IMG src="ktorrentwebinterfacelogo.png" width="340" height="150" align="top" border="0"></td>
+ <td><strong>ktorrent-><a href="interface.php">transfers</a></strong>->settings</td>
+ <td><a href="settings.php" >refresh</a></td>
+ </tr>
+ </tbody>
+</table>
+<table width="100%">
+ <tbody>
+<?php
+ $globalinfo=globalInfo();
+ echo "<FORM method=\"GET\">";
+ echo "<tr>";
+ echo "<td>Upload Speed (0 is no limit): </td>";
+ echo "<td><INPUT type=\"text\" name=\"maximum_upload_rate\" value=\"{$globalinfo['max_upload_speed']}\"></td>";
+ echo " </tr>";
+ echo "<tr>";
+ echo "<td>Download Speed (0 is no limit): </td>";
+ echo "<td><INPUT type=\"text\" name=\"maximum_download_rate\" value=\"{$globalinfo['max_download_speed']}\"></td>";
+ echo "</tr>";
+ echo "<tr>";
+ echo "<td>Maximum downloads (0 is no limit): </td>";
+ echo "<td><INPUT type=\"text\" name=\"maximum_downloads\" value=\"{$globalinfo['max_downloads']}\"></td>";
+ echo"</tr>";
+ echo "<tr>";
+ echo "<td>Maximum seeds (0 is no limit): </td>";
+ echo "<td><INPUT type=\"text\" name=\"maximum_seeds\" value=\"{$globalinfo['max_seeds']}\"></td>";
+ echo"</tr>";
+ echo "<tr><td><INPUT type=\"submit\"></tr></td>";
+ echo "</FORM>";
+?>
+</tbody>
+</table>
+
+</body>
+</html>
+
diff --git a/plugins/webinterface/www/mobile/start.png b/plugins/webinterface/www/mobile/start.png
new file mode 100644
index 0000000..ead5c73
--- /dev/null
+++ b/plugins/webinterface/www/mobile/start.png
Binary files differ
diff --git a/plugins/webinterface/www/mobile/stop.png b/plugins/webinterface/www/mobile/stop.png
new file mode 100644
index 0000000..7c6d824
--- /dev/null
+++ b/plugins/webinterface/www/mobile/stop.png
Binary files differ
diff --git a/plugins/webinterface/www/mobile/torrent.php b/plugins/webinterface/www/mobile/torrent.php
new file mode 100644
index 0000000..a1e451d
--- /dev/null
+++ b/plugins/webinterface/www/mobile/torrent.php
@@ -0,0 +1,91 @@
+<html>
+<head>
+<title>KTorrent WebInterface</title>
+</head>
+<body>
+<table width="100%">
+ <tbody>
+ <tr>
+ <td align="center"><IMG src="ktorrentwebinterfacelogo.png" width="340" height="150" align="top" border="0"></td>
+ <?php
+ $stats=downloadStatus();
+ $t=$stats[$_REQUEST['id']];
+ echo "<td><strong>ktorrent-><a href=\"interface.php\">transfers</a></strong>->{$t['torrent_name']}</td>";
+ echo "<td><a href=\"torrent.php?id={$_REQUEST['id']}\" >refresh</a></td>";
+ ?>
+ </tr>
+ </tbody>
+</table>
+<table width="100%">
+ <tbody>
+ <tr>
+ <?php
+ echo "<td><a href=\"torrent.php?stop={$_REQUEST['id']}&id={$_REQUEST['id']}\" title=\"STOP\"><img src=\"/stop.png\" name=\"stop\" width=\"16\" height=\"16\" border=\"0\"></a></td>";
+ echo "<td><a href=\"torrent.php?start={$_REQUEST['id']}&id={$_REQUEST['id']}\" title=\"START\"><img src=\"/start.png\" name=\"start\" width=\"16\" height=\"16\" border=\"0\"></a></td>";
+ echo "<td><a href=\"interface.php?remove={$_REQUEST['id']}\" title=\"REMOVE\"><img src=\"/remove.png\" name=\"remove\" width=\"16\" height=\"16\" border=\"0\"></a></td>";
+ ?>
+ </tr>
+ </tbody>
+</table>
+<table width="100%">
+ <tbody>
+ <?php
+ echo "<tr>";
+ echo "<td><strong>Status: </strong></td>";
+ switch ($t['status']) {
+ case 0:
+ echo "<td>NOT_STARTED</td>";
+ break;
+ case 1:
+ echo "<td>SEEDING_COMPLETE</td>";
+ break;
+ case 2:
+ echo "<td>DOWNLOAD_COMPLETE</td>";
+ break;
+ case 3:
+ echo "<td>SEEDING</td>";
+ break;
+ case 4:
+ echo "<td>DOWNLOADING</td>";
+ break;
+ case 5:
+ echo "<td>STALLED</td>";
+ break;
+ case 6:
+ echo "<td>STOPPED</td>";
+ break;
+ case 7:
+ echo "<td>ALLOCATING_DISKSPACE</td>";
+ break;
+ case 8:
+ echo "<td>ERROR</td>";
+ break;
+ case 9:
+ echo "<td>QUEUED</td>";
+ break;
+ case 10:
+ echo "<td>CHECKING_DATA</td>";
+ break;
+ default:
+ echo "<td>Not supported Status</td>";
+ }
+ echo "</tr>";
+ echo "<tr>";
+ echo "<td><strong>Down speed: </strong></td>";
+ echo "<td>{$t['download_rate']}</td>";
+ echo "</tr>";
+ echo "<tr>";
+ echo "<td><strong>Up speed: </strong></td>";
+ echo "<td>{$t['upload_rate']}</td>";
+ echo "</tr>";
+ echo "<tr>";
+ echo "<td><strong>Complete: </strong></td>";
+ $perc = round(100.0 - ($t['bytes_left_to_download'] / $t['total_bytes_to_download']) * 100.0, 2);
+ echo "<td>$perc %</td>";
+ echo "</tr>";
+ ?>
+ </tbody>
+</table>
+</body>
+</html>
+