Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

文件大小功能优化 #659

Merged
merged 4 commits into from
Dec 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions plugins/clean/index.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion plugins/tgbot/startup/extend/push_ad.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [
[
Expand Down
2 changes: 1 addition & 1 deletion plugins/tgbot/startup/extend/push_notice_msg.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [
[
Expand Down
6 changes: 4 additions & 2 deletions web/admin/files/files.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))


# 删除文件
Expand Down
5 changes: 4 additions & 1 deletion web/utils/file.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Loading