This repository has been archived by the owner on Nov 2, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(torrent/snatch): Add view of torrent/snatch
- Loading branch information
Showing
8 changed files
with
124 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
<?php | ||
/** | ||
* Created by PhpStorm. | ||
* User: Rhilip | ||
* Date: 2019/3/16 | ||
* Time: 17:10 | ||
* | ||
* @var League\Plates\Template\Template $this | ||
* @var \apps\models\Torrent $torrent | ||
*/ | ||
|
||
$timenow = time(); | ||
?> | ||
|
||
<?= $this->layout('layout/base') ?> | ||
|
||
<?php $this->start('title')?>Torrents Snatched Details<?php $this->end();?> | ||
|
||
<?php $this->start('container')?> | ||
<div class="text-center torrent-title-block"> | ||
<h1 class="torrent-title"><?= $torrent->getTitle() ?></h1> | ||
<small class="torrent-subtitle"><em><?= $torrent->getSubtitle() ?: 'No Subtitle.' ?></em></small> | ||
</div> | ||
|
||
<div class="row"> | ||
<div class="col-md-12"> | ||
<div class="panel" id="torrent_snatched_details_panel"> | ||
<div class="panel-heading"><b>Torrent Snatched Details</b></div> | ||
<div class="panel-body" id="torrent_snatched_details_body"> | ||
<div id="torrent_snatched_details"> | ||
<table class="table table-hover table-condensed"> | ||
<thead> | ||
<tr> | ||
<th>Username</th> | ||
<th>Ip Address</th> <!-- FIXME check privilege --> | ||
<th>IP on finished</th> | ||
<th>Uploaded/Downloaded</th> | ||
<th>Ratio</th> | ||
<th>Se. Time</th> | ||
<th>Le. Time</th> | ||
<th>Finished?</th> | ||
<th>Completed At</th> | ||
<th>Last Action</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
<?php foreach ($torrent->getSnatchDetails() as $snatchDetail): ?> | ||
<tr> | ||
<td><?= $this->insert('helper/username',['torrent'=>$torrent,'user'=>app()->site->getUser($snatchDetail['user_id'])]) ?></td> | ||
<td><?= inet_ntop($snatchDetail['ip']) ?></td> | ||
<td><?= $snatchDetail['finish_ip'] ? inet_ntop($snatchDetail['finish_ip']) : '?' ?></td> | ||
<td> | ||
<?= $this->e($snatchDetail['this_uploaded'],'format_bytes') ?>@<?= $this->e($snatchDetail['this_uploaded'] > 0 ? ($snatchDetail['this_uploaded'] / ($snatchDetail['seed_time'] + $snatchDetail['leech_time'])) : 0,'format_bytes') ?>/s <br> | ||
<?= $this->e($snatchDetail['this_download'],'format_bytes') ?>@<?= $this->e($snatchDetail['this_download'] > 0 ? ($snatchDetail['this_download'] / $snatchDetail['leech_time']) : 0,'format_bytes') ?>/s <br> | ||
</td> | ||
<td> | ||
<?php if ($snatchDetail['this_download'] > 0): ?> | ||
<?= number_format($snatchDetail['this_uploaded'] / $snatchDetail['this_download'], 3) ?> | ||
<?php elseif ($snatchDetail['this_uploaded'] > 0): ?> | ||
Inf. | ||
<?php else: ?> | ||
--- | ||
<?php endif; ?> | ||
</td> | ||
<td><?= $this->e($snatchDetail['seed_time'], 'sec2hms') ?></td> | ||
<td><?= $this->e($snatchDetail['leech_time'], 'sec2hms') ?></td> | ||
<td><?= $snatchDetail['finished'] ?></td> | ||
<td><?= $snatchDetail['finish_at'] ?></td> | ||
<td><?= $snatchDetail['last_action_at'] ?></td> | ||
</tr> | ||
|
||
|
||
<?php endforeach; ?> | ||
</tbody> | ||
</table> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
<?php $this->end();?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters