diff --git a/class/core/plugin_api.py b/class/core/plugin_api.py index 1d5a3af09..6acf16bd6 100755 --- a/class/core/plugin_api.py +++ b/class/core/plugin_api.py @@ -67,7 +67,11 @@ class plugin_api: return isTask def checkStatus(self, info): - pass + + data = self.run(info['name'], 'status', info['setup_version']) + if data[0] == 'start': + return True + return False def checkDisplayIndex(self, name, version): if not os.path.exists(self.__index): @@ -152,7 +156,7 @@ class plugin_api: else: pluginInfo['setup_version'] = self.getVersion( pluginInfo['install_checks']) - # pluginInfo['status'] = os.path.exists(pluginInfo['install_checks']) + pluginInfo['status'] = self.checkStatus(pluginInfo) return pluginInfo def makeCoexist(self, data): @@ -287,5 +291,19 @@ class plugin_api: public.writeFile(self.__index, json.dumps(indexList)) return public.returnJson(True, '删除成功!') - def run(self): - pass + def run(self, name, func, version, args='', script='index'): + path = public.getRunDir() + '/' + self.__plugin_dir + \ + '/' + name + '/' + script + '.py' + py = 'python ' + path + if args == '': + py_cmd = py + ' ' + func + ' ' + version + else: + py_cmd = py + ' ' + func + ' ' + version + ' ' + args + + # print path + # print os.path.exists(path) + + if not os.path.exists(path): + return ('', '') + data = public.execShell(py_cmd) + return (data[0].strip(), data[1].strip()) diff --git a/plugins/csvn/index.py b/plugins/csvn/index.py index a0cf4103c..b496dacc5 100755 --- a/plugins/csvn/index.py +++ b/plugins/csvn/index.py @@ -7,8 +7,11 @@ import os import urllib import binascii import json -import public import re +import sys + +sys.path.append(os.getcwd() + "/class/core") +import public def status(): diff --git a/plugins/memcached/index.html b/plugins/memcached/index.html index 9d09301eb..60a338be1 100755 --- a/plugins/memcached/index.html +++ b/plugins/memcached/index.html @@ -1,8 +1,8 @@
-

服务

-

配置修改

+

服务

+

配置修改

切换版本

负载状态

性能调整

@@ -14,5 +14,6 @@
\ No newline at end of file diff --git a/plugins/memcached/index.py b/plugins/memcached/index.py index e954d4d0f..41f8709b0 100755 --- a/plugins/memcached/index.py +++ b/plugins/memcached/index.py @@ -11,7 +11,7 @@ import public def status(): data = public.execShell( - "ps -ef|grep redis |grep -v grep | grep -v python | awk '{print $2}'") + "ps -ef|grep memcached |grep -v grep | grep -v python | awk '{print $2}'") if data[0] == '': return 'stop' return 'start' @@ -19,8 +19,8 @@ def status(): def start(): path = os.path.dirname(os.getcwd()) - cmd = path + "/redis/bin/redis-server" - cmd = cmd + " " + path + "/redis/redis.conf" + cmd = path + "/memcached/bin/memcached" + cmd = cmd + " " + path + "/memcached/memcached.conf" data = public.execShell(cmd) if data[0] == '': return 'ok' @@ -29,7 +29,7 @@ def start(): def stop(): data = public.execShell( - "ps -ef|grep redis |grep -v grep |grep -v python |awk '{print $2}' | xargs kill -9") + "ps -ef|grep memcached |grep -v grep |grep -v python |awk '{print $2}' | xargs kill -9") if data[0] == '': return 'ok' return 'fail' @@ -75,7 +75,7 @@ def runInfo(): def getConf(): - path = os.path.dirname(os.getcwd()) + "/redis/redis.conf" + path = os.getcwd() + "/plugins/memcached/init.d/memcached.tpl" return path if __name__ == "__main__": diff --git a/plugins/memcached/init.d/memcached.tpl b/plugins/memcached/init.d/memcached.tpl new file mode 100755 index 000000000..6085facd2 --- /dev/null +++ b/plugins/memcached/init.d/memcached.tpl @@ -0,0 +1,81 @@ +#! /bin/bash +# +# memcached: MemCached Daemon +# +# chkconfig: - 90 25 +# description: MemCached Daemon +# +### BEGIN INIT INFO +# Provides: memcached +# Required-Start: $syslog +# Required-Stop: $syslog +# Should-Start: $local_fs +# Should-Stop: $local_fs +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: memcached - Memory caching daemon +# Description: memcached - Memory caching daemon +### END INIT INFO + +IP=127.0.0.1 +PORT=11211 +USER=root +MAXCONN=1024 +CACHESIZE=64 +OPTIONS="" + +RETVAL=0 +prog="memcached" + +start () { + echo -n $"Starting $prog: " + {$PATH}/memcached/bin/memcached -d -l $IP -p $PORT -u $USER -m $CACHESIZE -c $MAXCONN -P /var/run/memcached.pid $OPTIONS + if [ "$?" != 0 ] ; then + echo " failed" + exit 1 + else + touch /var/lock/subsys/memcached + echo " done" + fi +} +stop () { + echo -n $"Stopping $prog: " + if [ ! -e /var/run/$prog.pid ]; then + echo -n $"$prog is not running." + exit 1 + fi + kill `cat /var/run/memcached.pid` + if [ "$?" != 0 ] ; then + echo " failed" + exit 1 + else + rm -f /var/lock/subsys/memcached + rm -f /var/run/memcached.pid + echo " done" + fi +} + +restart () { + $0 stop + sleep 2 + $0 start +} + +# See how we were called. +case "$1" in + start) + start + ;; + stop) + stop + ;; + restart|reload) + restart + ;; + *) + echo $"Usage: $0 {start|stop|status|restart|reload}" + exit 1 + ;; +esac + +exit $? diff --git a/plugins/openresty/index.html b/plugins/openresty/index.html index 8b1a6c01c..dbbb0a3f4 100755 --- a/plugins/openresty/index.html +++ b/plugins/openresty/index.html @@ -1,9 +1,9 @@
-

