Browse Source

stream comme dl (tab) + correction boutton download

master
Cabillot Julien 5 years ago
parent
commit
a65d24e399
3 changed files with 109 additions and 108 deletions
  1. 69
      root/css/admin.css
  2. 10
      root/js/my.js
  3. 138
      templates/status.php

69
root/css/admin.css

@ -6,17 +6,18 @@ html {
a {
text-decoration: none;
color: #F2AA65;
}
h1 {
color: #DA4336;
font-size: 22px;
textarea.multidl {
font-family: "source code pro";
margin-bottom: 1em;
width: 985px;
height: 200px;
}
div.account {
background: #DA4336;
color: #FEFCFC;
color: #270c0a;
padding: 0.5em;
text-align: center;
box-shadow: 1px 1px 12px rgba(85, 85, 85, 0.25);
@ -27,24 +28,54 @@ div.account {
height: 3em;
}
div.account .info {
color: #FEFCFC;
}
div.account .info .important {
font-weight: bold;
}
div.nomenclature {
background-color: rgba(214, 214, 214, 0.5);
color: #270c0a;
padding: 0.5em;
text-align: center;
box-shadow: 1px 1px 12px rgba(85, 85, 85, 0.25);
position: fixed;
top: 97%;
width: 100%;
left: 0;
height: 3em;
}
div.nomenclature span {
margin-left: 1em;
}
/* Page d'admin */
div.addMulti {
margin-bottom: 1em;
text-align: center;
margin-top: 5em;
margin-left: 1em;
margin-bottom: 1.5em;
text-align: center;
}
div.list {
background-color: #B9C1CC;
div.list div {
display: inline-block;
}
div.list div {
div.listdl div {
margin-bottom: 1em;
height: 100%;
width: 85%;
}
table.listdl {
width: 100%
margin: 0 auto;
}
table.liststream {
margin: 0 auto;
}
.added {
@ -62,3 +93,17 @@ table.listdl {
.dupp {
background-color: #ef5350;
}
div.mybtn {
margin-top: 1.2em;
margin-bottom: 1.2em;
display: inline;
}
a.btn {
box-shadow: 1px 1px 1px rgba(102, 102, 102, 0.25);
color: rgb(254, 254, 254);
background: #fa963f;
padding: 10px 20px 10px 20px;
}

10
root/js/my.js

@ -2,12 +2,16 @@
function subURL() {
$("body").css("cursor", "progress");
var lines = $('#urls').val().split('\n');
var url = [];
var url = [];
$.each(lines, function(){
if ($.trim(this) == '') {
if ('' === $.trim(this)) {
alert('Pas de liens ?');
return;
}
url.push($.trim(this));
});
@ -25,7 +29,7 @@ function subURL() {
},
error: function(xhr, err) {
$("body").css("cursor", "auto");
alert('LOOCKUP_FAILED');
alert(err);
}
});
} else {

138
templates/status.php

@ -11,34 +11,29 @@
</head>
<body>
<div class="account">
<b>Expiration :</b> <?= $infos['expires']->format('d/m/Y') ?> (<?= $restant ?>)<br>
<b>Traffic Restant :</b> <?= intval($infos['trafficleft_gigabytes']) ?>Go (<?= intval($infos['fairuse_left'] * 100) ?>%)<br>
Expiration : <span class="info"><?= $infos['expires']->format('d/m/Y') ?> (<span class="important"><?= $restant ?></span>)</span><br>
Traffic Restant : <span class="info"><?= intval($infos['trafficleft_gigabytes']) ?>Go (<span class="important"><?= intval($infos['fairuse_left'] * 100) ?>%</span>)</span><br>
</div>
<div class="nomenclature">
<span class="added">Ajouté</span>
<span class="downloading">En cours</span>
<span class="downloaded">Fini</span>
<span class="dupp">Duppliqu&eacute;</span>
</div>
<div class="addMulti">
<textarea id="urls" name="urls" style="margin: 0px; width: 985px; height: 401px;"></textarea><br>
<input type="button" id="sub" name="sub" value="submit" onclick="javascript:subURL();"><br>
<textarea class="multidl" id="urls" name="urls" spellcheck="false"></textarea><br>
<div class="mybtn" onclick="subURL();">
<a class="btn">
T&eacute;l&eacute;charger
</a>
</div>
</div>
<div class="list">
<div class="">
<table>
<tr>
<td class="added">Ajouté</td>
<td class="downloading">En cours</td>
<td class="downloaded">Fini</td>
<td class="dupp">Duppliqu&eacute;</td>
</tr>
</table>
</div>
<table class="listdl">
<thead>
<tr>
<th>Date</th>
<th>Filename</th>
</tr>
</thead>
<tbody>
<div class="listdl">
<table class="listdl">
<tbody>
<?php
foreach([ 'added' => $listAdded, 'downlading' => $listDownloading, 'downloaded' => $listDownloaded, 'dupp' => $listDupp ] as $catName => $cat) {
foreach([ $listAdded, $listDownloading, $listDownloaded, $listDupp ] as $cat) {
foreach($cat as $element) {
if ($element['href']) {
$nameLink = '<a href="/downloaded/'.$element['filename'].'">'.$element['filename'].'</a>';
@ -46,86 +41,43 @@ foreach([ 'added' => $listAdded, 'downlading' => $listDownloading, 'downloaded'
$nameLink = $element['filename'];
}
?>
<tr class="<?= $element['cstate']; ?>">
<td><?= $element['time']->format('d/m/Y'); ?></td>
<td><?= $nameLink; ?></td>
<td>
<img src="/img/ip.png" height=16 width=16 title="<?= $element['event'][0]['ip']; ?>" alt="<?= $element['event'][0]['ip']; ?>">
<a href="<?= $element['url']; ?>"><img src="/img/link.png" height=16 width=16></a>
</td>
</tr>
<tr class="<?= $element['cstate']; ?>">
<td><?= $nameLink; ?></td>
<td>
<img src="/img/ip.png" height=16 width=16 title="<?= $element['event'][0]['ip']; ?>" alt="<?= $element['event'][0]['ip']; ?>">
<a href="<?= $element['url']; ?>"><img src="/img/link.png" height=16 width=16></a>
</td>
<td><?= $element['time']->format('d/m/Y'); ?></td>
</tr>
<?php
}
}
?>
</tbody>
</table>
<?php
if (!empty($streamBegin)) {
?>
<div class="$streamBegin">
Stream en cours ou non fini : <br>
<table>
<thead>
<tr>
<th>Date</th>
<th>Filename</th>
<th>IP</th>
</tr>
</thead>
<tbody>
<?php
foreach ($streamBegin as $result) {
?>
<tr>
<td><?= $result['time']->format('d/m/Y'); ?></td>
<td><?= $result['filename']; ?></td>
<td><?= $result['ip']; ?></td>
</tr>
<?php
}
?>
</tbody>
</table>
<input type="button" value="Wipe" onClick="javascript:wipe('stream', 'begin');">
</div>
<?php
}
if (!empty($streamFinished)) {
?>
<div class="streamFinished">
Stream fini : <br>
<table>
<thead>
<tr>
<th>Date</th>
<th>Filename</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
</div>
<div class="liststream">
<table class="liststream">
<tbody>
<?php
foreach ($streamFinished as $result) {
# TODO : dans l'IP, ajouter le resolv
foreach([ $streamBegin, $streamFinished ] as $cat) {
foreach($cat as $element) {
?>
<tr>
<td><?= $result['time']->format('d/m/Y'); ?></td>
<td>
<img src="/img/ip.png" height=16 width=16 title="<?= $result['ip']; ?>" alt="<?= $result['ip']; ?>">
<a href="<?= $result['url']; ?>"><img src="/img/link.png" height=16 width=16></a>
<?= $result['filename']; ?>
</td>
</tr>
<tr>
<td><?= $element['filename']; ?></td>
<td>
<img src="/img/ip.png" height=16 width=16 title="<?= $element['ip']; ?>" alt="<?= $element['ip']; ?>">
<a href="<?= $element['url']; ?>"><img src="/img/link.png" height=16 width=16></a>
</td>
<td><?= $element['time']->format('d/m/Y'); ?></td>
</tr>
<?php
}
?>
</tbody>
</table>
<input type="button" value="Wipe" onClick="javascript:wipe('stream', 'finished');">
</div>
<?php
}
?>
</tbody>
</table>
</div>
</div>
</body>
</html>
Loading…
Cancel
Save