improve claim all seeding

This commit is contained in:
xiaomlove
2023-04-09 16:33:36 +08:00
parent 33b16ed7ac
commit b8f1690124
10 changed files with 10 additions and 58 deletions

View File

@@ -353,11 +353,8 @@ if (isset($total_size) && $total_size){
$hasData = true;
}
if ($hasData) {
$claimAllBtn = '';
if ($id == $CURUSER['id'] && has_role_work_seeding($CURUSER['id'])) {
$claimAllBtn = sprintf('<input type="button" value="%s" id="claim-all-seeding">', nexus_trans('claim.claim_all_seeding_btn'));
}
$header = sprintf('<div style="display: flex;justify-content: space-between"><div>%s</div><div>%s</div></div>', $summary, $claimAllBtn);
$btnArr = apply_filter("user_seeding_top_btn", [], $CURUSER['id']);
$header = sprintf('<div style="display: flex;justify-content: space-between"><div>%s</div><div>%s</div></div>', $summary, implode("", $btnArr));
echo '<br/>' . $header . $table;
} else {
echo $lang_getusertorrentlistajax['text_no_record'];

View File

@@ -633,7 +633,7 @@ if ($userInfo->id == $CURUSER['id'] && has_role_work_seeding($userInfo->id)) {
$claimJs = <<<JS
jQuery("body").on("click", "#claim-all-seeding", function (e) {
layer.confirm("$claimAllSeedingConfirmation", {}, function () {
jQuery.post('ajax.php', {"action": "claimAllSeeding"}, function (response) {
jQuery.post('/plugin/claim_all_seeding', {"action": "claimAllSeeding"}, function (response) {
if (response.ret == 0) {
window.location.reload()
} else {