Compare commits

..
32 Commits
Author SHA1 Message Date
Mr Chen 85fc333d2c Merge pull request #424 from midoks/dev
0.15.1
2023-07-15 23:04:39 +08:00
midoks 5bc27a4725 Update config_api.py 2023-07-15 22:53:38 +08:00
midoks e5acf206f5 Update cli.sh 2023-07-15 20:43:13 +08:00
midoks ae7afc2eb5 Update rhel.sh 2023-07-15 20:34:46 +08:00
midoks 5c8527a5de 监控页面-自定义时间优化。 2023-07-15 19:33:17 +08:00
midoks 274592229e Update rhel.sh 2023-07-15 15:51:03 +08:00
midoks 60ddb13f8e Update rhel.sh 2023-07-15 15:50:35 +08:00
midoks f62af00fb7 Update rhel.sh 2023-07-15 15:49:28 +08:00
midoks 9c6faefffd Update rhel.sh 2023-07-15 15:38:14 +08:00
midoks c9e27c2add 优化
* [插件]docker - 添加IP地址池。
* PHP下载中国优化。
2023-07-15 15:00:00 +08:00
midoks 97b1e8b9b3 Update rhel.sh 2023-07-15 12:34:47 +08:00
midoks 18cdcd1436 修复子目录绑定-伪静态问题。 2023-07-13 10:36:16 +08:00
midoks 7d783c64b6 OP防火墙优化
站点配置-状态关闭后,不再防御。
2023-07-13 00:40:46 +08:00
midoks 0b65d69750 Update __init__.py 2023-07-12 22:18:55 +08:00
midoks 693dbb8cf1 Update __init__.py 2023-07-12 22:17:58 +08:00
midoks 117a99e729 增加标识 2023-07-12 09:46:58 +08:00
midoks 45d4b8a5de update 2023-07-11 16:25:34 +08:00
midoks a5791051b1 Update debian.sh 2023-07-11 16:11:20 +08:00
midoks dc3f8f8e0b 自动同步gitee 2023-07-11 12:21:48 +08:00
midoks bf1d00c012 Update config_api.py 2023-07-10 22:41:13 +08:00
midoks 51cf851cea Update site.js 2023-07-10 22:38:37 +08:00
midoks 1e09408eb9 Update index.py 2023-07-10 22:13:46 +08:00
midoks 7659865caf Update lib.sh 2023-07-05 22:19:44 +08:00
Mr Chen ad1851d068 Merge pull request #423 from midoks/dev
requests兼容低版本
2023-07-05 18:05:33 +08:00
midoks e174652afc Update requirements.txt 2023-07-05 18:02:40 +08:00
midoks a95e7aacd7 Update r3.6.txt 2023-07-05 18:00:36 +08:00
Mr Chen 6aa638ef9a Merge pull request #422 from midoks/dev
Update requirements.txt
2023-07-05 13:03:14 +08:00
midoks 6f3d50bae5 Update requirements.txt 2023-07-05 13:01:08 +08:00
Mr Chen 301a5a95b8 Merge pull request #421 from midoks/dev
AD
2023-07-05 12:51:37 +08:00
midoks d35b9dccc7 AD信息 2023-07-05 12:49:47 +08:00
midoks 82680605ac mvirtua ad 2023-07-05 12:47:05 +08:00
midoks 5b148b3d1a Update requirements.txt 2023-07-05 10:20:04 +08:00
40 changed files with 695 additions and 338 deletions
+16
View File
@@ -0,0 +1,16 @@
name: sync2gitee
on: [push]
jobs:
repo-sync:
runs-on: ubuntu-latest
steps:
- name: Mirror the Github organization repos to Gitee.
uses: Yikun/hub-mirror-action@master
with:
src: 'github/midoks'
dst: 'gitee/midoks'
dst_key: ${{ secrets.GITEE_PRIVATE_KEY }}
dst_token: ${{ secrets.GITEE_TOKEN }}
static_list: "mdserver-web"
force_update: true
+11 -8
View File
@@ -88,6 +88,7 @@ PHP[72-82]支持phpMyAdmin[5.2.0]
| 服务商 | LOGO | 推广地址 | 优惠码 |
| ------------- |----------|-----------|-------|
| digitalvirt |[![digitalvirt](https://digitalvirt.com/templates/BlueWhite/img/logo-dark.svg)](https://digitalvirt.com/aff.php?aff=154) | https://digitalvirt.com/aff.php?aff=154 | mdserver-web |
| mvirtua |[![mvirtua](https://mvirtua.com/upload/logo-black.png)](https://mvirtua.com/aff/FUSKXVDH) | https://mvirtua.com/aff/FUSKXVDH | mdserver-web (全场8折)|
# Docker
@@ -99,15 +100,17 @@ docker run -itd --name mw-server --privileged=true -p 7200:7200 -p 80:80 -p 443:
```
### 版本更新 0.15.0
### 版本更新 0.15.1
* debian12适配。
* 添加nezha插件。
* 优化域名ssl保存功能。
* 修复PHP扩展intl不加载问题(debian/ubuntu)。
* 修复redhat安装openresty缺少openssl-devel。
* docker插件-将就能用。
* tgbot接收和push任务分离。
* 升级功能优化。
* 域名伪静态保存优化。
* 自动同步gitee。
* nezha保存优化。
* OP防火墙优化(站点配置-状态关闭后,不再防御)-已安装的,需要重载。
* 修复子目录绑定-伪静态问题。
* [插件]docker - 添加IP地址池。
* PHP下载中国优化。
* 监控页面-自定义时间优化。
### JSDelivr安装地址
+1 -1
View File
@@ -27,7 +27,7 @@ from flask import request
class config_api:
__version = '0.15.0'
__version = '0.15.1'
__api_addr = 'data/api.json'
def __init__(self):
+2
View File
@@ -1435,6 +1435,8 @@ class site_api:
data['data'] = mw.readFile(filename)
data['rlist'] = []
for ds in os.listdir(self.rewritePath):
if ds[0:1] == '.':
continue
if ds == 'list.txt':
continue
data['rlist'].append(ds[0:len(ds) - 5])
+10
View File
@@ -755,6 +755,8 @@ class system_api:
#!/bin/bash
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
P_VER=`python3 -V | awk '{print $2}'`
if [ ! -f /www/server/mdserver-web/bin/activate ];then
cd /www/server/mdserver-web && python3 -m venv .
cd /www/server/mdserver-web && source /www/server/mdserver-web/bin/activate
@@ -769,6 +771,14 @@ if [ ! -z "$cn" ];then
fi
cd /www/server/mdserver-web && pip3 install -r /www/server/mdserver-web/requirements.txt -i $PIPSRC
P_VER_D=`echo "$P_VER"|awk -F '.' '{print $1}'`
P_VER_M=`echo "$P_VER"|awk -F '.' '{print $2}'`
NEW_P_VER=${P_VER_D}.${P_VER_M}
if [ -f /www/server/mdserver-web/version/r${NEW_P_VER}.txt ];then
cd /www/server/mdserver-web && pip3 install -r /www/server/mdserver-web/version/r${NEW_P_VER}.txt -i $PIPSRC
fi
'''
os.system(update_env)
self.restartMw()
+2 -2
View File
@@ -16,7 +16,7 @@ mw_start_task()
{
isStart=$(ps aux |grep 'task.py'|grep -v grep|awk '{print $2}')
if [ "$isStart" == '' ];then
echo -e "Starting mw-tasks... \c"
echo -e "starting mw-tasks... \c"
cd $DIR && python3 task.py >> ${DIR}/logs/task.log 2>&1 &
sleep 0.3
isStart=$(ps aux |grep 'task.py'|grep -v grep|awk '{print $2}')
@@ -30,7 +30,7 @@ mw_start_task()
fi
echo -e "\033[32mdone\033[0m"
else
echo "Starting mw-tasks... mw-tasks (pid $(echo $isStart)) already running"
echo "starting mw-tasks... mw-tasks (pid $(echo $isStart)) already running"
fi
}
+1
View File
@@ -40,6 +40,7 @@
<p onclick="pluginInitD('docker');">自启动</p>
<p onclick="dockerConList();">容器列表</p>
<p onclick="dockerImageList();">镜像列表</p>
<p onclick="dockerIpList();">IP地址池</p>
<p onclick="repoList();">仓库</p>
</div>
<div class="bt-w-con pd15">
+58 -2
View File
@@ -443,7 +443,7 @@ def dockerLoginCheck(user_name, user_pass, registry):
return False
def getDockerIpList():
def getDockerIpListData():
# 取IP列表
path = getServerDir()
ipConf = path + '/iplist.json'
@@ -453,13 +453,63 @@ def getDockerIpList():
return iplist
def getDockerIpList():
data = getDockerIpListData()
return mw.returnJson(True, 'ok!', data)
def dockerAddIP():
# 添加IP
args = getArgs()
data = checkArgs(args, ['address', 'netmask', 'gateway'])
if not data[0]:
return data[1]
path = getServerDir()
ipConf = path + '/iplist.json'
if not os.path.exists(ipConf):
iplist = []
mw.writeFile(ipConf, json.dumps(iplist))
iplist = json.loads(mw.readFile(ipConf))
ipInfo = {
'address': args['address'],
'netmask': args['netmask'],
'gateway': args['gateway'],
}
iplist.append(ipInfo)
mw.writeFile(ipConf, json.dumps(iplist))
return mw.returnJson(True, '添加成功!')
def dockerDelIP():
# 删除IP
args = getArgs()
data = checkArgs(args, ['address'])
if not data[0]:
return data[1]
path = getServerDir()
ipConf = path + '/iplist.json'
if not os.path.exists(ipConf):
return mw.returnJson(False, '指定的IP不存在。!')
iplist = json.loads(mw.readFile(ipConf))
newList = []
for ipInfo in iplist:
if ipInfo['address'] == args['address']:
continue
newList.append(ipInfo)
mw.writeFile(ipConf, json.dumps(newList))
return mw.returnJson(True, '成功删除!')
def getDockerCreateInfo():
# 取创建依赖
import psutil
data = {}
data['images'] = imageList()
data['memSize'] = int(psutil.virtual_memory().total / 1024 / 1024)
data['iplist'] = getDockerIpList()
data['iplist'] = getDockerIpListData()
return mw.returnJson(True, 'ok!', data)
@@ -653,6 +703,12 @@ if __name__ == "__main__":
print(dockerPullReg())
elif func == 'image_list':
print(imageListData())
elif func == 'docker_get_iplist':
print(getDockerIpList())
elif func == 'docker_del_ip':
print(dockerDelIP())
elif func == 'docker_add_ip':
print(dockerAddIP())
elif func == 'get_docker_create_info':
print(getDockerCreateInfo())
elif func == 'docker_create_con':
+82 -1
View File
@@ -468,7 +468,7 @@ function pullImages(tag, id){
function dockerImageListRender(){
dPost('image_list', '', {}, function(rdata){
var rdata = $.parseJSON(rdata.data);
console.log(rdata);
// console.log(rdata);
if (!rdata.status){
layer.msg(rdata.msg,{icon:2,time:2000});
return;
@@ -634,6 +634,87 @@ function dockerImageList(){
dockerImageListRender();
}
function deleteIpList(address){
safeMessage('删除IP','你将删除从IP地址池['+address+'],确定?',function(){
dPost('docker_del_ip','', {address:address},function(rdata){
var rdata = $.parseJSON(rdata.data);
showMsg(rdata.msg,function(){
if(rdata.status) {
dockerIpListRender();
}
},{ icon: rdata.status ? 1 : 2 });
});
});
}
function dockerIpListRender(){
dPost('docker_get_iplist', '', {}, function(rdata){
var rdata = $.parseJSON(rdata.data);
// console.log(rdata);
if (!rdata.status){
layer.msg(rdata.msg,{icon:2,time:2000});
return;
}
var list = '';
var rlist = rdata.data;
for (var i = 0; i < rlist.length; i++) {
var op = '';
op += '<a href="javascript:;" onclick="deleteIpList(\''+rlist[i]['address']+'\')" class="btlink">删除</a>';
list += '<tr>';
list += '<td>'+rlist[i]['address']+'</td>';
list += '<td>'+rlist[i]['netmask']+'</td>';
list += '<td>'+rlist[i]['gateway']+'</td>';
list += '<td class="text-right">'+op+'</td>';
list += '</tr>';
}
$('#ip_list tbody').html(list);
});
}
function dockerAddIpPool(){
var address = $('input[name="address"]').val();
var netmask = $('input[name="netmask"]').val();
var gateway = $('input[name="gateway"]').val();
dPost('docker_add_ip','', {address:address,netmask:netmask,gateway:gateway}, function(rdata){
var rdata = $.parseJSON(rdata.data);
showMsg(rdata.msg, function(){
dockerIpListRender();
},{icon:rdata.status?1:2})
});
}
function dockerIpList(){
var con = '<div class="safe bgw">\
<div class="search_input">\
<input class="bt-input-text mr5" type="text" style="width:150px" name="address" placeholder="IP地址">\
<input class="bt-input-text mr5" name="netmask" type="text" style="width:150px" placeholder="子网掩码">\
<input name="gateway" class="bt-input-text mr5" type="text" style="width:150px" placeholder="网关">\
<button class="btn btn-success btn-sm va0" onclick="dockerAddIpPool()">添加</button>\
</div>\
<div class="divtable mtb10">\
<div class="tablescroll">\
<table id="ip_list" class="table table-hover" width="100%" cellspacing="0" cellpadding="0" border="0" style="border: 0 none;">\
<thead><tr>\
<th>IP地址</th>\
<th>子网掩码</th>\
<th>网关</th>\
<th style="text-align:right;">操作</th></tr></thead>\
<tbody></tbody></table>\
</div>\
<div id="databasePage" class="dataTables_paginate paging_bootstrap page"></div>\
</div>\
</div>';
$(".soft-man-con").html(con);
dockerIpListRender();
}
// login
function repoLogin(){
var _option1= "";
+1 -1
View File
@@ -29,7 +29,7 @@ class App:
self.__agent_cfg = self.__setupPath + '/agent.cfg'
def getArgs(self):
args = sys.argv[2:]
args = sys.argv[3:]
tmp = {}
args_len = len(args)
+43 -41
View File
@@ -533,49 +533,51 @@ end
function waf()
min_route()
-- C:D("min_route")
-- white ip
if waf_ip_white() then return true end
-- C:D("waf_ip_white")
-- url white
if waf_url_white() then return true end
-- C:D("waf_url_white")
-- black ip
if waf_ip_black() then return true end
-- C:D("waf_ip_black")
-- 封禁ip返回
if waf_drop_ip() then return true end
-- C:D("waf_drop_ip")
-- ua check
if waf_user_agent() then return true end
-- C:D("waf_user_agent")
if waf_url() then return true end
-- C:D("waf_url")
-- cc setting
if waf_cc_increase() then return true end
-- C:D("waf_cc_increase")
if waf_cc() then return true end
-- C:D("waf_cc")
-- cookie检查
if waf_cookie() then return true end
-- C:D("waf_cookie")
-- args参数拦截
if waf_get_args() then return true end
-- C:D("waf_get_args")
-- 扫描软件禁止
if waf_scan_black() then return true end
-- C:D("waf_scan_black")
if waf_post() then return true end
-- C:D("waf_post")
if site_config[server_name] and site_config[server_name]['open'] then
-- white ip
if waf_ip_white() then return true end
-- C:D("waf_ip_white")
-- url white
if waf_url_white() then return true end
-- C:D("waf_url_white")
-- black ip
if waf_ip_black() then return true end
-- C:D("waf_ip_black")
-- 封禁ip返回
if waf_drop_ip() then return true end
-- C:D("waf_drop_ip")
-- ua check
if waf_user_agent() then return true end
-- C:D("waf_user_agent")
if waf_url() then return true end
-- C:D("waf_url")
-- cc setting
if waf_cc_increase() then return true end
-- C:D("waf_cc_increase")
if waf_cc() then return true end
-- C:D("waf_cc")
-- cookie检查
if waf_cookie() then return true end
-- C:D("waf_cookie")
-- args参数拦截
if waf_get_args() then return true end
-- C:D("waf_get_args")
-- 扫描软件禁止
if waf_scan_black() then return true end
-- C:D("waf_scan_black")
if waf_post() then return true end
-- C:D("waf_post")
--------------------------------------------------------
--------------------------------------------------------
if X_Forwarded() then return true end
-- C:D("X_Forwarded")
if post_X_Forwarded() then return true end
+2 -2
View File
@@ -12,9 +12,9 @@ version=$1
action=$2
if [ -f /lib/systemd/system/php${version}-php-fpm.service ];then
systemctl ${action} php${version}
systemctl ${action} php${version}-php-fpm
elif [[ -f /usr/lib/systemd/system/php${version}-php-fpm.service ]]; then
systemctl ${action} php${version}
systemctl ${action} php${version}-php-fpm
else
$serverPath/php/init.d/php${version} ${action}
fi
+1
View File
@@ -49,6 +49,7 @@ fi
cd ${curPath} && sh -x $curPath/versions/$2/install.sh $1
if [ "${action}" == "install" ] && [ -d ${serverPath}/php/${type} ];then
#初始化
+14 -5
View File
@@ -15,11 +15,20 @@ SOURCE_ROOT=$rootPath/source/lib
if [ ! -d ${SERVER_ROOT}/freetype ];then
cd $SOURCE_ROOT
wget -O freetype-2.12.1.tar.gz --no-check-certificate https://download.savannah.gnu.org/releases/freetype/freetype-2.12.1.tar.gz -T 5
tar zxvf freetype-2.12.1.tar.gz
cd freetype-2.12.1
if [ ! -f $SOURCE_ROOT/freetype-2.12.1.tar.gz ];then
wget -O freetype-2.12.1.tar.gz --no-check-certificate https://download.savannah.gnu.org/releases/freetype/freetype-2.12.1.tar.gz -T 5
fi
if [ ! -d $SOURCE_ROOT/freetype-2.12.1 ];then
tar zxvf freetype-2.12.1.tar.gz
cd freetype-2.12.1
else
cd freetype-2.12.1
fi
./configure --prefix=${SERVER_ROOT}/freetype && make && make install
cd $SOURCE_ROOT
cd $SOURCE_ROOT && rm -rf freetype-2.12.1
#rm -rf freetype-2.12.1.tar.gz
#rm -rf freetype-2.12.1
fi
+14 -5
View File
@@ -15,11 +15,20 @@ SOURCE_ROOT=$rootPath/source/lib
if [ ! -d ${SERVER_ROOT}/freetype_old ];then
cd $SOURCE_ROOT
wget -O freetype-2.7.1.tar.gz --no-check-certificate https://download.savannah.gnu.org/releases/freetype/freetype-2.7.1.tar.gz -T 5
tar zxvf freetype-2.7.1.tar.gz
cd freetype-2.7.1
if [ ! -f $SOURCE_ROOT/freetype-2.7.1.tar.gz ];then
wget -O freetype-2.7.1.tar.gz --no-check-certificate https://download.savannah.gnu.org/releases/freetype/freetype-2.7.1.tar.gz -T 5
fi
if [ ! -d $SOURCE_ROOT/freetype-2.7.1 ];then
tar zxvf freetype-2.7.1.tar.gz
cd freetype-2.7.1
else
cd freetype-2.7.1
fi
./configure --prefix=${SERVER_ROOT}/freetype_old && make && make install
#cd $SOURCE_ROOT
cd $SOURCE_ROOT && rm -rf freetype-2.7.1
#rm -rf freetype-2.7.1.tar.gz
#rm -rf freetype-2.7.1
fi
+16
View File
@@ -24,6 +24,22 @@ mkdir -p $serverPath/php
cd ${rootPath}/plugins/php/lib && /bin/bash zlib.sh
if [ ! -d $sourcePath/php/php${PHP_VER} ];then
# ----------------------------------------------------------------------- #
# 中国优化安装
cn=$(curl -fsSL -m 10 -s http://ipinfo.io/json | grep "\"country\": \"CN\"")
LOCAL_ADDR=common
if [ ! -z "$cn" ];then
LOCAL_ADDR=cn
fi
if [ "$LOCAL_ADDR" == "cn" ];then
if [ ! -f $sourcePath/php/php-${version}.tar.xz ];then
wget --no-check-certificate -O $sourcePath/php/php-${version}.tar.xz https://mirrors.sohu.com/php/php-${version}.tar.xz
fi
fi
# ----------------------------------------------------------------------- #
if [ ! -f $sourcePath/php/php-${version}.tar.gz ];then
wget --no-check-certificate -O $sourcePath/php/php-${version}.tar.gz https://museum.php.net/php5/php-${version}.tar.gz
fi
+16
View File
@@ -24,6 +24,22 @@ mkdir -p $serverPath/php
cd ${rootPath}/plugins/php/lib && /bin/bash zlib.sh
if [ ! -d $sourcePath/php/php${PHP_VER} ];then
# ----------------------------------------------------------------------- #
# 中国优化安装
cn=$(curl -fsSL -m 10 -s http://ipinfo.io/json | grep "\"country\": \"CN\"")
LOCAL_ADDR=common
if [ ! -z "$cn" ];then
LOCAL_ADDR=cn
fi
if [ "$LOCAL_ADDR" == "cn" ];then
if [ ! -f $sourcePath/php/php-${version}.tar.xz ];then
wget --no-check-certificate -O $sourcePath/php/php-${version}.tar.xz https://mirrors.sohu.com/php/php-${version}.tar.xz
fi
fi
# ----------------------------------------------------------------------- #
if [ ! -f $sourcePath/php/php-${version}.tar.xz ];then
wget --no-check-certificate -O $sourcePath/php/php-${version}.tar.xz https://museum.php.net/php5/php-${version}.tar.xz
fi
+16
View File
@@ -24,6 +24,22 @@ mkdir -p $serverPath/php
cd ${rootPath}/plugins/php/lib && /bin/bash zlib.sh
if [ ! -d $sourcePath/php/php${PHP_VER} ];then
# ----------------------------------------------------------------------- #
# 中国优化安装
cn=$(curl -fsSL -m 10 -s http://ipinfo.io/json | grep "\"country\": \"CN\"")
LOCAL_ADDR=common
if [ ! -z "$cn" ];then
LOCAL_ADDR=cn
fi
if [ "$LOCAL_ADDR" == "cn" ];then
if [ ! -f $sourcePath/php/php-${version}.tar.xz ];then
wget --no-check-certificate -O $sourcePath/php/php-${version}.tar.xz https://mirrors.sohu.com/php/php-${version}.tar.xz
fi
fi
# ----------------------------------------------------------------------- #
if [ ! -f $sourcePath/php/php-${version}.tar.gz ];then
wget --no-check-certificate -O $sourcePath/php/php-${version}.tar.gz https://museum.php.net/php5/php-${version}.tar.gz
fi
+16
View File
@@ -23,6 +23,22 @@ cd ${rootPath}/plugins/php/lib && /bin/bash freetype_old.sh
cd ${rootPath}/plugins/php/lib && /bin/bash zlib.sh
if [ ! -d $sourcePath/php/php${PHP_VER} ];then
# ----------------------------------------------------------------------- #
# 中国优化安装
cn=$(curl -fsSL -m 10 -s http://ipinfo.io/json | grep "\"country\": \"CN\"")
LOCAL_ADDR=common
if [ ! -z "$cn" ];then
LOCAL_ADDR=cn
fi
if [ "$LOCAL_ADDR" == "cn" ];then
if [ ! -f $sourcePath/php/php-${version}.tar.xz ];then
wget --no-check-certificate -O $sourcePath/php/php-${version}.tar.xz https://mirrors.sohu.com/php/php-${version}.tar.xz
fi
fi
# ----------------------------------------------------------------------- #
if [ ! -f $sourcePath/php/php-${version}.tar.xz ];then
wget --no-check-certificate -O $sourcePath/php/php-${version}.tar.xz https://museum.php.net/php5/php-${version}.tar.xz
fi
+16
View File
@@ -23,6 +23,22 @@ cd ${rootPath}/plugins/php/lib && /bin/bash freetype_old.sh
cd ${rootPath}/plugins/php/lib && /bin/bash zlib.sh
if [ ! -d $sourcePath/php/php${PHP_VER} ];then
# ----------------------------------------------------------------------- #
# 中国优化安装
cn=$(curl -fsSL -m 10 -s http://ipinfo.io/json | grep "\"country\": \"CN\"")
LOCAL_ADDR=common
if [ ! -z "$cn" ];then
LOCAL_ADDR=cn
fi
if [ "$LOCAL_ADDR" == "cn" ];then
if [ ! -f $sourcePath/php/php-${version}.tar.xz ];then
wget --no-check-certificate -O $sourcePath/php/php-${version}.tar.xz https://mirrors.sohu.com/php/php-${version}.tar.xz
fi
fi
# ----------------------------------------------------------------------- #
if [ ! -f $sourcePath/php/php-${version}.tar.xz ];then
wget --no-check-certificate -O $sourcePath/php/php-${version}.tar.xz https://museum.php.net/php5/php-${version}.tar.xz
fi
+16
View File
@@ -23,6 +23,22 @@ cd ${rootPath}/plugins/php/lib && /bin/bash freetype_old.sh
cd ${rootPath}/plugins/php/lib && /bin/bash zlib.sh
if [ ! -d $sourcePath/php/php${PHP_VER} ];then
# ----------------------------------------------------------------------- #
# 中国优化安装
cn=$(curl -fsSL -m 10 -s http://ipinfo.io/json | grep "\"country\": \"CN\"")
LOCAL_ADDR=common
if [ ! -z "$cn" ];then
LOCAL_ADDR=cn
fi
if [ "$LOCAL_ADDR" == "cn" ];then
if [ ! -f $sourcePath/php/php-${version}.tar.xz ];then
wget --no-check-certificate -O $sourcePath/php/php-${version}.tar.xz https://mirrors.sohu.com/php/php-${version}.tar.xz
fi
fi
# ----------------------------------------------------------------------- #
if [ ! -f $sourcePath/php/php-${version}.tar.xz ];then
wget --no-check-certificate -O $sourcePath/php/php-${version}.tar.xz https://museum.php.net/php7/php-${version}.tar.xz
fi
+16
View File
@@ -23,6 +23,22 @@ cd ${rootPath}/plugins/php/lib && /bin/bash freetype_old.sh
cd ${rootPath}/plugins/php/lib && /bin/bash zlib.sh
if [ ! -d $sourcePath/php/php${PHP_VER} ];then
# ----------------------------------------------------------------------- #
# 中国优化安装
cn=$(curl -fsSL -m 10 -s http://ipinfo.io/json | grep "\"country\": \"CN\"")
LOCAL_ADDR=common
if [ ! -z "$cn" ];then
LOCAL_ADDR=cn
fi
if [ "$LOCAL_ADDR" == "cn" ];then
if [ ! -f $sourcePath/php/php-${version}.tar.xz ];then
wget --no-check-certificate -O $sourcePath/php/php-${version}.tar.xz https://mirrors.sohu.com/php/php-${version}.tar.xz
fi
fi
# ----------------------------------------------------------------------- #
if [ ! -f $sourcePath/php/php-${version}.tar.xz ];then
wget --no-check-certificate -O $sourcePath/php/php-${version}.tar.xz https://museum.php.net/php7/php-${version}.tar.xz
fi
+16
View File
@@ -24,6 +24,22 @@ cd ${rootPath}/plugins/php/lib && /bin/bash freetype_old.sh
cd ${rootPath}/plugins/php/lib && /bin/bash zlib.sh
if [ ! -d $sourcePath/php/php${PHP_VER} ];then
# ----------------------------------------------------------------------- #
# 中国优化安装
cn=$(curl -fsSL -m 10 -s http://ipinfo.io/json | grep "\"country\": \"CN\"")
LOCAL_ADDR=common
if [ ! -z "$cn" ];then
LOCAL_ADDR=cn
fi
if [ "$LOCAL_ADDR" == "cn" ];then
if [ ! -f $sourcePath/php/php-${version}.tar.xz ];then
wget --no-check-certificate -O $sourcePath/php/php-${version}.tar.xz https://mirrors.sohu.com/php/php-${version}.tar.xz
fi
fi
# ----------------------------------------------------------------------- #
if [ ! -f $sourcePath/php/php-${version}.tar.xz ];then
wget --no-check-certificate -O $sourcePath/php/php-${version}.tar.xz https://museum.php.net/php7/php-${version}.tar.xz
fi
+15
View File
@@ -28,6 +28,21 @@ cd ${rootPath}/plugins/php/lib && /bin/bash freetype_old.sh
cd ${rootPath}/plugins/php/lib && /bin/bash zlib.sh
if [ ! -d $sourcePath/php/php${PHP_VER} ];then
# ----------------------------------------------------------------------- #
# 中国优化安装
cn=$(curl -fsSL -m 10 -s http://ipinfo.io/json | grep "\"country\": \"CN\"")
LOCAL_ADDR=common
if [ ! -z "$cn" ];then
LOCAL_ADDR=cn
fi
if [ "$LOCAL_ADDR" == "cn" ];then
if [ ! -f $sourcePath/php/php-${version}.tar.xz ];then
wget --no-check-certificate -O $sourcePath/php/php-${version}.tar.xz https://mirrors.sohu.com/php/php-${version}.tar.xz
fi
fi
# ----------------------------------------------------------------------- #
if [ ! -f $sourcePath/php/php-${version}.tar.xz ];then
wget --no-check-certificate -O $sourcePath/php/php-${version}.tar.xz https://museum.php.net/php7/php-${version}.tar.xz
+15
View File
@@ -36,6 +36,21 @@ fi
if [ ! -d $sourcePath/php/php${PHP_VER} ];then
# ----------------------------------------------------------------------- #
# 中国优化安装
cn=$(curl -fsSL -m 10 -s http://ipinfo.io/json | grep "\"country\": \"CN\"")
LOCAL_ADDR=common
if [ ! -z "$cn" ];then
LOCAL_ADDR=cn
fi
if [ "$LOCAL_ADDR" == "cn" ];then
if [ ! -f $sourcePath/php/php-${version}.tar.xz ];then
wget --no-check-certificate -O $sourcePath/php/php-${version}.tar.xz https://mirrors.sohu.com/php/php-${version}.tar.xz
fi
fi
# ----------------------------------------------------------------------- #
if [ ! -f $sourcePath/php/php-${version}.tar.xz ];then
wget --no-check-certificate -O $sourcePath/php/php-${version}.tar.xz https://museum.php.net/php7/php-${version}.tar.xz
fi
+16
View File
@@ -35,6 +35,22 @@ if [ "$?" == "0" ];then
fi
if [ ! -d $sourcePath/php/php${PHP_VER} ];then
# ----------------------------------------------------------------------- #
# 中国优化安装
cn=$(curl -fsSL -m 10 -s http://ipinfo.io/json | grep "\"country\": \"CN\"")
LOCAL_ADDR=common
if [ ! -z "$cn" ];then
LOCAL_ADDR=cn
fi
if [ "$LOCAL_ADDR" == "cn" ];then
if [ ! -f $sourcePath/php/php-${version}.tar.xz ];then
wget --no-check-certificate -O $sourcePath/php/php-${version}.tar.xz https://mirrors.sohu.com/php/php-${version}.tar.xz
fi
fi
# ----------------------------------------------------------------------- #
if [ ! -f $sourcePath/php/php-${version}.tar.xz ];then
wget --no-check-certificate -O $sourcePath/php/php-${version}.tar.xz https://www.php.net/distributions/php-${version}.tar.xz
+16
View File
@@ -36,6 +36,22 @@ fi
if [ ! -d $sourcePath/php/php${PHP_VER} ];then
# ----------------------------------------------------------------------- #
# 中国优化安装
cn=$(curl -fsSL -m 10 -s http://ipinfo.io/json | grep "\"country\": \"CN\"")
LOCAL_ADDR=common
if [ ! -z "$cn" ];then
LOCAL_ADDR=cn
fi
if [ "$LOCAL_ADDR" == "cn" ];then
if [ ! -f $sourcePath/php/php-${version}.tar.xz ];then
wget --no-check-certificate -O $sourcePath/php/php-${version}.tar.xz https://mirrors.sohu.com/php/php-${version}.tar.xz
fi
fi
# ----------------------------------------------------------------------- #
if [ ! -f $sourcePath/php/php-${version}.tar.xz ];then
wget --no-check-certificate -O $sourcePath/php/php-${version}.tar.xz https://www.php.net/distributions/php-${version}.tar.xz
fi
+16
View File
@@ -36,6 +36,22 @@ fi
if [ ! -d $sourcePath/php/php${PHP_VER} ];then
# ----------------------------------------------------------------------- #
# 中国优化安装
cn=$(curl -fsSL -m 10 -s http://ipinfo.io/json | grep "\"country\": \"CN\"")
LOCAL_ADDR=common
if [ ! -z "$cn" ];then
LOCAL_ADDR=cn
fi
if [ "$LOCAL_ADDR" == "cn" ];then
if [ ! -f $sourcePath/php/php-${version}.tar.xz ];then
wget --no-check-certificate -O $sourcePath/php/php-${version}.tar.xz https://mirrors.sohu.com/php/php-${version}.tar.xz
fi
fi
# ----------------------------------------------------------------------- #
if [ ! -f $sourcePath/php/php-${version}.tar.xz ];then
wget --no-check-certificate -O $sourcePath/php/php-${version}.tar.xz https://www.php.net/distributions/php-${version}.tar.xz
fi
+2 -1
View File
@@ -43,8 +43,9 @@ def send_msg(bot, tag='ad', trigger_time=300):
# https://t.me/gjgzs2022 | 22/m
# 代付支付宝微信❤️淘宝帮付/💰流量变现💰集团收量/🕵️‍♀️实名认证/接码✅过人脸👤 | 28/m
# https://zhaoziyuan.la/ | 15/m | 2m | next,7/15
# https://zhaoziyuan.la/ | web | 15/m | 2m | next,7/15
# 香港高防CDN |9/m
# mvirtua | web | 7/m
keyboard = [
[
types.InlineKeyboardButton(
@@ -52,7 +52,9 @@ def send_msg(bot, tag='ad', trigger_time=300):
# https://t.me/gjgzs2022 | 22/m
# 代付支付宝微信❤️淘宝帮付/💰流量变现💰集团收量/🕵️‍♀️实名认证/接码✅过人脸👤 | 28/m
# https://zhaoziyuan.la/ | web | 15/m | 2m | next,7/15
# 香港高防CDN |9/m
# mvirtua | web | 7/m
keyboard = [
[
types.InlineKeyboardButton(
+1 -1
View File
@@ -2,7 +2,7 @@ setuptools>=33.1.1
Werkzeug>=1.0.1
wheel>=0.37.1
gunicorn==20.1.0
requests==2.27.1
requests>=2.27.1
urllib3>=1.21.1
flask>=2.0.3
flask-session==0.3.2
+8 -2
View File
@@ -47,7 +47,7 @@ cache.init_app(app, config={'CACHE_TYPE': 'simple'})
try:
from flask_sqlalchemy import SQLAlchemy
app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:////tmp/mw_session.db'
app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:////tmp/py_mw_session.db'
app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = True
app.config['SESSION_TYPE'] = 'sqlalchemy'
app.config['SESSION_SQLALCHEMY'] = sdb
@@ -60,7 +60,6 @@ except:
str(sys.version_info[0])
app.config['SESSION_FILE_THRESHOLD'] = 1024
app.config['SESSION_FILE_MODE'] = 384
mw.execShell("pip install flask_sqlalchemy &")
app.secret_key = uuid.UUID(int=uuid.getnode()).hex[-12:]
app.config['SESSION_PERMANENT'] = True
@@ -178,6 +177,13 @@ def requestCheck():
return domain_check
@app.after_request
def requestAfter(response):
response.headers['soft'] = 'mdserver-web'
response.headers['mw-version'] = app.config.version
return response
def isLogined():
if 'login' in session and 'username' in session and session['login'] == True:
userInfo = mw.M('users').where(
+128 -221
View File
@@ -1,78 +1,100 @@
//默认显示7天周期图表
setTimeout(function(){
Wday(0,'getload');
},500);
},100);
setTimeout(function(){
Wday(0,'cpu');
},500);
},200);
setTimeout(function(){
Wday(0,'mem');
},1000);
},500);
setTimeout(function(){
Wday(0,'disk');
},1500);
},100);
setTimeout(function(){
Wday(0,'network');
},2000);
},1500);
$(".st").hover(function(){
$(".searcTime .st").click(function(){
var status = $(this).data('status');
if (status == 'show'){
$(this).next().hide();
$(this).data('status','hide');
} else{
$(this).next().show();
$(this).data('status','show');
}
});
//自定义时间-切换
$(".searcTime .st").hover(function(){
$(this).data('status','show');
$(this).next().show();
},function(){
$(this).next().hide();
$(this).next().hover(function(){
$(this).show();
},function(){
$(this).hide();
})
// $(this).next().hide();
// $(this).next().hover(function(){
// $(this).show();
// },function(){
// $(this).hide();
// })
})
$(".searcTime .gt").click(function(){
$(this).addClass("on").siblings().removeClass("on");
})
$(".loadbtn").click(function(){
$(this).parents(".searcTime").find("span").removeClass("on");
$(this).parents(".searcTime").find(".st").addClass("on");
var b = (new Date($(this).parent().find(".btime").val()).getTime())/1000;
var e = (new Date($(this).parent().find(".etime").val()).getTime())/1000;
//渲染日期时间范围 start
var render_dlist = [
'loadbtn_rtime',
'cpubtn_rtime',
'membtn_rtime',
'diskbtn_rtime',
'networkbtn_rtime'
];
for (var i = 0; i < render_dlist.length; i++) {
laydate.render({
elem: '#'+render_dlist[i]
,type: 'datetime'
,range: true
});
var b = getBeforeDate(28).replaceAll('/','-') + " 00:00:00";
var e = getBeforeDate(0).replaceAll('/','-') + " 23:59:59";
$('#'+render_dlist[i]).val(b + ' - ' + e);
}
//渲染日期时间范围 end
$('.sbtn').click(function(){
$(".searcTime .st").next().hide();
var rtime = $(this).parent().find(".rtime").val();
var rarr = rtime.split(' - ');
var b = (new Date(rarr[0]).getTime())/1000;
var e = (new Date(rarr[1]).getTime())/1000;
b = Math.round(b);
e = Math.round(e);
getload(b,e)
})
$(".cpubtn").click(function(){
$(this).parents(".searcTime").find("span").removeClass("on");
$(this).parents(".searcTime").find(".st").addClass("on");
var b = (new Date($(this).parent().find(".btime").val()).getTime())/1000;
var e = (new Date($(this).parent().find(".etime").val()).getTime())/1000;
b = Math.round(b);
e = Math.round(e);
cpu(b,e)
})
$(".membtn").click(function(){
$(this).parents(".searcTime").find("span").removeClass("on");
$(this).parents(".searcTime").find(".st").addClass("on");
var b = (new Date($(this).parent().find(".btime").val()).getTime())/1000;
var e = (new Date($(this).parent().find(".etime").val()).getTime())/1000;
b = Math.round(b);
e = Math.round(e);
mem(b,e)
})
$(".diskbtn").click(function(){
$(this).parents(".searcTime").find("span").removeClass("on");
$(this).parents(".searcTime").find(".st").addClass("on");
var b = (new Date($(this).parent().find(".btime").val()).getTime())/1000;
var e = (new Date($(this).parent().find(".etime").val()).getTime())/1000;
b = Math.round(b);
e = Math.round(e);
disk(b,e)
})
$(".networkbtn").click(function(){
$(this).parents(".searcTime").find("span").removeClass("on");
$(this).parents(".searcTime").find(".st").addClass("on");
var b = (new Date($(this).parent().find(".btime").val()).getTime())/1000;
var e = (new Date($(this).parent().find(".etime").val()).getTime())/1000;
b = Math.round(b);
e = Math.round(e);
network(b,e)
})
if ($(this).hasClass('loadbtn')){
getload(b,e);
} else if ($(this).hasClass('cpubtn')){
cpu(b,e);
}else if ($(this).hasClass('membtn')){
mem(b,e);
} else if ($(this).hasClass('diskbtn')){
disk(b,e);
}
});
//指定天数
function Wday(day,name){
var now = (new Date().getTime())/1000;
@@ -94,19 +116,19 @@ function Wday(day,name){
}
switch (name){
case "cpu":
cpu(b,e);
cpu(b, e);
break;
case "mem":
mem(b,e);
mem(b, e);
break;
case "disk":
disk(b,e);
disk(b, e);
break;
case "network":
network(b,e);
network(b, e);
break;
case "getload":
getload(b,e);
getload(b, e);
break;
}
}
@@ -119,6 +141,7 @@ function getToday(){
return str;
}
getStatus();
//取监控状态
function getStatus(){
loadT = layer.msg('正在读取,请稍候...',{icon:16,time:0})
@@ -141,7 +164,7 @@ function getStatus(){
},'json');
}
getStatus();
//设置监控状态
function setControl(act, value=false){
@@ -172,8 +195,9 @@ function setControl(act, value=false){
loadT = layer.msg('正在处理,请稍候...',{icon:16,time:0})
$.post('/system/set_control','type='+type+'&day='+day,function(rdata){
layer.close(loadT);
layer.msg(rdata.msg,{icon:rdata.status?1:2});
showMsg(rdata.msg, function(){
layer.close(loadT);
},{icon:rdata.status?1:2})
},'json');
}
@@ -183,8 +207,9 @@ function closeControl(){
layer.confirm('您真的清空所有监控记录吗?',{title:'清空记录',icon:3,closeBtn:1}, function() {
loadT = layer.msg('正在处理,请稍候...',{icon:16,time:0})
$.post('/system/set_control','type=del',function(rdata){
layer.close(loadT);
layer.msg(rdata.msg,{icon:rdata.status?1:2});
showMsg(rdata.msg, function(){
layer.close(loadT);
},{icon:rdata.status?1:2})
},'json');
});
}
@@ -199,19 +224,18 @@ function getBeforeDate(n){
var day=d.getDate();
if(day <= n){
if(mon>1) {
mon=mon-1;
}
else {
year = year-1;
mon = 12;
mon = mon-1;
} else {
year = year-1;
mon = 12;
}
}
d.setDate(d.getDate()-n);
year = d.getFullYear();
mon=d.getMonth()+1;
day=d.getDate();
s = year+"/"+(mon<10?('0'+mon):mon)+"/"+(day<10?('0'+day):day);
return s;
s = year+"/"+(mon<10?('0'+mon):mon)+"/"+(day<10?('0'+day):day);
return s;
}
//cpu
function cpu(b,e){
@@ -229,20 +253,14 @@ function cpu(b,e){
option = {
tooltip: {
trigger: 'axis',
axisPointer: {
type: 'cross'
},
axisPointer: { type: 'cross' },
formatter: '{b}<br />{a}: {c}%'
},
xAxis: {
type: 'category',
boundaryGap: false,
data: xData,
axisLine:{
lineStyle:{
color:"#666"
}
}
axisLine:{ lineStyle:{ color:"#666"} }
},
yAxis: {
type: 'value',
@@ -250,16 +268,8 @@ function cpu(b,e){
boundaryGap: [0, '100%'],
min:0,
max: 100,
splitLine:{
lineStyle:{
color:"#ddd"
}
},
axisLine:{
lineStyle:{
color:"#666"
}
}
splitLine:{ lineStyle:{ color:"#ddd" } },
axisLine:{ lineStyle:{ color:"#666" } }
},
dataZoom: [{
type: 'inside',
@@ -286,17 +296,13 @@ function cpu(b,e){
smooth:true,
symbol: 'none',
sampling: 'average',
itemStyle: {
normal: {
color: 'rgb(0, 153, 238)'
}
},
itemStyle: { normal: { color: 'rgb(0, 153, 238)' } },
data: yData
}
]
};
myChartCpu.setOption(option);
window.addEventListener("resize",function(){
window.addEventListener("resize",function(){
myChartCpu.resize();
});
},'json');
@@ -318,20 +324,14 @@ function mem(b,e){
option = {
tooltip: {
trigger: 'axis',
axisPointer: {
type: 'cross'
},
axisPointer: { type: 'cross' },
formatter: '{b}<br />{a}: {c}%'
},
xAxis: {
type: 'category',
boundaryGap: false,
data: xData,
axisLine:{
lineStyle:{
color:"#666"
}
}
axisLine:{ lineStyle:{ color:"#666" } }
},
yAxis: {
type: 'value',
@@ -339,16 +339,8 @@ function mem(b,e){
boundaryGap: [0, '100%'],
min:0,
max: 100,
splitLine:{
lineStyle:{
color:"#ddd"
}
},
axisLine:{
lineStyle:{
color:"#666"
}
}
splitLine:{ lineStyle:{ color:"#ddd" } },
axisLine:{ lineStyle:{ color:"#666" } }
},
dataZoom: [{
type: 'inside',
@@ -375,11 +367,7 @@ function mem(b,e){
smooth:true,
symbol: 'none',
sampling: 'average',
itemStyle: {
normal: {
color: 'rgb(0, 153, 238)'
}
},
itemStyle: { normal: { color: 'rgb(0, 153, 238)' } },
data: zData
}
]
@@ -423,26 +411,14 @@ function disk(b,e){
type: 'category',
boundaryGap: false,
data: xData,
axisLine:{
lineStyle:{
color:"#666"
}
}
axisLine:{ lineStyle:{ color:"#666" }}
},
yAxis: {
type: 'value',
name: '单位:KB/s',
boundaryGap: [0, '100%'],
splitLine:{
lineStyle:{
color:"#ddd"
}
},
axisLine:{
lineStyle:{
color:"#666"
}
}
splitLine:{ lineStyle:{ color:"#ddd"} },
axisLine:{ lineStyle:{ color:"#666" } }
},
dataZoom: [{
type: 'inside',
@@ -469,11 +445,7 @@ function disk(b,e){
smooth:true,
symbol: 'none',
sampling: 'average',
itemStyle: {
normal: {
color: 'rgb(255, 70, 131)'
}
},
itemStyle: { normal: { color: 'rgb(255, 70, 131)' } },
data: rData
},
{
@@ -482,11 +454,7 @@ function disk(b,e){
smooth:true,
symbol: 'none',
sampling: 'average',
itemStyle: {
normal: {
color: 'rgba(46, 165, 186, .7)'
}
},
itemStyle: { normal: { color: 'rgba(46, 165, 186, .7)'} },
data: wData
}
]
@@ -522,9 +490,7 @@ function network(b,e){
option = {
tooltip: {
trigger: 'axis',
axisPointer: {
type: 'cross'
}
axisPointer: { type: 'cross' }
},
legend: {
data:[lan.index.net_up,lan.index.net_down]
@@ -533,26 +499,14 @@ function network(b,e){
type: 'category',
boundaryGap: false,
data: xData,
axisLine:{
lineStyle:{
color:"#666"
}
}
axisLine:{ lineStyle:{ color:"#666" } }
},
yAxis: {
type: 'value',
name: lan.index.unit+':KB/s',
boundaryGap: [0, '100%'],
splitLine:{
lineStyle:{
color:"#ddd"
}
},
axisLine:{
lineStyle:{
color:"#666"
}
}
splitLine:{ lineStyle:{ color:"#ddd" } },
axisLine:{ lineStyle:{ color:"#666" } }
},
dataZoom: [{
type: 'inside',
@@ -579,11 +533,7 @@ function network(b,e){
smooth:true,
symbol: 'none',
sampling: 'average',
itemStyle: {
normal: {
color: 'rgb(255, 140, 0)'
}
},
itemStyle: { normal: { color: 'rgb(255, 140, 0)' } },
data: yData
},
{
@@ -592,11 +542,7 @@ function network(b,e){
smooth:true,
symbol: 'none',
sampling: 'average',
itemStyle: {
normal: {
color: 'rgb(30, 144, 255)'
}
},
itemStyle: { normal: { color: 'rgb(30, 144, 255)' } },
data: zData
}
]
@@ -879,17 +825,8 @@ function getload(b,e){
{
name: '资源使用率%',
type: 'line',
lineStyle: {
normal: {
width: 2,
color: 'rgb(255, 140, 0)'
}
},
itemStyle: {
normal: {
color: 'rgb(255, 140, 0)'
}
},
lineStyle: { normal: { width: 2, color: 'rgb(255, 140, 0)'}},
itemStyle: {normal: { color: 'rgb(255, 140, 0)' }},
data: yData
},
{
@@ -897,17 +834,8 @@ function getload(b,e){
yAxisIndex: 1,
name: '1分钟',
type: 'line',
lineStyle: {
normal: {
width: 2,
color: 'rgb(30, 144, 255)'
}
},
itemStyle: {
normal: {
color: 'rgb(30, 144, 255)'
}
},
lineStyle: { normal: {width: 2,color: 'rgb(30, 144, 255)' }},
itemStyle: { normal: { color: 'rgb(30, 144, 255)'} },
data: zData
},
{
@@ -915,17 +843,8 @@ function getload(b,e){
yAxisIndex: 1,
name: '5分钟',
type: 'line',
lineStyle: {
normal: {
width: 2,
color: 'rgb(0, 178, 45)'
}
},
itemStyle: {
normal: {
color: 'rgb(0, 178, 45)'
}
},
lineStyle: { normal: { width: 2, color: 'rgb(0, 178, 45)'} },
itemStyle: { normal: { color: 'rgb(0, 178, 45)' } },
data: aData
},
{
@@ -933,28 +852,16 @@ function getload(b,e){
yAxisIndex: 1,
name: '15分钟',
type: 'line',
lineStyle: {
normal: {
width: 2,
color: 'rgb(147, 38, 255)'
}
},
itemStyle: {
normal: {
color: 'rgb(147, 38, 255)'
}
},
lineStyle: { normal: { width: 2, color: 'rgb(147, 38, 255)'}},
itemStyle: { normal: { color: 'rgb(147, 38, 255)' } },
data: bData
}
],
textStyle: {
color: '#666',
fontSize: 12
}
textStyle: { color: '#666',fontSize: 12}
}
myChartgetload.setOption(option);
window.addEventListener("resize",function(){
myChartgetload.resize();
})
},'json')
},'json');
}
+20 -13
View File
@@ -1301,7 +1301,7 @@ function showRewrite(rdata){
<select class='bt-input-text mr20' id='myRewrite' name='rewrite' style='width:30%;'>"+rList+"</select>\
<textarea class='bt-input-text mtb15' style='height: 260px; width: 470px; line-height:18px;padding:5px;' id='rewriteBody'>"+rdata.data+"</textarea>\
</div>\
<button id='SetRewriteBtn' class='btn btn-success btn-sm' onclick=\"SetRewrite('"+rdata.filename+"')\">保存</button>\
<button id='setRewriteBtn' class='btn btn-success btn-sm'>保存</button>\
<ul class='help-info-text c7 ptb10'>\
<li>请选择您的应用,若设置伪静态后,网站无法正常访问,请尝试设置回default</li>\
<li>您可以对伪静态规则进行修改,修改完后保存即可。</li>\
@@ -1314,14 +1314,21 @@ function showRewrite(rdata){
closeBtn: 1,
shift: 5,
shadeClose: true,
content:webBakHtml
});
$("#myRewrite").change(function(){
var rewriteName = $(this).val();
$.post('/files/get_body','path='+rdata['rewrite_dir']+'/'+rewriteName+'.conf',function(fileBody){
$("#rewriteBody").val(fileBody.data.data);
},'json');
content:webBakHtml,
success:function(){
$("#myRewrite").change(function(){
var rewriteName = $(this).val();
$.post('/files/get_body','path='+rdata['rewrite_dir']+'/'+rewriteName+'.conf',function(fileBody){
$("#rewriteBody").val(fileBody.data.data);
},'json');
});
$('#setRewriteBtn').click(function(){
var data = $("#rewriteBody").val();
setRewrite(rdata.filename, encodeURIComponent(data));
});
}
});
}
@@ -1334,7 +1341,7 @@ function addDirBinding(id){
return;
}
var data = 'id='+id+'&domain='+domain+'&dirName='+dirName
var data = 'id='+id+'&domain='+domain+'&dirName='+dirName;
$.post('/site/add_dir_bind',data,function(rdata){
dirBinding(id);
layer.msg(rdata.msg,{icon:rdata.status?1:2});
@@ -2428,7 +2435,7 @@ function rewrite(siteName){
$("#SetRewriteBtn").click(function(){
$("#rewriteBody").empty();
$("#rewriteBody").text(editor.getValue());
setRewrite(filename);
setRewrite(filename, encodeURIComponent(editor.getValue()));
});
$("#SetRewriteBtnTel").click(function(){
$("#rewriteBody").empty();
@@ -2460,8 +2467,8 @@ function rewrite(siteName){
//设置伪静态
function setRewrite(filename){
var data = 'data='+encodeURIComponent($("#rewriteBody").val())+'&path='+filename+'&encoding=utf-8';
function setRewrite(filename,data){
var data = 'data='+data+'&path='+filename+'&encoding=utf-8';
var loadT = layer.msg(lan.site.saving_txt,{icon:16,time:0,shade: [0.3, '#000']});
$.post('/site/set_rewrite',data,function(rdata){
layer.close(loadT);
+9 -8
View File
@@ -1805,7 +1805,7 @@ html .menu .menu_exit:hover {
.view1,
.view2 {
margin-bottom: 15px
margin-bottom: 15px;
}
.searcTime {
@@ -1840,7 +1840,7 @@ html .menu .menu_exit:hover {
display: inline-block;
position: relative;
float: left;
line-height: 16px
line-height: 16px;
}
.searcTime .ss .st {
@@ -1848,7 +1848,7 @@ html .menu .menu_exit:hover {
border: #ddd 1px solid;
margin-right: -1px;
cursor: pointer;
float: left
float: left;
}
.searcTime .ss .time {
@@ -1859,26 +1859,27 @@ html .menu .menu_exit:hover {
position: absolute;
right: -1px;
top: 27px;
width: 217px;
z-index: 99
width: 306px;
z-index: 99;
}
.searcTime .ss .time span {
margin-bottom: 10px;
display: block
display: block;
}
.searcTime .ss .time input {
border: 1px solid #ddd;
height: 22px;
padding: 0 5px;
width: 132px
margin-left:5px;
width: 227px;
}
.searcTime .ss .time input:focus {
border: #66afe9 1px solid;
-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075), 0 0 8px rgba(102, 175, 233, .6);
box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075), 0 0 8px rgba(102, 175, 233, .6)
box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075), 0 0 8px rgba(102, 175, 233, .6);
}
.searcTime .ss .sbtn {
+41 -16
View File
@@ -51,14 +51,15 @@
<div class="ss">
<span class="st">自定义时间</span>
<div class="time">
<span class="bt">开始时间<input class="btime" type="text" value="2017/1/10 00:00:00"></span>
<span class="et">结束时间<input class="etime" type="text" value="2017/1/13 00:00:00"></span>
<span class="bt">时间范围
<input id="loadbtn_rtime" class="rtime" type="text" value="2023-07-06 00:00:00 - 2023-08-08 00:00:00">
</span>
<div class="sbtn loadbtn">提交</div>
</div>
</div>
</div>
</div>
<div id="getloadview" style="width:100%; height:330px"></div>
<div id="getloadview" style="width:100%; height:330px;"></div>
</div>
</div>
</div>
@@ -67,12 +68,18 @@
<div class="bgw pb15">
<div class="title c6 plr15">
<h3 class="c-tit f16">CPU</h3>
<div class="searcTime pull-right"><span class="tit">区间检索:</span><span class="gt" onclick="Wday(1,'cpu')">昨天</span><span class="gt on" onclick="Wday(0,'cpu')">今天</span><span class="gt" onclick="Wday(7,'cpu')">最近7天</span><span class="gt" onclick="Wday(30,'cpu')">最近30天</span>
<div class="searcTime pull-right">
<span class="tit">区间检索:</span>
<span class="gt" onclick="Wday(1,'cpu')">昨天</span>
<span class="gt on" onclick="Wday(0,'cpu')">今天</span>
<span class="gt" onclick="Wday(7,'cpu')">最近7天</span>
<span class="gt" onclick="Wday(30,'cpu')">最近30天</span>
<div class="ss">
<span class="st">自定义时间</span>
<div class="time">
<span class="bt">开始时间<input class="btime" type="text" value="2017/1/10 00:00:00"></span>
<span class="et">结束时间<input class="etime" type="text" value="2017/1/13 00:00:00"></span>
<span class="bt">时间范围
<input id="cpubtn_rtime" class="rtime" type="text" value="2023-07-06 00:00:00 - 2023-08-08 00:00:00">
</span>
<div class="sbtn cpubtn">提交</div>
</div>
</div>
@@ -87,12 +94,18 @@
<div class="bgw pb15">
<div class="title c6 plr15">
<h3 class="c-tit f16">内存</h3>
<div class="searcTime pull-right"><span class="tit">区间检索:</span><span class="gt" onclick="Wday(1,'mem')">昨天</span><span class="gt on" onclick="Wday(0,'mem')">今天</span><span class="gt" onclick="Wday(7,'mem')">最近7天</span><span class="gt" onclick="Wday(30,'mem')">最近30天</span>
<div class="searcTime pull-right">
<span class="tit">区间检索:</span>
<span class="gt" onclick="Wday(1,'mem')">昨天</span>
<span class="gt on" onclick="Wday(0,'mem')">今天</span>、
<span class="gt" onclick="Wday(7,'mem')">最近7天</span>
<span class="gt" onclick="Wday(30,'mem')">最近30天</span>
<div class="ss">
<span class="st">自定义时间</span>
<div class="time">
<span class="bt">开始时间<input class="btime" type="text" value="2017/1/10 00:00:00"></span>
<span class="et">结束时间<input class="etime" type="text" value="2017/1/13 00:00:00"></span>
<span class="bt">时间范围
<input id="membtn_rtime" class="rtime" type="text" value="2023-07-06 00:00:00 - 2023-08-08 00:00:00">
</span>
<div class="sbtn membtn">提交</div>
</div>
</div>
@@ -107,12 +120,18 @@
<div class="bgw pb15">
<div class="title c6 plr15 mb15">
<h3 class="c-tit f16">磁盘IO</h3>
<div class="searcTime pull-right"><span class="tit">$data['lan']['S1']</span><span class="gt" onclick="Wday(1,'disk')">昨天</span><span class="gt on" onclick="Wday(0,'disk')">今天</span><span class="gt" onclick="Wday(7,'disk')">最近7天</span><span class="gt" onclick="Wday(30,'disk')">最近30天</span>
<div class="searcTime pull-right">
<span class="tit">$data['lan']['S1']</span>
<span class="gt" onclick="Wday(1,'disk')">昨天</span>
<span class="gt on" onclick="Wday(0,'disk')">今天</span>
<span class="gt" onclick="Wday(7,'disk')">最近7天</span>
<span class="gt" onclick="Wday(30,'disk')">最近30天</span>
<div class="ss">
<span class="st">自定义时间</span>
<div class="time">
<span class="bt">开始时间<input class="btime" type="text" value="2017/1/10 00:00:00"></span>
<span class="et">结束时间<input class="etime" type="text" value="2017/1/13 00:00:00"></span>
<span class="bt">时间范围
<input id="diskbtn_rtime" class="rtime" type="text" value="2023-07-06 00:00:00 - 2023-08-08 00:00:00">
</span>
<div class="sbtn diskbtn">提交</div>
</div>
</div>
@@ -127,12 +146,18 @@
<div class="bgw pb15">
<div class="title c6 plr15 mb15">
<h3 class="c-tit f16">网络IO</h3>
<div class="searcTime pull-right"><span class="tit">$data['lan']['S1']</span><span class="gt" onclick="Wday(1,'network')">昨天</span><span class="gt on" onclick="Wday(0,'network')">今天</span><span class="gt" onclick="Wday(7,'network')">最近7天</span><span class="gt" onclick="Wday(30,'network')">最近30天</span>
<div class="searcTime pull-right">
<span class="tit">$data['lan']['S1']</span>
<span class="gt" onclick="Wday(1,'network')">昨天</span>
<span class="gt on" onclick="Wday(0,'network')">今天</span>
<span class="gt" onclick="Wday(7,'network')">最近7天</span>
<span class="gt" onclick="Wday(30,'network')">最近30天</span>
<div class="ss">
<span class="st">自定义时间</span>
<div class="time">
<span class="bt">开始时间<input class="btime" type="text" value="2017/1/10 00:00:00"></span>
<span class="et">结束时间<input class="etime" type="text" value="2017/1/13 00:00:00"></span>
<span class="bt">时间范围
<input id="networkbtn_rtime" class="rtime" type="text" value="2023-07-06 00:00:00 - 2023-08-08 00:00:00">
</span>
<div class="sbtn networkbtn">提交</div>
</div>
</div>
@@ -146,6 +171,6 @@
</div>
</div>
</div>
<script type="text/javascript" src="/static/laydate/laydate.js?v={{config.version}}"></script>
<script src="/static/app/control.js?v={{config.version}}"></script>
{% endblock %}
+1
View File
@@ -141,6 +141,7 @@ apt install -y devscripts
apt install -y net-tools
apt install -y autoconf
apt install -y gcc
apt install -y patchelf
apt install -y libffi-dev
apt install -y cmake automake make
+16 -6
View File
@@ -88,16 +88,28 @@ echo "SSH PORT:${SSH_PORT}"
# fi
# echo "iptables wrap start"
echo "firewall open common port start"
if [ ! -f /usr/sbin/firewalld ];then
$PKGMGR install firewalld -y
systemctl enable firewalld
#取消服务锁定
systemctl unmask firewalld
systemctl start firewalld
sed -i 's#AllowZoneDrifting=yes#AllowZoneDrifting=no#g' /etc/firewalld/firewalld.conf
firewall-cmd --reload
#安装就开启
systemctl restart firewalld
fi
if [ -f /usr/sbin/firewalld ];then
# look
# firewall-cmd --list-all
# systemctl status firewalld
# firewall-cmd --zone=public --remove-port=80/tcp --permanent
if [ "$SSH_PORT" != "" ];then
firewall-cmd --permanent --zone=public --add-port=${SSH_PORT}/tcp
else
@@ -110,12 +122,10 @@ if [ ! -f /usr/sbin/firewalld ];then
# firewall-cmd --permanent --zone=public --add-port=3306/tcp
# firewall-cmd --permanent --zone=public --add-port=30000-40000/tcp
sed -i 's#AllowZoneDrifting=yes#AllowZoneDrifting=no#g' /etc/firewalld/firewalld.conf
firewall-cmd --reload
#安装时不开启
systemctl stop firewalld
fi
echo "firewall open common port end"
$PKGMGR install -y epel-release
if [ ! -z "$cn" ];then
+1 -1
View File
@@ -8,7 +8,7 @@ function version_ge() { test "$(echo "$@" | tr " " "\n" | sort -rV | head -n 1)"
P_VER=`python3 -V | awk '{print $2}'`
echo "python:$P_VER"
sleep 3
sleep 1
curPath=`pwd`
rootPath=$(dirname "$curPath")
+2 -1
View File
@@ -1,3 +1,4 @@
cryptography==36.0.1
flask==2.0.3
pyOpenSSL==22.0.0
pyOpenSSL==22.0.0
requests==2.27.1