diff --git a/class/core/public.py b/class/core/public.py index 67ea4fddc..0d666497f 100755 --- a/class/core/public.py +++ b/class/core/public.py @@ -793,16 +793,19 @@ def checkCert(certPath='ssl/certificate.pem'): return False return True -# 获取面板地址 -# def getPanelAddr(): -# import web -# protocol = 'https://' if os.path.exists("data/ssl.pl") else 'http://' -# h = web.ctx.host.split(':') -# try: -# result = protocol + h[0] + ':' + h[1] -# except: -# result = protocol + h[0] + ':' + readFile('data/port.pl').strip() -# return result + +def getPathSize(path): + # 取文件或目录大小 + if not os.path.exists(path): + return 0 + if not os.path.isdir(path): + return os.path.getsize(path) + size_total = 0 + for nf in os.walk(path): + for f in nf[2]: + filename = nf[0] + '/' + f + size_total += os.path.getsize(filename) + return size_total def toSize(size): diff --git a/plugins/readme/ico.png b/plugins/readme/ico.png deleted file mode 100644 index ba110c1a1..000000000 Binary files a/plugins/readme/ico.png and /dev/null differ diff --git a/plugins/readme/index.html b/plugins/readme/index.html deleted file mode 100755 index f91addaaf..000000000 --- a/plugins/readme/index.html +++ /dev/null @@ -1,57 +0,0 @@ -
在每一个插件中,都必须包含一个info.json文件,格式如下:
在每一个插件中,都必须包含一个info.json文件,格式如下:
{ -"title": "插件开发说明", -"tip": "soft", -"name": "readme", -"type": "扩展", -"ps": "(mdserver-web)插件产开发说明,每个版本可能有所变化!", -"versions": "0.1", -"shell": "install.sh", -"checks": "server/readme", -"path": "server/readme", -"author": "mdserver-web", -"home": "github.com/midoks/mdserver-web", -"date": "2018-11-30", -"pid": "5" -}
在每一个插件中,都必须包含一个index.py文件
名称:'+ data.title + '
\版本:' + data.versions +'
\描述:' + data.ps + '
\ -大小:' + bt.format_size(data.size, true) + '
\ +大小:' + toSize(data.size) + '
\作者:' + data.author + '
\ \ \