mirror of
https://github.com/midoks/mdserver-web.git
synced 2026-10-10 13:29:26 +08:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
540fb5a11f | ||
|
|
5dca6bfb80 | ||
|
|
8439fcbe98 | ||
|
|
6cee6f4785 | ||
|
|
6a067ad457 | ||
|
|
691aba1f2a | ||
|
|
6446a7053e | ||
|
|
040c66cdc3 | ||
|
|
c8d02eaa85 | ||
|
|
59bbd99ba4 | ||
|
|
c8d86fa835 | ||
|
|
e629a82ed9 | ||
|
|
fb0a771c81 | ||
|
|
891cd56163 | ||
|
|
0714780938 | ||
|
|
0a11f17d90 | ||
|
|
e22722f40e | ||
|
|
519544715f | ||
|
|
6d34061402 | ||
|
|
119928d9df | ||
|
|
022dfe31d4 | ||
|
|
c2011eedf9 | ||
|
|
b77d549b34 | ||
|
|
0b3bcafec7 | ||
|
|
4e12548978 | ||
|
|
bf7de761c8 | ||
|
|
bfc96e925f | ||
|
|
de1da98e92 | ||
|
|
d4edc449a2 | ||
|
|
a03d4e7dda | ||
|
|
4351367e32 | ||
|
|
0ec628f5e2 | ||
|
|
a94ef37b49 | ||
|
|
cf8729a6ac | ||
|
|
3688456ea0 | ||
|
|
47c64e7212 | ||
|
|
e653f76608 | ||
|
|
d40d0001bf | ||
|
|
793a236641 | ||
|
|
07996a3fe5 | ||
|
|
a826f784fc | ||
|
|
1561768524 | ||
|
|
1d899fe330 |
@@ -37,7 +37,7 @@ Talk is cheap, show me the code. -- linus
|
||||
```
|
||||
|
||||
- [兼容性测试报告](/compatibility.md)
|
||||
- [常用命令说明](/cmd.md) [ mw default ]
|
||||
- [常用命令说明](/cmd.md) [ mw default ] [ mw update_dev ]
|
||||
|
||||
### 主要插件介绍
|
||||
|
||||
@@ -110,10 +110,9 @@ docker run -itd --name mw-server --privileged=true -p 7200:7200 -p 80:80 -p 443:
|
||||
```
|
||||
|
||||
|
||||
### 版本更新 0.16.4
|
||||
### 版本更新 0.16.5
|
||||
|
||||
* 二次验证。
|
||||
* OP防火墙修复。
|
||||
* 文件管理,增加排序。
|
||||
|
||||
### JSDelivr安装地址
|
||||
|
||||
@@ -189,9 +188,9 @@ TVbNgrpeGBGZVm5gTLa21ADP7RpnPFhjya
|
||||
日行一善,以后必定大富大贵
|
||||
|
||||
|
||||
### 微信赞助
|
||||
### 支付宝赞助
|
||||
|
||||
[](https://cdn.jsdelivr.net/gh/midoks/mdserver-web@latest/route/static/img/alipay_zz.jpg)
|
||||
[](https://cdn.jsdelivr.net/gh/midoks/mdserver-web@latest/route/static/img/alipay_zz.png)
|
||||
|
||||
|
||||
### 无图不真相
|
||||
|
||||
+2
-97
@@ -441,19 +441,7 @@ fi
|
||||
return None
|
||||
if not os.path.exists(site_path):
|
||||
return None
|
||||
args = mw.dict_obj()
|
||||
args.id = site_id
|
||||
import panelSite
|
||||
run_path = panelSite.panelSite().GetRunPath(args)
|
||||
if run_path in ['/']:
|
||||
run_path = ''
|
||||
if run_path:
|
||||
if run_path[0] == '/':
|
||||
run_path = run_path[1:]
|
||||
site_run_path = os.path.join(site_path, run_path)
|
||||
if not os.path.exists(site_run_path):
|
||||
return site_path
|
||||
return site_run_path
|
||||
return site_path
|
||||
else:
|
||||
return False
|
||||
|
||||
@@ -1283,85 +1271,6 @@ fullchain.pem 粘贴到证书输入框
|
||||
root = old_domain_name
|
||||
return root, zone
|
||||
|
||||
# 获取当前正在使用此证书的网站目录
|
||||
def getSslUsedSite(self, save_path):
|
||||
pkey_file = '{}/privkey.pem'.format(save_path)
|
||||
pkey = mw.readFile(pkey_file)
|
||||
if not pkey:
|
||||
return False
|
||||
cert_paths = 'vhost/cert'
|
||||
import panelSite
|
||||
args = mw.dict_obj()
|
||||
args.siteName = ''
|
||||
for c_name in os.listdir(cert_paths):
|
||||
skey_file = '{}/{}/privkey.pem'.format(cert_paths, c_name)
|
||||
skey = mw.readFile(skey_file)
|
||||
if not skey:
|
||||
continue
|
||||
if skey == pkey:
|
||||
args.siteName = c_name
|
||||
run_path = panelSite.panelSite().GetRunPath(args)
|
||||
if not run_path:
|
||||
continue
|
||||
sitePath = mw.M('sites').where(
|
||||
'name=?', c_name).getField('path')
|
||||
if not sitePath:
|
||||
continue
|
||||
to_path = "{}/{}".format(sitePath, run_path)
|
||||
return to_path
|
||||
return False
|
||||
|
||||
def renewCertOther(self):
|
||||
cert_path = "{}/vhost/cert".format(mw.getRunDir())
|
||||
if not os.path.exists(cert_path):
|
||||
return
|
||||
new_time = time.time() + (86400 * 30)
|
||||
n = 0
|
||||
if not 'orders' in self.__config:
|
||||
self.__config['orders'] = {}
|
||||
import panelSite
|
||||
siteObj = panelSite.panelSite()
|
||||
args = mw.dict_obj()
|
||||
for siteName in os.listdir(cert_path):
|
||||
try:
|
||||
cert_file = '{}/{}/fullchain.pem'.format(cert_path, siteName)
|
||||
if not os.path.exists(cert_file):
|
||||
continue # 无证书文件
|
||||
siteInfo = mw.M('sites').where('name=?', siteName).find()
|
||||
if not siteInfo:
|
||||
continue # 无网站信息
|
||||
cert_init = self.getCertInit(cert_file)
|
||||
if not cert_init:
|
||||
continue # 无法获取证书
|
||||
end_time = time.mktime(time.strptime(
|
||||
cert_init['notAfter'], '%Y-%m-%d'))
|
||||
if end_time > new_time:
|
||||
continue # 未到期
|
||||
try:
|
||||
if not cert_init['issuer'] in ['R3', "Let's Encrypt"] and cert_init['issuer'].find("Let's Encrypt") == -1:
|
||||
continue # 非同品牌证书
|
||||
except:
|
||||
continue
|
||||
|
||||
if isinstance(cert_init['dns'], str):
|
||||
cert_init['dns'] = [cert_init['dns']]
|
||||
index = self.getIndex(cert_init['dns'])
|
||||
if index in self.__config['orders'].keys():
|
||||
continue # 已在订单列表
|
||||
|
||||
n += 1
|
||||
writeLog(
|
||||
"|-正在续签第 {} 张其它证书,域名: {}..".format(n, cert_init['subject']))
|
||||
writeLog("|-正在创建订单..")
|
||||
args.id = siteInfo['id']
|
||||
runPath = siteObj.GetRunPath(args)
|
||||
if runPath and not runPath in ['/']:
|
||||
path = siteInfo['path'] + '/' + runPath
|
||||
else:
|
||||
path = siteInfo['path']
|
||||
except:
|
||||
writeLog("|-[{}]续签失败".format(siteName))
|
||||
|
||||
# 外部API - START ----------------------------------------------------------
|
||||
def getHostConf(self, siteName):
|
||||
return mw.getServerDir() + '/web_conf/nginx/vhost/' + siteName + '.conf'
|
||||
@@ -1509,8 +1418,7 @@ fullchain.pem 粘贴到证书输入框
|
||||
# 已删除的网站直接跳过续签
|
||||
if self.__config['orders'][i]['auth_to'].find('|') == -1 and self.__config['orders'][i]['auth_to'].find('/') != -1:
|
||||
if not os.path.exists(self.__config['orders'][i]['auth_to']):
|
||||
auth_to = self.getSslUsedSite(
|
||||
self.__config['orders'][i]['save_path'])
|
||||
auth_to = self.__config['orders'][i]['auth_to']
|
||||
if not auth_to:
|
||||
continue
|
||||
|
||||
@@ -1549,9 +1457,6 @@ fullchain.pem 粘贴到证书输入框
|
||||
# 加入到续签订单
|
||||
order_index.append(i)
|
||||
if not order_index:
|
||||
writeLog("|-没有找到30天内到期的SSL证书,正在尝试去寻找其它可续签证书!")
|
||||
# self.getApis()
|
||||
# self.renewCertOther()
|
||||
writeLog("|-所有任务已处理完成!")
|
||||
return
|
||||
writeLog("|-共需要续签 {} 张证书".format(len(order_index)))
|
||||
|
||||
@@ -242,7 +242,7 @@ class cert_request:
|
||||
# 注册acme帐户
|
||||
def register(self, existing=False):
|
||||
if not 'email' in self.__config:
|
||||
self.__config['email'] = 'mdioks@163.com'
|
||||
self.__config['email'] = 'xxxx.xxxx@gmail.com'
|
||||
if existing:
|
||||
payload = {"onlyReturnExisting": True}
|
||||
elif self.__config['email']:
|
||||
|
||||
@@ -28,7 +28,7 @@ from flask import request
|
||||
|
||||
class config_api:
|
||||
|
||||
__version = '0.16.4'
|
||||
__version = '0.16.5'
|
||||
__api_addr = 'data/api.json'
|
||||
|
||||
# 统一默认配置文件
|
||||
|
||||
+66
-13
@@ -161,15 +161,12 @@ class files_api:
|
||||
search = request.args.get('search', '').strip().lower()
|
||||
search_all = request.args.get('all', '').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
|
||||
row = request.args.get('row', '10')
|
||||
order = request.form.get('order', '')
|
||||
|
||||
# return self.getAllDir(path, int(page), int(row), "wp-inlcude")
|
||||
if search_all == 'yes' and search != '':
|
||||
return self.getAllDir(path, int(page), int(row), search)
|
||||
return self.getDir(path, int(page), int(row), search)
|
||||
return self.getAllDir(path, int(page), int(row), order, search)
|
||||
return self.getDir(path, int(page), int(row), order, search)
|
||||
|
||||
def createFileApi(self):
|
||||
file = request.form.get('path', '')
|
||||
@@ -948,16 +945,64 @@ class files_api:
|
||||
i += 1
|
||||
return i
|
||||
|
||||
def getAllDir(self, path, page=1, page_size=10, search=None):
|
||||
def getAllDir(self, path, page=1, page_size=10, order='', search=None):
|
||||
# print("search:", search)
|
||||
data = {}
|
||||
dirnames = []
|
||||
filenames = []
|
||||
|
||||
info = {}
|
||||
|
||||
i = 0
|
||||
n = 0
|
||||
count = 0
|
||||
max_limit = 3000
|
||||
order_arr = order.split(' ')
|
||||
if len(order_arr) < 2:
|
||||
plist = mw.sortAllFileList(path, order_arr[0],'',search, max_limit)
|
||||
else:
|
||||
plist = mw.sortAllFileList(path, order_arr[0], order_arr[1], search,max_limit)
|
||||
|
||||
info['count'] = len(plist)
|
||||
info['row'] = page_size
|
||||
info['p'] = page
|
||||
info['tojs'] = 'getFiles'
|
||||
pageObj = mw.getPageObject(info, '1,2,3,4,5,6,7,8')
|
||||
data['PAGE'] = pageObj[0]
|
||||
|
||||
for dst_file in plist:
|
||||
|
||||
if not os.path.exists(dst_file):
|
||||
continue
|
||||
|
||||
i += 1
|
||||
if n >= pageObj[1].ROW:
|
||||
break
|
||||
if i < pageObj[1].SHIFT:
|
||||
continue
|
||||
|
||||
if os.path.isdir(dst_file):
|
||||
dirnames.append(self.__get_stats(dst_file, path))
|
||||
else:
|
||||
filenames.append(self.__get_stats(dst_file, path))
|
||||
n += 1
|
||||
|
||||
data['DIR'] = dirnames
|
||||
data['FILES'] = filenames
|
||||
data['PATH'] = path.replace('//', '/')
|
||||
|
||||
return mw.getJson(data)
|
||||
|
||||
#备份
|
||||
def getAllDirBk(self, path, page=1, page_size=10, order='', search=None):
|
||||
data = {}
|
||||
dirnames = []
|
||||
filenames = []
|
||||
|
||||
count = 0
|
||||
max_limit = 3000
|
||||
|
||||
for d_list in os.walk(path):
|
||||
|
||||
if count >= max_limit:
|
||||
break
|
||||
|
||||
@@ -996,7 +1041,7 @@ class files_api:
|
||||
|
||||
return mw.getJson(data)
|
||||
|
||||
def getDir(self, path, page=1, page_size=10, search=None):
|
||||
def getDir(self, path, page=1, page_size=10, order = '', search=None):
|
||||
data = {}
|
||||
dirnames = []
|
||||
filenames = []
|
||||
@@ -1011,7 +1056,14 @@ class files_api:
|
||||
|
||||
i = 0
|
||||
n = 0
|
||||
for filename in os.listdir(path):
|
||||
|
||||
order_arr = order.split(' ')
|
||||
if len(order_arr) < 2:
|
||||
plist = mw.sortFileList(path, order_arr[0],'')
|
||||
else:
|
||||
plist = mw.sortFileList(path, order_arr[0],order_arr[1])
|
||||
|
||||
for filename in plist:
|
||||
if search:
|
||||
if filename.lower().find(search) == -1:
|
||||
continue
|
||||
@@ -1033,8 +1085,8 @@ class files_api:
|
||||
n += 1
|
||||
except Exception as e:
|
||||
continue
|
||||
data['DIR'] = sorted(dirnames)
|
||||
data['FILES'] = sorted(filenames)
|
||||
data['DIR'] = dirnames
|
||||
data['FILES'] = filenames
|
||||
data['PATH'] = path.replace('//', '/')
|
||||
|
||||
return mw.getJson(data)
|
||||
@@ -1067,6 +1119,7 @@ cd %s
|
||||
return mw.returnJson(status, mw.getNumLines(fileName, 200))
|
||||
|
||||
def __get_stats(self, filename, path=None):
|
||||
# print(filename,path)
|
||||
filename = filename.replace('//', '/')
|
||||
try:
|
||||
stat = os.stat(filename)
|
||||
|
||||
@@ -1598,6 +1598,63 @@ def checkCert(certPath='ssl/certificate.pem'):
|
||||
return True
|
||||
|
||||
|
||||
def sortFileList(path, ftype = 'mtime', sort = 'desc'):
|
||||
flist = os.listdir(path)
|
||||
if ftype == 'mtime':
|
||||
if sort == 'desc':
|
||||
flist = sorted(flist, key=lambda f: os.path.getmtime(os.path.join(path,f)), reverse=True)
|
||||
if sort == 'asc':
|
||||
flist = sorted(flist, key=lambda f: os.path.getmtime(os.path.join(path,f)), reverse=False)
|
||||
|
||||
if ftype == 'size':
|
||||
if sort == 'desc':
|
||||
flist = sorted(flist, key=lambda f: os.path.getsize(os.path.join(path,f)), reverse=True)
|
||||
if sort == 'asc':
|
||||
flist = sorted(flist, key=lambda f: os.path.getsize(os.path.join(path,f)), reverse=False)
|
||||
return flist
|
||||
|
||||
|
||||
def sortAllFileList(path, ftype = 'mtime', sort = 'desc', search = '',limit = 3000):
|
||||
count = 0
|
||||
flist = []
|
||||
for d_list in os.walk(path):
|
||||
if count >= limit:
|
||||
break
|
||||
|
||||
for d in d_list[1]:
|
||||
if count >= limit:
|
||||
break
|
||||
if d.lower().find(search) != -1:
|
||||
filename = d_list[0] + '/' + d
|
||||
if not os.path.exists(filename):
|
||||
continue
|
||||
count += 1
|
||||
flist.append(filename)
|
||||
|
||||
for f in d_list[2]:
|
||||
if count >= limit:
|
||||
break
|
||||
|
||||
if f.lower().find(search) != -1:
|
||||
filename = d_list[0] + '/' + f
|
||||
if not os.path.exists(filename):
|
||||
continue
|
||||
count += 1
|
||||
flist.append(filename)
|
||||
|
||||
if ftype == 'mtime':
|
||||
if sort == 'desc':
|
||||
flist = sorted(flist, key=lambda f: os.path.getmtime(f), reverse=True)
|
||||
if sort == 'asc':
|
||||
flist = sorted(flist, key=lambda f: os.path.getmtime(f), reverse=False)
|
||||
|
||||
if ftype == 'size':
|
||||
if sort == 'desc':
|
||||
flist = sorted(flist, key=lambda f: os.path.getsize(f), reverse=True)
|
||||
if sort == 'asc':
|
||||
flist = sorted(flist, key=lambda f: os.path.getsize(f), reverse=False)
|
||||
return flist
|
||||
|
||||
def getPathSize(path):
|
||||
# 取文件或目录大小
|
||||
if not os.path.exists(path):
|
||||
|
||||
@@ -2779,7 +2779,7 @@ location ^~ {from} {\n\
|
||||
sslStr = """#error_page 404/404.html;
|
||||
ssl_certificate %s;
|
||||
ssl_certificate_key %s;
|
||||
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
|
||||
ssl_protocols TLSv1 TLSv1.1 TLSv1.2 TLSv1.3;
|
||||
ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:HIGH:!aNULL:!MD5:!RC4:!DHE;
|
||||
ssl_prefer_server_ciphers on;
|
||||
ssl_session_cache shared:SSL:10m;
|
||||
|
||||
@@ -860,68 +860,53 @@ function setDbPs(id, name, obj) {
|
||||
}
|
||||
|
||||
function openPhpmyadmin(name,username,password){
|
||||
$.post('/plugins/run', {'name':'phpmyadmin','func':'plugins_db_support'}, function(data){
|
||||
var rdata = $.parseJSON(data.data);
|
||||
|
||||
data = syncPost('/plugins/check',{'name':'phpmyadmin'});
|
||||
if (rdata.data['installed'] != 'ok'){
|
||||
layer.msg('phpMyAdmin未安装!',{icon:2,shade: [0.3, '#000']});
|
||||
return;
|
||||
}
|
||||
|
||||
if (rdata.data['status'] != 'start'){
|
||||
layer.msg('phpMyAdmin未启动',{icon:2,shade: [0.3, '#000']});
|
||||
return;
|
||||
}
|
||||
|
||||
if (!data.status){
|
||||
layer.msg(data.msg,{icon:2,shade: [0.3, '#000']});
|
||||
return;
|
||||
}
|
||||
if (rdata.data['cfg']['choose'] != 'mariadb'){
|
||||
layer.msg('当前为['+rdata.choose+']模式,若要使用请修改phpMyAdmin访问切换.',{icon:2,shade: [0.3, '#000']});
|
||||
return;
|
||||
}
|
||||
var home_page = rdata.data['home_page'];
|
||||
$("#toPHPMyAdmin").attr('action',home_page);
|
||||
if($("#toPHPMyAdmin").attr('action').indexOf('phpmyadmin') == -1){
|
||||
layer.msg('请先安装phpMyAdmin',{icon:2,shade: [0.3, '#000']});
|
||||
setTimeout(function(){ window.location.href = '/soft'; },3000);
|
||||
return;
|
||||
}
|
||||
//检查版本
|
||||
bigVer = rdata.data['version'];
|
||||
if (bigVer>=4.5){
|
||||
|
||||
data = syncPost('/plugins/run',{'name':'phpmyadmin','func':'status'});
|
||||
if (data.data != 'start'){
|
||||
layer.msg('phpMyAdmin未启动',{icon:2,shade: [0.3, '#000']});
|
||||
return;
|
||||
}
|
||||
|
||||
data = syncPost('/plugins/run',{'name':'phpmyadmin','func':'get_cfg'});
|
||||
var rdata = $.parseJSON(data.data);
|
||||
if (rdata.choose != 'mariadb'){
|
||||
layer.msg('当前为['+rdata.choose+']模式,若要使用请修改phpMyAdmin访问切换.',{icon:2,shade: [0.3, '#000']});
|
||||
return;
|
||||
}
|
||||
var phpmyadmin_cfg = rdata;
|
||||
setTimeout(function(){
|
||||
$("#toPHPMyAdmin").submit();
|
||||
},2000);
|
||||
layer.msg('phpMyAdmin['+data.data+']需要手动登录😭',{icon:16,shade: [0.3, '#000'],time:4000});
|
||||
|
||||
} else{
|
||||
var murl = $("#toPHPMyAdmin").attr('action');
|
||||
$("#pma_username").val(username);
|
||||
$("#pma_password").val(password);
|
||||
$("#db").val(name);
|
||||
|
||||
data = syncPost('/plugins/run',{'name':'phpmyadmin','func':'get_home_page'});
|
||||
var rdata = $.parseJSON(data.data);
|
||||
if (!rdata.status){
|
||||
layer.msg(rdata.msg,{icon:2,shade: [0.3, '#000']});
|
||||
return;
|
||||
}
|
||||
layer.msg('正在打开phpMyAdmin',{icon:16,shade: [0.3, '#000'],time:2000});
|
||||
|
||||
var home_page = rdata.data;
|
||||
home_page = home_page.replace("http://","http://"+phpmyadmin_cfg['username']+":"+phpmyadmin_cfg['password']+"@");
|
||||
$("#toPHPMyAdmin").attr('action',home_page);
|
||||
setTimeout(function(){
|
||||
$("#toPHPMyAdmin").submit();
|
||||
},2000);
|
||||
}
|
||||
|
||||
if($("#toPHPMyAdmin").attr('action').indexOf('phpmyadmin') == -1){
|
||||
layer.msg('请先安装phpMyAdmin',{icon:2,shade: [0.3, '#000']});
|
||||
setTimeout(function(){ window.location.href = '/soft'; },3000);
|
||||
return;
|
||||
}
|
||||
|
||||
//检查版本
|
||||
data = syncPost('/plugins/run',{'name':'phpmyadmin','func':'version'});
|
||||
bigVer = data.data.split('.')[0]
|
||||
if (bigVer>=4.5){
|
||||
|
||||
setTimeout(function(){
|
||||
$("#toPHPMyAdmin").submit();
|
||||
},3000);
|
||||
layer.msg('phpMyAdmin['+data.data+']需要手动登录😭',{icon:16,shade: [0.3, '#000'],time:4000});
|
||||
|
||||
} else{
|
||||
var murl = $("#toPHPMyAdmin").attr('action');
|
||||
$("#pma_username").val(username);
|
||||
$("#pma_password").val(password);
|
||||
$("#db").val(name);
|
||||
|
||||
layer.msg('正在打开phpMyAdmin',{icon:16,shade: [0.3, '#000'],time:2000});
|
||||
|
||||
setTimeout(function(){
|
||||
$("#toPHPMyAdmin").submit();
|
||||
},3000);
|
||||
}
|
||||
},'json');
|
||||
}
|
||||
|
||||
function delBackup(filename, name, path){
|
||||
|
||||
@@ -14,7 +14,7 @@ sysName=`uname`
|
||||
install_tmp=${rootPath}/tmp/mw_install.pl
|
||||
mariadbDir=${serverPath}/source/mariadb
|
||||
|
||||
MY_VER=10.11.6
|
||||
MY_VER=10.11.7
|
||||
|
||||
Install_app()
|
||||
{
|
||||
|
||||
@@ -13,7 +13,7 @@ sysName=`uname`
|
||||
install_tmp=${rootPath}/tmp/mw_install.pl
|
||||
mariadbDir=${serverPath}/source/mariadb
|
||||
|
||||
MY_VER=10.6.16
|
||||
MY_VER=10.6.17
|
||||
|
||||
Install_app()
|
||||
{
|
||||
|
||||
@@ -14,7 +14,7 @@ sysName=`uname`
|
||||
install_tmp=${rootPath}/tmp/mw_install.pl
|
||||
mariadbDir=${serverPath}/source/mariadb
|
||||
|
||||
MY_VER=11.0.4
|
||||
MY_VER=11.0.5
|
||||
|
||||
Install_app()
|
||||
{
|
||||
|
||||
@@ -14,7 +14,7 @@ sysName=`uname`
|
||||
install_tmp=${rootPath}/tmp/mw_install.pl
|
||||
mariadbDir=${serverPath}/source/mariadb
|
||||
|
||||
MY_VER=11.1.3
|
||||
MY_VER=11.1.4
|
||||
|
||||
Install_app()
|
||||
{
|
||||
|
||||
@@ -14,7 +14,7 @@ sysName=`uname`
|
||||
install_tmp=${rootPath}/tmp/mw_install.pl
|
||||
mariadbDir=${serverPath}/source/mariadb
|
||||
|
||||
MY_VER=11.2.2
|
||||
MY_VER=11.2.3
|
||||
|
||||
Install_app()
|
||||
{
|
||||
|
||||
@@ -14,7 +14,7 @@ sysName=`uname`
|
||||
install_tmp=${rootPath}/tmp/mw_install.pl
|
||||
mariadbDir=${serverPath}/source/mariadb
|
||||
|
||||
MY_VER=11.3.1
|
||||
MY_VER=11.3.2
|
||||
|
||||
Install_app()
|
||||
{
|
||||
|
||||
@@ -856,68 +856,53 @@ function setDbPs(id, name, obj) {
|
||||
}
|
||||
|
||||
function openPhpmyadmin(name,username,password){
|
||||
$.post('/plugins/run', {'name':'phpmyadmin','func':'plugins_db_support'}, function(data){
|
||||
var rdata = $.parseJSON(data.data);
|
||||
|
||||
data = syncPost('/plugins/check',{'name':'phpmyadmin'});
|
||||
if (rdata.data['installed'] != 'ok'){
|
||||
layer.msg('phpMyAdmin未安装!',{icon:2,shade: [0.3, '#000']});
|
||||
return;
|
||||
}
|
||||
|
||||
if (rdata.data['status'] != 'start'){
|
||||
layer.msg('phpMyAdmin未启动',{icon:2,shade: [0.3, '#000']});
|
||||
return;
|
||||
}
|
||||
|
||||
if (!data.status){
|
||||
layer.msg(data.msg,{icon:2,shade: [0.3, '#000']});
|
||||
return;
|
||||
}
|
||||
if (rdata.data['cfg']['choose'] != 'mysql-apt'){
|
||||
layer.msg('当前为['+rdata.choose+']模式,若要使用请修改phpMyAdmin访问切换.',{icon:2,shade: [0.3, '#000']});
|
||||
return;
|
||||
}
|
||||
var home_page = rdata.data['home_page'];
|
||||
$("#toPHPMyAdmin").attr('action',home_page);
|
||||
if($("#toPHPMyAdmin").attr('action').indexOf('phpmyadmin') == -1){
|
||||
layer.msg('请先安装phpMyAdmin',{icon:2,shade: [0.3, '#000']});
|
||||
setTimeout(function(){ window.location.href = '/soft'; },3000);
|
||||
return;
|
||||
}
|
||||
//检查版本
|
||||
bigVer = rdata.data['version'];
|
||||
if (bigVer>=4.5){
|
||||
|
||||
data = syncPost('/plugins/run',{'name':'phpmyadmin','func':'status'});
|
||||
if (data.data != 'start'){
|
||||
layer.msg('phpMyAdmin未启动',{icon:2,shade: [0.3, '#000']});
|
||||
return;
|
||||
}
|
||||
setTimeout(function(){
|
||||
$("#toPHPMyAdmin").submit();
|
||||
},2000);
|
||||
layer.msg('phpMyAdmin['+data.data+']需要手动登录😭',{icon:16,shade: [0.3, '#000'],time:4000});
|
||||
|
||||
} else{
|
||||
var murl = $("#toPHPMyAdmin").attr('action');
|
||||
$("#pma_username").val(username);
|
||||
$("#pma_password").val(password);
|
||||
$("#db").val(name);
|
||||
|
||||
data = syncPost('/plugins/run',{'name':'phpmyadmin','func':'get_cfg'});
|
||||
var rdata = $.parseJSON(data.data);
|
||||
if (rdata.choose != 'mysql-apt'){
|
||||
layer.msg('当前为['+rdata.choose+']模式,若要使用请修改phpMyAdmin访问切换.',{icon:2,shade: [0.3, '#000']});
|
||||
return;
|
||||
}
|
||||
layer.msg('正在打开phpMyAdmin',{icon:16,shade: [0.3, '#000'],time:2000});
|
||||
|
||||
var phpmyadmin_cfg = rdata;
|
||||
data = syncPost('/plugins/run',{'name':'phpmyadmin','func':'get_home_page'});
|
||||
var rdata = $.parseJSON(data.data);
|
||||
if (!rdata.status){
|
||||
layer.msg(rdata.msg,{icon:2,shade: [0.3, '#000']});
|
||||
return;
|
||||
}
|
||||
var home_page = rdata.data;
|
||||
setTimeout(function(){
|
||||
$("#toPHPMyAdmin").submit();
|
||||
},2000);
|
||||
}
|
||||
|
||||
home_page = home_page.replace("http://","http://"+phpmyadmin_cfg['username']+":"+phpmyadmin_cfg['password']+"@")
|
||||
|
||||
$("#toPHPMyAdmin").attr('action',home_page);
|
||||
if($("#toPHPMyAdmin").attr('action').indexOf('phpmyadmin') == -1){
|
||||
layer.msg('请先安装phpMyAdmin',{icon:2,shade: [0.3, '#000']});
|
||||
setTimeout(function(){ window.location.href = '/soft'; },3000);
|
||||
return;
|
||||
}
|
||||
|
||||
//检查版本
|
||||
data = syncPost('/plugins/run',{'name':'phpmyadmin','func':'version'});
|
||||
bigVer = data.data.split('.')[0];
|
||||
if (bigVer>=4.5){
|
||||
|
||||
setTimeout(function(){
|
||||
$("#toPHPMyAdmin").submit();
|
||||
},3000);
|
||||
layer.msg('phpMyAdmin['+data.data+']需要手动登录😭',{icon:16,shade: [0.3, '#000'],time:4000});
|
||||
|
||||
} else{
|
||||
var murl = $("#toPHPMyAdmin").attr('action');
|
||||
$("#pma_username").val(username);
|
||||
$("#pma_password").val(password);
|
||||
$("#db").val(name);
|
||||
|
||||
layer.msg('正在打开phpMyAdmin',{icon:16,shade: [0.3, '#000'],time:2000});
|
||||
|
||||
setTimeout(function(){
|
||||
$("#toPHPMyAdmin").submit();
|
||||
},3000);
|
||||
}
|
||||
},'json');
|
||||
}
|
||||
|
||||
function delBackup(filename, name, path){
|
||||
|
||||
@@ -857,68 +857,53 @@ function setDbPs(id, name, obj) {
|
||||
}
|
||||
|
||||
function openPhpmyadmin(name,username,password){
|
||||
$.post('/plugins/run', {'name':'phpmyadmin','func':'plugins_db_support'}, function(data){
|
||||
var rdata = $.parseJSON(data.data);
|
||||
|
||||
data = syncPost('/plugins/check',{'name':'phpmyadmin'});
|
||||
if (rdata.data['installed'] != 'ok'){
|
||||
layer.msg('phpMyAdmin未安装!',{icon:2,shade: [0.3, '#000']});
|
||||
return;
|
||||
}
|
||||
|
||||
if (rdata.data['status'] != 'start'){
|
||||
layer.msg('phpMyAdmin未启动',{icon:2,shade: [0.3, '#000']});
|
||||
return;
|
||||
}
|
||||
|
||||
if (!data.status){
|
||||
layer.msg(data.msg,{icon:2,shade: [0.3, '#000']});
|
||||
return;
|
||||
}
|
||||
if (rdata.data['cfg']['choose'] != 'mysql-yum'){
|
||||
layer.msg('当前为['+rdata.choose+']模式,若要使用请修改phpMyAdmin访问切换.',{icon:2,shade: [0.3, '#000']});
|
||||
return;
|
||||
}
|
||||
var home_page = rdata.data['home_page'];
|
||||
$("#toPHPMyAdmin").attr('action',home_page);
|
||||
if($("#toPHPMyAdmin").attr('action').indexOf('phpmyadmin') == -1){
|
||||
layer.msg('请先安装phpMyAdmin',{icon:2,shade: [0.3, '#000']});
|
||||
setTimeout(function(){ window.location.href = '/soft'; },3000);
|
||||
return;
|
||||
}
|
||||
//检查版本
|
||||
bigVer = rdata.data['version'];
|
||||
if (bigVer>=4.5){
|
||||
|
||||
data = syncPost('/plugins/run',{'name':'phpmyadmin','func':'status'});
|
||||
if (data.data != 'start'){
|
||||
layer.msg('phpMyAdmin未启动',{icon:2,shade: [0.3, '#000']});
|
||||
return;
|
||||
}
|
||||
setTimeout(function(){
|
||||
$("#toPHPMyAdmin").submit();
|
||||
},2000);
|
||||
layer.msg('phpMyAdmin['+data.data+']需要手动登录😭',{icon:16,shade: [0.3, '#000'],time:4000});
|
||||
|
||||
} else{
|
||||
var murl = $("#toPHPMyAdmin").attr('action');
|
||||
$("#pma_username").val(username);
|
||||
$("#pma_password").val(password);
|
||||
$("#db").val(name);
|
||||
|
||||
data = syncPost('/plugins/run',{'name':'phpmyadmin','func':'get_cfg'});
|
||||
var rdata = $.parseJSON(data.data);
|
||||
if (rdata.choose != 'mysql-yum'){
|
||||
layer.msg('当前为['+rdata.choose+']模式,若要使用请修改phpMyAdmin访问切换.',{icon:2,shade: [0.3, '#000']});
|
||||
return;
|
||||
}
|
||||
layer.msg('正在打开phpMyAdmin',{icon:16,shade: [0.3, '#000'],time:2000});
|
||||
|
||||
var phpmyadmin_cfg = rdata;
|
||||
data = syncPost('/plugins/run',{'name':'phpmyadmin','func':'get_home_page'});
|
||||
var rdata = $.parseJSON(data.data);
|
||||
if (!rdata.status){
|
||||
layer.msg(rdata.msg,{icon:2,shade: [0.3, '#000']});
|
||||
return;
|
||||
}
|
||||
var home_page = rdata.data;
|
||||
setTimeout(function(){
|
||||
$("#toPHPMyAdmin").submit();
|
||||
},2000);
|
||||
}
|
||||
|
||||
home_page = home_page.replace("http://","http://"+phpmyadmin_cfg['username']+":"+phpmyadmin_cfg['password']+"@")
|
||||
|
||||
$("#toPHPMyAdmin").attr('action',home_page);
|
||||
if($("#toPHPMyAdmin").attr('action').indexOf('phpmyadmin') == -1){
|
||||
layer.msg('请先安装phpMyAdmin',{icon:2,shade: [0.3, '#000']});
|
||||
setTimeout(function(){ window.location.href = '/soft'; },3000);
|
||||
return;
|
||||
}
|
||||
|
||||
//检查版本
|
||||
data = syncPost('/plugins/run',{'name':'phpmyadmin','func':'version'});
|
||||
bigVer = data.data.split('.')[0];
|
||||
if (bigVer>=4.5){
|
||||
|
||||
setTimeout(function(){
|
||||
$("#toPHPMyAdmin").submit();
|
||||
},3000);
|
||||
layer.msg('phpMyAdmin['+data.data+']需要手动登录😭',{icon:16,shade: [0.3, '#000'],time:4000});
|
||||
|
||||
} else{
|
||||
var murl = $("#toPHPMyAdmin").attr('action');
|
||||
$("#pma_username").val(username);
|
||||
$("#pma_password").val(password);
|
||||
$("#db").val(name);
|
||||
|
||||
layer.msg('正在打开phpMyAdmin',{icon:16,shade: [0.3, '#000'],time:2000});
|
||||
|
||||
setTimeout(function(){
|
||||
$("#toPHPMyAdmin").submit();
|
||||
},3000);
|
||||
}
|
||||
},'json');
|
||||
}
|
||||
|
||||
function delBackup(filename, name, path){
|
||||
|
||||
+40
-55
@@ -857,68 +857,53 @@ function setDbPs(id, name, obj) {
|
||||
}
|
||||
|
||||
function openPhpmyadmin(name,username,password){
|
||||
$.post('/plugins/run', {'name':'phpmyadmin','func':'plugins_db_support'}, function(data){
|
||||
var rdata = $.parseJSON(data.data);
|
||||
|
||||
data = syncPost('/plugins/check',{'name':'phpmyadmin'});
|
||||
if (rdata.data['installed'] != 'ok'){
|
||||
layer.msg('phpMyAdmin未安装!',{icon:2,shade: [0.3, '#000']});
|
||||
return;
|
||||
}
|
||||
|
||||
if (rdata.data['status'] != 'start'){
|
||||
layer.msg('phpMyAdmin未启动',{icon:2,shade: [0.3, '#000']});
|
||||
return;
|
||||
}
|
||||
|
||||
if (!data.status){
|
||||
layer.msg(data.msg,{icon:2,shade: [0.3, '#000']});
|
||||
return;
|
||||
}
|
||||
if (rdata.data['cfg']['choose'] != 'mysql'){
|
||||
layer.msg('当前为['+rdata.choose+']模式,若要使用请修改phpMyAdmin访问切换.',{icon:2,shade: [0.3, '#000']});
|
||||
return;
|
||||
}
|
||||
var home_page = rdata.data['home_page'];
|
||||
$("#toPHPMyAdmin").attr('action',home_page);
|
||||
if($("#toPHPMyAdmin").attr('action').indexOf('phpmyadmin') == -1){
|
||||
layer.msg('请先安装phpMyAdmin',{icon:2,shade: [0.3, '#000']});
|
||||
setTimeout(function(){ window.location.href = '/soft'; },3000);
|
||||
return;
|
||||
}
|
||||
//检查版本
|
||||
bigVer = rdata.data['version'];
|
||||
if (bigVer>=4.5){
|
||||
|
||||
data = syncPost('/plugins/run',{'name':'phpmyadmin','func':'status'});
|
||||
if (data.data != 'start'){
|
||||
layer.msg('phpMyAdmin未启动',{icon:2,shade: [0.3, '#000']});
|
||||
return;
|
||||
}
|
||||
setTimeout(function(){
|
||||
$("#toPHPMyAdmin").submit();
|
||||
},2000);
|
||||
layer.msg('phpMyAdmin['+data.data+']需要手动登录😭',{icon:16,shade: [0.3, '#000'],time:4000});
|
||||
|
||||
} else{
|
||||
var murl = $("#toPHPMyAdmin").attr('action');
|
||||
$("#pma_username").val(username);
|
||||
$("#pma_password").val(password);
|
||||
$("#db").val(name);
|
||||
|
||||
data = syncPost('/plugins/run',{'name':'phpmyadmin','func':'get_cfg'});
|
||||
var rdata = $.parseJSON(data.data);
|
||||
if (rdata.choose != 'mysql'){
|
||||
layer.msg('当前为['+rdata.choose+']模式,若要使用请修改phpMyAdmin访问切换.',{icon:2,shade: [0.3, '#000']});
|
||||
return;
|
||||
}
|
||||
layer.msg('正在打开phpMyAdmin',{icon:16,shade: [0.3, '#000'],time:2000});
|
||||
|
||||
var phpmyadmin_cfg = rdata;
|
||||
data = syncPost('/plugins/run',{'name':'phpmyadmin','func':'get_home_page'});
|
||||
var rdata = $.parseJSON(data.data);
|
||||
if (!rdata.status){
|
||||
layer.msg(rdata.msg,{icon:2,shade: [0.3, '#000']});
|
||||
return;
|
||||
}
|
||||
var home_page = rdata.data;
|
||||
setTimeout(function(){
|
||||
$("#toPHPMyAdmin").submit();
|
||||
},2000);
|
||||
}
|
||||
|
||||
home_page = home_page.replace("http://","http://"+phpmyadmin_cfg['username']+":"+phpmyadmin_cfg['password']+"@")
|
||||
|
||||
$("#toPHPMyAdmin").attr('action',home_page);
|
||||
if($("#toPHPMyAdmin").attr('action').indexOf('phpmyadmin') == -1){
|
||||
layer.msg('请先安装phpMyAdmin',{icon:2,shade: [0.3, '#000']});
|
||||
setTimeout(function(){ window.location.href = '/soft'; },3000);
|
||||
return;
|
||||
}
|
||||
|
||||
//检查版本
|
||||
data = syncPost('/plugins/run',{'name':'phpmyadmin','func':'version'});
|
||||
bigVer = data.data.split('.')[0];
|
||||
if (bigVer>=4.5){
|
||||
|
||||
setTimeout(function(){
|
||||
$("#toPHPMyAdmin").submit();
|
||||
},2000);
|
||||
layer.msg('phpMyAdmin['+data.data+']需要手动登录😭',{icon:16,shade: [0.3, '#000'],time:4000});
|
||||
|
||||
} else{
|
||||
var murl = $("#toPHPMyAdmin").attr('action');
|
||||
$("#pma_username").val(username);
|
||||
$("#pma_password").val(password);
|
||||
$("#db").val(name);
|
||||
|
||||
layer.msg('正在打开phpMyAdmin',{icon:16,shade: [0.3, '#000'],time:2000});
|
||||
|
||||
setTimeout(function(){
|
||||
$("#toPHPMyAdmin").submit();
|
||||
},2000);
|
||||
}
|
||||
},'json');
|
||||
}
|
||||
|
||||
function delBackup(filename, name, path){
|
||||
|
||||
@@ -8,10 +8,10 @@
|
||||
"install_pre_inspection":true,
|
||||
"checks":"server/openresty",
|
||||
"path":"server/openresty",
|
||||
"author":"agentzh",
|
||||
"author":"nginx/agentzh",
|
||||
"home":"http://openresty.org",
|
||||
"date":"2017-11-24",
|
||||
"pid": "1",
|
||||
"versions": ["1.17.8.2","1.19.3.1","1.21.4.2","1.21.4.3"],
|
||||
"updates": ["1.17.8.2","1.19.3.1","1.21.4.2","1.21.4.3"]
|
||||
"versions": ["1.17.8.2","1.19.3.1","1.21.4.2","1.21.4.3","1.25.3.1"],
|
||||
"updates": ["1.17.8.2","1.19.3.1","1.21.4.2","1.21.4.3","1.25.3.1"]
|
||||
}
|
||||
@@ -121,6 +121,12 @@ Install_openresty()
|
||||
# OPTIONS="${OPTIONS} --with-openssl=${OPENSSL_LIB_DEPEND_DIR}"
|
||||
fi
|
||||
|
||||
if [ "$VERSION" == "1.25.3.1" ]; then
|
||||
OPTIONS="${OPTIONS} --with-http_v3_module"
|
||||
fi
|
||||
|
||||
|
||||
|
||||
# --with-openssl=$serverPath/source/lib/openssl-1.0.2q
|
||||
cd ${openrestyDir}/openresty-${VERSION} && ./configure \
|
||||
--prefix=$serverPath/openresty \
|
||||
|
||||
@@ -16,7 +16,7 @@ function version_lt() { test "$(echo "$@" | tr " " "\n" | sort -rV | head -n 1)"
|
||||
function version_ge() { test "$(echo "$@" | tr " " "\n" | sort -rV | head -n 1)" == "$1"; }
|
||||
|
||||
|
||||
version=8.2.15
|
||||
version=8.2.17
|
||||
PHP_VER=82
|
||||
Install_php()
|
||||
{
|
||||
@@ -57,7 +57,7 @@ if [ ! -d $sourcePath/php/php${PHP_VER} ];then
|
||||
fi
|
||||
|
||||
#检测文件是否损坏.
|
||||
md5_file_ok=eca5deac02d77d806838275f8a3024b38b35ac0a5d9853dcc71c6cbe3f1f8765
|
||||
md5_file_ok=1cc4ef733ba58f6557db648012471f1916e5bac316303aa165535bedab08ee35
|
||||
if [ -f $sourcePath/php/php-${version}.tar.xz ];then
|
||||
md5_file=`sha256sum $sourcePath/php/php-${version}.tar.xz | awk '{print $1}'`
|
||||
if [ "${md5_file}" != "${md5_file_ok}" ]; then
|
||||
|
||||
@@ -15,7 +15,7 @@ function version_le() { test "$(echo "$@" | tr " " "\n" | sort -V | head -n 1)"
|
||||
function version_lt() { test "$(echo "$@" | tr " " "\n" | sort -rV | head -n 1)" != "$1"; }
|
||||
function version_ge() { test "$(echo "$@" | tr " " "\n" | sort -rV | head -n 1)" == "$1"; }
|
||||
|
||||
version=8.3.2
|
||||
version=8.3.4
|
||||
PHP_VER=83
|
||||
Install_php()
|
||||
{
|
||||
@@ -56,7 +56,7 @@ if [ ! -d $sourcePath/php/php${PHP_VER} ];then
|
||||
fi
|
||||
|
||||
#检测文件是否损坏.
|
||||
md5_file_ok=4ffa3e44afc9c590e28dc0d2d31fc61f0139f8b335f11880a121b9f9b9f0634e
|
||||
md5_file_ok=39a337036a546e5c28aea76cf424ac172db5156bd8a8fd85252e389409a5ba63
|
||||
if [ -f $sourcePath/php/php-${version}.tar.xz ];then
|
||||
md5_file=`sha256sum $sourcePath/php/php-${version}.tar.xz | awk '{print $1}'`
|
||||
if [ "${md5_file}" != "${md5_file_ok}" ]; then
|
||||
|
||||
@@ -20,7 +20,7 @@ LIBNAME=zip
|
||||
LIBV=0
|
||||
|
||||
|
||||
if [ "$version" -lt "73" ];then
|
||||
if [ "$version" -lt "72" ];then
|
||||
echo "not need"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
@@ -724,6 +724,7 @@
|
||||
{
|
||||
"name": "zip",
|
||||
"versions": [
|
||||
"72",
|
||||
"83"
|
||||
],
|
||||
"type": "压缩",
|
||||
|
||||
@@ -446,9 +446,37 @@ def errorLog():
|
||||
return getServerDir() + '/error.log'
|
||||
|
||||
|
||||
def Version():
|
||||
def installVersion():
|
||||
return mw.readFile(getServerDir() + '/version.pl')
|
||||
|
||||
def pluginsDbSupport():
|
||||
data = {}
|
||||
|
||||
data['installed'] = 'no'
|
||||
install_path = getServerDir()
|
||||
if not os.path.exists(install_path):
|
||||
return mw.returnJson(True, 'ok', data)
|
||||
|
||||
data['installed'] = 'ok'
|
||||
data['status'] = status()
|
||||
if (data['status'] == 'stop'):
|
||||
return mw.returnJson(True, 'ok', data)
|
||||
|
||||
data['cfg'] = getCfg()
|
||||
port = getPort()
|
||||
ip = '127.0.0.1'
|
||||
if not mw.isAppleSystem():
|
||||
ip = mw.getLocalIp()
|
||||
|
||||
cfg = data['cfg']
|
||||
auth = cfg['username']+':'+cfg['password']
|
||||
rand_path = cfg['path']
|
||||
home_page = 'http://' + auth + '@' + ip + ':' + port + '/' + rand_path + '/index.php'
|
||||
|
||||
data['home_page'] = home_page
|
||||
data['version'] = installVersion().strip()
|
||||
|
||||
return mw.returnJson(True, 'ok', data)
|
||||
|
||||
if __name__ == "__main__":
|
||||
func = sys.argv[1]
|
||||
@@ -465,7 +493,7 @@ if __name__ == "__main__":
|
||||
elif func == 'conf':
|
||||
print(getConf())
|
||||
elif func == 'version':
|
||||
print(Version())
|
||||
print(installVersion())
|
||||
elif func == 'get_cfg':
|
||||
print(returnCfg())
|
||||
elif func == 'config_inc':
|
||||
@@ -494,5 +522,7 @@ if __name__ == "__main__":
|
||||
print(accessLog())
|
||||
elif func == 'error_log':
|
||||
print(errorLog())
|
||||
elif func == 'plugins_db_support':
|
||||
print(pluginsDbSupport())
|
||||
else:
|
||||
print('error')
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"global": {
|
||||
"monitor": true,
|
||||
"save_day": 180,
|
||||
"save_day": 1,
|
||||
"autorefresh": false,
|
||||
"refresh_interval": 3,
|
||||
"cdn": true,
|
||||
|
||||
+67
-28
@@ -1,33 +1,73 @@
|
||||
var num = 0;
|
||||
//查看任务日志
|
||||
function getLogs(id){
|
||||
layer.msg('正在获取,请稍候...',{icon:16,time:0,shade: [0.3, '#000']});
|
||||
var data='&id='+id;
|
||||
$.post('/crontab/logs', data, function(rdata){
|
||||
layer.closeAll();
|
||||
if(!rdata.status) {
|
||||
layer.msg(rdata.msg,{icon:2, time:2000});
|
||||
return;
|
||||
};
|
||||
layer.open({
|
||||
type:1,
|
||||
title:lan.crontab.task_log_title,
|
||||
area: ['60%','500px'],
|
||||
shadeClose:false,
|
||||
closeBtn:1,
|
||||
content:'<div class="setchmod bt-form pd20 pb70">'
|
||||
+'<pre id="crontab-log" style="overflow: auto; border: 0px none; line-height:23px;padding: 15px; margin: 0px; white-space: pre-wrap; height: 405px; background-color: rgb(51,51,51);color:#f1f1f1;border-radius:0px;font-family:"></pre>'
|
||||
+'<div class="bt-form-submit-btn" style="margin-top: 0px;">'
|
||||
+'<button type="button" class="btn btn-success btn-sm" onclick="closeLogs('+id+')">清空</button>'
|
||||
+'<button type="button" class="btn btn-danger btn-sm" onclick="layer.closeAll()">关闭</button>'
|
||||
+'</div>'
|
||||
+'</div>'
|
||||
});
|
||||
|
||||
setTimeout(function(){
|
||||
$("#crontab-log").html(rdata.msg);
|
||||
},200);
|
||||
},'json');
|
||||
var reqTimer = null;
|
||||
var reqCount = 0;
|
||||
|
||||
var tips = layer.msg('正在获取,请稍候...',{icon:16,time:0,shade: [0.3, '#000']});
|
||||
var req_log_args = 'id='+id;
|
||||
function requestLogs(layerIndex){
|
||||
|
||||
$.post('/crontab/logs', req_log_args, function(rdata){
|
||||
|
||||
if (reqCount == 0){
|
||||
layer.close(tips);
|
||||
}
|
||||
|
||||
if(!rdata.status) {
|
||||
layer.close(layerIndex);
|
||||
layer.msg(rdata.msg,{icon:2, time:2000});
|
||||
clearInterval(reqTimer);
|
||||
return;
|
||||
};
|
||||
|
||||
if (rdata.msg == ''){
|
||||
rdata.msg = '暂无数据!';
|
||||
}
|
||||
|
||||
$("#crontab_log").html(rdata.msg);
|
||||
//滚动到最低
|
||||
var ob = document.getElementById('crontab_log');
|
||||
ob.scrollTop = ob.scrollHeight;
|
||||
reqCount++;
|
||||
},'json');
|
||||
|
||||
}
|
||||
|
||||
|
||||
layer.open({
|
||||
type:1,
|
||||
title:"任务执行日志",
|
||||
area: ['60%','500px'],
|
||||
shadeClose:false,
|
||||
btn:["清空","关闭"],
|
||||
closeBtn:1,
|
||||
end: function(){
|
||||
if (reqTimer){
|
||||
clearInterval(reqTimer);
|
||||
}
|
||||
},
|
||||
content:'<div class="setchmod bt-form" style="padding:5px;">'
|
||||
+'<pre id="crontab_log" style="overflow: auto; border: 0px none; line-height:23px;padding: 5px; margin: 0px; white-space: pre-wrap; height: 395px; background-color: rgb(51,51,51);color:#f1f1f1;border-radius:0px;font-family:"></pre>'
|
||||
// +'<div class="bt-form-submit-btn" style="margin-top: 0px;">'
|
||||
// +'<button type="button" class="btn btn-success btn-sm" onclick="closeLogs('+id+')">清空</button>'
|
||||
// +'<button type="button" class="btn btn-danger btn-sm" onclick="layer.closeAll()">关闭</button>'
|
||||
// +'</div>'
|
||||
+'</div>',
|
||||
success:function(index,layer_index){
|
||||
requestLogs(layer_index);
|
||||
reqTimer = setInterval(function(){
|
||||
requestLogs(layer_index);
|
||||
},3000);
|
||||
},
|
||||
|
||||
yes:function(index){
|
||||
clearInterval(reqTimer);
|
||||
closeLogs(id);
|
||||
layer.close(index);
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -119,7 +159,6 @@ function startTask(id){
|
||||
var data='id='+id;
|
||||
$.post('/crontab/start_task',data,function(rdata){
|
||||
showMsg(rdata.msg, function(){
|
||||
layer.closeAll();
|
||||
},{icon:rdata.status?1:2,time:2000});
|
||||
},'json');
|
||||
}
|
||||
@@ -131,7 +170,7 @@ function closeLogs(id){
|
||||
var data='id='+id;
|
||||
$.post('/crontab/del_logs',data,function(rdata){
|
||||
showMsg(rdata.msg, function(){
|
||||
layer.closeAll();
|
||||
// layer.closeAll();
|
||||
},{icon:rdata.status?1:2,time:2000});
|
||||
},'json');
|
||||
}
|
||||
|
||||
+175
-94
@@ -26,15 +26,15 @@ function recycleBin(type){
|
||||
if(shortwebname.length > 20) shortwebname = shortwebname.substring(0, 20) + "...";
|
||||
if(shortpath.length > 20) shortpath = shortpath.substring(0, 20) + "...";
|
||||
body += '<tr>\
|
||||
<td><span class=\'ico ico-folder\'></span><span class="tname" title="'+rdata.dirs[i].name+'">'+shortwebname+'</span></td>\
|
||||
<td><span title="'+rdata.dirs[i].dname+'">'+shortpath+'</span></td>\
|
||||
<td>'+toSize(rdata.dirs[i].size)+'</td>\
|
||||
<td>'+getLocalTime(rdata.dirs[i].time)+'</td>\
|
||||
<td style="text-align: right;">\
|
||||
<a class="btlink" href="javascript:;" onclick="reRecycleBin(\'' + rdata.dirs[i].rname.replace(/'/,"\\'") + '\',this)">'+lan.files.recycle_bin_re+'</a>\
|
||||
| <a class="btlink" href="javascript:;" onclick="delRecycleBin(\'' + rdata.dirs[i].rname.replace(/'/,"\\'") + '\',this)">'+lan.files.recycle_bin_del+'</a>\
|
||||
</td>\
|
||||
</tr>'
|
||||
<td><span class=\'ico ico-folder\'></span><span class="tname" title="'+rdata.dirs[i].name+'">'+shortwebname+'</span></td>\
|
||||
<td><span title="'+rdata.dirs[i].dname+'">'+shortpath+'</span></td>\
|
||||
<td>'+toSize(rdata.dirs[i].size)+'</td>\
|
||||
<td>'+getLocalTime(rdata.dirs[i].time)+'</td>\
|
||||
<td style="text-align: right;">\
|
||||
<a class="btlink" href="javascript:;" onclick="reRecycleBin(\'' + rdata.dirs[i].rname.replace(/'/,"\\'") + '\',this)">'+lan.files.recycle_bin_re+'</a>\
|
||||
| <a class="btlink" href="javascript:;" onclick="delRecycleBin(\'' + rdata.dirs[i].rname.replace(/'/,"\\'") + '\',this)">'+lan.files.recycle_bin_del+'</a>\
|
||||
</td>\
|
||||
</tr>';
|
||||
}
|
||||
for(var i=0;i<rdata.files.length;i++){
|
||||
if(rdata.files[i].name.indexOf('BTDB_') != -1){
|
||||
@@ -43,15 +43,15 @@ function recycleBin(type){
|
||||
if(shortwebname.length > 20) shortwebname = shortwebname.substring(0, 20) + "...";
|
||||
if(shortpath.length > 20) shortpath = shortpath.substring(0, 20) + "...";
|
||||
body += '<tr>\
|
||||
<td><span class="ico ico-'+(getExtName(rdata.files[i].name))+'"></span><span class="tname" title="'+rdata.files[i].name+'">'+shortwebname.replace('BTDB_','')+'</span></td>\
|
||||
<td><span title="'+rdata.files[i].dname+'">mysql://'+shortpath.replace('BTDB_','')+'</span></td>\
|
||||
<td>-</td>\
|
||||
<td>'+getLocalTime(rdata.files[i].time)+'</td>\
|
||||
<td style="text-align: right;">\
|
||||
<a class="btlink" href="javascript:;" onclick="reRecycleBin(\'' + rdata.files[i].rname.replace(/'/,"\\'") + '\',this)">'+lan.files.recycle_bin_re+'</a>\
|
||||
| <a class="btlink" href="javascript:;" onclick="delRecycleBin(\'' + rdata.files[i].rname.replace(/'/,"\\'") + '\',this)">'+lan.files.recycle_bin_del+'</a>\
|
||||
</td>\
|
||||
</tr>'
|
||||
<td><span class="ico ico-'+(getExtName(rdata.files[i].name))+'"></span><span class="tname" title="'+rdata.files[i].name+'">'+shortwebname.replace('BTDB_','')+'</span></td>\
|
||||
<td><span title="'+rdata.files[i].dname+'">mysql://'+shortpath.replace('BTDB_','')+'</span></td>\
|
||||
<td>-</td>\
|
||||
<td>'+getLocalTime(rdata.files[i].time)+'</td>\
|
||||
<td style="text-align: right;">\
|
||||
<a class="btlink" href="javascript:;" onclick="reRecycleBin(\'' + rdata.files[i].rname.replace(/'/,"\\'") + '\',this)">'+lan.files.recycle_bin_re+'</a>\
|
||||
| <a class="btlink" href="javascript:;" onclick="delRecycleBin(\'' + rdata.files[i].rname.replace(/'/,"\\'") + '\',this)">'+lan.files.recycle_bin_del+'</a>\
|
||||
</td>\
|
||||
</tr>';
|
||||
|
||||
continue;
|
||||
}
|
||||
@@ -80,15 +80,15 @@ function recycleBin(type){
|
||||
if(shortwebname.length > 20) shortwebname = shortwebname.substring(0, 20) + "...";
|
||||
if(shortpath.length > 20) shortpath = shortpath.substring(0, 20) + "...";
|
||||
body += '<tr>\
|
||||
<td><span class=\'ico ico-folder\'></span><span class="tname" title="'+rdata.dirs[i].name+'">'+shortwebname+'</span></td>\
|
||||
<td><span title="'+rdata.dirs[i].dname+'">'+shortpath+'</span></td>\
|
||||
<td>'+toSize(rdata.dirs[i].size)+'</td>\
|
||||
<td>'+getLocalTime(rdata.dirs[i].time)+'</td>\
|
||||
<td style="text-align: right;">\
|
||||
<a class="btlink" href="javascript:;" onclick="reRecycleBin(\'' + rdata.dirs[i].rname.replace(/'/,"\\'") + '\',this)">'+lan.files.recycle_bin_re+'</a>\
|
||||
| <a class="btlink" href="javascript:;" onclick="delRecycleBin(\'' + rdata.dirs[i].rname.replace(/'/,"\\'") + '\',this)">'+lan.files.recycle_bin_del+'</a>\
|
||||
</td>\
|
||||
</tr>'
|
||||
<td><span class=\'ico ico-folder\'></span><span class="tname" title="'+rdata.dirs[i].name+'">'+shortwebname+'</span></td>\
|
||||
<td><span title="'+rdata.dirs[i].dname+'">'+shortpath+'</span></td>\
|
||||
<td>'+toSize(rdata.dirs[i].size)+'</td>\
|
||||
<td>'+getLocalTime(rdata.dirs[i].time)+'</td>\
|
||||
<td style="text-align: right;">\
|
||||
<a class="btlink" href="javascript:;" onclick="reRecycleBin(\'' + rdata.dirs[i].rname.replace(/'/,"\\'") + '\',this)">'+lan.files.recycle_bin_re+'</a>\
|
||||
| <a class="btlink" href="javascript:;" onclick="delRecycleBin(\'' + rdata.dirs[i].rname.replace(/'/,"\\'") + '\',this)">'+lan.files.recycle_bin_del+'</a>\
|
||||
</td>\
|
||||
</tr>'
|
||||
}
|
||||
$("#RecycleBody").html(body);
|
||||
return;
|
||||
@@ -101,15 +101,15 @@ function recycleBin(type){
|
||||
if(shortwebname.length > 20) shortwebname = shortwebname.substring(0, 20) + "...";
|
||||
if(shortpath.length > 20) shortpath = shortpath.substring(0, 20) + "...";
|
||||
body += '<tr>\
|
||||
<td><span class="ico ico-'+(getExtName(rdata.files[i].name))+'"></span><span class="tname" title="'+rdata.files[i].name+'">'+shortwebname+'</span></td>\
|
||||
<td><span title="'+rdata.files[i].dname+'">'+shortpath+'</span></td>\
|
||||
<td>'+toSize(rdata.files[i].size)+'</td>\
|
||||
<td>'+getLocalTime(rdata.files[i].time)+'</td>\
|
||||
<td style="text-align: right;">\
|
||||
<a class="btlink" href="javascript:;" onclick="reRecycleBin(\'' + rdata.files[i].rname.replace(/'/,"\\'") + '\',this)">'+lan.files.recycle_bin_re+'</a>\
|
||||
| <a class="btlink" href="javascript:;" onclick="delRecycleBin(\'' + rdata.files[i].rname.replace(/'/,"\\'") + '\',this)">'+lan.files.recycle_bin_del+'</a>\
|
||||
</td>\
|
||||
</tr>'
|
||||
<td><span class="ico ico-'+(getExtName(rdata.files[i].name))+'"></span><span class="tname" title="'+rdata.files[i].name+'">'+shortwebname+'</span></td>\
|
||||
<td><span title="'+rdata.files[i].dname+'">'+shortpath+'</span></td>\
|
||||
<td>'+toSize(rdata.files[i].size)+'</td>\
|
||||
<td>'+getLocalTime(rdata.files[i].time)+'</td>\
|
||||
<td style="text-align: right;">\
|
||||
<a class="btlink" href="javascript:;" onclick="reRecycleBin(\'' + rdata.files[i].rname.replace(/'/,"\\'") + '\',this)">'+lan.files.recycle_bin_re+'</a>\
|
||||
| <a class="btlink" href="javascript:;" onclick="delRecycleBin(\'' + rdata.files[i].rname.replace(/'/,"\\'") + '\',this)">'+lan.files.recycle_bin_del+'</a>\
|
||||
</td>\
|
||||
</tr>';
|
||||
}
|
||||
$("#RecycleBody").html(body);
|
||||
return;
|
||||
@@ -122,15 +122,15 @@ function recycleBin(type){
|
||||
if(shortwebname.length > 20) shortwebname = shortwebname.substring(0, 20) + "...";
|
||||
if(shortpath.length > 20) shortpath = shortpath.substring(0, 20) + "...";
|
||||
body += '<tr>\
|
||||
<td><span class="ico ico-'+(getExtName(rdata.files[i].name))+'"></span><span class="tname" title="'+rdata.files[i].name+'">'+shortwebname+'</span></td>\
|
||||
<td><span title="'+rdata.files[i].dname+'">'+shortpath+'</span></td>\
|
||||
<td>'+toSize(rdata.files[i].size)+'</td>\
|
||||
<td>'+getLocalTime(rdata.files[i].time)+'</td>\
|
||||
<td style="text-align: right;">\
|
||||
<a class="btlink" href="javascript:;" onclick="reRecycleBin(\'' + rdata.files[i].rname.replace(/'/,"\\'") + '\',this)">'+lan.files.recycle_bin_re+'</a>\
|
||||
| <a class="btlink" href="javascript:;" onclick="delRecycleBin(\'' + rdata.files[i].rname.replace(/'/,"\\'") + '\',this)">'+lan.files.recycle_bin_del+'</a>\
|
||||
</td>\
|
||||
</tr>'
|
||||
<td><span class="ico ico-'+(getExtName(rdata.files[i].name))+'"></span><span class="tname" title="'+rdata.files[i].name+'">'+shortwebname+'</span></td>\
|
||||
<td><span title="'+rdata.files[i].dname+'">'+shortpath+'</span></td>\
|
||||
<td>'+toSize(rdata.files[i].size)+'</td>\
|
||||
<td>'+getLocalTime(rdata.files[i].time)+'</td>\
|
||||
<td style="text-align: right;">\
|
||||
<a class="btlink" href="javascript:;" onclick="reRecycleBin(\'' + rdata.files[i].rname.replace(/'/,"\\'") + '\',this)">'+lan.files.recycle_bin_re+'</a>\
|
||||
| <a class="btlink" href="javascript:;" onclick="delRecycleBin(\'' + rdata.files[i].rname.replace(/'/,"\\'") + '\',this)">'+lan.files.recycle_bin_del+'</a>\
|
||||
</td>\
|
||||
</tr>';
|
||||
}
|
||||
}
|
||||
$("#RecycleBody").html(body);
|
||||
@@ -222,6 +222,7 @@ function getFileName(name){
|
||||
text = text[n];
|
||||
return text;
|
||||
}
|
||||
|
||||
//判断图片文件
|
||||
function reisImage(fileName){
|
||||
var exts = ['jpg','jpeg','png','bmp','gif','tiff','ico'];
|
||||
@@ -328,87 +329,142 @@ function searchFile(p){
|
||||
getFiles(p);
|
||||
}
|
||||
|
||||
//处理排序
|
||||
function listFileOrder(skey, obj){
|
||||
var or = getCookie('file_order');
|
||||
var orderType = 'desc';
|
||||
if(or){
|
||||
var or_arr = or.split('|');
|
||||
if(or.split('|')[1] == 'desc'){
|
||||
orderType = 'asc';
|
||||
} else if (or_arr[1] == 'asc'){
|
||||
orderType = 'none';
|
||||
} else {
|
||||
orderType = 'desc';
|
||||
}
|
||||
}
|
||||
setCookie('file_order',skey + '|' + orderType);
|
||||
getFiles(1);
|
||||
// console.log(obj,orderType);
|
||||
// if(orderType == 'desc'){
|
||||
// $(obj).find(".glyphicon-triangle-top").remove();
|
||||
// $(obj).append("<span class='glyphicon glyphicon-triangle-bottom' style='margin-left:5px;color:#bbb'></span>");
|
||||
// } else {
|
||||
// $(obj).find(".glyphicon-triangle-bottom").remove();
|
||||
// $(obj).append("<span class='glyphicon glyphicon-triangle-top' style='margin-left:5px;color:#bbb'></span>");
|
||||
// }
|
||||
}
|
||||
|
||||
function makeFilePage(showRow, page = ''){
|
||||
var rows = ['10','50','100','200','500','1000','2000'];
|
||||
var rowOption = '';
|
||||
for(var i=0;i<rows.length;i++){
|
||||
var rowSelected = '';
|
||||
if(showRow == rows[i]) rowSelected = 'selected';
|
||||
rowOption += '<option value="'+rows[i]+'" '+rowSelected+'>'+rows[i]+'</option>';
|
||||
}
|
||||
|
||||
//分页
|
||||
$("#filePage").html(page);
|
||||
$("#filePage div").append("<span class='Pcount-item'>每页<select style='margin-left: 3px;margin-right: 3px;border:#ddd 1px solid' class='showRow'>"+rowOption+"</select>条</span>");
|
||||
$("#filePage .Pcount").css("left","16px");
|
||||
}
|
||||
|
||||
//取数据
|
||||
function getFiles(Path) {
|
||||
var searchtype = Path;
|
||||
if(isNaN(Path)){
|
||||
var p = 1;
|
||||
Path = encodeURIComponent(Path);
|
||||
} else {
|
||||
var p = Path;
|
||||
Path = getCookie('open_dir_path');
|
||||
Path = encodeURIComponent(Path);
|
||||
}
|
||||
|
||||
var search = '';
|
||||
var searchV = $("#SearchValue").val();
|
||||
if(searchV.length > 1 && searchtype == '1'){
|
||||
search = "&search="+searchV;
|
||||
}
|
||||
var showRow = getCookie('showRow');
|
||||
if(!showRow) {
|
||||
showRow = '100';
|
||||
|
||||
var args = {};
|
||||
args['p'] = p;
|
||||
var post = {};
|
||||
post['path'] = Path;
|
||||
|
||||
|
||||
var file_row = $.cookie('file_row');
|
||||
if(!file_row) {
|
||||
file_row = '100';
|
||||
args['row'] = file_row;
|
||||
}
|
||||
|
||||
var body = '';
|
||||
var data = 'path=' + Path;
|
||||
var totalSize = 0;
|
||||
|
||||
var search = '';
|
||||
var search_file = $("#search_file").val();
|
||||
|
||||
if(search_file.length > 0){
|
||||
args['search'] = search_file;
|
||||
}
|
||||
|
||||
var search_all = '';
|
||||
var all = $('#search_all').hasClass('active');
|
||||
if(all){
|
||||
search_all = "&all=yes";
|
||||
args['all'] = 'yes';
|
||||
}
|
||||
|
||||
var file_order = $.cookie('file_order');
|
||||
if (file_order){
|
||||
post['order'] = file_order.replace('|',' ');
|
||||
}
|
||||
|
||||
var query_str = toUrlParam(args);
|
||||
|
||||
var loadT = layer.load();
|
||||
$.post('/files/get_dir?p=' + p + '&showRow=' + showRow + search + search_all, data, function(rdata) {
|
||||
$.post('/files/get_dir?' + query_str, post, function(rdata) {
|
||||
layer.close(loadT);
|
||||
|
||||
var rows = ['10','50','100','200','500','1000','2000'];
|
||||
var rowOption = '';
|
||||
for(var i=0;i<rows.length;i++){
|
||||
var rowSelected = '';
|
||||
if(showRow == rows[i]) rowSelected = 'selected';
|
||||
rowOption += '<option value="'+rows[i]+'" '+rowSelected+'>'+rows[i]+'</option>';
|
||||
//构建分页
|
||||
makeFilePage(file_row,rdata.PAGE);
|
||||
|
||||
if(rdata.DIR == null) {
|
||||
rdata.DIR = [];
|
||||
}
|
||||
|
||||
$("#filePage").html(rdata.PAGE);
|
||||
$("#filePage div").append("<span class='Pcount-item'>每页<select style='margin-left: 3px;margin-right: 3px;border:#ddd 1px solid' class='showRow'>"+rowOption+"</select>条</span>");
|
||||
$("#filePage .Pcount").css("left","16px");
|
||||
if(rdata.DIR == null) rdata.DIR = [];
|
||||
|
||||
for (var i = 0; i < rdata.DIR.length; i++) {
|
||||
|
||||
var fmp = rdata.DIR[i].split(";");
|
||||
var cnametext =fmp[0] + fmp[5];
|
||||
|
||||
fmp[0] = fmp[0].replace(/'/, "\\'");
|
||||
if(cnametext.length>20){
|
||||
cnametext = cnametext.substring(0,20) + '...';
|
||||
}
|
||||
|
||||
if(isChineseChar(cnametext)){
|
||||
if(cnametext.length>10){
|
||||
cnametext = cnametext.substring(0,10) + '...';
|
||||
}
|
||||
}
|
||||
|
||||
var timetext ='--';
|
||||
if(getCookie('rank') == 'a'){
|
||||
$("#set_list").addClass("active");
|
||||
$("#set_icon").removeClass("active");
|
||||
body += "<tr class='folderBoxTr' data-path='" + rdata.PATH + "/" + fmp[0] + "' filetype='dir'>\
|
||||
<td><input type='checkbox' name='id' value='"+fmp[0]+"'></td>\
|
||||
<td class='column-name'><span class='cursor' onclick=\"getFiles('" + rdata.PATH + "/" + fmp[0] + "')\">\
|
||||
<span class='ico ico-folder'></span><a class='text' title='" + fmp[0] + fmp[5] + "'>" + cnametext + "</a></span></td>\
|
||||
<td>"+toSize(fmp[1])+"</td>\
|
||||
<td>"+getLocalTime(fmp[2])+"</td>\
|
||||
<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:;' onclick=\"reName(0,'" + fmp[0] + "');\">重命名</a> | \
|
||||
<a class='btlink' href='javascript:;' onclick=\"setChmod(0,'" + rdata.PATH + "/"+fmp[0] + "');\">权限</a> | \
|
||||
<a class='btlink' href='javascript:;' onclick=\"zip('" + rdata.PATH +"/" +fmp[0] + "');\">压缩</a> | \
|
||||
<a class='btlink' href='javascript:;' onclick=\"deleteDir('" + rdata.PATH +"/"+ fmp[0] + "')\">删除</a></span>\
|
||||
</td>\
|
||||
</tr>";
|
||||
//列表展示
|
||||
$("#set_list").addClass("active");
|
||||
$("#set_icon").removeClass("active");
|
||||
body += "<tr class='folderBoxTr' data-path='" + rdata.PATH + "/" + fmp[0] + "' filetype='dir'>\
|
||||
<td><input type='checkbox' name='id' value='"+fmp[0]+"'></td>\
|
||||
<td class='column-name'><span class='cursor' onclick=\"getFiles('" + rdata.PATH + "/" + fmp[0] + "')\">\
|
||||
<span class='ico ico-folder'></span><a class='text' title='" + fmp[0] + fmp[5] + "'>" + cnametext + "</a></span></td>\
|
||||
<td>"+toSize(fmp[1])+"</td>\
|
||||
<td>"+getLocalTime(fmp[2])+"</td>\
|
||||
<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:;' onclick=\"reName(0,'" + fmp[0] + "');\">重命名</a> | \
|
||||
<a class='btlink' href='javascript:;' onclick=\"setChmod(0,'" + rdata.PATH + "/"+fmp[0] + "');\">权限</a> | \
|
||||
<a class='btlink' href='javascript:;' onclick=\"zip('" + rdata.PATH +"/" +fmp[0] + "');\">压缩</a> | \
|
||||
<a class='btlink' href='javascript:;' onclick=\"deleteDir('" + rdata.PATH +"/"+ fmp[0] + "')\">删除</a></span>\
|
||||
</td>\
|
||||
</tr>";
|
||||
} else {
|
||||
//图标展示
|
||||
$("#set_icon").addClass("active");
|
||||
$("#set_list").removeClass("active");
|
||||
body += "<div class='file folderBox menufolder' data-path='" + rdata.PATH + "/" + fmp[0] + "' filetype='dir' title='"+lan.files.file_name+":" + fmp[0]+" "+lan.files.file_size+":"
|
||||
@@ -421,6 +477,7 @@ function getFiles(Path) {
|
||||
</div>";
|
||||
}
|
||||
}
|
||||
|
||||
for (var i = 0; i < rdata.FILES.length; i++) {
|
||||
if(rdata.FILES[i] == null) continue;
|
||||
var fmp = rdata.FILES[i].split(";");
|
||||
@@ -490,13 +547,37 @@ function getFiles(Path) {
|
||||
+ (toSize(totalSize))+'<a class="btlink ml5" onClick="getPathSize()">获取</a></font>)';
|
||||
$("#dir_info").html(dirInfo);
|
||||
if( getCookie('rank') == 'a' ){
|
||||
|
||||
// console.log(post['order']);
|
||||
var size_icon = '<span class="glyphicon glyphicon-triangle-top" style="margin-left:5px;color:#bbb">';
|
||||
if (post['order'] == 'size desc'){
|
||||
size_icon = '<span class="glyphicon glyphicon-triangle-bottom" style="margin-left:5px;color:#bbb">';
|
||||
} else if (post['order'] == 'size asc'){
|
||||
size_icon = '<span class="glyphicon glyphicon-triangle-top" style="margin-left:5px;color:#bbb">';
|
||||
} else {
|
||||
size_icon = '<span class="glyphicon glyphicon-option-horizontal" style="top:3px;margin-left:5px;color:#bbb">';
|
||||
}
|
||||
|
||||
var mtime_icon = '<span class="glyphicon glyphicon-triangle-top" style="margin-left:5px;color:#bbb">';
|
||||
if (post['order'] == 'mtime desc'){
|
||||
mtime_icon = '<span class="glyphicon glyphicon-triangle-bottom" style="margin-left:5px;color:#bbb">';
|
||||
} else if (post['order'] == 'mtime asc'){
|
||||
mtime_icon = '<span class="glyphicon glyphicon-triangle-top" style="margin-left:5px;color:#bbb">';
|
||||
} else {
|
||||
mtime_icon = '<span class="glyphicon glyphicon-option-horizontal" style="top:3px;margin-left:5px;color:#bbb">';
|
||||
}
|
||||
|
||||
var tablehtml = '<table width="100%" border="0" cellpadding="0" cellspacing="0" class="table table-hover">\
|
||||
<thead>\
|
||||
<tr>\
|
||||
<th width="30"><input type="checkbox" id="setBox" placeholder=""></th>\
|
||||
<th>文件名</th>\
|
||||
<th>大小</th>\
|
||||
<th>修改时间</th>\
|
||||
<th onclick="listFileOrder(\'size\',this)" style="cursor: pointer;">大小\
|
||||
'+size_icon+'\
|
||||
</th>\
|
||||
<th onclick="listFileOrder(\'mtime\',this)" style="cursor: pointer;">修改时间\
|
||||
'+mtime_icon+'\
|
||||
</th>\
|
||||
<th>权限</th>\
|
||||
<th>所有者</th>\
|
||||
<th style="text-align: right;" width="330">操作</th>\
|
||||
@@ -613,12 +694,12 @@ function getFiles(Path) {
|
||||
|
||||
//每页行数
|
||||
$(".showRow").change(function(){
|
||||
setCookie('showRow',$(this).val());
|
||||
setCookie('file_row',$(this).val());
|
||||
getFiles(p);
|
||||
});
|
||||
pathPlaceBtn(rdata.PATH);
|
||||
},'json');
|
||||
setTimeout(function(){getCookie('open_dir_path');},200);
|
||||
// setTimeout(function(){getCookie('open_dir_path');},200);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -825,6 +825,7 @@ function isAction() {
|
||||
}
|
||||
$("#memuA" + name).addClass("current")
|
||||
}
|
||||
|
||||
var W_window = $(window).width();
|
||||
if(W_window <= 980) {
|
||||
$(window).scroll(function() {
|
||||
@@ -1868,6 +1869,10 @@ function showSpeedWindow(msg, speed_log_func_name, callback){
|
||||
|
||||
/*** 其中功能,针对插件通过库使用 start ***/
|
||||
|
||||
function toUrlParam(json) {
|
||||
return Object.keys(json).map(key => key + '=' + json[key]).join('&');
|
||||
}
|
||||
|
||||
//字符串转数组对象
|
||||
function toArrayObject(str){
|
||||
var data = {};
|
||||
|
||||
@@ -1094,20 +1094,21 @@ html .menu .menu_exit:hover {
|
||||
}
|
||||
|
||||
.table .btlinkbed:hover {
|
||||
border: #ddd 1px solid
|
||||
border: #ddd 1px solid;
|
||||
}
|
||||
|
||||
.dataTables_paginate {
|
||||
display: block;
|
||||
height: 30px;
|
||||
height: 35px;
|
||||
margin-bottom: 0px;
|
||||
margin-top: 0px;
|
||||
margin-top: 5px;
|
||||
position:relative;
|
||||
}
|
||||
|
||||
#filePage{
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.page {
|
||||
/* line-height: 16px; */
|
||||
text-align: right;
|
||||
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
/*! jquery.cookie v1.4.1 | MIT */
|
||||
!function(a){"function"==typeof define&&define.amd?define(["jquery"],a):"object"==typeof exports?a(require("jquery")):a(jQuery)}(function(a){function b(a){return h.raw?a:encodeURIComponent(a)}function c(a){return h.raw?a:decodeURIComponent(a)}function d(a){return b(h.json?JSON.stringify(a):String(a))}function e(a){0===a.indexOf('"')&&(a=a.slice(1,-1).replace(/\\"/g,'"').replace(/\\\\/g,"\\"));try{return a=decodeURIComponent(a.replace(g," ")),h.json?JSON.parse(a):a}catch(b){}}function f(b,c){var d=h.raw?b:e(b);return a.isFunction(c)?c(d):d}var g=/\+/g,h=a.cookie=function(e,g,i){if(void 0!==g&&!a.isFunction(g)){if(i=a.extend({},h.defaults,i),"number"==typeof i.expires){var j=i.expires,k=i.expires=new Date;k.setTime(+k+864e5*j)}return document.cookie=[b(e),"=",d(g),i.expires?"; expires="+i.expires.toUTCString():"",i.path?"; path="+i.path:"",i.domain?"; domain="+i.domain:"",i.secure?"; secure":""].join("")}for(var l=e?void 0:{},m=document.cookie?document.cookie.split("; "):[],n=0,o=m.length;o>n;n++){var p=m[n].split("="),q=c(p.shift()),r=p.join("=");if(e&&e===q){l=f(r,g);break}e||void 0===(r=f(r))||(l[q]=r)}return l};h.defaults={},a.removeCookie=function(b,c){return void 0===a.cookie(b)?!1:(a.cookie(b,"",a.extend({},c,{expires:-1})),!a.cookie(b))}});
|
||||
@@ -16,7 +16,7 @@
|
||||
<div class="pull-left mlr15" style="line-height:26px"><span id='dir_info'></span></div>
|
||||
<div class="search pull-right" style="position: absolute; top: 6px; right: 5px;">
|
||||
<form target="hid">
|
||||
<input type="text" id="SearchValue" class="ser-text pull-left" placeholder="搜索文件/目录" />
|
||||
<input type="text" id="search_file" class="ser-text pull-left" placeholder="搜索文件/目录" />
|
||||
<button type="button" class="ser-sub pull-left" onclick='searchFile(1)'></button>
|
||||
<div class="file_search" draggable="false">
|
||||
<div id="search_all" class="file_search_checked"></div>
|
||||
@@ -43,6 +43,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 文件展示 -->
|
||||
<div class="divtable pd15" id="fileCon"></div>
|
||||
<div class="dataTables_paginate paging_bootstrap pagination plr15" style="position: relative; top: -6px;">
|
||||
<ul id="filePage" class="page"></ul>
|
||||
@@ -65,7 +66,7 @@
|
||||
<script type="text/javascript">
|
||||
|
||||
|
||||
$("#SearchValue").focus().keyup(function(e){
|
||||
$("#search_file").focus().keyup(function(e){
|
||||
if(e.keyCode == 13) searchFile(1);
|
||||
});
|
||||
|
||||
|
||||
@@ -73,6 +73,7 @@
|
||||
<link rel="stylesheet" href="/static/build/xterm.css?v={{config.version}}">
|
||||
<link rel="stylesheet" href="/static/build/addons/fullscreen/fullscreen.css?v={{config.version}}">
|
||||
<script src="/static/js/jquery-1.10.2.min.js"></script>
|
||||
<script src="/static/js/jquery.cookie-1.4.1.min.js"></script>
|
||||
<script src="/static/js/bootstrap.min.js"></script>
|
||||
<script src="/static/layer/layer.js"></script>
|
||||
<script src="/static/js/jquery.fly.min.js"></script>
|
||||
@@ -89,7 +90,6 @@
|
||||
<script src="/static/js/echarts.min.js"></script>
|
||||
<!-- <script src="//cdn.jsdelivr.net/gh/midoks/mdserver-web@latest/route/static/js/echarts.min.js"></script> -->
|
||||
<!-- <script src="//unpkg.com/echarts@5.4.3/dist/echarts.min.js"></script> -->
|
||||
|
||||
|
||||
<script src="/static/js/jquery.dragsort-0.5.2.min.js"></script>
|
||||
<script src="/static/js/jquery-qrcode-0.18.0.min.js?v={{config.version}}"></script>
|
||||
|
||||
Reference in New Issue
Block a user