服务

-

配置修改

-

负载状态

+

服务

+

配置修改

+

负载状态

diff --git a/plugins/openresty/index.py b/plugins/openresty/index.py index c52f6bd6e..ab32a5ef9 100755 --- a/plugins/openresty/index.py +++ b/plugins/openresty/index.py @@ -45,6 +45,11 @@ def reload(): return 'fail' +def openrestyConf(): + path = os.path.dirname(os.getcwd()) + return path + "/openresty/nginx/conf/nginx.conf" + + if __name__ == "__main__": func = sys.argv[1] if func == 'status': @@ -55,5 +60,7 @@ if __name__ == "__main__": print stop() elif func == 'reload': print reload() + elif func == 'conf': + print openrestyConf() else: print 'error' diff --git a/plugins/openresty/js/openresty.js b/plugins/openresty/js/openresty.js index d74695b91..e6d38a5fe 100755 --- a/plugins/openresty/js/openresty.js +++ b/plugins/openresty/js/openresty.js @@ -246,9 +246,9 @@ function addWafKey(name) { //查看Nginx负载状态 -function getStatus() { +function getOpenrestyStatus() { - $.post('/plugins/run', {name:'openresty', func:'run_status'}, function(data) { + $.post('/plugins/run', {name:'openresty', func:'run_info'}, function(data) { console.log(data); },'json'); $.post('/ajax?action=GetNginxStatus', '', function(rdata) { @@ -265,136 +265,4 @@ function getStatus() { },'json'); } -function openrestyOp(a, b) { - - var c = "name=" + a + "&func=" + b; - var d = ""; - - switch(b) { - case "stop":d = '停止';break; - case "start":d = '启动';break; - case "restart":d = '重启';break; - case "reload":d = '重载';break; - } - layer.confirm( '您真的要{1}{2}服务吗?'.replace('{1}', d).replace('{2}', a), {icon:3,closeBtn: 2}, function() { - var e = layer.msg('正在{1}{2}服务,请稍候...'.replace('{1}', d).replace('{2}', a), {icon: 16,time: 0}); - $.post("/plugins/run", c, function(g) { - layer.close(e); - - var f = g.data == 'ok' ? '{1}服务已{2}'.replace('{1}', a).replace('{2}', d):'{1}服务{2}失败!'.replace('{1}', a).replace('{2}', d); - layer.msg(f, {icon: g.data == 'ok' ? 1 : 2}); - - if(b != "reload" && g.data == 'ok') { - if (b == 'start') { - setRedisService('redis', true); - } else if (b=='stop'){ - setRedisService('redis', false); - } else { - } - } - if(g.data != 'ok') { - layer.msg(g.data, {icon: 2,time: 0,shade: 0.3,shadeClose: true}); - } - },'json').error(function() { - layer.close(e); - layer.msg('操作成功!', {icon: 1}); - }); - }) -} - -//服务 -function setOpenrestyService(name, status){ - var serviceCon ='

当前状态:'+(status ? '开启' : '关闭' )+ - '

\ - \ - \ - \ -
'; - $(".soft-man-con").html(serviceCon); -} - -//服务 -function openrestyService(){ - - $.post('/plugins/run', {name:'openresty', func:'status'}, function(data) { - console.log(data); - if(!data.status){ - layer.msg(data.msg,{icon:0,time:3000,shade: [0.3, '#000']}); - return; - } - if (data.data == 'start'){ - setOpenrestyService('openresty', true); - } else { - setOpenrestyService('openresty', false); - } - },'json'); -} -openrestyService(); - - - -//配置修改 --- start -function openrestyConfig(type){ - - var con = '

提示:Ctrl+F 搜索关键字,Ctrl+G 查找下一个,Ctrl+S 保存,Ctrl+Shift+R 查找替换!

\ - \ -
    \ -
  • 此处为redis主配置文件,若您不了解配置规则,请勿随意修改。
  • \ -
'; - $(".soft-man-con").html(con); - - var loadT = layer.msg('配置文件路径获取中...',{icon:16,time:0,shade: [0.3, '#000']}); - $.post('/plugins/run', {name:'redis', func:'conf'},function (data) { - layer.close(loadT); - - var loadT2 = layer.msg('文件内容获取中...',{icon:16,time:0,shade: [0.3, '#000']}); - var fileName = data.data; - $.post('/files/get_body', 'path=' + fileName, function(rdata) { - layer.close(loadT2); - if (!rdata.status){ - layer.msg(rdata.msg,{icon:0,time:2000,shade: [0.3, '#000']}); - return; - } - $("#textBody").empty().text(rdata.data.data); - $(".CodeMirror").remove(); - var editor = CodeMirror.fromTextArea(document.getElementById("textBody"), { - extraKeys: { - "Ctrl-Space": "autocomplete", - "Ctrl-F": "findPersistent", - "Ctrl-H": "replaceAll", - "Ctrl-S": function() { - redisConfSafe(fileName); - } - }, - lineNumbers: true, - matchBrackets:true, - }); - editor.focus(); - $(".CodeMirror-scroll").css({"height":"300px","margin":0,"padding":0}); - $("#OnlineEditFileBtn").click(function(){ - $("#textBody").text(editor.getValue()); - openrestyConfSave(fileName); - }); - },'json'); - },'json'); -} - - -//配置保存 -function openrestyConfSave(fileName) { - var data = encodeURIComponent($("#textBody").val()); - var encoding = 'utf-8'; - var loadT = layer.msg('保存中...', { - icon: 16, - time: 0 - }); - $.post('/files/save_body', 'data=' + data + '&path=' + fileName + '&encoding=' + encoding, function(rdata) { - layer.close(loadT); - layer.msg(rdata.msg, { - icon: rdata.status ? 1 : 2 - }); - },'json'); -} -//配置修改 --- end +pluginService('openresty'); \ No newline at end of file diff --git a/plugins/readme/index.py b/plugins/readme/index.py index a0cf4103c..b496dacc5 100755 --- a/plugins/readme/index.py +++ b/plugins/readme/index.py @@ -7,8 +7,11 @@ import os import urllib import binascii import json -import public import re +import sys + +sys.path.append(os.getcwd() + "/class/core") +import public def status(): diff --git a/plugins/readme/info.json b/plugins/readme/info.json index bb85f2f3f..2afdffc56 100755 --- a/plugins/readme/info.json +++ b/plugins/readme/info.json @@ -1,15 +1,15 @@ { - "title":"插件开发说明", + "title":"开发说明", "tip":"soft", "name":"readme", "type":"扩展", - "ps":"(mdserver-web)插件产开发说明,每个版本可能有所变化!", + "ps":"[mdserver-web]插件产开发说明,每个版本可能有所变化!", "versions": "0.1", "shell":"install.sh", "checks":"server/readme", "path":"server/readme", "author":"mdserver-web", - "home":"github.com/midoks/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/redis/index.html b/plugins/redis/index.html index be3a7fdbd..6d26966fa 100755 --- a/plugins/redis/index.html +++ b/plugins/redis/index.html @@ -12,5 +12,174 @@
\ No newline at end of file diff --git a/plugins/redis/js/redis.js b/plugins/redis/js/redis.js deleted file mode 100755 index 3c70f06f6..000000000 --- a/plugins/redis/js/redis.js +++ /dev/null @@ -1,170 +0,0 @@ -function redisOp(a, b) { - - var c = "name=" + a + "&func=" + b; - var d = ""; - - switch(b) { - case "stop":d = '停止';break; - case "start":d = '启动';break; - case "restart":d = '重启';break; - case "reload":d = '重载';break; - } - layer.confirm( '您真的要{1}{2}服务吗?'.replace('{1}', d).replace('{2}', a), {icon:3,closeBtn: 2}, function() { - var e = layer.msg('正在{1}{2}服务,请稍候...'.replace('{1}', d).replace('{2}', a), {icon: 16,time: 0}); - $.post("/plugins/run", c, function(g) { - layer.close(e); - - var f = g.data == 'ok' ? '{1}服务已{2}'.replace('{1}', a).replace('{2}', d):'{1}服务{2}失败!'.replace('{1}', a).replace('{2}', d); - layer.msg(f, {icon: g.data == 'ok' ? 1 : 2}); - - if(b != "reload" && g.data == 'ok') { - if (b == 'start') { - setRedisService('redis', true); - } else if (b=='stop'){ - setRedisService('redis', false); - } else { - } - } - if(g.data != 'ok') { - layer.msg(g.data, {icon: 2,time: 0,shade: 0.3,shadeClose: true}); - } - },'json').error(function() { - layer.close(e); - layer.msg('操作成功!', {icon: 1}); - }); - }) -} - -//服务 -function setRedisService(name, status){ - var serviceCon ='

当前状态:'+(status ? '开启' : '关闭' )+ - '

\ - \ - \ - \ -
'; - $(".soft-man-con").html(serviceCon); -} - - -//服务 -function redisService(){ - - $.post('/plugins/run', {name:'redis', func:'status'}, function(data) { - console.log(data); - if(!data.status){ - layer.msg(data.msg,{icon:0,time:3000,shade: [0.3, '#000']}); - return; - } - if (data.data == 'start'){ - setRedisService('redis', true); - } else { - setRedisService('redis', false); - } - },'json'); -} - -redisService(); - - -//配置修改 --- start -function redisConfig(type){ - - var con = '

提示:Ctrl+F 搜索关键字,Ctrl+G 查找下一个,Ctrl+S 保存,Ctrl+Shift+R 查找替换!

\ - \ -
    \ -
  • 此处为redis主配置文件,若您不了解配置规则,请勿随意修改。
  • \ -
'; - $(".soft-man-con").html(con); - - var loadT = layer.msg('配置文件路径获取中...',{icon:16,time:0,shade: [0.3, '#000']}); - $.post('/plugins/run', {name:'redis', func:'conf'},function (data) { - layer.close(loadT); - - var loadT2 = layer.msg('文件内容获取中...',{icon:16,time:0,shade: [0.3, '#000']}); - var fileName = data.data; - $.post('/files/get_body', 'path=' + fileName, function(rdata) { - layer.close(loadT2); - if (!rdata.status){ - layer.msg(rdata.msg,{icon:0,time:2000,shade: [0.3, '#000']}); - return; - } - $("#textBody").empty().text(rdata.data.data); - $(".CodeMirror").remove(); - var editor = CodeMirror.fromTextArea(document.getElementById("textBody"), { - extraKeys: { - "Ctrl-Space": "autocomplete", - "Ctrl-F": "findPersistent", - "Ctrl-H": "replaceAll", - "Ctrl-S": function() { - redisConfSafe(fileName); - } - }, - lineNumbers: true, - matchBrackets:true, - }); - editor.focus(); - $(".CodeMirror-scroll").css({"height":"300px","margin":0,"padding":0}); - $("#OnlineEditFileBtn").click(function(){ - $("#textBody").text(editor.getValue()); - redisConfSave(fileName); - }); - },'json'); - },'json'); -} - -//配置保存 -function redisConfSave(fileName) { - var data = encodeURIComponent($("#textBody").val()); - var encoding = 'utf-8'; - var loadT = layer.msg('保存中...', { - icon: 16, - time: 0 - }); - $.post('/files/save_body', 'data=' + data + '&path=' + fileName + '&encoding=' + encoding, function(rdata) { - layer.close(loadT); - layer.msg(rdata.msg, { - icon: rdata.status ? 1 : 2 - }); - },'json'); -} -//配置修改 --- end - -//redis负载状态 start -function redisStatus() { - var loadT = layer.msg('正在获取...', { icon: 16, time: 0, shade: 0.3 }); - $.post('/plugins/run', {name:'redis', func:'run_info'}, function(data) { - layer.close(loadT); - if (!data.status){ - layer.msg(data.msg,{icon:0,time:2000,shade: [0.3, '#000']}); - return; - } - - var rdata = $.parseJSON(data.data); - hit = (parseInt(rdata.keyspace_hits) / (parseInt(rdata.keyspace_hits) + parseInt(rdata.keyspace_misses)) * 100).toFixed(2); - var Con = '
\ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ -
字段当前值说明
uptime_in_days' + rdata.uptime_in_days + '已运行天数
tcp_port' + rdata.tcp_port + '当前监听端口
connected_clients' + rdata.connected_clients + '连接的客户端数量
used_memory_rss' + toSize(rdata.used_memory_rss) + 'Redis当前占用的系统内存总量
used_memory' + toSize(rdata.used_memory) + 'Redis当前已分配的内存总量
used_memory_peak' + toSize(rdata.used_memory_peak) + 'Redis历史分配内存的峰值
mem_fragmentation_ratio' + rdata.mem_fragmentation_ratio + '%内存碎片比率
total_connections_received' + rdata.total_connections_received + '运行以来连接过的客户端的总数量
total_commands_processed' + rdata.total_commands_processed + '运行以来执行过的命令的总数量
instantaneous_ops_per_sec' + rdata.instantaneous_ops_per_sec + '服务器每秒钟执行的命令数量
keyspace_hits' + rdata.keyspace_hits + '查找数据库键成功的次数
keyspace_misses' + rdata.keyspace_misses + '查找数据库键失败的次数
hit' + hit + '%查找数据库键命中率
latest_fork_usec' + rdata.latest_fork_usec + '最近一次 fork() 操作耗费的微秒数
' - $(".soft-man-con").html(Con); - },'json'); -} -//redis负载状态 end \ No newline at end of file diff --git a/plugins/score/index.py b/plugins/score/index.py index a94a2b101..3a1db22b1 100755 --- a/plugins/score/index.py +++ b/plugins/score/index.py @@ -7,8 +7,11 @@ import os import urllib import binascii import json -import public import re +import sys + +sys.path.append(os.getcwd() + "/class/core") +import public class score_main: diff --git a/route/plugins.py b/route/plugins.py index 8957818cc..6c9e1279b 100644 --- a/route/plugins.py +++ b/route/plugins.py @@ -179,18 +179,11 @@ def setting(): def run(): name = request.form.get('name', '') func = request.form.get('func', '') + version = request.form.get('version', '') args = request.form.get('args', '') script = request.form.get('script', 'index') - py = 'python ' + public.getRunDir() + '/' + __plugin_name + '/' + name - if args == '': - py = py + '/' + script + '.py' + ' ' + func - else: - py = py + '/' + script + '.py' + ' ' + func + ' ' + args - - print py - data = public.execShell(py) - - if data[1].strip() == '': + data = plugin_api.plugin_api().run(name, func, version, args, script) + if data[1] == '': return public.returnJson(True, "OK", data[0].strip()) return public.returnJson(False, data[1].strip()) diff --git a/static/app/public.js b/static/app/public.js index 80e266aa6..7609ae160 100755 --- a/static/app/public.js +++ b/static/app/public.js @@ -1473,20 +1473,129 @@ $(function(){ /*** 其中功能,针对插件通过库使用 start ***/ function pluginService(_name){ $.post('/plugins/run', {name:_name, func:'status'}, function(data) { - console.log(data); if(!data.status){ layer.msg(data.msg,{icon:0,time:3000,shade: [0.3, '#000']}); return; } if (data.data == 'start'){ - setOpenrestyService('openresty', true); + pluginSetService(_name, true); } else { - setOpenrestyService('openresty', false); + pluginSetService(_name, false); } },'json'); } -function pluginSetService(_name ,start){ +function pluginSetService(_name ,status){ + var serviceCon ='

当前状态:'+(status ? '开启' : '关闭' )+ + '

\ + \ + \ + \ +
'; + $(".soft-man-con").html(serviceCon); +} + + +function pluginOpService(a, b) { + + var c = "name=" + a + "&func=" + b; + var d = ""; + + switch(b) { + case "stop":d = '停止';break; + case "start":d = '启动';break; + case "restart":d = '重启';break; + case "reload":d = '重载';break; + } + layer.confirm( '您真的要{1}{2}服务吗?'.replace('{1}', d).replace('{2}', a), {icon:3,closeBtn: 2}, function() { + var e = layer.msg('正在{1}{2}服务,请稍候...'.replace('{1}', d).replace('{2}', a), {icon: 16,time: 0}); + $.post("/plugins/run", c, function(g) { + layer.close(e); + + var f = g.data == 'ok' ? '{1}服务已{2}'.replace('{1}', a).replace('{2}', d):'{1}服务{2}失败!'.replace('{1}', a).replace('{2}', d); + layer.msg(f, {icon: g.data == 'ok' ? 1 : 2}); + + if(b != "reload" && g.data == 'ok') { + if (b == 'start') { + pluginSetService(a, true); + } else if (b=='stop'){ + pluginSetService(a, false); + } else { + } + } + if(g.data != 'ok') { + layer.msg(g.data, {icon: 2,time: 0,shade: 0.3,shadeClose: true}); + } + },'json').error(function() { + layer.close(e); + layer.msg('操作成功!', {icon: 1}); + }); + }) +} + +//配置修改 --- start +function pluginConfig(_name){ + + var con = '

提示:Ctrl+F 搜索关键字,Ctrl+G 查找下一个,Ctrl+S 保存,Ctrl+Shift+R 查找替换!

\ + \ +
    \ +
  • 此处为'+ _name +'主配置文件,若您不了解配置规则,请勿随意修改。
  • \ +
'; + $(".soft-man-con").html(con); + + var loadT = layer.msg('配置文件路径获取中...',{icon:16,time:0,shade: [0.3, '#000']}); + $.post('/plugins/run', {name:_name, func:'conf'},function (data) { + layer.close(loadT); + + var loadT2 = layer.msg('文件内容获取中...',{icon:16,time:0,shade: [0.3, '#000']}); + var fileName = data.data; + $.post('/files/get_body', 'path=' + fileName, function(rdata) { + layer.close(loadT2); + if (!rdata.status){ + layer.msg(rdata.msg,{icon:0,time:2000,shade: [0.3, '#000']}); + return; + } + $("#textBody").empty().text(rdata.data.data); + $(".CodeMirror").remove(); + var editor = CodeMirror.fromTextArea(document.getElementById("textBody"), { + extraKeys: { + "Ctrl-Space": "autocomplete", + "Ctrl-F": "findPersistent", + "Ctrl-H": "replaceAll", + "Ctrl-S": function() { + pluginConfigSave(fileName); + } + }, + lineNumbers: true, + matchBrackets:true, + }); + editor.focus(); + $(".CodeMirror-scroll").css({"height":"300px","margin":0,"padding":0}); + $("#OnlineEditFileBtn").click(function(){ + $("#textBody").text(editor.getValue()); + pluginConfigSave(fileName); + }); + },'json'); + },'json'); +} + + +//配置保存 +function pluginConfigSave(fileName) { + var data = encodeURIComponent($("#textBody").val()); + var encoding = 'utf-8'; + var loadT = layer.msg('保存中...', { + icon: 16, + time: 0 + }); + $.post('/files/save_body', 'data=' + data + '&path=' + fileName + '&encoding=' + encoding, function(rdata) { + layer.close(loadT); + layer.msg(rdata.msg, { + icon: rdata.status ? 1 : 2 + }); + },'json'); } /*** 其中功能,针对插件通过库使用 end ***/ \ No newline at end of file