Merge pull request #659 from midoks/dev

文件大小功能优化
pull/669/head
Mr Chen 5 months ago committed by GitHub
commit a581b7cdef
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 1
      plugins/clean/index.py
  2. 2
      plugins/tgbot/startup/extend/push_ad.py
  3. 2
      plugins/tgbot/startup/extend/push_notice_msg.py
  4. 6
      web/admin/files/files.py
  5. 5
      web/utils/file.py

@ -156,6 +156,7 @@ def initConf():
"/www/server/redis/data",
"/www/server/alist/data/log",
"/www/server/dztasks/logs",
"/www/server/rsyncd/lsyncd.log"
"/www/server/cron",
]
for i in clogcom:

@ -49,7 +49,7 @@ def send_msg(bot, tag='ad', trigger_time=300):
# TTKCDN 无视移动墙/GFW/SNI阻断 TG第一性价比 | 10/m | @ssdpflood
# https://t.me/gjgzs2022 | 22/m | @GJ_gzs
# 综合包网/NG接口开户 | 28/m | 6m | next,4/28 | x
# 实名认证/过人脸🕵各种账号处理✅ | 30/m| next,12/30 | @nngzs
# 实名认证/过人脸🕵各种账号处理✅ | 30/m| next,6/30 | @nngzs
# 桃花资源采集| 13/m| next,1/13 | @xiaolizi1122
keyboard = [
[

@ -58,7 +58,7 @@ def send_msg(bot, tag='ad', trigger_time=300):
# TTKCDN | 10/m | @ssdpflood | 5
# https://t.me/gjgzs2022 | 22/m | @GJ_gzs
# 综合包网/NG接口开户 | 28/m | 6m | next,4/28 | x
# 实名认证/过人脸🕵各种账号处理✅ | 30/m| next,12/30 | @nngzs
# 实名认证/过人脸🕵各种账号处理✅ | 30/m| next,6/30 | @nngzs
# 桃花资源采集| 13/m| next,1/13 | @xiaolizi1122
keyboard = [
[

@ -252,8 +252,10 @@ def create_dir():
@panel_login_required
def get_dir_size():
path = request.form.get('path', '')
size = file.getDirSize(path)
return mw.returnData(True, mw.toSize(size))
size = file.getDirSizeByBash(path)
return mw.returnData(True, size)
# size = file.getDirSize(path)
# return mw.returnData(True, mw.toSize(size))
# 删除文件

@ -632,7 +632,10 @@ def checkFileName(filename):
def getDirSize(filePath, size=0):
for root, dirs, files in os.walk(filePath):
for f in files:
size += os.path.getsize(os.path.join(root, f))
try:
size += os.path.getsize(os.path.join(root, f))
except Exception as e:
pass
# print(f)
return size

Loading…
Cancel
Save