Changeset 718f73eb
- Timestamp:
- Jul 23, 2009 5:01:43 PM (11 years ago)
- Branches:
- master
- Children:
- ca41537
- Parents:
- fb47eef
- Files:
-
- 6 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
apps/i2psnark/java/src/org/klomp/snark/SnarkManager.java
rfb47eef r718f73eb 340 340 if (_util.shouldUseOpenTrackers() != useOpenTrackers) { 341 341 _config.setProperty(I2PSnarkUtil.PROP_USE_OPENTRACKERS, useOpenTrackers + ""); 342 addMessage((useOpenTrackers ? "En" : "Dis") + "abled open trackers - torrent restart required to take effect ");342 addMessage((useOpenTrackers ? "En" : "Dis") + "abled open trackers - torrent restart required to take effect."); 343 343 changed = true; 344 344 } … … 346 346 if (openTrackers.trim().length() > 0 && !openTrackers.trim().equals(_util.getOpenTrackerString())) { 347 347 _config.setProperty(I2PSnarkUtil.PROP_OPENTRACKERS, openTrackers.trim()); 348 addMessage("Open Tracker list changed - torrent restart required to take effect ");348 addMessage("Open Tracker list changed - torrent restart required to take effect."); 349 349 changed = true; 350 350 } … … 353 353 saveConfig(); 354 354 } else { 355 addMessage("Configuration unchanged ");355 addMessage("Configuration unchanged."); 356 356 } 357 357 } … … 363 363 } 364 364 } catch (IOException ioe) { 365 addMessage("Unable to save the config to '" + _configFile.getAbsolutePath() + "' ");365 addMessage("Unable to save the config to '" + _configFile.getAbsolutePath() + "'."); 366 366 } 367 367 } … … 384 384 boolean ok = _util.connect(); 385 385 if (!ok) { 386 addMessage("Error connecting to I2P - check your I2CP settings ");386 addMessage("Error connecting to I2P - check your I2CP settings!"); 387 387 return; 388 388 } … … 447 447 if (!dontAutoStart && shouldAutoStart()) { 448 448 torrent.startTorrent(); 449 addMessage("Torrent added and started: '" + f.getName() + "' ");449 addMessage("Torrent added and started: '" + f.getName() + "'."); 450 450 } else { 451 addMessage("Torrent added: '" + f.getName() + "' ");451 addMessage("Torrent added: '" + f.getName() + "'."); 452 452 } 453 453 } … … 545 545 if ((!announce.startsWith("http://")) || 546 546 (announce.indexOf(".i2p/") < 0)) // need to do better than this 547 return "Non-i2p tracker in " + info.getName() + ", deleting it";547 return "Non-i2p tracker in " + info.getName() + ", removing it from our list of trackers!"; 548 548 List files = info.getFiles(); 549 549 if ( (files != null) && (files.size() > MAX_FILES_PER_TORRENT) ) { 550 return "Too many files in " + info.getName() + " (" + files.size() + "), deleting it ";550 return "Too many files in " + info.getName() + " (" + files.size() + "), deleting it!"; 551 551 } else if (info.getPieces() <= 0) { 552 return "No pieces in " + info.getName() + "? deleting it ";552 return "No pieces in " + info.getName() + "? deleting it!"; 553 553 } else if (info.getPieceLength(0) > Storage.MAX_PIECE_SIZE) { 554 554 return "Pieces are too large in " + info.getName() + " (" + DataHelper.formatSize(info.getPieceLength(0)) + 555 "B), deleting it ";555 "B), deleting it."; 556 556 } else if (info.getTotalLength() > Storage.MAX_TOTAL_SIZE) { 557 557 System.out.println("torrent info: " + info.toString()); … … 559 559 if (lengths != null) 560 560 for (int i = 0; i < lengths.size(); i++) 561 System.out.println("File " + i + " is " + lengths.get(i) + " long ");561 System.out.println("File " + i + " is " + lengths.get(i) + " long."); 562 562 563 563 return "Torrents larger than " + DataHelper.formatSize(Storage.MAX_TOTAL_SIZE) + 564 "B are not supported yet (because we're paranoid): " + info.getName() + ", deleting it ";564 "B are not supported yet (because we're paranoid): " + info.getName() + ", deleting it!"; 565 565 } else { 566 566 // ok … … 599 599 } 600 600 if (!wasStopped) 601 addMessage("Torrent stopped: '" + sfile.getName() + "' ");601 addMessage("Torrent stopped: '" + sfile.getName() + "'."); 602 602 } 603 603 return torrent; … … 614 614 if (torrent.storage != null) 615 615 removeTorrentStatus(torrent.storage.getMetaInfo()); 616 addMessage("Torrent removed: '" + torrentFile.getName() + "' ");616 addMessage("Torrent removed: '" + torrentFile.getName() + "'."); 617 617 } 618 618 } … … 647 647 File f = new File(snark.torrent); 648 648 long len = snark.meta.getTotalLength(); 649 addMessage("Download complete of" + f.getName() + " (size: " + DataHelper.formatSize(len) + "B)");649 addMessage("Download finished: " + f.getName() + " (size: " + DataHelper.formatSize(len) + "B)"); 650 650 updateStatus(snark); 651 651 } … … 675 675 } else { 676 676 if (shouldAutoStart() && !_util.connect()) 677 addMessage("Unable to connect to I2P ");677 addMessage("Unable to connect to I2P!"); 678 678 addTorrent((String)foundNames.get(i), !shouldAutoStart()); 679 679 } -
apps/i2psnark/java/src/org/klomp/snark/web/I2PSnarkServlet.java
rfb47eef r718f73eb 84 84 out.write(HEADER); 85 85 out.write("</head><body>"); 86 out.write("<div class=\"page\"><table border=\"0\" width=\"100%\"><tr><td align=\"center\" class=\"snarkTitle\"><a href=\"" + req.getRequestURI() + peerString + "\" title=\"I2PSnark (Manual Page Refresh)\"><img src=\"/themes/console/images/i2psnark.png\" alt=\"I2PSnark Anonymous BitTorrent Client\" border=\"0\" ></a><hr>");87 out.write("<a href=\"http://forum.i2p/viewforum.php?f=21\" class=\"snarkRefresh\" >Forum</a>\n");86 out.write("<div class=\"page\"><table border=\"0\" width=\"100%\"><tr><td align=\"center\" class=\"snarkTitle\"><a href=\"" + req.getRequestURI() + peerString + "\" title=\"I2PSnark (Manual Page Refresh)\"><img src=\"/themes/console/images/i2psnark.png\" alt=\"I2PSnark Anonymous BitTorrent Client\" border=\"0\" class=\"snarklogo\"></a><br>"); 87 out.write("<a href=\"http://forum.i2p/viewforum.php?f=21\" class=\"snarkRefresh\" target=\"_blank\">Forum</a>\n"); 88 88 Map trackers = _manager.getTrackers(); 89 89 for (Iterator iter = trackers.entrySet().iterator(); iter.hasNext(); ) { … … 95 95 continue; 96 96 baseURL = baseURL.substring(e + 1); 97 out.write("<a href=\"" + baseURL + "\" class=\"snarkRefresh\" >" + name + "</a>");97 out.write("<a href=\"" + baseURL + "\" class=\"snarkRefresh\" target=\"_blank\">" + name + "</a>"); 98 98 } 99 99 out.write("</table>\n"); 100 out.write("<div class=\" section\"><div class=\"snarkMessages\"><table><tr><td valign=\"top\" align=\"left\"><pre>");100 out.write("<div class=\"mainsection\"><div class=\"snarkMessages\"><table><tr><td valign=\"top\" align=\"left\"><pre>"); 101 101 List msgs = _manager.getMessages(); 102 102 for (int i = msgs.size()-1; i >= 0; i--) { … … 354 354 } 355 355 } else if ("StopAll".equals(action)) { 356 _manager.addMessage("Stopping all torrents and closing the I2P tunnel ");356 _manager.addMessage("Stopping all torrents and closing the I2P tunnel."); 357 357 List snarks = getSortedSnarks(req); 358 358 for (int i = 0; i < snarks.size(); i++) { … … 363 363 if (_manager.util().connected()) { 364 364 _manager.util().disconnect(); 365 _manager.addMessage("I2P tunnel closed ");365 _manager.addMessage("I2P tunnel closed."); 366 366 } 367 367 } else if ("StartAll".equals(action)) { 368 _manager.addMessage("Opening the I2P tunnel and starting all torrents ");368 _manager.addMessage("Opening the I2P tunnel and starting all torrents."); 369 369 List snarks = getSortedSnarks(req); 370 370 for (int i = 0; i < snarks.size(); i++) { … … 511 511 continue; 512 512 baseURL = baseURL.substring(e + 1); 513 out.write(" (<a href=\"" + baseURL + "details.php?dllist=1&filelist=1&info_hash=");513 out.write(" [<a href=\"" + baseURL + "details.php?dllist=1&filelist=1&info_hash="); 514 514 out.write(TrackerClient.urlencode(snark.meta.getInfoHash())); 515 out.write("\" title=\"" + name + " Tracker\">Details</a> )");515 out.write("\" title=\"" + name + " Tracker\">Details</a>]"); 516 516 break; 517 517 } … … 653 653 out.write("<form action=\"" + uri + "\" method=\"POST\">\n"); 654 654 out.write("<input type=\"hidden\" name=\"nonce\" value=\"" + _nonce + "\" />\n"); 655 out.write("<div class=\" section\"><span class=\"snarkConfigTitle\">Add Torrent:</span><br />\n");655 out.write("<div class=\"addtorrentsection\"><span class=\"snarkConfigTitle\">Add Torrent:</span><br />\n"); 656 656 out.write("From URL : <input type=\"text\" name=\"newURL\" size=\"80\" value=\"" + newURL + "\" /> \n"); 657 657 // not supporting from file at the moment, since the file name passed isn't always absolute (so it may not resolve) … … 669 669 baseFile = ""; 670 670 671 out.write("<div class=\" section\"><span class=\"snarkNewTorrent\">\n");671 out.write("<div class=\"newtorrentsection\"><span class=\"snarkNewTorrent\">\n"); 672 672 // *not* enctype="multipart/form-data", so that the input type=file sends the filename, not the file 673 673 out.write("<form action=\"" + uri + "\" method=\"POST\">\n"); … … 705 705 706 706 out.write("<form action=\"" + uri + "\" method=\"POST\">\n"); 707 out.write("<div class=\" section\"><span class=\"snarkConfig\">\n");707 out.write("<div class=\"configsection\"><span class=\"snarkConfig\">\n"); 708 708 out.write("<input type=\"hidden\" name=\"nonce\" value=\"" + _nonce + "\" />\n"); 709 709 out.write("<span class=\"snarkConfigTitle\">Configuration:</span><br />\n"); -
installer/resources/themes/console/light/default.css
rfb47eef r718f73eb 27 27 float: left; 28 28 width: 120px; 29 height: 2 8px;29 height: 24px; 30 30 font-weight: normal; 31 31 text-align: right; … … 35 35 box-sizing: border-box; 36 36 line-height: 120%; 37 color: #427; 37 38 } 38 39 … … 85 86 div.statusNotRunning { 86 87 float: left; 87 width: 72px;88 width: 68px; 88 89 height: 24px; 89 90 overflow: hidden; … … 96 97 div.statusRunning { 97 98 float: left; 98 width: 72px;99 width: 68px; 99 100 height: 24px; 100 101 overflow: hidden; … … 107 108 div.statusStarting { 108 109 float: left; 109 width: 72px;110 width: 68px; 110 111 height: 24px; 111 112 overflow: hidden; -
installer/resources/themes/console/snark.css
rfb47eef r718f73eb 13 13 14 14 .snarkRefresh { 15 font-size: 9pt;16 }17 18 .snarkRefresh {19 15 border: 1px outset #001; 20 16 padding: 1px 10px; 21 background: # ffb;17 background: #eef; 22 18 text-decoration: none; 23 19 border-radius: 4px; … … 32 28 } 33 29 30 .snarkRefresh a:hover{ 31 border: 1px inset #001; 32 padding: 1px 10px; 33 background: #003; 34 text-decoration: none; 35 border-radius: 4px; 36 -moz-border-radius: 4px; 37 -khtml-border-radius: 4px; 38 font-size: 9pt; 39 font-weight: bold; 40 margin: -10px 3px 0 3px; 41 text-align: center; 42 vertical-align: middle; 43 text-transform: uppercase; 44 color: #f60; 45 } 46 34 47 .snarkMessages { 35 background-color: #f e9;48 background-color: #f83; 36 49 font-family: "Lucida Console", "DejaVu Sans Mono", Courier, mono !important; 37 50 font-size: 9pt; … … 40 53 margin: 0 0 15px 0; 41 54 border: 0px; 42 padding: 5px;55 padding: 0px; 43 56 border-spacing: 0px; 44 57 -moz-border-radius: 4px; … … 48 61 text-align: center; 49 62 overflow-x: scroll; 50 background: #ddf url('../console/light/images/lightbluetile.png'); 63 background: #ddf url('../console/images/orangetile.png'); 64 color: #531; 65 height: 64px; 51 66 } 52 67 … … 56 71 font-size: 8pt; 57 72 padding: 0; 73 text-align: left !important; 74 height: 8px; 58 75 } 59 76 … … 65 82 border-spacing: 0px; 66 83 } 84 67 85 th { 68 background-color: #f91;69 86 padding: 5px; 70 font-size: 9pt;87 font-size: 8pt; 71 88 border-top: 1px outset #001; 72 89 border-bottom: 1px inset #001; 90 background: #f91 url('.../console/images/tabletitleorangealt.png') repeat-x; 91 text-align: center; 73 92 } 74 93 … … 80 99 td { 81 100 padding: 5px; 101 text-align: center; 82 102 } 83 103 .snarkTorrentEven { 84 104 background-color: #fb1; 85 font-size: 8pt;105 font-size: 7pt; 86 106 } 87 107 .snarkTorrentOdd { 88 108 background-color: #fa1; 89 font-size: 8pt;109 font-size: 7pt; 90 110 } 91 111 .snarkNewTorrent { 92 font-size: 10pt;112 font-size: 9pt; 93 113 } 94 114 .snarkAddInfo { 95 font-size: 10pt;115 font-size: 9pt; 96 116 line-height: 130% !important; 97 117 } … … 108 128 .page { 109 129 background-color: #fff; 110 color:# 001;130 color:#310; 111 131 margin: 20px; 112 132 padding: 10px 20px 5px 20px; … … 119 139 -moz-box-shadow: inset 0px 0px 1px 0px #002; 120 140 text-align: center; 121 background: #ddf url('../console/light/images/ sandtile.png');141 background: #ddf url('../console/light/images/lightbluetile.png'); 122 142 } 123 143 … … 139 159 height: 1px; 140 160 border: 0px solid #003; 141 margin: 5px 0; 142 } 143 144 div.section { 145 margin: 0 0 20px 0; 146 padding: 10px; 147 background: #ffe; 148 border: 1px solid #001; 149 text-align: left; 150 color: #001; 151 -moz-border-radius: 4px; 152 -khtml-border-radius: 4px; 153 border-radius: 4px; 154 -moz-box-shadow: inset 0px 0px 1px 0px #002; 155 word-wrap: break-word; 161 width: 100%; 162 margin: 10px 0 7px 0; 156 163 text-align: center; 157 164 } 158 165 159 166 a:link{ 160 161 162 163 167 color: #830; 168 text-decoration: none; 169 font-weight: bold; 170 word-wrap: break-word; 164 171 } 165 172 166 173 a:visited{ 167 168 169 174 color: #606; 175 text-decoration: none; 176 font-weight: bold; 170 177 } 171 178 172 179 a:hover{ 173 174 180 color: #f60; 181 font-weight: bold; 175 182 } 176 183 … … 189 196 font-size: 9pt; 190 197 } 191 } 198 199 img { 200 border: none; 201 margin: 5px 5px 10px 5px; 202 } 203 204 205 div.section { 206 margin: 0 0 20px 0; 207 padding: 10px; 208 background: #ffe; 209 border: 1px solid #001; 210 text-align: center; 211 color: #001; 212 -moz-border-radius: 4px; 213 -khtml-border-radius: 4px; 214 border-radius: 4px; 215 -moz-box-shadow: inset 0px 0px 1px 0px #002; 216 word-wrap: break-word; 217 text-align: center; 218 background: #ffe url('../console/light/images/tabletile.png'); 219 } 220 221 div.mainsection { 222 margin: 0 0 20px 0; 223 padding: 10px; 224 background: #ffe; 225 border: 1px solid #001; 226 text-align: center; 227 color: #001; 228 -moz-border-radius: 4px; 229 -khtml-border-radius: 4px; 230 border-radius: 4px; 231 -moz-box-shadow: inset 0px 0px 1px 0px #002; 232 word-wrap: break-word; 233 text-align: center; 234 background: #ffe url('../console/light/images/tabletile.png'); 235 } 236 237 div.newtorrentsection { 238 margin: 0 0 20px 0; 239 padding: 10px; 240 background: #ffe; 241 border: 1px solid #001; 242 text-align: center; 243 color: #001; 244 -moz-border-radius: 4px; 245 -khtml-border-radius: 4px; 246 border-radius: 4px; 247 -moz-box-shadow: inset 0px 0px 1px 0px #002; 248 word-wrap: break-word; 249 text-align: center; 250 background: #ffe url('../console/images/yellowtile.png'); 251 } 252 253 div.addtorrentsection { 254 margin: 0 0 20px 0; 255 padding: 10px; 256 background: #ffe; 257 border: 1px solid #001; 258 text-align: center; 259 color: #001; 260 -moz-border-radius: 4px; 261 -khtml-border-radius: 4px; 262 border-radius: 4px; 263 -moz-box-shadow: inset 0px 0px 1px 0px #002; 264 word-wrap: break-word; 265 text-align: center; 266 background: #ffe url('../console/images/greentile.png'); 267 } 268 269 div.configsection { 270 margin: 0 0 20px 0; 271 padding: 10px; 272 background: #ffe; 273 border: 1px solid #001; 274 text-align: center; 275 color: #fff; 276 -moz-border-radius: 4px; 277 -khtml-border-radius: 4px; 278 border-radius: 4px; 279 -moz-box-shadow: inset 0px 0px 1px 0px #002; 280 word-wrap: break-word; 281 text-align: center; 282 background: #ffe url('../console/images/redtile.png'); 283 }
Note: See TracChangeset
for help on using the changeset viewer.