From 3ba534e41ff12a79da4f773951837d1fee87161e Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Tue, 26 Feb 2019 11:26:17 +0800 Subject: [PATCH] u --- class/core/public.py | 23 ++++++++------- plugins/readme/ico.png | Bin 1150 -> 0 bytes plugins/readme/index.html | 57 -------------------------------------- plugins/readme/index.py | 20 ------------- plugins/readme/info.json | 15 ---------- plugins/readme/install.sh | 30 -------------------- route/static/app/soft.js | 17 ++++++------ 7 files changed, 22 insertions(+), 140 deletions(-) delete mode 100644 plugins/readme/ico.png delete mode 100755 plugins/readme/index.html delete mode 100755 plugins/readme/index.py delete mode 100755 plugins/readme/info.json delete mode 100755 plugins/readme/install.sh 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 ba110c1a1c04c973fbf7556133bea1f334a9d931..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1150 zcmV-^1cCdBP)ePo>}JNDW@f6Wv}vv9c{t$li}hX^ zO0rZx*I(7}oYIuGj@oYkFPv8KU!GQTH&3Z~ousDXZ=cd|Uu(7S(wc!ztNClhV0{^P zZ%r^~)!YZ`42BuW)W@p^!t}BU)Le?3f0NQk4AE!txPDrL+_-O_O~4za-p?ck4a<^> z`$GX*3h1PYfA#cZ{-YI{#`&^ne`>h5mV54$#{J%Z21I<1R=j~#{87={R&lmvpHuT8 zNrBRZI>fWp6#5{yG zu1tCXbEC3HValC^{$L2_v@ZEd&JoT)tJ9~~X9)-b&3IDsEeefx4?4X8WXcU{z5WpL z)utFo4rLoGxY2x$9m8B*wz()Qk*jgI5leQjEgK8$rqn2i^;ziqmx1vweU zyl7@{fE;bXOl`cN{c1dbkIq3NS7zplWnkyEN!n)#B*%Vcw`bjK^0R6i^_?T%k>saxuWyd-E(7#$!=L7;akVIm&#WdkjfTVF!ejG zP0)W%Pd&Ea8SfcTsn(h|*5HjJGy`gP`*6qLVf}$rp8AA9H>O>pHCGJePv&6S6{Uvv zS0_0JR3eiLQ-Acnk@h{d2B@U)8ngPy>R%KHgU^)f49G|TbCm||J9uXn2E!qhn-B=& z5U#uT=Je`;PP3X2uff{$sK=Sf?j`sFwF4&@I8YFXe%iM=|UCfWk5&n8DZ8FCvU!j zaz#J{TD#u3Fs!jXY}H=2ne%w@}YSi z(8))Zr*qvmv9UU52(C_WtfJu={kR6+KQQ^Q!i_%ySfRlAahw=P{5d4d(g_)UQ#i5Q zceziWf@ySUMDIZ&jl%Y;6J;q4W7v8{7utA1qo=W5(C#2{e)62slqPNa6E|Tcp6jBy QGXMYp07*qoM6N<$f>zlwrvLx| 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说明

-

index.py说明

-
- -
-
-

在每一个插件中,都必须包含一个info.json文件,格式如下:


-
123
-
- -
-

在每一个插件中,都必须包含一个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文件


-
-
-
- -
- \ No newline at end of file diff --git a/plugins/readme/index.py b/plugins/readme/index.py deleted file mode 100755 index 9780ba8c3..000000000 --- a/plugins/readme/index.py +++ /dev/null @@ -1,20 +0,0 @@ -# coding: utf-8 - -import time -import random -import os -import json -import re -import sys - -sys.path.append(os.getcwd() + "/class/core") -import public - - -def status(): - return 'start' - -if __name__ == "__main__": - func = sys.argv[1] - if func == 'status': - print status() diff --git a/plugins/readme/info.json b/plugins/readme/info.json deleted file mode 100755 index 2afdffc56..000000000 --- a/plugins/readme/info.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "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":"https://github.com/midoks/mdserver-web", - "date":"2018-11-30", - "pid":"5" -} \ No newline at end of file diff --git a/plugins/readme/install.sh b/plugins/readme/install.sh deleted file mode 100755 index e37dea1f4..000000000 --- a/plugins/readme/install.sh +++ /dev/null @@ -1,30 +0,0 @@ -#!/bin/bash -PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin -export PATH - -curPath=`pwd` -rootPath=$(dirname "$curPath") -rootPath=$(dirname "$rootPath") -serverPath=$(dirname "$rootPath") - -install_tmp=${rootPath}/tmp/bt_install.pl - -Install_readme() -{ - mkdir -p ${serverPath}/readme - echo "${1}" > ${serverPath}/readme/version.pl - echo '安装完成' > $install_tmp -} - -Uninstall_readme() -{ - rm -rf ${serverPath}/readme - echo '卸载完成' > $install_tmp -} - -action=$1 -if [ "${1}" == 'install' ];then - Install_readme $2 -else - Uninstall_readme $2 -fi diff --git a/route/static/app/soft.js b/route/static/app/soft.js index 2f940876f..3006cb4da 100755 --- a/route/static/app/soft.js +++ b/route/static/app/soft.js @@ -381,6 +381,7 @@ function importPlugin(file){ type: "POST", data: formData, processData: false, + dataType:'json', contentType: false, success: function (data) { if (data.status === false) { @@ -405,21 +406,21 @@ function importPlugin(file){

名称:'+ data.title + '

\

版本:' + data.versions +'

\

描述:' + data.ps + '

\ -

大小:' + bt.format_size(data.size, true) + '

\ +

大小:' + toSize(data.size) + '

\

作者:' + data.author + '

\

来源:' + data.home + '

\ \
    \ -
  • 此为第三方开发的插件,宝塔无法验证其可靠性!
  • \ +
  • 此为第三方开发的插件,无法验证其可靠性!
  • \
  • 安装过程可能需要几分钟时间,请耐心等候!
  • \
  • 如果已存在此插件,将被替换!
  • \
\
\ ' }); - }, - error: function (responseStr) { - layer.msg('上传失败2!', { icon: 2 }); + + },error: function (responseStr) { + layer.msg('上传失败2!:' + responseStr, { icon: 2 }); } }); } @@ -427,13 +428,13 @@ function importPlugin(file){ function importPluginInstall(plugin_name, tmp_path) { layer.msg('正在安装,这可能需要几分钟时间...', { icon: 16, time: 0, shade: [0.3, '#000'] }); - $.post('/plugin?action=input_zip', { plugin_name: plugin_name, tmp_path: tmp_path }, function (rdata) { + $.post('/plugins/input_zip', { plugin_name: plugin_name, tmp_path: tmp_path }, function (rdata) { layer.closeAll() if (rdata.status) { - soft.get_list(); + getSList(true); } setTimeout(function () { layer.msg(rdata.msg, { icon: rdata.status ? 1 : 2 }) }, 1000); - }); + },'json'); } $(function() {