Compare commits

..
62 Commits
Author SHA1 Message Date
midoks 83cf0c2604 0.7.3 2019-03-29 01:14:01 +08:00
midoks 7999108b91 减小图片大小 2019-03-29 01:10:00 +08:00
midoks b80de25598 减小图片大小 2019-03-29 01:05:11 +08:00
midoks 7c25ae0ec2 BBR[DEV] 2019-03-29 01:02:58 +08:00
Mr Chen 84e9c4a484 Update README.md 2019-03-28 17:21:44 +08:00
Mr Chen 5178e11e44 截图 2019-03-28 17:20:00 +08:00
midoks 0e7c2769c8 修复bug
retJson
2019-03-27 00:30:43 +08:00
midoks 6651a706b7 Update files_api.py 2019-03-27 00:14:53 +08:00
midoks a81f922592 Update .gitignore 2019-03-27 00:11:45 +08:00
Mr Chen 2b87887054 批量复制|剪切|权限|压缩优化 2019-03-26 16:46:52 +08:00
midoks 7859bfb451 修复更新检查判断 2019-03-26 00:14:53 +08:00
midoks 35369f8f41 部分优化 2019-03-25 23:31:51 +08:00
midoks a47166d547 Update files_api.py 2019-03-25 21:46:57 +08:00
midoks 457a69b34a Update config_api.py 2019-03-25 21:45:09 +08:00
midoks 881f571902 Update files.js 2019-03-25 21:44:53 +08:00
midoks d889c3305f Update files.js 2019-03-25 21:43:31 +08:00
midoks cb793d5f3f 0.7.0
fix
2019-03-25 21:42:49 +08:00
Mr Chen b4882aa0fc 优化配置 2019-03-25 10:52:09 +08:00
Mr Chen ef3b5b2a6c Create video.conf 2019-03-20 16:49:35 +08:00
Mr Chen d4501b736b 优化sphinx 2019-03-20 16:49:17 +08:00
Mr Chen 261e24390f 优先显示 2019-03-19 17:26:14 +08:00
Mr Chen 10abbd7efd 调整时间 2019-03-19 16:38:25 +08:00
Mr Chen e2196735d9 Update task.py 2019-03-19 16:28:59 +08:00
Mr Chen dbbc243359 Update task.py 2019-03-19 16:23:37 +08:00
Mr Chen 94bb8e31cf Update task.py 2019-03-19 16:07:20 +08:00
Mr Chen 282bcccf39 优化 2019-03-19 16:06:20 +08:00
Mr Chen 886f6c2369 优化PHP插件
启动时,就配置php-fpm配置文件
2019-03-19 15:49:59 +08:00
Mr Chen ab822f0572 Update task.py 2019-03-19 15:27:02 +08:00
Mr Chen 4ec2355182 添加PHP守护插件 2019-03-19 15:14:50 +08:00
midoks a4237ca213 Update task.py 2019-03-18 22:49:21 +08:00
midoks 4615b70c60 Update firewall_api.py
关闭防火墙-删除自启动
开启防火墙-添加自启动
2019-03-18 21:30:31 +08:00
Mr Chen 97b9d12769 gogs修改
post-receive很少修改。
commit 修改比较多
2019-03-18 15:17:41 +08:00
Mr Chen 35a7c2d96f 权限设置修复 2019-03-18 14:42:04 +08:00
Mr Chen 11ea1e2e1f 删除PHPmysqlAdmin未解决方案 2019-03-18 14:20:07 +08:00
Mr Chen 1860dda320 登陆提示优化 2019-03-18 11:20:56 +08:00
Mr Chen 5610b1b1da Update setting.py 2019-03-15 18:02:09 +08:00
Mr Chen 422dea0e3f Update info.json 2019-03-15 17:48:31 +08:00
Mr Chen d52a355cc9 Update config_api.py 2019-03-15 17:45:55 +08:00
Mr Chen 389d87c2b5 Update index.py 2019-03-15 17:44:33 +08:00
Mr Chen 7ef8322731 Update index.py 2019-03-15 17:42:27 +08:00
Mr Chen d1a0b32bf6 Update gogs.tpl 2019-03-15 17:24:56 +08:00
Mr Chen 295cb399e3 Update gogs.tpl 2019-03-15 17:15:06 +08:00
Mr Chen db9477c22e Update install_centos.sh 2019-03-15 17:05:50 +08:00
Mr Chen b2ae6b67d6 Update install_centos.sh 2019-03-15 16:58:10 +08:00
Mr Chen bf5f0cecff Update config_api.py 2019-03-15 16:54:55 +08:00
Mr Chen 251503952d sphinx 自启动 done 2019-03-15 16:54:00 +08:00
Mr Chen 60445a565d pureftp 自启动 done 2019-03-15 16:50:20 +08:00
Mr Chen 6a8db02aa7 redis 自启动 done 2019-03-15 16:47:55 +08:00
Mr Chen ac50b335c3 memcached 自启动 done 2019-03-15 16:45:15 +08:00
Mr Chen c9826d5daf mysql 自启动done 2019-03-15 16:02:59 +08:00
Mr Chen ada8225e05 update 2019-03-15 15:23:54 +08:00
Mr Chen 613ca4bce0 Update index.py 2019-03-15 14:53:08 +08:00
Mr Chen 1bdfb0625a openresty 自启动 2019-03-15 14:52:18 +08:00
Mr Chen ad2e33fcd2 Update common.py 2019-03-15 14:43:00 +08:00
Mr Chen 6e846a4a51 Update common.py 2019-03-15 14:42:38 +08:00
Mr Chen dc76f0ca33 chkconfig自启动需要 2019-03-15 14:33:33 +08:00
Mr Chen c619f00c54 Update README.md 2019-03-14 17:14:28 +08:00
Mr Chen 015b132b85 update 2019-03-14 15:29:09 +08:00
Mr Chen 4e4b4ad308 Update info.json 2019-03-14 14:29:41 +08:00
Mr Chen 1226caaa39 Update update_centos.sh 2019-03-14 14:21:14 +08:00
Mr Chen 5a92027f20 Update update_centos.sh 2019-03-14 14:21:01 +08:00
Mr Chen ea6ed08461 Update update_centos.sh 2019-03-14 14:20:43 +08:00
249 changed files with 979 additions and 556 deletions
+5 -3
View File
@@ -116,7 +116,9 @@ data/iplist.txt
data/json/index.json
data/json/config.json
data/site.pl
data/admin_path.pl
data/close.pl
data/admin_path.pl
data/close.pl
ssl/input.pl
data/datadir.pl
data/datadir.pl
data/502Task.pl
plugins/qbittorrent/
+8 -1
View File
@@ -1,5 +1,6 @@
# mdserver-web
简单的Linux面板
简单的Linux面板,感谢bt.cn写出如此好的web管理软件。我一看到,就知道这是我一直想要的页面化管理方式。
复制了后台管理界面,按照自己想要的方式写了一版。
### 自动安装
```
@@ -12,3 +13,9 @@ curl -fsSL https://raw.githubusercontent.com/midoks/mdserver-web/master/scripts
curl -fsSL https://raw.githubusercontent.com/midoks/mdserver-web/master/scripts/update.sh | sh
```
### 无图不真相
[![截图](/route/static/mdw.jpg)](/route/static/mdw.jpg)
### wiki
[了解更多...](https://github.com/midoks/mdserver-web/wiki)
+2
View File
@@ -68,6 +68,8 @@ def initInitD():
import shutil
shutil.copyfile(script_bin, initd_bin)
public.execShell('chmod +x ' + initd_bin)
#加入自启动
public.execShell('chkconfig --add mw')
def initUserInfo():
+3 -2
View File
@@ -15,8 +15,9 @@ from flask import request
class config_api:
__version = '0.4.2'
# 本版解决自启动问题
# 文件管理重命名
__version = '0.7.3'
def __init__(self):
pass
+234 -1
View File
@@ -13,6 +13,7 @@ import shutil
from flask import request
from flask import send_file, send_from_directory
from flask import make_response
from flask import session
class files_api:
@@ -51,7 +52,7 @@ class files_api:
if not os.path.exists(filename):
return ''
response = make_response(send_from_directory(
os.path.dirname(filename), os.path.basename(filename), as_attachment=True))
os.path.dirname(filename).encode('utf-8'), os.path.basename(filename).encode('utf-8'), as_attachment=True))
return response
def zipApi(self):
@@ -61,6 +62,27 @@ class files_api:
path = request.form.get('path', '').encode('utf-8')
return self.zip(sfile, dfile, stype, path)
# 移动文件或目录
def mvFileApi(self):
sfile = request.form.get('sfile', '').encode('utf-8')
dfile = request.form.get('dfile', '').encode('utf-8')
if not self.checkFileName(dfile):
return public.returnJson(False, '文件名中不能包含特殊字符!')
if not os.path.exists(sfile):
return public.returnJson(False, '指定文件不存在!')
if not self.checkDir(sfile):
return public.returnJson(False, 'FILE_DANGER')
import shutil
try:
shutil.move(sfile, dfile)
msg = public.getInfo('移动文件或目录[{1}]到[{2}]成功!', (sfile, dfile,))
public.writeLog('文件管理', msg)
return public.returnJson(True, '移动文件或目录成功!')
except:
return public.returnJson(False, '移动文件或目录失败!')
def deleteApi(self):
path = request.form.get('path', '').encode('utf-8')
return self.delete(path)
@@ -70,6 +92,32 @@ class files_api:
data = self.getAccess(filename)
return public.getJson(data)
def setFileAccessApi(self):
if public.isAppleSystem():
return public.returnJson(True, '开发机不设置!')
filename = request.form.get('filename', '').encode('utf-8')
user = request.form.get('user', '').encode('utf-8')
access = request.form.get('access', '755')
sall = '-R'
try:
if not self.checkDir(filename):
return public.returnJson(False, '请不要花样作死')
if not os.path.exists(filename):
return public.returnJson(False, '指定文件不存在!')
os.system('chmod ' + sall + ' ' + access + " '" + filename + "'")
os.system('chown ' + sall + ' ' + user +
':' + user + " '" + filename + "'")
msg = public.getInfo(
'设置[{1}]权限为[{2}]所有者为[{3}]', (filename, access, user,))
public.writeLog('文件管理', msg)
return public.returnJson(True, '设置成功!')
except:
return public.returnJson(False, '设置失败!')
def getDirSizeApi(self):
path = request.form.get('path', '').encode('utf-8')
tmp = self.getDirSize(path)
@@ -82,6 +130,10 @@ class files_api:
search = request.args.get('search', '').strip().lower()
page = request.args.get('p', '1').strip().lower()
row = request.args.get('showRow', '10')
disk = request.form.get('disk', '')
if disk == 'True':
row = 1000
return self.getDir(path, int(page), int(row), search)
def createFileApi(self):
@@ -325,8 +377,189 @@ done
tmp = self.getDirSize(logPath)
return public.returnJson(True, tmp[0].split()[0])
def setBatchDataApi(self):
path = request.form.get('path', '').encode('utf-8')
stype = request.form.get('type', '').encode('utf-8')
access = request.form.get('access', '').encode('utf-8')
user = request.form.get('user', '').encode('utf-8')
data = request.form.get('data')
if stype == '1' or stype == '2':
session['selected'] = {
'path': path,
'type': stype,
'access': access,
'user': user,
'data': data
}
return public.returnJson(True, '标记成功,请在目标目录点击粘贴所有按钮!')
elif stype == '3':
for key in json.loads(data):
try:
key = key.encode('utf-8')
filename = path + '/' + key
if not self.checkDir(filename):
return public.returnJson(False, 'FILE_DANGER')
os.system('chmod -R ' + access + " '" + filename + "'")
os.system('chown -R ' + user + ':' +
user + " '" + filename + "'")
except:
continue
public.writeLog('文件管理', '批量设置权限成功!')
return public.returnJson(True, '批量设置权限成功!')
else:
import shutil
isRecyle = os.path.exists('data/recycle_bin.pl')
data = json.loads(data)
l = len(data)
i = 0
for key in data:
try:
filename = path + '/' + key.encode('utf-8')
topath = filename
if not os.path.exists(filename):
continue
i += 1
public.writeSpeed(key, i, l)
if os.path.isdir(filename):
if not self.checkDir(filename):
return public.returnJson(False, '请不要花样作死!')
if isRecyle:
self.mvRecycleBin(topath)
else:
shutil.rmtree(filename)
else:
if key == '.user.ini':
os.system('which chattr && chattr -i ' + filename)
if isRecyle:
self.mvRecycleBin(topath)
else:
os.remove(filename)
except:
continue
public.writeSpeed(None, 0, 0)
public.writeLog('文件管理', '批量删除成功!')
return public.returnJson(True, '批量删除成功!')
def checkExistsFilesApi(self):
dfile = request.form.get('dfile', '').encode('utf-8')
filename = request.form.get('filename', '').encode('utf-8')
data = []
filesx = []
if filename == '':
filesx = json.loads(session['selected']['data'])
else:
filesx.append(filename)
print filesx
for fn in filesx:
if fn == '.':
continue
filename = dfile + '/' + fn
if os.path.exists(filename):
tmp = {}
stat = os.stat(filename)
tmp['filename'] = fn
tmp['size'] = os.path.getsize(filename)
tmp['mtime'] = str(int(stat.st_mtime))
data.append(tmp)
return public.returnJson(True, 'ok', data)
def batchPasteApi(self):
path = request.form.get('path', '').encode('utf-8')
stype = request.form.get('type', '').encode('utf-8')
# filename = request.form.get('filename', '').encode('utf-8')
import shutil
if not self.checkDir(path):
return public.returnJson(False, '请不要花样作死!')
i = 0
myfiles = json.loads(session['selected']['data'])
l = len(myfiles)
if stype == '1':
for key in myfiles:
i += 1
public.writeSpeed(key, i, l)
try:
sfile = session['selected'][
'path'] + '/' + key.encode('utf-8')
dfile = path + '/' + key.encode('utf-8')
if os.path.isdir(sfile):
shutil.copytree(sfile, dfile)
else:
shutil.copyfile(sfile, dfile)
stat = os.stat(sfile)
os.chown(dfile, stat.st_uid, stat.st_gid)
except:
continue
msg = public.getInfo('从[{1}]批量复制到[{2}]成功',
(session['selected']['path'], path,))
public.writeLog('文件管理', msg)
else:
for key in myfiles:
try:
i += 1
public.writeSpeed(key, i, l)
sfile = session['selected'][
'path'] + '/' + key.encode('utf-8')
dfile = path + '/' + key.encode('utf-8')
shutil.move(sfile, dfile)
except:
continue
msg = public.getInfo('从[{1}]批量移动到[{2}]成功',
(session['selected']['path'], path,))
public.writeLog('文件管理', msg)
public.writeSpeed(None, 0, 0)
errorCount = len(myfiles) - i
del(session['selected'])
msg = public.getInfo('批量操作成功[{1}],失败[{2}]', (str(i), str(errorCount)))
return public.returnJson(True, msg)
def copyFileApi(self):
sfile = request.form.get('sfile', '').encode('utf-8')
dfile = request.form.get('dfile', '').encode('utf-8')
if not os.path.exists(sfile):
return public.returnJson(False, '指定文件不存在!')
if os.path.isdir(sfile):
return self.copyDir(get)
import shutil
try:
shutil.copyfile(sfile, dfile)
msg = public.getInfo('复制文件[{1}]到[{2}]成功!', (sfile, dfile,))
public.writeLog('文件管理', msg)
stat = os.stat(sfile)
os.chown(dfile, stat.st_uid, stat.st_gid)
return public.returnJson(True, '文件复制成功!')
except:
return public.returnJson(False, '文件复制失败!')
##### ----- end ----- ###
def copyDir(self, sfile, dfile):
if not os.path.exists(sfile):
return public.returnJson(False, '指定目录不存在!')
if os.path.exists(dfile):
return public.returnJson(False, '指定目录已存在!')
import shutil
try:
shutil.copytree(sfile, dfile)
stat = os.stat(sfile)
os.chown(dfile, stat.st_uid, stat.st_gid)
msg = public.getInfo('复制目录[{1}]到[{2}]成功!', (sfile, dfile))
public.writeLog('文件管理', msg)
return public.returnJson(True, '目录复制成功!')
except:
return public.returnJson(False, '目录复制失败!')
# 检查敏感目录
def checkDir(self, path):
path = path.replace('//', '/')
+2
View File
@@ -289,6 +289,7 @@ class firewall_api:
return
if self.__isFirewalld:
public.execShell('systemctl stop firewalld.service')
public.execShell('systemctl disabled firewalld.service')
elif self.__isMac:
pass
else:
@@ -300,6 +301,7 @@ class firewall_api:
return
if self.__isFirewalld:
public.execShell('systemctl start firewalld.service')
public.execShell('systemctl enable firewalld.service')
elif self.__isMac:
pass
else:
+7 -4
View File
@@ -98,10 +98,10 @@ class plugins_api:
return public.returnJson(False, '缺少版本信息!', ())
infoJsonPos = self.__plugin_dir + '/' + name + '/' + 'info.json'
print infoJsonPos
# print infoJsonPos
if not os.path.exists(infoJsonPos):
return public.retJson(False, '配置文件不存在!', ())
return public.returnJson(False, '配置文件不存在!', ())
pluginInfo = json.loads(public.readFile(infoJsonPos))
@@ -128,7 +128,7 @@ class plugins_api:
infoJsonPos = self.__plugin_dir + '/' + name + '/' + 'info.json'
if not os.path.exists(infoJsonPos):
return public.retJson(False, "配置文件不存在!", ())
return public.returnJson(False, "配置文件不存在!", ())
pluginInfo = json.loads(public.readFile(infoJsonPos))
@@ -156,7 +156,7 @@ class plugins_api:
infoJsonPos = self.__plugin_dir + '/' + name + '/' + 'info.json'
if not os.path.exists(infoJsonPos):
return public.retJson(False, "配置文件不存在!", ())
return public.returnJson(False, "配置文件不存在!", ())
pluginInfo = json.loads(public.readFile(infoJsonPos))
@@ -165,6 +165,9 @@ class plugins_api:
+ " uninstall " + version
data = public.execShell(execstr)
if public.isAppleSystem():
print execstr
print data[0], data[1]
return public.returnJson(True, '卸载执行成功!')
# if data[1] == '':
# return public.returnJson(True, '已将卸载成功!')
+1 -1
View File
@@ -429,7 +429,7 @@ def writeSpeed(title, used, total, speed=0):
def getSpeed():
# 取进度
path = public.getRootDir()
path = getRootDir()
data = readFile(path + '/tmp/panelSpeed.pl')
if not data:
data = json.dumps({'title': None, 'progress': 0,
+12 -5
View File
@@ -602,11 +602,17 @@ class system_api:
old_list = old.split('.')
ret = 'none'
for i in range(len(old_list)):
tm_new = int(new_list[i])
tm_old = int(old_list[i])
if tm_new > tm_old:
return 'new'
# t = [0] * 3
isHasNew = True
for i in range(3):
if int(new_list[i]) > int(old_list[i]):
pass
else:
isHasNew = False
if isHasNew:
return 'new'
return ret
def getServerInfo(self):
@@ -633,6 +639,7 @@ class system_api:
diff = self.versionDiff(
version_now, version_new_info['version'])
print diff
if diff == 'new':
return public.returnJson(True, '有新版本!', version_new_info['version'])
elif diff == 'test':
Binary file not shown.

After

Width:  |  Height:  |  Size: 498 B

+9
View File
@@ -0,0 +1,9 @@
<script type="text/javascript">
resetPluginWinWidth(480);
// $.getScript( "/plugins/file?name=webssh&f=js/webssh.js", function() {
//});
if ($(".term-box #term").text() != 'W') {
layer.closeAll();
webShell();
}
</script>
+20
View File
@@ -0,0 +1,20 @@
# 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()
+15
View File
@@ -0,0 +1,15 @@
{
"id":4,
"title":"BBR[DEV]",
"tip":"soft",
"name":"bbr",
"type":"软件",
"ps":"BBR是Google提出的一种新型拥塞控制算法,可以使Linux服务器显著地提高吞吐量和减少TCP连接的延迟",
"versions":"1.0",
"shell":"install.sh",
"checks":"server/bbr",
"author":"Google",
"home":"https://github.com/google/bbr",
"date":"2019-03-29",
"pid":"4"
}
+34
View File
@@ -0,0 +1,34 @@
#!/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/mw_install.pl
Install_bbr()
{
echo '正在安装脚本文件...' > $install_tmp
mkdir -p $serverPath/bbr
echo '1.0' > $serverPath/bbr/version.pl
echo '安装完成' > $install_tmp
}
Uninstall_bbr()
{
rm -rf $serverPath/bbr
echo "卸载完成" > $install_tmp
}
action=$1
if [ "${1}" == 'install' ];then
Install_bbr
else
Uninstall_bbr
fi
View File
+2 -2
View File
@@ -35,9 +35,9 @@ USE_PLAIN_TEXT = true
[service]
REGISTER_EMAIL_CONFIRM = false
ENABLE_NOTIFY_MAIL = false
DISABLE_REGISTRATION = false
DISABLE_REGISTRATION = true
ENABLE_CAPTCHA = true
REQUIRE_SIGNIN_VIEW = false
REQUIRE_SIGNIN_VIEW = true
[picture]
DISABLE_GRAVATAR = false
Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

+3 -1
View File
@@ -300,6 +300,7 @@ def initdInstall():
initd_bin = getInitDFile()
shutil.copyfile(mem_bin, initd_bin)
public.execShell('chmod +x ' + initd_bin)
public.execShell('chkconfig --add ' + getPluginName())
return 'ok'
@@ -310,6 +311,7 @@ def initdUinstall():
return "Apple Computer does not support"
initd_bin = getInitDFile()
os.remove(initd_bin)
public.execShell('chkconfig --del ' + getPluginName())
return 'ok'
@@ -503,7 +505,7 @@ def projectScriptEdit():
user = args['user']
name = args['name'] + '.git'
post_receive = getRootPath() + '/' + user + '/' + name + \
'/custom_hooks/post-receive'
'/custom_hooks/commit'
if os.path.exists(post_receive):
return public.returnJson(True, 'OK', {'path': post_receive})
else:
+1 -1
View File
@@ -2,7 +2,7 @@
"ps": "Gogs是一款极易搭建的自助Git服务",
"name": "gogs",
"title": "Gogs",
"versions": ["0.11.86","0.11.79"],
"versions": ["0.11.86"],
"tip": "soft",
"checks": "server/gogs",
"author": "midoks",
+2 -1
View File
@@ -30,7 +30,8 @@ if [ -f /etc/rc.d/init.d/functions ];then
fi
# Default values
HOME={$HOME_DIR}
export HOME={$HOME_DIR}
export USER={$RUN_USER}
NAME=gogs
GOGS_HOME={$SERVER_PATH}/gogs
GOGS_PATH=${GOGS_HOME}/$NAME
+4
View File
@@ -194,10 +194,12 @@ def initdInstall():
if public.isAppleSystem():
return "Apple Computer does not support"
mem_bin = initDreplace()
initd_bin = getInitDFile()
shutil.copyfile(mem_bin, initd_bin)
public.execShell('chmod +x ' + initd_bin)
public.execShell('chkconfig --add ' + getPluginName())
return 'ok'
@@ -205,6 +207,8 @@ def initdUinstall():
if not app_debug:
if public.isAppleSystem():
return "Apple Computer does not support"
public.execShell('chkconfig --del ' + getPluginName())
initd_bin = getInitDFile()
os.remove(initd_bin)
return 'ok'
+8 -11
View File
@@ -1,4 +1,5 @@
#!/bin/bash
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
export PATH
@@ -7,35 +8,31 @@ rootPath=$(dirname "$curPath")
rootPath=$(dirname "$rootPath")
serverPath=$(dirname "$rootPath")
install_tmp=${rootPath}/tmp/mw_install.pl
Install_mem()
{
Install_mem(){
mkdir -p $serverPath/source
echo '正在安装脚本文件...' > $install_tmp
if [ ! -f $serverPath/source/memcached.tar.gz ];then
wget -O $serverPath/source/memcached.tar.gz http://www.memcached.org/files/memcached-1.5.12.tar.gz
if
fi
cd $serverPath/source && tar -zxvf memcached.tar.gz
mkdir -p $serverPath/memcached
cd memcached* && ./configure --prefix=$serverPath/memcached && make && make install
cd $serverPath/source/memcached*
./configure --prefix=$serverPath/memcached && make && make install
echo '1.5' > $serverPath/memcached/version.pl
echo '安装完成' > $install_tmp
echo 'install ok' > $install_tmp
}
Uninstall_mem()
{
$serverPath/memcached/init.d/memcached stop
rm -rf mkdir -p $serverPath/memcached
${serverPath}/memcached/init.d/memcached stop
rm -rf $serverPath/memcached
}
Binary file not shown.

Before

Width:  |  Height:  |  Size: 515 B

After

Width:  |  Height:  |  Size: 388 B

+2
View File
@@ -293,6 +293,7 @@ def initdInstall():
initd_bin = getInitDFile()
shutil.copyfile(mysql_bin, initd_bin)
public.execShell('chmod +x ' + initd_bin)
public.execShell('chkconfig --add ' + getPluginName())
return 'ok'
@@ -300,6 +301,7 @@ def initdUinstall():
if not app_debug:
if public.isAppleSystem():
return "Apple Computer does not support"
public.execShell('chkconfig --del ' + getPluginName())
initd_bin = getInitDFile()
os.remove(initd_bin)
return 'ok'
+2 -1
View File
@@ -4,7 +4,8 @@
"name":"mysql",
"type":"运行环境",
"ps":"MySQL是一种关系数据库管理系统!",
"versions":["5.5","5.6","5.7","8.0"],
"todo_versions":["5.6","5.7","8.0"],
"versions":["5.5"],
"updates":["5.5.62"],
"shell":"install.sh",
"checks":"server/mysql",
+4
View File
@@ -1,4 +1,8 @@
#!/bin/sh
# chkconfig: 2345 55 25
# Description: mysql service
# distro. For CentOS/Redhat run: 'chkconfig --add mysql'
# Copyright Abandoned 1996 TCX DataKonsult AB & Monty Program KB & Detron HB
# This file is public domain and comes with NO WARRANTY of any kind
Binary file not shown.

Before

Width:  |  Height:  |  Size: 501 B

After

Width:  |  Height:  |  Size: 344 B

+3
View File
@@ -232,6 +232,7 @@ def initdInstall():
initd_bin = getInitDFile()
shutil.copyfile(source_bin, initd_bin)
public.execShell('chmod +x ' + initd_bin)
public.execShell('chkconfig --add ' + getPluginName())
return 'ok'
@@ -239,6 +240,8 @@ def initdUinstall():
if not app_debug:
if public.isAppleSystem():
return "Apple Computer does not support"
public.execShell('chkconfig --del ' + getPluginName())
initd_bin = getInitDFile()
os.remove(initd_bin)
return 'ok'
+1 -1
View File
@@ -2,7 +2,7 @@
# chkconfig: 2345 55 25
# Description: Startup script for nginx webserver on Debian. Place in /etc/init.d and
# run 'update-rc.d -f nginx defaults', or use the appropriate command on your
# distro. For CentOS/Redhat run: 'chkconfig --add nginx'
# distro. For CentOS/Redhat run: 'chkconfig --add openresty'
### BEGIN INIT INFO
# Provides: nginx
Binary file not shown.

Before

Width:  |  Height:  |  Size: 786 B

After

Width:  |  Height:  |  Size: 785 B

+1 -1
View File
@@ -3,6 +3,7 @@
<div class="bt-w-main">
<div class="bt-w-menu">
<p class="bgw" onclick="pluginService('php', $('.plugin_version').attr('version'));">服务</p>
<p onclick="pluginInitD('php', $('.plugin_version').attr('version'));">自启动</p>
<p onclick="phpLibConfig($('.plugin_version').attr('version'));">安装扩展</p>
<p onclick="phpSetConfig($('.plugin_version').attr('version'));">配置修改</p>
<p onclick="phpUploadLimitReq($('.plugin_version').attr('version'));">上传限制</p>
@@ -25,5 +26,4 @@
$.getScript( "/plugins/file?name=php&f=js/php.js", function(){
pluginService('php', $('.plugin_version').attr('version'));
});
</script>
+76 -31
View File
@@ -33,10 +33,10 @@ def getServerDir():
return public.getServerDir() + '/' + getPluginName()
def getInitDFile():
def getInitDFile(version):
if app_debug:
return '/tmp/' + getPluginName()
return '/etc/init.d/' + getPluginName()
return '/etc/init.d/' + getPluginName()+version
def getArgs():
@@ -113,7 +113,8 @@ def contentReplace(content, version):
def makeOpenrestyConf():
if public.isInstalledWeb():
d_pathinfo = public.getServerDir() + '/openresty/nginx/conf/pathinfo.conf'
sdir = public.getServerDir()
d_pathinfo = sdir + '/openresty/nginx/conf/pathinfo.conf'
if not os.path.exists(d_pathinfo):
s_pathinfo = getPluginDir() + '/conf/pathinfo.conf'
shutil.copyfile(s_pathinfo, d_pathinfo)
@@ -125,12 +126,21 @@ def makeOpenrestyConf():
tpl = getPluginDir() + '/conf/enable-php.conf'
tpl_content = public.readFile(tpl)
for x in range(len(versions)):
desc_file = public.getServerDir() + '/openresty/nginx/conf/enable-php-' + \
versions[x] + '.conf'
if not os.path.exists(desc_file):
dfile = sdir + '/openresty/nginx/conf/enable-php-' + versions[x] + '.conf'
if not os.path.exists(dfile):
w_content = contentReplace(tpl_content, versions[x])
public.writeFile(desc_file, w_content)
#php-fpm status
phpversions = ['53','54','55','56','70','71','72','73','74']
for version in phpversions:
dfile = sdir + '/openresty/nginx/conf/php_status/phpfpm_status_' + version + '.conf'
tpl = getPluginDir() + '/conf/phpfpm_status.conf'
if not os.path.exists(dfile):
content = public.readFile(tpl)
content = contentReplace(content, version)
public.writeFile(dfile, content)
public.restartWeb()
def phpFpmReplace(version):
desc_php_fpm = getServerDir() + '/' + version + '/etc/php-fpm.conf'
@@ -216,6 +226,41 @@ def reload(version):
return phpOp(version, 'reload')
def initdStatus(version):
if not app_debug:
if public.isAppleSystem():
return "Apple Computer does not support"
initd_bin = getInitDFile(version)
if os.path.exists(initd_bin):
return 'ok'
return 'fail'
def initdInstall(version):
import shutil
if not app_debug:
if public.isAppleSystem():
return "Apple Computer does not support"
source_bin = initReplace(version)
initd_bin = getInitDFile(version)
shutil.copyfile(source_bin, initd_bin)
public.execShell('chmod +x ' + initd_bin)
public.execShell('chkconfig --add ' + getPluginName()+version)
return 'ok'
def initdUinstall(version):
if not app_debug:
if public.isAppleSystem():
return "Apple Computer does not support"
public.execShell('chkconfig --del ' + getPluginName())
initd_bin = getInitDFile(version)
os.remove(initd_bin)
return 'ok'
def fpmLog(version):
return getServerDir() + '/' + version + '/var/log/php-fpm.log'
@@ -349,16 +394,8 @@ def setMaxSize(version):
conf = re.sub(rep, u'\npost_max_size = ' + max + 'M', conf)
public.writeFile(path, conf)
# if public.get_webserver() == 'nginx':
# path = web.ctx.session.setupPath + '/nginx/conf/nginx.conf'
# conf = public.readFile(path)
# rep = "client_max_body_size\s+([0-9]+)m"
# tmp = re.search(rep, conf).groups()
# if int(tmp[0]) < int(max):
# conf = re.sub(rep, 'client_max_body_size ' + max + 'm', conf)
# public.writeFile(path, conf)
public.writeLog("TYPE_PHP", "PHP_UPLOAD_MAX", (version, max))
msg = public.getInfo('设置PHP-{1}最大上传大小为[{2}MB]!',(version, max,))
public.writeLog('插件管理[PHP]', msg)
return public.returnJson(True, '设置成功!')
@@ -423,20 +460,22 @@ def setFpmConfig(version):
public.writeFile(file, conf)
reload(version)
public.writeLog("TYPE_PHP", 'PHP_CHILDREN', (version, max_children,
start_servers, min_spare_servers, max_spare_servers))
return public.returnJson(True, '设置成功')
msg = public.getInfo('设置PHP-{1}并发设置,max_children={2},start_servers={3},min_spare_servers={4},max_spare_servers={5}',(version, max_children,
start_servers, min_spare_servers, max_spare_servers,))
public.writeLog('插件管理[PHP]', msg)
return public.returnJson(True, '设置成功!')
def checkFpmStatusFile(version):
if public.isInstalledWeb():
desc_file = public.getServerDir(
) + '/openresty/nginx/conf/php_status/phpfpm_status_' + version + '.conf'
if not os.path.exists(desc_file):
sdir = public.getServerDir()
dfile = sdir + '/openresty/nginx/conf/php_status/phpfpm_status_' + version + '.conf'
if not os.path.exists(dfile):
tpl = getPluginDir() + '/conf/phpfpm_status.conf'
content = public.readFile(tpl)
content = contentReplace(content, version)
public.writeFile(desc_file, content)
public.writeFile(dfile, content)
public.restartWeb()
@@ -473,10 +512,10 @@ def setDisableFunc(version):
phpini = public.readFile(filename)
rep = "disable_functions\s*=\s*.*\n"
phpini = re.sub(rep, 'disable_functions = ' +
disable_functions + "\n", phpini)
public.writeLog('TYPE_PHP', 'PHP_DISABLE_FUNCTION',
(version, disable_functions))
phpini = re.sub(rep, 'disable_functions = ' +disable_functions + "\n", phpini)
msg = public.getInfo('修改PHP-{1}的禁用函数为[{2}]',(version, disable_functions,))
public.writeLog('插件管理[PHP]', msg)
public.writeFile(filename, phpini)
reload(version)
return public.returnJson(True, '设置成功!')
@@ -484,13 +523,13 @@ def setDisableFunc(version):
def checkPhpinfoFile(v):
if public.isInstalledWeb():
desc_file = public.getServerDir(
) + '/openresty/nginx/conf/php_status/phpinfo_' + v + '.conf'
if not os.path.exists(desc_file):
sdir = public.getServerDir()
dfile = sdir + '/openresty/nginx/conf/php_status/phpinfo_' + v + '.conf'
if not os.path.exists(dfile):
tpl = getPluginDir() + '/conf/phpinfo.conf'
content = public.readFile(tpl)
content = contentReplace(content, v)
public.writeFile(desc_file, content)
public.writeFile(dfile, content)
public.restartWeb()
@@ -595,6 +634,12 @@ if __name__ == "__main__":
print restart(version)
elif func == 'reload':
print reload(version)
elif func == 'initd_status':
print initdStatus(version)
elif func == 'initd_install':
print initdInstall(version)
elif func == 'initd_uninstall':
print initdUinstall(version)
elif func == 'fpm_log':
print fpmLog(version)
elif func == 'fpm_slow_log':
+2
View File
@@ -1,4 +1,6 @@
#! /bin/sh
# chkconfig: 2345 55 25
# description: PHP Service
### BEGIN INIT INFO
# Provides: php-fpm
BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 900 B

+7
View File
@@ -0,0 +1,7 @@
<script type="text/javascript">
setTimeout(function(){
layer.closeAll();
layer.msg('PHP守护已启动,无需设置',{icon:1,time:2000,shade: [0.3, '#000']});
},1);
</script>
+71
View File
@@ -0,0 +1,71 @@
# coding:utf-8
import sys
import io
import os
import time
import re
import json
import shutil
reload(sys)
sys.setdefaultencoding('utf8')
sys.path.append(os.getcwd() + "/class/core")
sys.path.append("/usr/local/lib/python2.7/site-packages")
import public
app_debug = False
if public.isAppleSystem():
app_debug = True
def getPluginName():
return 'php_guard'
def getPluginDir():
return public.getPluginDir() + '/' + getPluginName()
def getServerDir():
return public.getServerDir() + '/' + getPluginName()
def getInitDFile(version):
if app_debug:
return '/tmp/' + getPluginName()
return '/etc/init.d/' + getPluginName()+version
def getArgs():
args = sys.argv[3:]
tmp = {}
args_len = len(args)
if args_len == 1:
t = args[0].strip('{').strip('}')
t = t.split(':')
tmp[t[0]] = t[1]
elif args_len > 1:
for i in range(len(args)):
t = args[i].split(':')
tmp[t[0]] = t[1]
return tmp
def checkArgs(data, ck=[]):
for i in range(len(ck)):
if not ck[i] in data:
return (False, public.returnJson(False, '参数:(' + ck[i] + ')没有!'))
return (True, public.returnJson(True, 'ok'))
if __name__ == "__main__":
func = sys.argv[1]
if func == 'status':
print 'start'
else:
print "fail"
+18
View File
@@ -0,0 +1,18 @@
{
"sort": 7,
"ps": "监控PHP-FPM运行状态,防止大批量出现502错误!",
"shell": "install.sh",
"name": "php_guard",
"title": "PHP守护",
"versions": "1.0",
"updates": "1.0",
"tip": "soft",
"checks": "server/php_guard",
"path": "server/php/VERSION",
"display": 1,
"author": "midoks",
"date": "2019-03-01",
"home": "https://github.com/midoks",
"type": "语言解释器",
"pid": "1"
}
+39
View File
@@ -0,0 +1,39 @@
#!/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/mw_install.pl
Install_pg()
{
echo 'install scripts ...' > $install_tmp
echo 'True' > ${rootPath}/data/502Task.pl
mkdir -p $serverPath/php_guard
echo '1.0' > $serverPath/php_guard/version.pl
echo 'install ok' > $install_tmp
}
Uninstall_pg()
{
rm -rf ${rootPath}/data/502Task.pl
rm -rf $serverPath/php_guard
}
action=$1
host=$2
if [ "${1}" == 'install' ];then
Install_pg
else
Uninstall_pg
fi
Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.3 KiB

After

Width:  |  Height:  |  Size: 2.0 KiB

+3 -2
View File
@@ -4,8 +4,9 @@
"name":"phpmyadmin",
"type":"运行环境",
"ps":"著名Web端MySQL管理工具",
"versions":["4.4.15","4.8.4"],
"updates":["4.4.15","4.8.4"],
"to_ver":["4.8.4"],
"versions":["4.4.15"],
"updates":["4.4.15"],
"shell":"install.sh",
"checks":"server/phpmyadmin",
"author":"phpMyAdmin",
Binary file not shown.

Before

Width:  |  Height:  |  Size: 1017 B

After

Width:  |  Height:  |  Size: 870 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 44 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

+2
View File
@@ -166,6 +166,7 @@ def initdInstall():
initd_bin = getInitDFile()
shutil.copyfile(source_bin, initd_bin)
public.execShell('chmod +x ' + initd_bin)
public.execShell('chkconfig --add ' + getPluginName())
return 'ok'
@@ -176,6 +177,7 @@ def initdUinstall():
return "Apple Computer does not support"
initd_bin = getInitDFile()
os.remove(initd_bin)
public.execShell('chkconfig --del ' + getPluginName())
return 'ok'
Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

+3
View File
@@ -172,6 +172,7 @@ def initdInstall():
initd_bin = getInitDFile()
shutil.copyfile(source_bin, initd_bin)
public.execShell('chmod +x ' + initd_bin)
public.execShell('chkconfig --add ' + getPluginName())
return 'ok'
@@ -179,6 +180,8 @@ def initdUinstall():
if not app_debug:
if public.isAppleSystem():
return "Apple Computer does not support"
public.execShell('chkconfig --del ' + getPluginName())
initd_bin = getInitDFile()
os.remove(initd_bin)
return 'ok'
+3 -4
View File
@@ -147,15 +147,14 @@ def initdStatus():
data = public.execShell('systemctl status rsyncd.service | grep enabled')
if data[0] == '':
return 'ok'
return 'fail'
return 'fail'
return 'ok'
def initdInstall():
if public.isAppleSystem():
return "Apple Computer does not support"
data = public.execShell('systemctl enable rsyncd.service')
if data[0] == '':
if data[0] != '':
return 'fail'
return 'ok'
Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.6 KiB

After

Width:  |  Height:  |  Size: 664 B

+37 -4
View File
@@ -114,8 +114,12 @@ def mkdirAll():
rep = 'path\s*=\s*(.*)'
p = re.compile(rep)
tmp = p.findall(content)
for x in tmp:
public.execShell('mkdir -p ' + x)
if x.find('binlog') != -1:
public.execShell('mkdir -p ' + x)
else:
public.execShell('mkdir -p ' + os.path.dirname(x))
def initDreplace():
@@ -146,8 +150,31 @@ def initDreplace():
return file_bin
def checkIndexSph():
content = public.readFile(getConf())
rep = 'path\s*=\s*(.*)'
p = re.compile(rep)
tmp = p.findall(content)
for x in tmp:
if x.find('binlog') != -1:
continue
else:
p = x+'.sph'
if os.path.exists(p):
return False
return True
def start():
file = initDreplace()
data = sphinxConfParse()
if 'index' in data :
if checkIndexSph():
rebuild()
time.sleep(5)
else:
return '配置不正确!'
data = public.execShell(file + ' start')
if data[1] == '':
return 'ok'
@@ -206,6 +233,7 @@ def initdInstall():
initd_bin = getInitDFile()
shutil.copyfile(source_bin, initd_bin)
public.execShell('chmod +x ' + initd_bin)
public.execShell('chkconfig --add ' + getPluginName())
return 'ok'
@@ -215,6 +243,7 @@ def initdUinstall():
return "Apple Computer does not support"
initd_bin = getInitDFile()
os.remove(initd_bin)
public.execShell('chkconfig --del ' + getPluginName())
return 'ok'
@@ -262,15 +291,15 @@ def runStatus():
return public.returnJson(True, 'ok', rData)
def sphinxCmd():
def sphinxConfParse():
file = getConf()
bin_dir = getServerDir()
content = public.readFile(file)
rep = 'index\s(.*)'
sindex = re.findall(rep, content)
indexlen = len(sindex)
cmd = {}
if indexlen > 0:
cmd = {}
cmd_index = []
cmd_delta = []
for x in range(indexlen):
@@ -282,8 +311,12 @@ def sphinxCmd():
cmd['index'] = cmd_index
cmd['delta'] = cmd_delta
cmd['cmd'] = bin_dir + '/bin/bin/indexer -c ' + bin_dir + '/sphinx.conf'
return cmd
return public.returnJson(True, 'ok', cmd)
def sphinxCmd():
data = sphinxConfParse()
if 'index' in data:
return public.returnJson(True, 'ok', data)
else:
return public.returnJson(False, 'no index')
+7 -4
View File
@@ -103,27 +103,30 @@ function runStatus(){
function readme(){
spPost('sphinx_cmd', '', function(data){
var rdata = $.parseJSON(data.data);
if (!rdata['status']){
layer.msg(rdata['msg'],{icon:2,time:2000,shade: [0.3, '#000']});
return;
}
var con = '';
var con = '<ul class="help-info-text c7">';
con += '<li style="color:red;">如果数据量比较大,第一次启动会失败!(可通过手动建立索引)</li>';
//主索引
for (var i = 0; i < rdata['data']['index'].length; i++) {
var index_t = rdata['data']['index'][i];
con += '<p>主索引:' + rdata['data']['cmd'] + ' '+ index_t +' --rotate </p>';
con += '<li>主索引:' + rdata['data']['cmd'] + ' '+ index_t +' --rotate</li>';
}
for (var i = 0; i < rdata['data']['delta'].length; i++) {
var delta_t = rdata['data']['delta'][i];
var list = delta_t.split(':');
console.log(list);
con += '<p>增量索引:' + rdata['data']['cmd'] + ' '+ list[0] +' --rotate </p>';
con += '<p>合并索引:' + rdata['data']['cmd'] + ' --merge '+ list[1] + ' ' + list[0] +' --rotate </p>';
con += '<li>增量索引:' + rdata['data']['cmd'] + ' '+ list[0] +' --rotate</li>';
con += '<li>合并索引:' + rdata['data']['cmd'] + ' --merge '+ list[1] + ' ' + list[0] +' --rotate</li>';
}
con += '</ul>';
$(".soft-man-con").html(con);
});
+1 -1
View File
@@ -52,7 +52,7 @@ source search_hash
index search_hash
{
source = search_hash
path = {$SERVER_APP}/index/db/search_hash
path = {$SERVER_APP}/index/db/search_hash/index
ngram_len = 1
ngram_chars = U+3000..U+2FA1F
+2 -2
View File
@@ -65,7 +65,7 @@ source search_hash_delta : search_hash
index search_hash
{
source = search_hash
path = {$SERVER_APP}/index/db/search_hash
path = {$SERVER_APP}/index/db/search_hash/index
ngram_len = 1
ngram_chars = U+3000..U+2FA1F
@@ -75,7 +75,7 @@ index search_hash
index search_hash_delta : search_hash
{
source = search_hash_delta
path = {$SERVER_APP}/index/db/search_hash_delta
path = {$SERVER_APP}/index/db/search_hash_delta/index
ngram_len = 1
ngram_chars = U+3000..U+2FA1F
+58
View File
@@ -0,0 +1,58 @@
#
# Minimal Sphinx configuration sample (clean, simple, functional)
#
indexer
{
mem_limit = 32M
}
searchd
{
listen = 9312
listen = 9306:mysql41
log = {$SERVER_APP}/index/searchd.log
query_log = {$SERVER_APP}/index/query.log
read_timeout = 5
max_children = 0
pid_file = {$SERVER_APP}/index/searchd.pid
seamless_rotate = 1
preopen_indexes = 1
unlink_old = 1
#workers = threads # for RT to work
binlog_path = {$SERVER_APP}/binlog
}
source sp_video
{
type = mysql
sql_host = 127.0.0.1
sql_user = video_spider
sql_pass = video_spider
sql_db = video_spider
sql_port = 3306 # optional, default is 3306
sql_query_range = SELECT min(id), max(id) FROM sp_video
sql_range_step = 1000
sql_query_pre = SET NAMES utf8
sql_query = SELECT id, name, UNIX_TIMESTAMP(create_time) AS create_time, UNIX_TIMESTAMP(update_time) AS update_time \
FROM sp_video where id >= $start AND id <= $end
sql_attr_bigint = length
sql_attr_timestamp = create_time
sql_attr_timestamp = update_time
sql_attr_uint = category
}
index sp_video
{
source = sp_video
path = {$SERVER_APP}/index/db/sp_video/index
ngram_len = 1
ngram_chars = U+3000..U+2FA1F
}
Binary file not shown.

Before

Width:  |  Height:  |  Size: 659 B

After

Width:  |  Height:  |  Size: 504 B

+2 -2
View File
@@ -177,8 +177,8 @@ def doLogin():
password = public.md5(password)
if userInfo['username'] != username or userInfo['password'] != password:
public.writeLog('TYPE_LOGIN', public.getInfo(
"< a style='color: red'>密码错误</a>,帐号:{1},密码:{2},登录IP:{3}", (('****', '******', request.remote_addr))))
public.writeLog('用户登录', public.getInfo(
"<a style='color: red'>密码错误</a>,帐号:{1},密码:{2},登录IP:{3}", (('****', '******', request.remote_addr))))
return public.returnJson(False, public.getInfo("用户名或密码错误,您还可以尝试[{1}]次!", ('1')))
session['login'] = True
+118 -109
View File
@@ -348,11 +348,11 @@ function getFiles(Path) {
<td>"+fmp[3]+"</td>\
<td>"+fmp[4]+"</td>\
<td class='editmenu'><span>\
<a class='btlink' href='javascript:;' onclick=\"CopyFile('" + rdata.PATH +"/"+ fmp[0] + "')\">复制</a> | \
<a class='btlink' href='javascript:;' onclick=\"CutFile('" + rdata.PATH +"/"+ fmp[0]+ "')\">剪切</a> | \
<a class='btlink' href=\"javascript:ReName(0,'" + fmp[0] + "');\">重命名</a> | \
<a class='btlink' href='javascript:;' onclick=\"copyFile('" + rdata.PATH +"/"+ fmp[0] + "')\">复制</a> | \
<a class='btlink' href='javascript:;' onclick=\"cutFile('" + rdata.PATH +"/"+ fmp[0]+ "')\">剪切</a> | \
<a class='btlink' href=\"javascript:reName(0,'" + fmp[0] + "');\">重命名</a> | \
<a class='btlink' href=\"javascript:setChmod(0,'" + rdata.PATH + "/"+fmp[0] + "');\">权限</a> | \
<a class='btlink' href=\"javascript:Zip('" + rdata.PATH +"/" +fmp[0] + "');\">压缩</a> | \
<a class='btlink' href=\"javascript:zip('" + rdata.PATH +"/" +fmp[0] + "');\">压缩</a> | \
<a class='btlink' href='javascript:;' onclick=\"deleteDir('" + rdata.PATH +"/"+ fmp[0] + "')\">删除</a></span>\
</td></tr>";
} else {
@@ -404,17 +404,17 @@ function getFiles(Path) {
<td>"+fmp[3]+"</td>\
<td>"+fmp[4]+"</td>\
<td class='editmenu'>\
<span><a class='btlink' href='javascript:;' onclick=\"CopyFile('" + rdata.PATH +"/"+ fmp[0] + "')\">"+lan.files.file_menu_copy+"</a> | \
<a class='btlink' href='javascript:;' onclick=\"CutFile('" + rdata.PATH +"/"+ fmp[0] + "')\">"+lan.files.file_menu_mv+"</a> | \
<a class='btlink' href='javascript:;' onclick=\"ReName(0,'" + fmp[0] + "')\">"+lan.files.file_menu_rename+"</a> | \
<a class='btlink' href=\"javascript:setChmod(0,'" + rdata.PATH +"/"+ fmp[0] + "');\">"+lan.files.file_menu_auth+"</a> | \
<a class='btlink' href=\"javascript:Zip('" + rdata.PATH +"/" +fmp[0] + "');\">"+lan.files.file_menu_zip+"</a> | \
<span><a class='btlink' href='javascript:;' onclick=\"copyFile('" + rdata.PATH +"/"+ fmp[0] + "')\">复制</a> | \
<a class='btlink' href='javascript:;' onclick=\"cutFile('" + rdata.PATH +"/"+ fmp[0] + "')\">剪切</a> | \
<a class='btlink' href='javascript:;' onclick=\"reName(0,'" + fmp[0] + "')\">重命名</a> | \
<a class='btlink' href=\"javascript:setChmod(0,'" + rdata.PATH +"/"+ fmp[0] + "');\">权限</a> | \
<a class='btlink' href=\"javascript:zip('" + rdata.PATH +"/" +fmp[0] + "');\">压缩</a> | \
"+bodyZip+download+"\
<a class='btlink' href='javascript:;' onclick=\"deleteFile('" + rdata.PATH +"/"+ fmp[0] + "')\">"+lan.files.file_menu_del+"</a>\
<a class='btlink' href='javascript:;' onclick=\"deleteFile('" + rdata.PATH +"/"+ fmp[0] + "')\">删除</a>\
</span></td></tr>";
}
else{
Body += "<div class='file folderBox menufile' data-path='" + rdata.PATH +"/"+ fmp[0] + "' filetype='"+fmp[0]+"' title='"+lan.files.file_name+":" + fmp[0]+"&#13;"+lan.files.file_size+":" + toSize(fmp[1])+"&#13;"+lan.files.file_etime+":"+getLocalTime(fmp[2])+"&#13;"+lan.files.file_auth+":"+fmp[3]+"&#13;"+lan.files.file_own+":"+fmp[4]+"'>\
Body += "<div class='file folderBox menufile' data-path='" + rdata.PATH +"/"+ fmp[0] + "' filetype='"+fmp[0]+"' title='文件名:" + fmp[0]+"&#13;大小:" + toSize(fmp[1])+"&#13;修改时间:"+getLocalTime(fmp[2])+"&#13;权限:"+fmp[3]+"&#13;所有者:"+fmp[4]+"'>\
<input type='checkbox' name='id' value='"+fmp[0]+"'>\
<div class='ico ico-"+(getExtName(fmp[0]))+"'></div>\
<div class='titleBox'><span class='tname'>" + fmp[0] + "</span></div>\
@@ -428,12 +428,12 @@ function getFiles(Path) {
<thead>\
<tr>\
<th width="30"><input type="checkbox" id="setBox" placeholder=""></th>\
<th>'+lan.files.file_name+'</th>\
<th>'+lan.files.file_size+'</th>\
<th>'+lan.files.file_etime+'</th>\
<th>'+lan.files.file_auth+'</th>\
<th>'+lan.files.file_own+'</th>\
<th style="text-align: right;" width="330">'+lan.files.file_act+'</th>\
<th>文件名</th>\
<th>大小</th>\
<th>修改时间</th>\
<th>权限</th>\
<th>所有者</th>\
<th style="text-align: right;" width="330">操作</th>\
</tr>\
</thead>\
<tbody id="filesBody" class="list-list">'+Body+'</tbody>\
@@ -448,7 +448,7 @@ function getFiles(Path) {
$("#DirPathPlace input").val(rdata.PATH);
var BarTools = '<div class="btn-group">\
<button class="btn btn-default btn-sm dropdown-toggle" type="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">\
'+lan.files.new+' <span class="caret"></span>\
新建<span class="caret"></span>\
</button>\
<ul class="dropdown-menu">\
<li><a href="javascript:createFile(0,\'' + Path + '\');">新建空白文件</a></li>\
@@ -600,11 +600,11 @@ function showSeclect(){
var count = totalFile();
var BatchTools = '';
if(count > 1){
BatchTools = '<button onclick="javascript:Batch(1);" class="btn btn-default btn-sm">'+lan.files.file_menu_copy+'</button>\
<button onclick="javascript:Batch(2);" class="btn btn-default btn-sm">'+lan.files.file_menu_mv+'</button>\
<button onclick="javascript:Batch(3);" class="btn btn-default btn-sm">'+lan.files.file_menu_auth+'</button>\
<button onclick="javascript:Batch(5);" class="btn btn-default btn-sm">'+lan.files.file_menu_zip+'</button>\
<button onclick="javascript:Batch(4);" class="btn btn-default btn-sm">'+lan.files.file_menu_del+'</button>'
BatchTools = '<button onclick="javascript:batch(1);" class="btn btn-default btn-sm">复制</button>\
<button onclick="javascript:batch(2);" class="btn btn-default btn-sm">剪切</button>\
<button onclick="javascript:batch(3);" class="btn btn-default btn-sm">权限</button>\
<button onclick="javascript:batch(5);" class="btn btn-default btn-sm">压缩</button>\
<button onclick="javascript:batch(4);" class="btn btn-default btn-sm">删除</button>'
$("#Batch").html(BatchTools);
}else{
$("#Batch").html(BatchTools);
@@ -638,20 +638,22 @@ window.onresize = function(){
}
//批量操作
function Batch(type,access){
function batch(type,access){
var path = $("#DirPathPlace input").val();
var el = document.getElementsByTagName('input');
var len = el.length;
var data='path='+path+'&type='+type;
var name = 'data';
var datas = [];
var oldType = getCookie('BatchPaste');
for(var i=0;i<len;i++){
if(el[i].checked == true && el[i].value != 'on'){
data += '&'+name+'='+encodeURIComponent(el[i].value);
datas.push(el[i].value)
}
}
data += "&data=" + encodeURIComponent(JSON.stringify(datas))
if(type == 3 && access == undefined){
setChmod(0,lan.files.all);
@@ -668,7 +670,7 @@ function Batch(type,access){
layer.closeAll();
}
if(type == 4){
AllDeleteFileSub(data,path);
allDeleteFileSub(data,path);
setCookie('BatchPaste',oldType);
return;
}
@@ -680,26 +682,28 @@ function Batch(type,access){
names += el[i].value + ',';
}
}
Zip(names);
zip(names);
return;
}
myloadT = layer.msg("<div class='myspeed'>"+lan.public.the+"</div>",{icon:16,time:0,shade: [0.3, '#000']});
myloadT = layer.msg("<div class='myspeed'>正在处理,请稍候...</div>",{icon:16,time:0,shade: [0.3, '#000']});
setTimeout(function(){getSpeed('.myspeed');},1000);
$.post('files?action=SetBatchData',data,function(rdata){
console.log(data);
$.post('files/set_batch_data',data,function(rdata){
layer.close(myloadT);
getFiles(path);
layer.msg(rdata.msg,{icon:1});
});
},'json');
}
//批量粘贴
function BatchPaste(){
function batchPaste(){
var path = $("#DirPathPlace input").val();
var type = getCookie('BatchPaste');
var data = 'type='+type+'&path='+path;
$.post('/files?action=CheckExistsFiles',{dfile:path},function(result){
$.post('/files/check_exists_files',{dfile:path},function(rdata){
var result = rdata['data'];
if(result.length > 0){
var tbody = '';
for(var i=0;i<result.length;i++){
@@ -708,25 +712,25 @@ function BatchPaste(){
var mbody = '<div class="divtable"><table class="table table-hover" width="100%" border="0" cellpadding="0" cellspacing="0"><thead><th>文件名</th><th>大小</th><th>最后修改时间</th></thead>\
<tbody>'+tbody+'</tbody>\
</table></div>';
SafeMessage('即将覆盖以下文件',mbody,function(){
BatchPasteTo(data,path);
safeMessage('即将覆盖以下文件',mbody,function(){
batchPasteTo(data,path);
});
$(".layui-layer-page").css("width","500px");
}else{
BatchPasteTo(data,path);
batchPasteTo(data,path);
}
});
},'json');
}
function BatchPasteTo(data,path){
myloadT = layer.msg("<div class='myspeed'>"+lan.public.the+"</div>",{icon:16,time:0,shade: [0.3, '#000']});
function batchPasteTo(data,path){
myloadT = layer.msg("<div class='myspeed'>正在处理,请稍候...</div>",{icon:16,time:0,shade: [0.3, '#000']});
setTimeout(function(){getSpeed('.myspeed');},1000);
$.post('files?action=BatchPaste',data,function(rdata){
$.post('files/batch_paste',data,function(rdata){
layer.close(myloadT);
setCookie('BatchSelected', null);
getFiles(path);
layer.msg(rdata.msg,{icon:1});
});
},'json');
}
@@ -820,7 +824,7 @@ function createFile(type, path) {
shift: 5,
closeBtn: 2,
area: '320px',
title: lan.files.new_empty_file,
title: '新建空白文件',
content: '<div class="bt-form pd20 pb70">\
<div class="line">\
<input type="text" class="bt-input-text" name="Name" id="newFileName" value="" placeholder="文件名" style="width:100%" />\
@@ -839,7 +843,7 @@ function createFile(type, path) {
function createDir(type, path) {
if (type == 1) {
var dirName = $("#newDirName").val();
layer.msg(lan.public.the, {
layer.msg('正在处理,请稍候...', {
icon: 16,
time: 10000
});
@@ -857,7 +861,7 @@ function createDir(type, path) {
shift: 5,
closeBtn: 2,
area: '320px',
title: lan.files.new_dir,
title: '新建目录',
content: '<div class="bt-form pd20 pb70">\
<div class="line">\
<input type="text" class="bt-input-text" name="Name" id="newDirName" value="" placeholder="目录名称" style="width:100%" />\
@@ -875,8 +879,8 @@ function createDir(type, path) {
//删除文件
function deleteFile(fileName){
layer.confirm(lan.get('recycle_bin_confirm',[fileName]),{title:lan.files.del_file,closeBtn:2,icon:3},function(){
layer.msg(lan.public.the,{icon:16,time:0,shade: [0.3, '#000']});
layer.confirm(lan.get('recycle_bin_confirm',[fileName]),{title:'删除文件',closeBtn:2,icon:3},function(){
layer.msg('正在处理,请稍候...',{icon:16,time:0,shade: [0.3, '#000']});
$.post('/files/delete', 'path=' + encodeURIComponent(fileName), function(rdata) {
layer.closeAll();
layer.msg(rdata.msg, {
@@ -889,8 +893,8 @@ function deleteFile(fileName){
//删除目录
function deleteDir(dirName){
layer.confirm(lan.get('recycle_bin_confirm_dir',[dirName]),{title:lan.files.del_dir,closeBtn:2,icon:3},function(){
layer.msg(lan.public.the,{icon:16,time:0,shade: [0.3, '#000']});
layer.confirm(lan.get('recycle_bin_confirm_dir',[dirName]),{title:'删除目录',closeBtn:2,icon:3},function(){
layer.msg('正在处理,请稍候...',{icon:16,time:0,shade: [0.3, '#000']});
$.post('/files/delete_dir', 'path=' + encodeURIComponent(dirName), function(rdata) {
layer.closeAll();
layer.msg(rdata.msg, {
@@ -901,20 +905,20 @@ function deleteDir(dirName){
});
}
//批量删除文件
function AllDeleteFileSub(data,path){
layer.confirm(lan.files.del_all_msg,{title:lan.files.del_all_file,closeBtn:2,icon:3},function(){
layer.msg("<div class='myspeed'>"+lan.public.the+"</div>",{icon:16,time:0,shade: [0.3, '#000']});
function allDeleteFileSub(data,path){
layer.confirm('您确实要把这些文件放入回收站吗?',{title:'批量删除文件',closeBtn:2,icon:3},function(){
layer.msg("<div class='myspeed'>正在处理,请稍候...</div>",{icon:16,time:0,shade: [0.3, '#000']});
setTimeout(function(){getSpeed('.myspeed');},1000);
$.post('files?action=SetBatchData',data,function(rdata){
$.post('files/set_batch_data',data,function(rdata){
layer.closeAll();
getFiles(path);
layer.msg(rdata.msg,{icon:1});
});
},'json');
});
}
//重载文件列表
function ReloadFiles(){
function reloadFiles(){
setInterval(function(){
var path = $("#DirPathPlace input").val();
getFiles(path);
@@ -973,7 +977,7 @@ function downloadFile(action){
//重命名
function ReName(type, fileName) {
function reName(type, fileName) {
if (type == 1) {
var path = $("#DirPathPlace input").val();
var newFileName = encodeURIComponent(path + '/' + $("#newFileName").val());
@@ -982,13 +986,13 @@ function ReName(type, fileName) {
icon: 16,
time: 10000
});
$.post('/files?action=MvFile', 'sfile=' + oldFileName + '&dfile=' + newFileName, function(rdata) {
$.post('/files/mv_file', 'sfile=' + oldFileName + '&dfile=' + newFileName, function(rdata) {
layer.closeAll();
layer.msg(rdata.msg, {
icon: rdata.status ? 1 : 2
});
getFiles(path);
});
},'json');
return;
}
layer.open({
@@ -996,14 +1000,14 @@ function ReName(type, fileName) {
shift: 5,
closeBtn: 2,
area: '320px',
title: lan.files.file_menu_rename,
title: '重命名',
content: '<div class="bt-form pd20 pb70">\
<div class="line">\
<input type="text" class="bt-input-text" name="Name" id="newFileName" value="' + fileName + '" placeholder="'+lan.files.file_name+'" style="width:100%" />\
<input type="text" class="bt-input-text" name="Name" id="newFileName" value="' + fileName + '" placeholder="文件名" style="width:100%" />\
</div>\
<div class="bt-form-submit-btn">\
<button type="button" class="btn btn-danger btn-sm btn-title" onclick="layer.closeAll()">'+lan.public.close+'</button>\
<button type="button" id="ReNameBtn" class="btn btn-success btn-sm btn-title" onclick="ReName(1,\'' + fileName.replace(/'/,"\\'") + '\')">'+lan.public.save+'</button>\
<button type="button" class="btn btn-danger btn-sm btn-title" onclick="layer.closeAll()">关闭</button>\
<button type="button" id="ReNameBtn" class="btn btn-success btn-sm btn-title" onclick="reName(1,\'' + fileName.replace(/'/,"\\'") + '\')">保存</button>\
</div>\
</div>'
});
@@ -1012,36 +1016,41 @@ function ReName(type, fileName) {
});
}
//剪切
function CutFile(fileName) {
function cutFile(fileName) {
var path = $("#DirPathPlace input").val();
setCookie('cutFileName', fileName);
setCookie('copyFileName', null);
layer.msg(lan.files.mv_ok, {
layer.msg('已剪切', {
icon: 1,
time: 1
time: 1000
});
getFiles(path);
setTimeout(function(){
getFiles(path);
},1000);
}
//复制
function CopyFile(fileName) {
function copyFile(fileName) {
var path = $("#DirPathPlace input").val();
setCookie('copyFileName', fileName);
setCookie('cutFileName', null);
layer.msg(lan.files.copy_ok, {
layer.msg('已复制', {
icon: 1,
time: 1
time: 1000
});
getFiles(path);
setTimeout(function(){
getFiles(path);
},1000);
}
//粘贴
function PasteFile(fileName) {
function pasteFile(fileName) {
var path = $("#DirPathPlace input").val();
var copyName = getCookie('copyFileName');
var cutName = getCookie('cutFileName');
var filename = copyName;
if(cutName != 'null' && cutName != undefined) filename=cutName;
filename = filename.split('/').pop();
$.post('/files?action=CheckExistsFiles',{dfile:path,filename:filename},function(result){
$.post('/files/check_exists_files',{dfile:path,filename:filename},function(result){
if(result.length > 0){
var tbody = '';
for(var i=0;i<result.length;i++){
@@ -1050,29 +1059,29 @@ function PasteFile(fileName) {
var mbody = '<div class="divtable"><table class="table table-hover" width="100%" border="0" cellpadding="0" cellspacing="0"><thead><th>文件名</th><th>大小</th><th>最后修改时间</th></thead>\
<tbody>'+tbody+'</tbody>\
</table></div>';
SafeMessage('即将覆盖以下文件',mbody,function(){
PasteTo(path,copyName,cutName,fileName);
safeMessage('即将覆盖以下文件',mbody,function(){
pasteTo(path,copyName,cutName,fileName);
});
}else{
PasteTo(path,copyName,cutName,fileName);
pasteTo(path,copyName,cutName,fileName);
}
});
},'json');
}
function PasteTo(path,copyName,cutName,fileName){
function pasteTo(path,copyName,cutName,fileName){
if (copyName != 'null' && copyName != undefined) {
layer.msg(lan.files.copy_the, {
icon: 16,
time: 0,shade: [0.3, '#000']
});
$.post('/files?action=CopyFile', 'sfile=' + encodeURIComponent(copyName) + '&dfile=' + encodeURIComponent(path +'/'+ fileName), function(rdata) {
$.post('/files/copy_file', 'sfile=' + encodeURIComponent(copyName) + '&dfile=' + encodeURIComponent(path +'/'+ fileName), function(rdata) {
layer.closeAll();
layer.msg(rdata.msg, {
icon: rdata.status ? 1 : 2
});
getFiles(path);
});
},'json');
setCookie('copyFileName', null);
setCookie('cutFileName', null);
return;
@@ -1083,7 +1092,7 @@ function PasteTo(path,copyName,cutName,fileName){
icon: 16,
time: 0,shade: [0.3, '#000']
});
$.post('/files?action=MvFile', 'sfile=' + encodeURIComponent(cutName) + '&dfile=' + encodeURIComponent(path + '/'+fileName), function(rdata) {
$.post('/files/mv_file', 'sfile=' + encodeURIComponent(cutName) + '&dfile=' + encodeURIComponent(path + '/'+fileName), function(rdata) {
layer.closeAll();
layer.msg(rdata.msg, {
icon: rdata.status ? 1 : 2
@@ -1097,7 +1106,7 @@ function PasteTo(path,copyName,cutName,fileName){
//压缩目录
function Zip(dirName,submits) {
function zip(dirName,submits) {
var path = $("#DirPathPlace input").val();
if(submits != undefined){
if(dirName.indexOf(',') == -1){
@@ -1115,7 +1124,7 @@ function Zip(dirName,submits) {
if(rdata == null || rdata == undefined){
layer.msg(lan.files.zip_ok,{icon:1});
getFiles(path)
ReloadFiles();
reloadFiles();
return;
}
layer.msg(rdata.msg, {icon: rdata.status ? 1 : 2});
@@ -1143,7 +1152,7 @@ function Zip(dirName,submits) {
+'</div>'
+'<div class="bt-form-submit-btn">'
+'<button type="button" class="btn btn-danger btn-sm btn-title" onclick="layer.closeAll()">'+lan.public.close+'</button>'
+'<button type="button" id="ReNameBtn" class="btn btn-success btn-sm btn-title" onclick="Zip(\'' + param + '\',1)">'+lan.files.file_menu_zip+'</button>'
+'<button type="button" id="ReNameBtn" class="btn btn-success btn-sm btn-title" onclick="zip(\'' + param + '\',1)">'+lan.files.file_menu_zip+'</button>'
+'</div>'
+'</div>'
});
@@ -1295,55 +1304,55 @@ function setChmod(action,fileName){
var chmod = $("#access").val();
var chown = $("#chown").val();
var data = 'filename='+ encodeURIComponent(fileName)+'&user='+chown+'&access='+chmod;
var loadT = layer.msg(lan.public.config,{icon:16,time:0,shade: [0.3, '#000']});
$.post('files?action=SetFileAccess',data,function(rdata){
var loadT = layer.msg('正在设置...',{icon:16,time:0,shade: [0.3, '#000']});
$.post('files/set_file_access',data,function(rdata){
layer.close(loadT);
if(rdata.status) layer.closeAll();
layer.msg(rdata.msg,{icon:rdata.status?1:2});
var path = $("#DirPathPlace input").val();
getFiles(path)
});
},'json');
return;
}
var toExec = fileName == lan.files.all?'Batch(3,1)':'setChmod(1,\''+fileName+'\')';
var toExec = fileName == lan.files.all?'batch(3,1)':'setChmod(1,\''+fileName+'\')';
$.post('/files/file_access','filename='+encodeURIComponent(fileName),function(rdata){
console.log(rdata);
// console.log(rdata);
layer.open({
type:1,
closeBtn: 2,
title: lan.files.set_auth + '['+fileName+']',
title: '设置权限['+fileName+']',
area: '400px',
shadeClose:false,
content:'<div class="setchmod bt-form ptb15 pb70">\
<fieldset>\
<legend>'+lan.files.file_own+'</legend>\
<p><input type="checkbox" id="owner_r" />'+lan.files.file_read+'</p>\
<p><input type="checkbox" id="owner_w" />'+lan.files.file_write+'</p>\
<p><input type="checkbox" id="owner_x" />'+lan.files.file_exec+'</p>\
<legend>所有者</legend>\
<p><input type="checkbox" id="owner_r" />读取</p>\
<p><input type="checkbox" id="owner_w" />写入</p>\
<p><input type="checkbox" id="owner_x" />执行</p>\
</fieldset>\
<fieldset>\
<legend>'+lan.files.file_group+'</legend>\
<p><input type="checkbox" id="group_r" />'+lan.files.file_read+'</p>\
<p><input type="checkbox" id="group_w" />'+lan.files.file_write+'</p>\
<p><input type="checkbox" id="group_x" />'+lan.files.file_exec+'</p>\
<legend>用户组</legend>\
<p><input type="checkbox" id="group_r" />读取</p>\
<p><input type="checkbox" id="group_w" />写入</p>\
<p><input type="checkbox" id="group_x" />执行</p>\
</fieldset>\
<fieldset>\
<legend>'+lan.files.file_public+'</legend>\
<p><input type="checkbox" id="public_r" />'+lan.files.file_read+'</p>\
<p><input type="checkbox" id="public_w" />'+lan.files.file_write+'</p>\
<p><input type="checkbox" id="public_x" />'+lan.files.file_exec+'</p>\
<legend>公共</legend>\
<p><input type="checkbox" id="public_r" />读取</p>\
<p><input type="checkbox" id="public_w" />写入</p>\
<p><input type="checkbox" id="public_x" />执行</p>\
</fieldset>\
<div class="setchmodnum"><input class="bt-input-text" type="text" id="access" maxlength="3" value="'+rdata.chmod+'">'+lan.files.file_menu_auth+',\
<span>'+lan.files.file_own+'\
<div class="setchmodnum"><input class="bt-input-text" type="text" id="access" maxlength="3" value="'+rdata.chmod+'">权限,\
<span>所有者\
<select id="chown" class="bt-input-text">\
<option value="www" '+(rdata.chown=='www'?'selected="selected"':'')+'>www</option>\
<option value="mysql" '+(rdata.chown=='mysql'?'selected="selected"':'')+'>mysql</option>\
<option value="root" '+(rdata.chown=='root'?'selected="selected"':'')+'>root</option>\
</select></span></div>\
<div class="bt-form-submit-btn">\
<button type="button" class="btn btn-danger btn-sm btn-title" onclick="layer.closeAll()">'+lan.public.close+'</button>\
<button type="button" class="btn btn-success btn-sm btn-title" onclick="'+toExec+'" >'+lan.public.ok+'</button>\
<button type="button" class="btn btn-danger btn-sm btn-title" onclick="layer.closeAll()">关闭</button>\
<button type="button" class="btn btn-success btn-sm btn-title" onclick="'+toExec+'" >确定</button>\
</div>\
</div>'
});
@@ -1415,11 +1424,11 @@ function onAccess(){
function RClick(type,path,name){
var displayZip = isZip(type);
var options = {items:[
{text: lan.files.file_menu_copy, onclick: function() {CopyFile(path)}},
{text: lan.files.file_menu_mv, onclick: function() {CutFile(path)}},
{text: lan.files.file_menu_rename, onclick: function() {ReName(0,name)}},
{text: lan.files.file_menu_copy, onclick: function() {copyFile(path)}},
{text: lan.files.file_menu_mv, onclick: function() {cutFile(path)}},
{text: lan.files.file_menu_rename, onclick: function() {reName(0,name)}},
{text: lan.files.file_menu_auth, onclick: function() {setChmod(0,path)}},
{text: lan.files.file_menu_zip, onclick: function() {Zip(path)}}
{text: lan.files.file_menu_zip, onclick: function() {zip(path)}}
]};
if(type == "dir"){
+17 -13
View File
@@ -1773,9 +1773,13 @@ function pluginConfigSave(fileName) {
}
function pluginInitD(_name){
function pluginInitD(_name,_version){
if (typeof _version == 'undefined'){
_version = '';
}
var loadT = layer.msg('正在获取...', { icon: 16, time: 0, shade: 0.3 });
$.post('/plugins/run', {name:_name, func:'initd_status'}, function(data) {
$.post('/plugins/run', {name:_name, func:'initd_status',version : _version}, function(data) {
layer.close(loadT);
if( !data.status ){
layer.msg(data.msg,{icon:0,time:3000,shade: [0.3, '#000']});
@@ -1786,41 +1790,41 @@ function pluginInitD(_name){
return;
}
if (data.data == 'ok'){
pluginSetInitD(_name, true);
pluginSetInitD(_name, _version, true);
} else {
pluginSetInitD(_name, false);
pluginSetInitD(_name, _version, false);
}
},'json');
}
function pluginSetInitD(_name, status){
function pluginSetInitD(_name, _version, status){
var serviceCon ='<p class="status">当前状态:<span>'+(status ? '已加载' : '未加载' )+
'</span><span style="color: '+
(status?'#20a53a;':'red;')+
' margin-left: 3px;" class="glyphicon ' + (status?'glyphicon glyphicon-play':'glyphicon-pause')+'"></span></p><div class="sfm-opt">\
<button class="btn btn-default btn-sm" onclick="pluginOpInitD(\''+_name+'\',\''+(status?'initd_uninstall':'initd_install')+'\')">'+(status?'卸载':'加载')+'</button>\
<button class="btn btn-default btn-sm" onclick="pluginOpInitD(\''+_name+'\',\''+_version+'\',\''+(status?'initd_uninstall':'initd_install')+'\')">'+(status?'卸载':'加载')+'</button>\
</div>';
$(".soft-man-con").html(serviceCon);
}
function pluginOpInitD(a, b) {
var c = "name=" + a + "&func=" + b;
function pluginOpInitD(a, _version, b) {
var c = "name=" + a + "&func=" + b + "&version="+_version;
var d = "";
switch(b) {
case "initd_install":d = '加载';break;
case "initd_uninstall":d = '卸载';break;
}
layer.confirm( msgTpl('您真的要{1}{2}服务吗?', [d,a]), {icon:3,closeBtn: 2}, function() {
var e = layer.msg(msgTpl('正在{1}{2}服务,请稍候...',[d,a]), {icon: 16,time: 0});
layer.confirm( msgTpl('您真的要{1}{2}{3}服务吗?', [d,a,_version]), {icon:3,closeBtn: 2}, function() {
var e = layer.msg(msgTpl('正在{1}{2}{3}服务,请稍候...',[d,a,_version]), {icon: 16,time: 0});
$.post("/plugins/run", c, function(g) {
layer.close(e);
var f = g.data == 'ok' ? msgTpl('{1}服务已{2}',[a,d]) : msgTpl('{1}服务{2}失败!',[a,d]);
var f = g.data == 'ok' ? msgTpl('{1}{3}服务已{2}',[a,d,_version]) : msgTpl('{1}{3}服务{2}失败!',[a,d,_version]);
layer.msg(f, {icon: g.data == 'ok' ? 1 : 2});
if ( b == 'initd_install' && g.data == 'ok' ) {
pluginSetInitD(a, true);
pluginSetInitD(a, _version, true);
}else{
pluginSetInitD(a, false);
pluginSetInitD(a, _version, false);
}
if(g.data != 'ok') {
layer.msg(g.data, {icon: 2,time: 0,shade: 0.3,shadeClose: true});
File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 106 KiB

After

Width:  |  Height:  |  Size: 99 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 780 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 645 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 758 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 874 B

After

Width:  |  Height:  |  Size: 503 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 683 B

After

Width:  |  Height:  |  Size: 359 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.9 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.9 KiB

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.2 KiB

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.4 KiB

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.4 KiB

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 203 B

After

Width:  |  Height:  |  Size: 105 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.9 KiB

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.9 KiB

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 672 B

After

Width:  |  Height:  |  Size: 396 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 53 KiB

After

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 53 KiB

After

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 53 KiB

After

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.7 KiB

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 212 B

After

Width:  |  Height:  |  Size: 110 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 166 B

After

Width:  |  Height:  |  Size: 95 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 586 B

After

Width:  |  Height:  |  Size: 414 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 420 B

After

Width:  |  Height:  |  Size: 260 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 424 B

After

Width:  |  Height:  |  Size: 246 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 449 B

After

Width:  |  Height:  |  Size: 281 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 476 B

After

Width:  |  Height:  |  Size: 243 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 705 B

After

Width:  |  Height:  |  Size: 585 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 1010 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 973 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 1.0 KiB

Some files were not shown because too many files have changed in this diff Show More