Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
83cf0c2604 | ||
|
|
7999108b91 | ||
|
|
b80de25598 | ||
|
|
7c25ae0ec2 | ||
|
|
84e9c4a484 | ||
|
|
5178e11e44 | ||
|
|
0e7c2769c8 | ||
|
|
6651a706b7 | ||
|
|
a81f922592 | ||
|
|
2b87887054 | ||
|
|
7859bfb451 | ||
|
|
35369f8f41 | ||
|
|
a47166d547 | ||
|
|
457a69b34a | ||
|
|
881f571902 | ||
|
|
d889c3305f | ||
|
|
cb793d5f3f | ||
|
|
b4882aa0fc | ||
|
|
ef3b5b2a6c | ||
|
|
d4501b736b | ||
|
|
261e24390f | ||
|
|
10abbd7efd | ||
|
|
e2196735d9 | ||
|
|
dbbc243359 | ||
|
|
94bb8e31cf | ||
|
|
282bcccf39 | ||
|
|
886f6c2369 | ||
|
|
ab822f0572 | ||
|
|
4ec2355182 | ||
|
|
a4237ca213 | ||
|
|
4615b70c60 | ||
|
|
97b9d12769 | ||
|
|
35a7c2d96f | ||
|
|
11ea1e2e1f | ||
|
|
1860dda320 | ||
|
|
5610b1b1da |
@@ -120,3 +120,5 @@ data/admin_path.pl
|
|||||||
data/close.pl
|
data/close.pl
|
||||||
ssl/input.pl
|
ssl/input.pl
|
||||||
data/datadir.pl
|
data/datadir.pl
|
||||||
|
data/502Task.pl
|
||||||
|
plugins/qbittorrent/
|
||||||
|
|||||||
@@ -13,5 +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
|
curl -fsSL https://raw.githubusercontent.com/midoks/mdserver-web/master/scripts/update.sh | sh
|
||||||
```
|
```
|
||||||
|
|
||||||
### wiki
|
### 无图不真相
|
||||||
|
[](/route/static/mdw.jpg)
|
||||||
|
|
||||||
|
### wiki
|
||||||
|
[了解更多...](https://github.com/midoks/mdserver-web/wiki)
|
||||||
|
|
||||||
|
|||||||
@@ -16,16 +16,8 @@ from flask import request
|
|||||||
class config_api:
|
class config_api:
|
||||||
|
|
||||||
# 本版解决自启动问题
|
# 本版解决自启动问题
|
||||||
# openresty 自启动 done
|
# 文件管理重命名
|
||||||
# php 自启动 done
|
__version = '0.7.3'
|
||||||
# mysql 自启动 done
|
|
||||||
# memcached 自启动 done
|
|
||||||
# redis 自启动 done
|
|
||||||
# pureftp 自启动 done
|
|
||||||
# sphinx 自启动 done
|
|
||||||
# 修复rsync自启动问题
|
|
||||||
__version = '0.5.6'
|
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ import shutil
|
|||||||
from flask import request
|
from flask import request
|
||||||
from flask import send_file, send_from_directory
|
from flask import send_file, send_from_directory
|
||||||
from flask import make_response
|
from flask import make_response
|
||||||
|
from flask import session
|
||||||
|
|
||||||
|
|
||||||
class files_api:
|
class files_api:
|
||||||
@@ -51,7 +52,7 @@ class files_api:
|
|||||||
if not os.path.exists(filename):
|
if not os.path.exists(filename):
|
||||||
return ''
|
return ''
|
||||||
response = make_response(send_from_directory(
|
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
|
return response
|
||||||
|
|
||||||
def zipApi(self):
|
def zipApi(self):
|
||||||
@@ -61,6 +62,27 @@ class files_api:
|
|||||||
path = request.form.get('path', '').encode('utf-8')
|
path = request.form.get('path', '').encode('utf-8')
|
||||||
return self.zip(sfile, dfile, stype, path)
|
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):
|
def deleteApi(self):
|
||||||
path = request.form.get('path', '').encode('utf-8')
|
path = request.form.get('path', '').encode('utf-8')
|
||||||
return self.delete(path)
|
return self.delete(path)
|
||||||
@@ -70,6 +92,32 @@ class files_api:
|
|||||||
data = self.getAccess(filename)
|
data = self.getAccess(filename)
|
||||||
return public.getJson(data)
|
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):
|
def getDirSizeApi(self):
|
||||||
path = request.form.get('path', '').encode('utf-8')
|
path = request.form.get('path', '').encode('utf-8')
|
||||||
tmp = self.getDirSize(path)
|
tmp = self.getDirSize(path)
|
||||||
@@ -82,6 +130,10 @@ class files_api:
|
|||||||
search = request.args.get('search', '').strip().lower()
|
search = request.args.get('search', '').strip().lower()
|
||||||
page = request.args.get('p', '1').strip().lower()
|
page = request.args.get('p', '1').strip().lower()
|
||||||
row = request.args.get('showRow', '10')
|
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)
|
return self.getDir(path, int(page), int(row), search)
|
||||||
|
|
||||||
def createFileApi(self):
|
def createFileApi(self):
|
||||||
@@ -325,8 +377,189 @@ done
|
|||||||
tmp = self.getDirSize(logPath)
|
tmp = self.getDirSize(logPath)
|
||||||
return public.returnJson(True, tmp[0].split()[0])
|
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 ----- ###
|
##### ----- 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):
|
def checkDir(self, path):
|
||||||
path = path.replace('//', '/')
|
path = path.replace('//', '/')
|
||||||
|
|||||||
@@ -289,6 +289,7 @@ class firewall_api:
|
|||||||
return
|
return
|
||||||
if self.__isFirewalld:
|
if self.__isFirewalld:
|
||||||
public.execShell('systemctl stop firewalld.service')
|
public.execShell('systemctl stop firewalld.service')
|
||||||
|
public.execShell('systemctl disabled firewalld.service')
|
||||||
elif self.__isMac:
|
elif self.__isMac:
|
||||||
pass
|
pass
|
||||||
else:
|
else:
|
||||||
@@ -300,6 +301,7 @@ class firewall_api:
|
|||||||
return
|
return
|
||||||
if self.__isFirewalld:
|
if self.__isFirewalld:
|
||||||
public.execShell('systemctl start firewalld.service')
|
public.execShell('systemctl start firewalld.service')
|
||||||
|
public.execShell('systemctl enable firewalld.service')
|
||||||
elif self.__isMac:
|
elif self.__isMac:
|
||||||
pass
|
pass
|
||||||
else:
|
else:
|
||||||
|
|||||||
@@ -101,7 +101,7 @@ class plugins_api:
|
|||||||
# print infoJsonPos
|
# print infoJsonPos
|
||||||
|
|
||||||
if not os.path.exists(infoJsonPos):
|
if not os.path.exists(infoJsonPos):
|
||||||
return public.retJson(False, '配置文件不存在!', ())
|
return public.returnJson(False, '配置文件不存在!', ())
|
||||||
|
|
||||||
pluginInfo = json.loads(public.readFile(infoJsonPos))
|
pluginInfo = json.loads(public.readFile(infoJsonPos))
|
||||||
|
|
||||||
@@ -128,7 +128,7 @@ class plugins_api:
|
|||||||
infoJsonPos = self.__plugin_dir + '/' + name + '/' + 'info.json'
|
infoJsonPos = self.__plugin_dir + '/' + name + '/' + 'info.json'
|
||||||
|
|
||||||
if not os.path.exists(infoJsonPos):
|
if not os.path.exists(infoJsonPos):
|
||||||
return public.retJson(False, "配置文件不存在!", ())
|
return public.returnJson(False, "配置文件不存在!", ())
|
||||||
|
|
||||||
pluginInfo = json.loads(public.readFile(infoJsonPos))
|
pluginInfo = json.loads(public.readFile(infoJsonPos))
|
||||||
|
|
||||||
@@ -156,7 +156,7 @@ class plugins_api:
|
|||||||
infoJsonPos = self.__plugin_dir + '/' + name + '/' + 'info.json'
|
infoJsonPos = self.__plugin_dir + '/' + name + '/' + 'info.json'
|
||||||
|
|
||||||
if not os.path.exists(infoJsonPos):
|
if not os.path.exists(infoJsonPos):
|
||||||
return public.retJson(False, "配置文件不存在!", ())
|
return public.returnJson(False, "配置文件不存在!", ())
|
||||||
|
|
||||||
pluginInfo = json.loads(public.readFile(infoJsonPos))
|
pluginInfo = json.loads(public.readFile(infoJsonPos))
|
||||||
|
|
||||||
@@ -167,7 +167,7 @@ class plugins_api:
|
|||||||
data = public.execShell(execstr)
|
data = public.execShell(execstr)
|
||||||
if public.isAppleSystem():
|
if public.isAppleSystem():
|
||||||
print execstr
|
print execstr
|
||||||
print data[0],data[1]
|
print data[0], data[1]
|
||||||
return public.returnJson(True, '卸载执行成功!')
|
return public.returnJson(True, '卸载执行成功!')
|
||||||
# if data[1] == '':
|
# if data[1] == '':
|
||||||
# return public.returnJson(True, '已将卸载成功!')
|
# return public.returnJson(True, '已将卸载成功!')
|
||||||
|
|||||||
@@ -429,7 +429,7 @@ def writeSpeed(title, used, total, speed=0):
|
|||||||
|
|
||||||
def getSpeed():
|
def getSpeed():
|
||||||
# 取进度
|
# 取进度
|
||||||
path = public.getRootDir()
|
path = getRootDir()
|
||||||
data = readFile(path + '/tmp/panelSpeed.pl')
|
data = readFile(path + '/tmp/panelSpeed.pl')
|
||||||
if not data:
|
if not data:
|
||||||
data = json.dumps({'title': None, 'progress': 0,
|
data = json.dumps({'title': None, 'progress': 0,
|
||||||
|
|||||||
@@ -602,11 +602,17 @@ class system_api:
|
|||||||
|
|
||||||
old_list = old.split('.')
|
old_list = old.split('.')
|
||||||
ret = 'none'
|
ret = 'none'
|
||||||
for i in range(len(old_list)):
|
|
||||||
tm_new = int(new_list[i])
|
# t = [0] * 3
|
||||||
tm_old = int(old_list[i])
|
isHasNew = True
|
||||||
if tm_new > tm_old:
|
for i in range(3):
|
||||||
return 'new'
|
if int(new_list[i]) > int(old_list[i]):
|
||||||
|
pass
|
||||||
|
else:
|
||||||
|
isHasNew = False
|
||||||
|
|
||||||
|
if isHasNew:
|
||||||
|
return 'new'
|
||||||
return ret
|
return ret
|
||||||
|
|
||||||
def getServerInfo(self):
|
def getServerInfo(self):
|
||||||
@@ -633,6 +639,7 @@ class system_api:
|
|||||||
|
|
||||||
diff = self.versionDiff(
|
diff = self.versionDiff(
|
||||||
version_now, version_new_info['version'])
|
version_now, version_new_info['version'])
|
||||||
|
print diff
|
||||||
if diff == 'new':
|
if diff == 'new':
|
||||||
return public.returnJson(True, '有新版本!', version_new_info['version'])
|
return public.returnJson(True, '有新版本!', version_new_info['version'])
|
||||||
elif diff == 'test':
|
elif diff == 'test':
|
||||||
|
|||||||
|
After Width: | Height: | Size: 498 B |
@@ -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>
|
||||||
@@ -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()
|
||||||
@@ -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"
|
||||||
|
}
|
||||||
@@ -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
|
||||||
@@ -35,9 +35,9 @@ USE_PLAIN_TEXT = true
|
|||||||
[service]
|
[service]
|
||||||
REGISTER_EMAIL_CONFIRM = false
|
REGISTER_EMAIL_CONFIRM = false
|
||||||
ENABLE_NOTIFY_MAIL = false
|
ENABLE_NOTIFY_MAIL = false
|
||||||
DISABLE_REGISTRATION = false
|
DISABLE_REGISTRATION = true
|
||||||
ENABLE_CAPTCHA = true
|
ENABLE_CAPTCHA = true
|
||||||
REQUIRE_SIGNIN_VIEW = false
|
REQUIRE_SIGNIN_VIEW = true
|
||||||
|
|
||||||
[picture]
|
[picture]
|
||||||
DISABLE_GRAVATAR = false
|
DISABLE_GRAVATAR = false
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 1.7 KiB |
@@ -505,7 +505,7 @@ def projectScriptEdit():
|
|||||||
user = args['user']
|
user = args['user']
|
||||||
name = args['name'] + '.git'
|
name = args['name'] + '.git'
|
||||||
post_receive = getRootPath() + '/' + user + '/' + name + \
|
post_receive = getRootPath() + '/' + user + '/' + name + \
|
||||||
'/custom_hooks/post-receive'
|
'/custom_hooks/commit'
|
||||||
if os.path.exists(post_receive):
|
if os.path.exists(post_receive):
|
||||||
return public.returnJson(True, 'OK', {'path': post_receive})
|
return public.returnJson(True, 'OK', {'path': post_receive})
|
||||||
else:
|
else:
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
"ps": "Gogs是一款极易搭建的自助Git服务",
|
"ps": "Gogs是一款极易搭建的自助Git服务",
|
||||||
"name": "gogs",
|
"name": "gogs",
|
||||||
"title": "Gogs",
|
"title": "Gogs",
|
||||||
"versions": ["0.11.86","0.11.79"],
|
"versions": ["0.11.86"],
|
||||||
"tip": "soft",
|
"tip": "soft",
|
||||||
"checks": "server/gogs",
|
"checks": "server/gogs",
|
||||||
"author": "midoks",
|
"author": "midoks",
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 515 B After Width: | Height: | Size: 388 B |
|
Before Width: | Height: | Size: 501 B After Width: | Height: | Size: 344 B |
|
Before Width: | Height: | Size: 786 B After Width: | Height: | Size: 785 B |
@@ -113,7 +113,8 @@ def contentReplace(content, version):
|
|||||||
|
|
||||||
def makeOpenrestyConf():
|
def makeOpenrestyConf():
|
||||||
if public.isInstalledWeb():
|
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):
|
if not os.path.exists(d_pathinfo):
|
||||||
s_pathinfo = getPluginDir() + '/conf/pathinfo.conf'
|
s_pathinfo = getPluginDir() + '/conf/pathinfo.conf'
|
||||||
shutil.copyfile(s_pathinfo, d_pathinfo)
|
shutil.copyfile(s_pathinfo, d_pathinfo)
|
||||||
@@ -125,12 +126,21 @@ def makeOpenrestyConf():
|
|||||||
tpl = getPluginDir() + '/conf/enable-php.conf'
|
tpl = getPluginDir() + '/conf/enable-php.conf'
|
||||||
tpl_content = public.readFile(tpl)
|
tpl_content = public.readFile(tpl)
|
||||||
for x in range(len(versions)):
|
for x in range(len(versions)):
|
||||||
desc_file = public.getServerDir() + '/openresty/nginx/conf/enable-php-' + \
|
dfile = sdir + '/openresty/nginx/conf/enable-php-' + versions[x] + '.conf'
|
||||||
versions[x] + '.conf'
|
if not os.path.exists(dfile):
|
||||||
if not os.path.exists(desc_file):
|
|
||||||
w_content = contentReplace(tpl_content, versions[x])
|
w_content = contentReplace(tpl_content, versions[x])
|
||||||
public.writeFile(desc_file, w_content)
|
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):
|
def phpFpmReplace(version):
|
||||||
desc_php_fpm = getServerDir() + '/' + version + '/etc/php-fpm.conf'
|
desc_php_fpm = getServerDir() + '/' + version + '/etc/php-fpm.conf'
|
||||||
@@ -384,16 +394,8 @@ def setMaxSize(version):
|
|||||||
conf = re.sub(rep, u'\npost_max_size = ' + max + 'M', conf)
|
conf = re.sub(rep, u'\npost_max_size = ' + max + 'M', conf)
|
||||||
public.writeFile(path, conf)
|
public.writeFile(path, conf)
|
||||||
|
|
||||||
# if public.get_webserver() == 'nginx':
|
msg = public.getInfo('设置PHP-{1}最大上传大小为[{2}MB]!',(version, max,))
|
||||||
# path = web.ctx.session.setupPath + '/nginx/conf/nginx.conf'
|
public.writeLog('插件管理[PHP]', msg)
|
||||||
# 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))
|
|
||||||
return public.returnJson(True, '设置成功!')
|
return public.returnJson(True, '设置成功!')
|
||||||
|
|
||||||
|
|
||||||
@@ -458,20 +460,22 @@ def setFpmConfig(version):
|
|||||||
|
|
||||||
public.writeFile(file, conf)
|
public.writeFile(file, conf)
|
||||||
reload(version)
|
reload(version)
|
||||||
public.writeLog("TYPE_PHP", 'PHP_CHILDREN', (version, max_children,
|
|
||||||
start_servers, min_spare_servers, max_spare_servers))
|
msg = public.getInfo('设置PHP-{1}并发设置,max_children={2},start_servers={3},min_spare_servers={4},max_spare_servers={5}',(version, max_children,
|
||||||
return public.returnJson(True, '设置成功')
|
start_servers, min_spare_servers, max_spare_servers,))
|
||||||
|
public.writeLog('插件管理[PHP]', msg)
|
||||||
|
return public.returnJson(True, '设置成功!')
|
||||||
|
|
||||||
|
|
||||||
def checkFpmStatusFile(version):
|
def checkFpmStatusFile(version):
|
||||||
if public.isInstalledWeb():
|
if public.isInstalledWeb():
|
||||||
desc_file = public.getServerDir(
|
sdir = public.getServerDir()
|
||||||
) + '/openresty/nginx/conf/php_status/phpfpm_status_' + version + '.conf'
|
dfile = sdir + '/openresty/nginx/conf/php_status/phpfpm_status_' + version + '.conf'
|
||||||
if not os.path.exists(desc_file):
|
if not os.path.exists(dfile):
|
||||||
tpl = getPluginDir() + '/conf/phpfpm_status.conf'
|
tpl = getPluginDir() + '/conf/phpfpm_status.conf'
|
||||||
content = public.readFile(tpl)
|
content = public.readFile(tpl)
|
||||||
content = contentReplace(content, version)
|
content = contentReplace(content, version)
|
||||||
public.writeFile(desc_file, content)
|
public.writeFile(dfile, content)
|
||||||
public.restartWeb()
|
public.restartWeb()
|
||||||
|
|
||||||
|
|
||||||
@@ -508,10 +512,10 @@ def setDisableFunc(version):
|
|||||||
|
|
||||||
phpini = public.readFile(filename)
|
phpini = public.readFile(filename)
|
||||||
rep = "disable_functions\s*=\s*.*\n"
|
rep = "disable_functions\s*=\s*.*\n"
|
||||||
phpini = re.sub(rep, 'disable_functions = ' +
|
phpini = re.sub(rep, 'disable_functions = ' +disable_functions + "\n", phpini)
|
||||||
disable_functions + "\n", phpini)
|
|
||||||
public.writeLog('TYPE_PHP', 'PHP_DISABLE_FUNCTION',
|
msg = public.getInfo('修改PHP-{1}的禁用函数为[{2}]',(version, disable_functions,))
|
||||||
(version, disable_functions))
|
public.writeLog('插件管理[PHP]', msg)
|
||||||
public.writeFile(filename, phpini)
|
public.writeFile(filename, phpini)
|
||||||
reload(version)
|
reload(version)
|
||||||
return public.returnJson(True, '设置成功!')
|
return public.returnJson(True, '设置成功!')
|
||||||
@@ -519,13 +523,13 @@ def setDisableFunc(version):
|
|||||||
|
|
||||||
def checkPhpinfoFile(v):
|
def checkPhpinfoFile(v):
|
||||||
if public.isInstalledWeb():
|
if public.isInstalledWeb():
|
||||||
desc_file = public.getServerDir(
|
sdir = public.getServerDir()
|
||||||
) + '/openresty/nginx/conf/php_status/phpinfo_' + v + '.conf'
|
dfile = sdir + '/openresty/nginx/conf/php_status/phpinfo_' + v + '.conf'
|
||||||
if not os.path.exists(desc_file):
|
if not os.path.exists(dfile):
|
||||||
tpl = getPluginDir() + '/conf/phpinfo.conf'
|
tpl = getPluginDir() + '/conf/phpinfo.conf'
|
||||||
content = public.readFile(tpl)
|
content = public.readFile(tpl)
|
||||||
content = contentReplace(content, v)
|
content = contentReplace(content, v)
|
||||||
public.writeFile(desc_file, content)
|
public.writeFile(dfile, content)
|
||||||
public.restartWeb()
|
public.restartWeb()
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
|
After Width: | Height: | Size: 900 B |
@@ -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>
|
||||||
@@ -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"
|
||||||
@@ -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"
|
||||||
|
}
|
||||||
@@ -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
|
||||||
|
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 2.0 KiB |
@@ -4,8 +4,9 @@
|
|||||||
"name":"phpmyadmin",
|
"name":"phpmyadmin",
|
||||||
"type":"运行环境",
|
"type":"运行环境",
|
||||||
"ps":"著名Web端MySQL管理工具",
|
"ps":"著名Web端MySQL管理工具",
|
||||||
"versions":["4.4.15","4.8.4"],
|
"to_ver":["4.8.4"],
|
||||||
"updates":["4.4.15","4.8.4"],
|
"versions":["4.4.15"],
|
||||||
|
"updates":["4.4.15"],
|
||||||
"shell":"install.sh",
|
"shell":"install.sh",
|
||||||
"checks":"server/phpmyadmin",
|
"checks":"server/phpmyadmin",
|
||||||
"author":"phpMyAdmin",
|
"author":"phpMyAdmin",
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 1017 B After Width: | Height: | Size: 870 B |
|
Before Width: | Height: | Size: 44 KiB After Width: | Height: | Size: 1.6 KiB |
|
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
|
Before Width: | Height: | Size: 3.6 KiB After Width: | Height: | Size: 664 B |
@@ -114,8 +114,12 @@ def mkdirAll():
|
|||||||
rep = 'path\s*=\s*(.*)'
|
rep = 'path\s*=\s*(.*)'
|
||||||
p = re.compile(rep)
|
p = re.compile(rep)
|
||||||
tmp = p.findall(content)
|
tmp = p.findall(content)
|
||||||
|
|
||||||
for x in tmp:
|
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():
|
def initDreplace():
|
||||||
@@ -146,8 +150,31 @@ def initDreplace():
|
|||||||
return file_bin
|
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():
|
def start():
|
||||||
file = initDreplace()
|
file = initDreplace()
|
||||||
|
|
||||||
|
data = sphinxConfParse()
|
||||||
|
if 'index' in data :
|
||||||
|
if checkIndexSph():
|
||||||
|
rebuild()
|
||||||
|
time.sleep(5)
|
||||||
|
else:
|
||||||
|
return '配置不正确!'
|
||||||
|
|
||||||
data = public.execShell(file + ' start')
|
data = public.execShell(file + ' start')
|
||||||
if data[1] == '':
|
if data[1] == '':
|
||||||
return 'ok'
|
return 'ok'
|
||||||
@@ -264,15 +291,15 @@ def runStatus():
|
|||||||
return public.returnJson(True, 'ok', rData)
|
return public.returnJson(True, 'ok', rData)
|
||||||
|
|
||||||
|
|
||||||
def sphinxCmd():
|
def sphinxConfParse():
|
||||||
file = getConf()
|
file = getConf()
|
||||||
bin_dir = getServerDir()
|
bin_dir = getServerDir()
|
||||||
content = public.readFile(file)
|
content = public.readFile(file)
|
||||||
rep = 'index\s(.*)'
|
rep = 'index\s(.*)'
|
||||||
sindex = re.findall(rep, content)
|
sindex = re.findall(rep, content)
|
||||||
indexlen = len(sindex)
|
indexlen = len(sindex)
|
||||||
|
cmd = {}
|
||||||
if indexlen > 0:
|
if indexlen > 0:
|
||||||
cmd = {}
|
|
||||||
cmd_index = []
|
cmd_index = []
|
||||||
cmd_delta = []
|
cmd_delta = []
|
||||||
for x in range(indexlen):
|
for x in range(indexlen):
|
||||||
@@ -284,8 +311,12 @@ def sphinxCmd():
|
|||||||
cmd['index'] = cmd_index
|
cmd['index'] = cmd_index
|
||||||
cmd['delta'] = cmd_delta
|
cmd['delta'] = cmd_delta
|
||||||
cmd['cmd'] = bin_dir + '/bin/bin/indexer -c ' + bin_dir + '/sphinx.conf'
|
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:
|
else:
|
||||||
return public.returnJson(False, 'no index')
|
return public.returnJson(False, 'no index')
|
||||||
|
|
||||||
|
|||||||
@@ -103,27 +103,30 @@ function runStatus(){
|
|||||||
|
|
||||||
function readme(){
|
function readme(){
|
||||||
spPost('sphinx_cmd', '', function(data){
|
spPost('sphinx_cmd', '', function(data){
|
||||||
|
|
||||||
var rdata = $.parseJSON(data.data);
|
var rdata = $.parseJSON(data.data);
|
||||||
if (!rdata['status']){
|
if (!rdata['status']){
|
||||||
layer.msg(rdata['msg'],{icon:2,time:2000,shade: [0.3, '#000']});
|
layer.msg(rdata['msg'],{icon:2,time:2000,shade: [0.3, '#000']});
|
||||||
return;
|
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++) {
|
for (var i = 0; i < rdata['data']['index'].length; i++) {
|
||||||
var index_t = rdata['data']['index'][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++) {
|
for (var i = 0; i < rdata['data']['delta'].length; i++) {
|
||||||
var delta_t = rdata['data']['delta'][i];
|
var delta_t = rdata['data']['delta'][i];
|
||||||
var list = delta_t.split(':');
|
var list = delta_t.split(':');
|
||||||
console.log(list);
|
console.log(list);
|
||||||
con += '<p>增量索引:' + rdata['data']['cmd'] + ' '+ list[0] +' --rotate </p>';
|
con += '<li>增量索引:' + rdata['data']['cmd'] + ' '+ list[0] +' --rotate</li>';
|
||||||
con += '<p>合并索引:' + rdata['data']['cmd'] + ' --merge '+ list[1] + ' ' + list[0] +' --rotate </p>';
|
con += '<li>合并索引:' + rdata['data']['cmd'] + ' --merge '+ list[1] + ' ' + list[0] +' --rotate</li>';
|
||||||
}
|
}
|
||||||
|
con += '</ul>';
|
||||||
|
|
||||||
$(".soft-man-con").html(con);
|
$(".soft-man-con").html(con);
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ source search_hash
|
|||||||
index search_hash
|
index search_hash
|
||||||
{
|
{
|
||||||
source = search_hash
|
source = search_hash
|
||||||
path = {$SERVER_APP}/index/db/search_hash
|
path = {$SERVER_APP}/index/db/search_hash/index
|
||||||
|
|
||||||
ngram_len = 1
|
ngram_len = 1
|
||||||
ngram_chars = U+3000..U+2FA1F
|
ngram_chars = U+3000..U+2FA1F
|
||||||
|
|||||||
@@ -65,7 +65,7 @@ source search_hash_delta : search_hash
|
|||||||
index search_hash
|
index search_hash
|
||||||
{
|
{
|
||||||
source = search_hash
|
source = search_hash
|
||||||
path = {$SERVER_APP}/index/db/search_hash
|
path = {$SERVER_APP}/index/db/search_hash/index
|
||||||
|
|
||||||
ngram_len = 1
|
ngram_len = 1
|
||||||
ngram_chars = U+3000..U+2FA1F
|
ngram_chars = U+3000..U+2FA1F
|
||||||
@@ -75,7 +75,7 @@ index search_hash
|
|||||||
index search_hash_delta : search_hash
|
index search_hash_delta : search_hash
|
||||||
{
|
{
|
||||||
source = search_hash_delta
|
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_len = 1
|
||||||
ngram_chars = U+3000..U+2FA1F
|
ngram_chars = U+3000..U+2FA1F
|
||||||
|
|||||||
@@ -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
|
||||||
|
}
|
||||||
|
Before Width: | Height: | Size: 659 B After Width: | Height: | Size: 504 B |
@@ -177,8 +177,8 @@ def doLogin():
|
|||||||
|
|
||||||
password = public.md5(password)
|
password = public.md5(password)
|
||||||
if userInfo['username'] != username or userInfo['password'] != password:
|
if userInfo['username'] != username or userInfo['password'] != password:
|
||||||
public.writeLog('TYPE_LOGIN', public.getInfo(
|
public.writeLog('用户登录', public.getInfo(
|
||||||
"< a style='color: red'>密码错误</a>,帐号:{1},密码:{2},登录IP:{3}", (('****', '******', request.remote_addr))))
|
"<a style='color: red'>密码错误</a>,帐号:{1},密码:{2},登录IP:{3}", (('****', '******', request.remote_addr))))
|
||||||
return public.returnJson(False, public.getInfo("用户名或密码错误,您还可以尝试[{1}]次!", ('1')))
|
return public.returnJson(False, public.getInfo("用户名或密码错误,您还可以尝试[{1}]次!", ('1')))
|
||||||
|
|
||||||
session['login'] = True
|
session['login'] = True
|
||||||
|
|||||||
@@ -348,11 +348,11 @@ function getFiles(Path) {
|
|||||||
<td>"+fmp[3]+"</td>\
|
<td>"+fmp[3]+"</td>\
|
||||||
<td>"+fmp[4]+"</td>\
|
<td>"+fmp[4]+"</td>\
|
||||||
<td class='editmenu'><span>\
|
<td class='editmenu'><span>\
|
||||||
<a class='btlink' href='javascript:;' onclick=\"CopyFile('" + rdata.PATH +"/"+ 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:;' onclick=\"cutFile('" + rdata.PATH +"/"+ fmp[0]+ "')\">剪切</a> | \
|
||||||
<a class='btlink' href=\"javascript:ReName(0,'" + 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: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>\
|
<a class='btlink' href='javascript:;' onclick=\"deleteDir('" + rdata.PATH +"/"+ fmp[0] + "')\">删除</a></span>\
|
||||||
</td></tr>";
|
</td></tr>";
|
||||||
} else {
|
} else {
|
||||||
@@ -404,17 +404,17 @@ function getFiles(Path) {
|
|||||||
<td>"+fmp[3]+"</td>\
|
<td>"+fmp[3]+"</td>\
|
||||||
<td>"+fmp[4]+"</td>\
|
<td>"+fmp[4]+"</td>\
|
||||||
<td class='editmenu'>\
|
<td class='editmenu'>\
|
||||||
<span><a class='btlink' href='javascript:;' onclick=\"CopyFile('" + rdata.PATH +"/"+ fmp[0] + "')\">"+lan.files.file_menu_copy+"</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] + "')\">"+lan.files.file_menu_mv+"</a> | \
|
<a class='btlink' href='javascript:;' onclick=\"cutFile('" + rdata.PATH +"/"+ fmp[0] + "')\">剪切</a> | \
|
||||||
<a class='btlink' href='javascript:;' onclick=\"ReName(0,'" + fmp[0] + "')\">"+lan.files.file_menu_rename+"</a> | \
|
<a class='btlink' href='javascript:;' onclick=\"reName(0,'" + fmp[0] + "')\">重命名</a> | \
|
||||||
<a class='btlink' href=\"javascript:setChmod(0,'" + rdata.PATH +"/"+ fmp[0] + "');\">"+lan.files.file_menu_auth+"</a> | \
|
<a class='btlink' href=\"javascript:setChmod(0,'" + rdata.PATH +"/"+ fmp[0] + "');\">权限</a> | \
|
||||||
<a class='btlink' href=\"javascript:Zip('" + rdata.PATH +"/" +fmp[0] + "');\">"+lan.files.file_menu_zip+"</a> | \
|
<a class='btlink' href=\"javascript:zip('" + rdata.PATH +"/" +fmp[0] + "');\">压缩</a> | \
|
||||||
"+bodyZip+download+"\
|
"+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>";
|
</span></td></tr>";
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
Body += "<div class='file folderBox menufile' data-path='" + rdata.PATH +"/"+ fmp[0] + "' filetype='"+fmp[0]+"' title='"+lan.files.file_name+":" + fmp[0]+" "+lan.files.file_size+":" + toSize(fmp[1])+" "+lan.files.file_etime+":"+getLocalTime(fmp[2])+" "+lan.files.file_auth+":"+fmp[3]+" "+lan.files.file_own+":"+fmp[4]+"'>\
|
Body += "<div class='file folderBox menufile' data-path='" + rdata.PATH +"/"+ fmp[0] + "' filetype='"+fmp[0]+"' title='文件名:" + fmp[0]+" 大小:" + toSize(fmp[1])+" 修改时间:"+getLocalTime(fmp[2])+" 权限:"+fmp[3]+" 所有者:"+fmp[4]+"'>\
|
||||||
<input type='checkbox' name='id' value='"+fmp[0]+"'>\
|
<input type='checkbox' name='id' value='"+fmp[0]+"'>\
|
||||||
<div class='ico ico-"+(getExtName(fmp[0]))+"'></div>\
|
<div class='ico ico-"+(getExtName(fmp[0]))+"'></div>\
|
||||||
<div class='titleBox'><span class='tname'>" + fmp[0] + "</span></div>\
|
<div class='titleBox'><span class='tname'>" + fmp[0] + "</span></div>\
|
||||||
@@ -428,12 +428,12 @@ function getFiles(Path) {
|
|||||||
<thead>\
|
<thead>\
|
||||||
<tr>\
|
<tr>\
|
||||||
<th width="30"><input type="checkbox" id="setBox" placeholder=""></th>\
|
<th width="30"><input type="checkbox" id="setBox" placeholder=""></th>\
|
||||||
<th>'+lan.files.file_name+'</th>\
|
<th>文件名</th>\
|
||||||
<th>'+lan.files.file_size+'</th>\
|
<th>大小</th>\
|
||||||
<th>'+lan.files.file_etime+'</th>\
|
<th>修改时间</th>\
|
||||||
<th>'+lan.files.file_auth+'</th>\
|
<th>权限</th>\
|
||||||
<th>'+lan.files.file_own+'</th>\
|
<th>所有者</th>\
|
||||||
<th style="text-align: right;" width="330">'+lan.files.file_act+'</th>\
|
<th style="text-align: right;" width="330">操作</th>\
|
||||||
</tr>\
|
</tr>\
|
||||||
</thead>\
|
</thead>\
|
||||||
<tbody id="filesBody" class="list-list">'+Body+'</tbody>\
|
<tbody id="filesBody" class="list-list">'+Body+'</tbody>\
|
||||||
@@ -448,7 +448,7 @@ function getFiles(Path) {
|
|||||||
$("#DirPathPlace input").val(rdata.PATH);
|
$("#DirPathPlace input").val(rdata.PATH);
|
||||||
var BarTools = '<div class="btn-group">\
|
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">\
|
<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>\
|
</button>\
|
||||||
<ul class="dropdown-menu">\
|
<ul class="dropdown-menu">\
|
||||||
<li><a href="javascript:createFile(0,\'' + Path + '\');">新建空白文件</a></li>\
|
<li><a href="javascript:createFile(0,\'' + Path + '\');">新建空白文件</a></li>\
|
||||||
@@ -600,11 +600,11 @@ function showSeclect(){
|
|||||||
var count = totalFile();
|
var count = totalFile();
|
||||||
var BatchTools = '';
|
var BatchTools = '';
|
||||||
if(count > 1){
|
if(count > 1){
|
||||||
BatchTools = '<button onclick="javascript:Batch(1);" class="btn btn-default btn-sm">'+lan.files.file_menu_copy+'</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">'+lan.files.file_menu_mv+'</button>\
|
<button onclick="javascript:batch(2);" class="btn btn-default btn-sm">剪切</button>\
|
||||||
<button onclick="javascript:Batch(3);" class="btn btn-default btn-sm">'+lan.files.file_menu_auth+'</button>\
|
<button onclick="javascript:batch(3);" class="btn btn-default btn-sm">权限</button>\
|
||||||
<button onclick="javascript:Batch(5);" class="btn btn-default btn-sm">'+lan.files.file_menu_zip+'</button>\
|
<button onclick="javascript:batch(5);" class="btn btn-default btn-sm">压缩</button>\
|
||||||
<button onclick="javascript:Batch(4);" class="btn btn-default btn-sm">'+lan.files.file_menu_del+'</button>'
|
<button onclick="javascript:batch(4);" class="btn btn-default btn-sm">删除</button>'
|
||||||
$("#Batch").html(BatchTools);
|
$("#Batch").html(BatchTools);
|
||||||
}else{
|
}else{
|
||||||
$("#Batch").html(BatchTools);
|
$("#Batch").html(BatchTools);
|
||||||
@@ -638,20 +638,22 @@ window.onresize = function(){
|
|||||||
}
|
}
|
||||||
|
|
||||||
//批量操作
|
//批量操作
|
||||||
function Batch(type,access){
|
function batch(type,access){
|
||||||
var path = $("#DirPathPlace input").val();
|
var path = $("#DirPathPlace input").val();
|
||||||
var el = document.getElementsByTagName('input');
|
var el = document.getElementsByTagName('input');
|
||||||
var len = el.length;
|
var len = el.length;
|
||||||
var data='path='+path+'&type='+type;
|
var data='path='+path+'&type='+type;
|
||||||
var name = 'data';
|
var name = 'data';
|
||||||
|
var datas = [];
|
||||||
|
|
||||||
var oldType = getCookie('BatchPaste');
|
var oldType = getCookie('BatchPaste');
|
||||||
|
|
||||||
for(var i=0;i<len;i++){
|
for(var i=0;i<len;i++){
|
||||||
if(el[i].checked == true && el[i].value != 'on'){
|
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){
|
if(type == 3 && access == undefined){
|
||||||
setChmod(0,lan.files.all);
|
setChmod(0,lan.files.all);
|
||||||
@@ -668,7 +670,7 @@ function Batch(type,access){
|
|||||||
layer.closeAll();
|
layer.closeAll();
|
||||||
}
|
}
|
||||||
if(type == 4){
|
if(type == 4){
|
||||||
AllDeleteFileSub(data,path);
|
allDeleteFileSub(data,path);
|
||||||
setCookie('BatchPaste',oldType);
|
setCookie('BatchPaste',oldType);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -680,26 +682,28 @@ function Batch(type,access){
|
|||||||
names += el[i].value + ',';
|
names += el[i].value + ',';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Zip(names);
|
zip(names);
|
||||||
return;
|
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);
|
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);
|
layer.close(myloadT);
|
||||||
getFiles(path);
|
getFiles(path);
|
||||||
layer.msg(rdata.msg,{icon:1});
|
layer.msg(rdata.msg,{icon:1});
|
||||||
});
|
},'json');
|
||||||
}
|
}
|
||||||
|
|
||||||
//批量粘贴
|
//批量粘贴
|
||||||
function BatchPaste(){
|
function batchPaste(){
|
||||||
var path = $("#DirPathPlace input").val();
|
var path = $("#DirPathPlace input").val();
|
||||||
var type = getCookie('BatchPaste');
|
var type = getCookie('BatchPaste');
|
||||||
var data = 'type='+type+'&path='+path;
|
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){
|
if(result.length > 0){
|
||||||
var tbody = '';
|
var tbody = '';
|
||||||
for(var i=0;i<result.length;i++){
|
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>\
|
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>\
|
<tbody>'+tbody+'</tbody>\
|
||||||
</table></div>';
|
</table></div>';
|
||||||
SafeMessage('即将覆盖以下文件',mbody,function(){
|
safeMessage('即将覆盖以下文件',mbody,function(){
|
||||||
BatchPasteTo(data,path);
|
batchPasteTo(data,path);
|
||||||
});
|
});
|
||||||
$(".layui-layer-page").css("width","500px");
|
$(".layui-layer-page").css("width","500px");
|
||||||
}else{
|
}else{
|
||||||
BatchPasteTo(data,path);
|
batchPasteTo(data,path);
|
||||||
}
|
}
|
||||||
});
|
},'json');
|
||||||
}
|
}
|
||||||
|
|
||||||
function BatchPasteTo(data,path){
|
function batchPasteTo(data,path){
|
||||||
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);
|
setTimeout(function(){getSpeed('.myspeed');},1000);
|
||||||
$.post('files?action=BatchPaste',data,function(rdata){
|
$.post('files/batch_paste',data,function(rdata){
|
||||||
layer.close(myloadT);
|
layer.close(myloadT);
|
||||||
setCookie('BatchSelected', null);
|
setCookie('BatchSelected', null);
|
||||||
getFiles(path);
|
getFiles(path);
|
||||||
layer.msg(rdata.msg,{icon:1});
|
layer.msg(rdata.msg,{icon:1});
|
||||||
});
|
},'json');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -820,7 +824,7 @@ function createFile(type, path) {
|
|||||||
shift: 5,
|
shift: 5,
|
||||||
closeBtn: 2,
|
closeBtn: 2,
|
||||||
area: '320px',
|
area: '320px',
|
||||||
title: lan.files.new_empty_file,
|
title: '新建空白文件',
|
||||||
content: '<div class="bt-form pd20 pb70">\
|
content: '<div class="bt-form pd20 pb70">\
|
||||||
<div class="line">\
|
<div class="line">\
|
||||||
<input type="text" class="bt-input-text" name="Name" id="newFileName" value="" placeholder="文件名" style="width:100%" />\
|
<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) {
|
function createDir(type, path) {
|
||||||
if (type == 1) {
|
if (type == 1) {
|
||||||
var dirName = $("#newDirName").val();
|
var dirName = $("#newDirName").val();
|
||||||
layer.msg(lan.public.the, {
|
layer.msg('正在处理,请稍候...', {
|
||||||
icon: 16,
|
icon: 16,
|
||||||
time: 10000
|
time: 10000
|
||||||
});
|
});
|
||||||
@@ -857,7 +861,7 @@ function createDir(type, path) {
|
|||||||
shift: 5,
|
shift: 5,
|
||||||
closeBtn: 2,
|
closeBtn: 2,
|
||||||
area: '320px',
|
area: '320px',
|
||||||
title: lan.files.new_dir,
|
title: '新建目录',
|
||||||
content: '<div class="bt-form pd20 pb70">\
|
content: '<div class="bt-form pd20 pb70">\
|
||||||
<div class="line">\
|
<div class="line">\
|
||||||
<input type="text" class="bt-input-text" name="Name" id="newDirName" value="" placeholder="目录名称" style="width:100%" />\
|
<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){
|
function deleteFile(fileName){
|
||||||
layer.confirm(lan.get('recycle_bin_confirm',[fileName]),{title:lan.files.del_file,closeBtn:2,icon:3},function(){
|
layer.confirm(lan.get('recycle_bin_confirm',[fileName]),{title:'删除文件',closeBtn:2,icon:3},function(){
|
||||||
layer.msg(lan.public.the,{icon:16,time:0,shade: [0.3, '#000']});
|
layer.msg('正在处理,请稍候...',{icon:16,time:0,shade: [0.3, '#000']});
|
||||||
$.post('/files/delete', 'path=' + encodeURIComponent(fileName), function(rdata) {
|
$.post('/files/delete', 'path=' + encodeURIComponent(fileName), function(rdata) {
|
||||||
layer.closeAll();
|
layer.closeAll();
|
||||||
layer.msg(rdata.msg, {
|
layer.msg(rdata.msg, {
|
||||||
@@ -889,8 +893,8 @@ function deleteFile(fileName){
|
|||||||
|
|
||||||
//删除目录
|
//删除目录
|
||||||
function deleteDir(dirName){
|
function deleteDir(dirName){
|
||||||
layer.confirm(lan.get('recycle_bin_confirm_dir',[dirName]),{title:lan.files.del_dir,closeBtn:2,icon:3},function(){
|
layer.confirm(lan.get('recycle_bin_confirm_dir',[dirName]),{title:'删除目录',closeBtn:2,icon:3},function(){
|
||||||
layer.msg(lan.public.the,{icon:16,time:0,shade: [0.3, '#000']});
|
layer.msg('正在处理,请稍候...',{icon:16,time:0,shade: [0.3, '#000']});
|
||||||
$.post('/files/delete_dir', 'path=' + encodeURIComponent(dirName), function(rdata) {
|
$.post('/files/delete_dir', 'path=' + encodeURIComponent(dirName), function(rdata) {
|
||||||
layer.closeAll();
|
layer.closeAll();
|
||||||
layer.msg(rdata.msg, {
|
layer.msg(rdata.msg, {
|
||||||
@@ -901,20 +905,20 @@ function deleteDir(dirName){
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
//批量删除文件
|
//批量删除文件
|
||||||
function AllDeleteFileSub(data,path){
|
function allDeleteFileSub(data,path){
|
||||||
layer.confirm(lan.files.del_all_msg,{title:lan.files.del_all_file,closeBtn:2,icon:3},function(){
|
layer.confirm('您确实要把这些文件放入回收站吗?',{title:'批量删除文件',closeBtn:2,icon:3},function(){
|
||||||
layer.msg("<div class='myspeed'>"+lan.public.the+"</div>",{icon:16,time:0,shade: [0.3, '#000']});
|
layer.msg("<div class='myspeed'>正在处理,请稍候...</div>",{icon:16,time:0,shade: [0.3, '#000']});
|
||||||
setTimeout(function(){getSpeed('.myspeed');},1000);
|
setTimeout(function(){getSpeed('.myspeed');},1000);
|
||||||
$.post('files?action=SetBatchData',data,function(rdata){
|
$.post('files/set_batch_data',data,function(rdata){
|
||||||
layer.closeAll();
|
layer.closeAll();
|
||||||
getFiles(path);
|
getFiles(path);
|
||||||
layer.msg(rdata.msg,{icon:1});
|
layer.msg(rdata.msg,{icon:1});
|
||||||
});
|
},'json');
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
//重载文件列表
|
//重载文件列表
|
||||||
function ReloadFiles(){
|
function reloadFiles(){
|
||||||
setInterval(function(){
|
setInterval(function(){
|
||||||
var path = $("#DirPathPlace input").val();
|
var path = $("#DirPathPlace input").val();
|
||||||
getFiles(path);
|
getFiles(path);
|
||||||
@@ -973,7 +977,7 @@ function downloadFile(action){
|
|||||||
|
|
||||||
|
|
||||||
//重命名
|
//重命名
|
||||||
function ReName(type, fileName) {
|
function reName(type, fileName) {
|
||||||
if (type == 1) {
|
if (type == 1) {
|
||||||
var path = $("#DirPathPlace input").val();
|
var path = $("#DirPathPlace input").val();
|
||||||
var newFileName = encodeURIComponent(path + '/' + $("#newFileName").val());
|
var newFileName = encodeURIComponent(path + '/' + $("#newFileName").val());
|
||||||
@@ -982,13 +986,13 @@ function ReName(type, fileName) {
|
|||||||
icon: 16,
|
icon: 16,
|
||||||
time: 10000
|
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.closeAll();
|
||||||
layer.msg(rdata.msg, {
|
layer.msg(rdata.msg, {
|
||||||
icon: rdata.status ? 1 : 2
|
icon: rdata.status ? 1 : 2
|
||||||
});
|
});
|
||||||
getFiles(path);
|
getFiles(path);
|
||||||
});
|
},'json');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
layer.open({
|
layer.open({
|
||||||
@@ -996,14 +1000,14 @@ function ReName(type, fileName) {
|
|||||||
shift: 5,
|
shift: 5,
|
||||||
closeBtn: 2,
|
closeBtn: 2,
|
||||||
area: '320px',
|
area: '320px',
|
||||||
title: lan.files.file_menu_rename,
|
title: '重命名',
|
||||||
content: '<div class="bt-form pd20 pb70">\
|
content: '<div class="bt-form pd20 pb70">\
|
||||||
<div class="line">\
|
<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>\
|
||||||
<div class="bt-form-submit-btn">\
|
<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-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(/'/,"\\'") + '\')">'+lan.public.save+'</button>\
|
<button type="button" id="ReNameBtn" class="btn btn-success btn-sm btn-title" onclick="reName(1,\'' + fileName.replace(/'/,"\\'") + '\')">保存</button>\
|
||||||
</div>\
|
</div>\
|
||||||
</div>'
|
</div>'
|
||||||
});
|
});
|
||||||
@@ -1012,36 +1016,41 @@ function ReName(type, fileName) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
//剪切
|
//剪切
|
||||||
function CutFile(fileName) {
|
function cutFile(fileName) {
|
||||||
var path = $("#DirPathPlace input").val();
|
var path = $("#DirPathPlace input").val();
|
||||||
setCookie('cutFileName', fileName);
|
setCookie('cutFileName', fileName);
|
||||||
setCookie('copyFileName', null);
|
setCookie('copyFileName', null);
|
||||||
layer.msg(lan.files.mv_ok, {
|
layer.msg('已剪切', {
|
||||||
icon: 1,
|
icon: 1,
|
||||||
time: 1
|
time: 1000
|
||||||
});
|
});
|
||||||
getFiles(path);
|
setTimeout(function(){
|
||||||
|
getFiles(path);
|
||||||
|
},1000);
|
||||||
}
|
}
|
||||||
//复制
|
//复制
|
||||||
function CopyFile(fileName) {
|
function copyFile(fileName) {
|
||||||
var path = $("#DirPathPlace input").val();
|
var path = $("#DirPathPlace input").val();
|
||||||
setCookie('copyFileName', fileName);
|
setCookie('copyFileName', fileName);
|
||||||
setCookie('cutFileName', null);
|
setCookie('cutFileName', null);
|
||||||
layer.msg(lan.files.copy_ok, {
|
layer.msg('已复制', {
|
||||||
icon: 1,
|
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 path = $("#DirPathPlace input").val();
|
||||||
var copyName = getCookie('copyFileName');
|
var copyName = getCookie('copyFileName');
|
||||||
var cutName = getCookie('cutFileName');
|
var cutName = getCookie('cutFileName');
|
||||||
var filename = copyName;
|
var filename = copyName;
|
||||||
if(cutName != 'null' && cutName != undefined) filename=cutName;
|
if(cutName != 'null' && cutName != undefined) filename=cutName;
|
||||||
filename = filename.split('/').pop();
|
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){
|
if(result.length > 0){
|
||||||
var tbody = '';
|
var tbody = '';
|
||||||
for(var i=0;i<result.length;i++){
|
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>\
|
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>\
|
<tbody>'+tbody+'</tbody>\
|
||||||
</table></div>';
|
</table></div>';
|
||||||
SafeMessage('即将覆盖以下文件',mbody,function(){
|
safeMessage('即将覆盖以下文件',mbody,function(){
|
||||||
PasteTo(path,copyName,cutName,fileName);
|
pasteTo(path,copyName,cutName,fileName);
|
||||||
});
|
});
|
||||||
}else{
|
}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) {
|
if (copyName != 'null' && copyName != undefined) {
|
||||||
layer.msg(lan.files.copy_the, {
|
layer.msg(lan.files.copy_the, {
|
||||||
icon: 16,
|
icon: 16,
|
||||||
time: 0,shade: [0.3, '#000']
|
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.closeAll();
|
||||||
layer.msg(rdata.msg, {
|
layer.msg(rdata.msg, {
|
||||||
icon: rdata.status ? 1 : 2
|
icon: rdata.status ? 1 : 2
|
||||||
});
|
});
|
||||||
getFiles(path);
|
getFiles(path);
|
||||||
});
|
},'json');
|
||||||
setCookie('copyFileName', null);
|
setCookie('copyFileName', null);
|
||||||
setCookie('cutFileName', null);
|
setCookie('cutFileName', null);
|
||||||
return;
|
return;
|
||||||
@@ -1083,7 +1092,7 @@ function PasteTo(path,copyName,cutName,fileName){
|
|||||||
icon: 16,
|
icon: 16,
|
||||||
time: 0,shade: [0.3, '#000']
|
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.closeAll();
|
||||||
layer.msg(rdata.msg, {
|
layer.msg(rdata.msg, {
|
||||||
icon: rdata.status ? 1 : 2
|
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();
|
var path = $("#DirPathPlace input").val();
|
||||||
if(submits != undefined){
|
if(submits != undefined){
|
||||||
if(dirName.indexOf(',') == -1){
|
if(dirName.indexOf(',') == -1){
|
||||||
@@ -1115,7 +1124,7 @@ function Zip(dirName,submits) {
|
|||||||
if(rdata == null || rdata == undefined){
|
if(rdata == null || rdata == undefined){
|
||||||
layer.msg(lan.files.zip_ok,{icon:1});
|
layer.msg(lan.files.zip_ok,{icon:1});
|
||||||
getFiles(path)
|
getFiles(path)
|
||||||
ReloadFiles();
|
reloadFiles();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
layer.msg(rdata.msg, {icon: rdata.status ? 1 : 2});
|
layer.msg(rdata.msg, {icon: rdata.status ? 1 : 2});
|
||||||
@@ -1143,7 +1152,7 @@ function Zip(dirName,submits) {
|
|||||||
+'</div>'
|
+'</div>'
|
||||||
+'<div class="bt-form-submit-btn">'
|
+'<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-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>'
|
||||||
+'</div>'
|
+'</div>'
|
||||||
});
|
});
|
||||||
@@ -1295,55 +1304,55 @@ function setChmod(action,fileName){
|
|||||||
var chmod = $("#access").val();
|
var chmod = $("#access").val();
|
||||||
var chown = $("#chown").val();
|
var chown = $("#chown").val();
|
||||||
var data = 'filename='+ encodeURIComponent(fileName)+'&user='+chown+'&access='+chmod;
|
var data = 'filename='+ encodeURIComponent(fileName)+'&user='+chown+'&access='+chmod;
|
||||||
var loadT = layer.msg(lan.public.config,{icon:16,time:0,shade: [0.3, '#000']});
|
var loadT = layer.msg('正在设置...',{icon:16,time:0,shade: [0.3, '#000']});
|
||||||
$.post('files?action=SetFileAccess',data,function(rdata){
|
$.post('files/set_file_access',data,function(rdata){
|
||||||
layer.close(loadT);
|
layer.close(loadT);
|
||||||
if(rdata.status) layer.closeAll();
|
if(rdata.status) layer.closeAll();
|
||||||
layer.msg(rdata.msg,{icon:rdata.status?1:2});
|
layer.msg(rdata.msg,{icon:rdata.status?1:2});
|
||||||
var path = $("#DirPathPlace input").val();
|
var path = $("#DirPathPlace input").val();
|
||||||
getFiles(path)
|
getFiles(path)
|
||||||
});
|
},'json');
|
||||||
return;
|
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){
|
$.post('/files/file_access','filename='+encodeURIComponent(fileName),function(rdata){
|
||||||
console.log(rdata);
|
// console.log(rdata);
|
||||||
layer.open({
|
layer.open({
|
||||||
type:1,
|
type:1,
|
||||||
closeBtn: 2,
|
closeBtn: 2,
|
||||||
title: lan.files.set_auth + '['+fileName+']',
|
title: '设置权限['+fileName+']',
|
||||||
area: '400px',
|
area: '400px',
|
||||||
shadeClose:false,
|
shadeClose:false,
|
||||||
content:'<div class="setchmod bt-form ptb15 pb70">\
|
content:'<div class="setchmod bt-form ptb15 pb70">\
|
||||||
<fieldset>\
|
<fieldset>\
|
||||||
<legend>'+lan.files.file_own+'</legend>\
|
<legend>所有者</legend>\
|
||||||
<p><input type="checkbox" id="owner_r" />'+lan.files.file_read+'</p>\
|
<p><input type="checkbox" id="owner_r" />读取</p>\
|
||||||
<p><input type="checkbox" id="owner_w" />'+lan.files.file_write+'</p>\
|
<p><input type="checkbox" id="owner_w" />写入</p>\
|
||||||
<p><input type="checkbox" id="owner_x" />'+lan.files.file_exec+'</p>\
|
<p><input type="checkbox" id="owner_x" />执行</p>\
|
||||||
</fieldset>\
|
</fieldset>\
|
||||||
<fieldset>\
|
<fieldset>\
|
||||||
<legend>'+lan.files.file_group+'</legend>\
|
<legend>用户组</legend>\
|
||||||
<p><input type="checkbox" id="group_r" />'+lan.files.file_read+'</p>\
|
<p><input type="checkbox" id="group_r" />读取</p>\
|
||||||
<p><input type="checkbox" id="group_w" />'+lan.files.file_write+'</p>\
|
<p><input type="checkbox" id="group_w" />写入</p>\
|
||||||
<p><input type="checkbox" id="group_x" />'+lan.files.file_exec+'</p>\
|
<p><input type="checkbox" id="group_x" />执行</p>\
|
||||||
</fieldset>\
|
</fieldset>\
|
||||||
<fieldset>\
|
<fieldset>\
|
||||||
<legend>'+lan.files.file_public+'</legend>\
|
<legend>公共</legend>\
|
||||||
<p><input type="checkbox" id="public_r" />'+lan.files.file_read+'</p>\
|
<p><input type="checkbox" id="public_r" />读取</p>\
|
||||||
<p><input type="checkbox" id="public_w" />'+lan.files.file_write+'</p>\
|
<p><input type="checkbox" id="public_w" />写入</p>\
|
||||||
<p><input type="checkbox" id="public_x" />'+lan.files.file_exec+'</p>\
|
<p><input type="checkbox" id="public_x" />执行</p>\
|
||||||
</fieldset>\
|
</fieldset>\
|
||||||
<div class="setchmodnum"><input class="bt-input-text" type="text" id="access" maxlength="3" value="'+rdata.chmod+'">'+lan.files.file_menu_auth+',\
|
<div class="setchmodnum"><input class="bt-input-text" type="text" id="access" maxlength="3" value="'+rdata.chmod+'">权限,\
|
||||||
<span>'+lan.files.file_own+'\
|
<span>所有者\
|
||||||
<select id="chown" class="bt-input-text">\
|
<select id="chown" class="bt-input-text">\
|
||||||
<option value="www" '+(rdata.chown=='www'?'selected="selected"':'')+'>www</option>\
|
<option value="www" '+(rdata.chown=='www'?'selected="selected"':'')+'>www</option>\
|
||||||
<option value="mysql" '+(rdata.chown=='mysql'?'selected="selected"':'')+'>mysql</option>\
|
<option value="mysql" '+(rdata.chown=='mysql'?'selected="selected"':'')+'>mysql</option>\
|
||||||
<option value="root" '+(rdata.chown=='root'?'selected="selected"':'')+'>root</option>\
|
<option value="root" '+(rdata.chown=='root'?'selected="selected"':'')+'>root</option>\
|
||||||
</select></span></div>\
|
</select></span></div>\
|
||||||
<div class="bt-form-submit-btn">\
|
<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-danger btn-sm btn-title" onclick="layer.closeAll()">关闭</button>\
|
||||||
<button type="button" class="btn btn-success btn-sm btn-title" onclick="'+toExec+'" >'+lan.public.ok+'</button>\
|
<button type="button" class="btn btn-success btn-sm btn-title" onclick="'+toExec+'" >确定</button>\
|
||||||
</div>\
|
</div>\
|
||||||
</div>'
|
</div>'
|
||||||
});
|
});
|
||||||
@@ -1415,11 +1424,11 @@ function onAccess(){
|
|||||||
function RClick(type,path,name){
|
function RClick(type,path,name){
|
||||||
var displayZip = isZip(type);
|
var displayZip = isZip(type);
|
||||||
var options = {items:[
|
var options = {items:[
|
||||||
{text: lan.files.file_menu_copy, onclick: function() {CopyFile(path)}},
|
{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_mv, onclick: function() {cutFile(path)}},
|
||||||
{text: lan.files.file_menu_rename, onclick: function() {ReName(0,name)}},
|
{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_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"){
|
if(type == "dir"){
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 106 KiB After Width: | Height: | Size: 99 KiB |
|
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 780 B |
|
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 645 B |
|
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.0 KiB |
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 758 B |
|
Before Width: | Height: | Size: 874 B After Width: | Height: | Size: 503 B |
|
Before Width: | Height: | Size: 683 B After Width: | Height: | Size: 359 B |
|
Before Width: | Height: | Size: 2.9 KiB After Width: | Height: | Size: 1.2 KiB |
|
Before Width: | Height: | Size: 3.9 KiB After Width: | Height: | Size: 3.9 KiB |
|
Before Width: | Height: | Size: 3.2 KiB After Width: | Height: | Size: 2.0 KiB |
|
Before Width: | Height: | Size: 3.4 KiB After Width: | Height: | Size: 2.1 KiB |
|
Before Width: | Height: | Size: 3.4 KiB After Width: | Height: | Size: 2.1 KiB |
|
Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 1.9 KiB |
|
Before Width: | Height: | Size: 203 B After Width: | Height: | Size: 105 B |
|
Before Width: | Height: | Size: 2.9 KiB After Width: | Height: | Size: 1.9 KiB |
|
Before Width: | Height: | Size: 2.9 KiB After Width: | Height: | Size: 2.0 KiB |
|
Before Width: | Height: | Size: 672 B After Width: | Height: | Size: 396 B |
|
Before Width: | Height: | Size: 53 KiB After Width: | Height: | Size: 4.4 KiB |
|
Before Width: | Height: | Size: 53 KiB After Width: | Height: | Size: 4.2 KiB |
|
Before Width: | Height: | Size: 53 KiB After Width: | Height: | Size: 4.3 KiB |
|
Before Width: | Height: | Size: 3.7 KiB After Width: | Height: | Size: 2.1 KiB |
|
Before Width: | Height: | Size: 212 B After Width: | Height: | Size: 110 B |
|
Before Width: | Height: | Size: 166 B After Width: | Height: | Size: 95 B |
|
Before Width: | Height: | Size: 586 B After Width: | Height: | Size: 414 B |
|
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 1.4 KiB |
|
Before Width: | Height: | Size: 420 B After Width: | Height: | Size: 260 B |
|
Before Width: | Height: | Size: 424 B After Width: | Height: | Size: 246 B |
|
Before Width: | Height: | Size: 449 B After Width: | Height: | Size: 281 B |
|
Before Width: | Height: | Size: 476 B After Width: | Height: | Size: 243 B |
|
Before Width: | Height: | Size: 705 B After Width: | Height: | Size: 585 B |
|
Before Width: | Height: | Size: 2.2 KiB After Width: | Height: | Size: 1.3 KiB |
|
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1010 B |
|
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.0 KiB |
|
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.0 KiB |
|
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 1.0 KiB |
|
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.0 KiB |
|
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 1.2 KiB |
|
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 973 B |
|
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.0 KiB |
|
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.0 KiB |
|
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 1.4 KiB |
|
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1018 B |
|
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1007 B |
|
Before Width: | Height: | Size: 2.0 KiB After Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 499 B After Width: | Height: | Size: 233 B |
|
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.0 KiB |
|
Before Width: | Height: | Size: 2.1 KiB After Width: | Height: | Size: 1.2 KiB |
|
Before Width: | Height: | Size: 2.0 KiB After Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 2.0 KiB After Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 2.0 KiB After Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 2.0 KiB After Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 2.2 KiB After Width: | Height: | Size: 1.3 KiB |
|
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1023 B |