From 120a7da5c1bcb2d4b125c21cd42de88d35aa5ef0 Mon Sep 17 00:00:00 2001 From: OldHawk Date: Sun, 20 May 2018 21:54:14 +0800 Subject: [PATCH] feat(torrents): add H&R system enable config --- config/env/torrents.js | 2 ++ config/lib/cron-job.js | 7 +++- .../client/views/maker-view.client.view.html | 2 +- .../announces.server.controller.js | 36 ++++++++++--------- modules/core/client/app/trans-string-en.js | 2 +- .../controllers/header.client.controller.js | 8 +++-- .../torrent-list-item.client.directive.js | 1 + .../core/client/views/header.client.view.html | 2 +- .../admin-invitations.client.controller.js | 1 + .../invitations.client.controller.js | 1 + .../views/admin/official.client.view.html | 2 +- .../client/views/detail.client.view.html | 2 +- .../admin/admin-list.client.controller.js | 1 + .../controllers/torrents.client.controller.js | 1 + modules/torrents/client/less/torrents.less | 4 +-- .../templates/torrent-item.client.view.html | 5 +-- .../views/admin/admin-list.client.view.html | 2 +- .../views/list-torrents.client.view.html | 2 +- .../status/status.client.controller.js | 1 + .../userinfo/userinfo.client.controller.js | 1 + .../views/admin/view-user.client.view.html | 2 +- .../views/status/account.client.view.html | 4 +-- .../views/status/status.client.view.html | 2 +- .../views/userinfo/userinfo.client.view.html | 2 +- modules/vip/client/views/vip.client.view.html | 2 +- 25 files changed, 58 insertions(+), 37 deletions(-) diff --git a/config/env/torrents.js b/config/env/torrents.js index 8c29793d..25ca83be 100644 --- a/config/env/torrents.js +++ b/config/env/torrents.js @@ -964,6 +964,7 @@ module.exports = { * when admin/oper to delete a h&r torrent, system will auto remove all warning and number of user * NOTE: you can change these value at anytime if you understand it * + * @enable: setting whether enable the H&R function * @condition: the condition of HnR warning, user must meet one of them before you receive the warning * @seedTime: torrent seed time, unit of day, default to 7 days * @seedTime_str: string desc of @seedTime @@ -975,6 +976,7 @@ module.exports = { * @checkWaringInterval_str: string desc of @checkWaringInterval */ hitAndRun: { + enable: true, condition: { seedTime: 60 * 60 * 1000 * 24 * 7, seedTime_str: '7d', diff --git a/config/lib/cron-job.js b/config/lib/cron-job.js index c6849034..fff31d05 100644 --- a/config/lib/cron-job.js +++ b/config/lib/cron-job.js @@ -22,6 +22,8 @@ var supportConfig = config.meanTorrentConfig.support; var backupConfig = config.meanTorrentConfig.backup; var announceConfig = config.meanTorrentConfig.announce; var signConfig = config.meanTorrentConfig.sign; +var hnrConfig = config.meanTorrentConfig.hitAndRun; + var inbox = require('inbox'); var simpleParser = require('mailparser').simpleParser; @@ -71,7 +73,10 @@ module.exports = function (app) { cronJobs.push(removeGhostPeers()); cronJobs.push(checkUserAccountIdleStatus()); - cronJobs.push(countUsersHnrWarning()); + + if (hnrConfig.enable) { + cronJobs.push(countUsersHnrWarning()); + } if (supportConfig.mailTicketSupportService) { cronJobs.push(listenServiceEmail()); diff --git a/modules/about/client/views/maker-view.client.view.html b/modules/about/client/views/maker-view.client.view.html index bfd369e7..79393973 100644 --- a/modules/about/client/views/maker-view.client.view.html +++ b/modules/about/client/views/maker-view.client.view.html @@ -200,7 +200,7 @@
{{ 'CA_TORRENT_ATTR' | translate}}:
-
-