diff --git a/app/command/CleanViteJs.php b/app/command/CleanViteJs.php index 961e164..b356113 100644 --- a/app/command/CleanViteJs.php +++ b/app/command/CleanViteJs.php @@ -67,7 +67,7 @@ class CleanViteJs extends Command $end = $start + strlen($code); for($i=$start;$i>=0;$i--){ $char = substr($content,$i,1); - if(!ctype_alpha($char)){ + if(!ctype_alpha($char)&&$char!='_'){ $start = $i+1; break; } @@ -108,18 +108,20 @@ class CleanViteJs extends Command if(strpos($file, 'window.location.protocol.indexOf("https")>=0')!==false){ //index $file = str_replace('(window.location.protocol.indexOf("https")>=0)', '1', $file); - $file = preg_replace('!setTimeout\(\(\(\)=>\{\w+\(\)\}\),3e3\)!', '', $file); - $file = preg_replace('!setTimeout\(\(function\(\)\{\w+\(\)\}\),3e3\)!', '', $file); - $file = preg_replace('!recommendShow:\w+,!', 'recommendShow:!1,', $file); - $code = $this->getExtendCode($file, '"需求反馈"', 2); + $code = $this->getExtendCode($file, 'isGetCoupon:', 2); if($code){ $file = str_replace($code, '{}', $file); } + $file = preg_replace('!recommendShow:\w+,!', 'recommendShow:!1,', $file, 1); + $code = $this->getExtendCode($file, '"需求反馈"', 1, '[', ']'); + if($code){ + $file = str_replace($code, '[]', $file); + } $flag = true; } - if(strpos($file, '"WechatOfficial"')!==false){ //main - $code = $this->getExtendCode($file, '"WechatOfficial"', 5); + if(strpos($file, '售后QQ群:')!==false){ //main + $code = $this->getExtendCode($file, '"微信公众号"', 1); $code = $this->getExtendFunction($file, $code); $start = strpos($file, $code) - 1; for($i=$start;$i>=0;$i--){ @@ -129,36 +131,43 @@ class CleanViteJs extends Command } } $code = $this->getExtendCode($file, '"/other/customer-service.png"', 2); - $code = $this->getExtendCode($file, $code, 2, '[', ']'); + $code = $this->getExtendFunction($file, $code); $end = strpos($file, $code)+strlen($code); - $code = substr($file, $start, $end - $start + 1); + $code = substr($file, $start, $end - $start); $file = str_replace($code, '', $file); - $file = str_replace('startNegotiate(),', '', $file); $flag = true; } - - if(strpos($file, '"calc"') !== false && strpos($file, '"checkConfirm"') !== false){ //main2 - $file = preg_replace('!,isCalc:\w+,isInput:\w+,!', ',isCalc:!1,isInput:!1,', $file); - $file = preg_replace('!"calc"===\w+\.type!', '!1', $file); - $file = preg_replace('!\w+\(\(\(\)=>"input"===\w+\.type\)\)!', '!1', $file); - $file = preg_replace('!\w+\(\(function\(\)\{return"input"===\w+\.type\}\)\)!', '!1', $file); + + if(strpos($file, 'useNegotiate')!==false){ //utils + $code = $this->getExtendCode($file, 'createPeerConnection()', 1); + if($code){ + $file = str_replace($code, '{}', $file); + } + $file = preg_replace('!\w+\(\(\(\)=>"calc"===\w+\.\w+\.type\)\)!', '!1', $file); + $file = preg_replace('!\w+\(\(\(\)=>"input"===\w+\.\w+\.type\)\)!', '!1', $file); + $file = preg_replace('!\w+\(\(function\(\)\{return"calc"===\w+\.\w+\.type\}\)\)!', '!1', $file); + $file = preg_replace('!\w+\(\(function\(\)\{return"input"===\w+\.\w+\.type\}\)\)!', '!1', $file); $flag = true; } if(strpos($file, '请冷静几秒钟,确认以下要删除的数据')!==false && strpos($file, '"计算结果:"')!==false){ //site - $code = $this->getExtendCode($file, '"计算结果:"', 2, '[', ']'); + $code = $this->getExtendCode($file, '"计算结果:"', 1, '[', ']'); $code = $this->getExtendFunction($file, $code); $file = str_replace($code, '', $file); $file = preg_replace('!\w+\.sum===\w+\.addend1\+\w+\.addend2!', '!0', $file); - $file = preg_replace('!\w+\.sum\!==\w+\.addend1\+\w+\.addend2!', '!1', $file); - $file = preg_replace('!,disableDeleteButton:\w+,countdown:\w+,!', ',disableDeleteButton:!1,countdown:!1,', $file); - if(preg_match('/startCountdown:(\w+),/', $file, $matchs)){ - $file = str_replace([';'.$matchs[1].'()', $matchs[1].'(),'], '', $file); - } + $file = preg_replace('!value=\!0,(\w+)\.value=5;!', 'value=!1,$1.value=0;', $file); $flag = true; } - if(strpos($file, 'svgtofont-left-waf')!==false){ //site.table + if(strpos($file, '"left-waf"')!==false && strpos($file, '"iconWaf"')!==false){ //site.table + $code = $this->getExtendCode($file, '"left-waf"'); + $code = $this->getExtendCode($file, $code, 1, '[', ']'); + $code = $this->getExtendFunction($file, $code); + $file = str_replace($code, '""', $file); + $flag = true; + } + + if(strpos($file, 'svgtofont-left-waf')!==false && strpos($file, '"iconWaf"')!==false){ //site.table $code = $this->getExtendCode($file, 'svgtofont-left-waf'); $code = $this->getExtendCode($file, $code, 1, '[', ']'); $code = $this->getExtendFunction($file, $code); @@ -169,11 +178,19 @@ class CleanViteJs extends Command if(strpos($file, '"商用SSL证书"')!==false){ //site-ssl $code = $this->getExtendFunction($file, '"商用SSL证书"', '{', '}'); $file = str_replace($code, '', $file); - $code = $this->getExtendFunction($file, '"测试证书"', '{', '}'); + $code = $this->getExtendFunction($file, '"宝塔证书"', '{', '}'); $file = str_replace($code, '', $file); - $file = str_replace('"currentCertInfo":"busSslList"', '"currentCertInfo":"currentCertInfo"', $file); - $file = preg_replace('!\{(\w+)\.value="busSslList",\w+\(\)\}!', '{$1.value="letsEncryptList"}', $file); - $file = preg_replace('!defaultActive:(\w+)\("sslCertificate"\)!', 'defaultActive:$1("EncryptCertificate")', $file); + $code = $this->getExtendCode($file, '"购买商业证书"', 2); + if($code){ + $code2 = str_replace('"busSslList"', '"letsEncryptList"', $code); + $code2 = str_replace($this->getExtendFunction($code, '"购买商业证书"'), '', $code2); + $file = str_replace($code, $code2, $file); + } + $file = preg_replace('!(\w+)\("sslCertificate"\)!', '$1("EncryptCertificate")', $file); + $flag = true; + } + if(strpos($file, '"busSslList"')!==false && strpos($filepath, '/useStore')){ //site-ssl + $file = str_replace('"busSslList"', '"currentCertInfo"', $file); $flag = true; } @@ -185,50 +202,36 @@ class CleanViteJs extends Command } if(strpos($file, '"recom-view"')!==false){ //soft - $code = $this->getExtendFunction($file, '"recom-view"'); - $file = str_replace($code, 'void(0)', $file); + $code = $this->getExtendCode($file, '"recom-view"'); + $code = $this->getExtendFunction($file, $code); + $file = str_replace($code, '', $file); $flag = true; } if(strpos($file, '"打开插件文件目录"')!==false){ //soft.table - $code = $this->getExtendFunction($file, '"(续费)"'); - $file = str_replace($code, '""', $file); $code = $this->getExtendFunction($file, '"(续费)"'); $file = str_replace($code, '""', $file); $flag = true; } - if(strpos($file, '检测到同名文件')!==false){ //file. - $code = $this->getExtendCode($file, '计算结果:', 3, '[', ']'); - $code = $this->getExtendFunction($file, $code); - $file = str_replace($code, '', $file); - $file = preg_replace('!\w+\.sum===\w+\.addend1\+\w+\.addend2!', '!0', $file); - $flag = true; - } - for($i=0;$i<5;$i++){ - $code = $this->getExtendCode($file, 'content:"需求反馈"', 2); + $code = $this->getExtendCode($file, ',"需求反馈"', 1, '[', ']'); if($code){ - $code = $this->getExtendFunction($file, $code); - $start = strpos($file, $code); - if(substr($file,$start-1,1) == ':'){ - $file = $this->str_replace_once($code, '{}', $file); - }else{ - $file = $this->str_replace_once($code, '', $file); - } + $file = str_replace($code, '[]', $file); $flag = true; } } - $code = $this->getExtendFunction($file, '("需求反馈")'); + $code = $this->getExtendCode($file, '("需求反馈")', 1, '[', ']'); if($code){ - $file = str_replace($code, '', $file); + $file = str_replace($code, '[]', $file); $flag = true; } - $code = $this->getExtendFunction($file, '(" 需求反馈 ")'); - if($code){ - $file = str_replace($code, '', $file); + $code = $this->getExtendCode($file, '(" 需求反馈 ")', 1, '[', ']'); + if($code && strpos($filepath, 'vue_vue_type_') === false){ + $file = str_replace($code, '[]', $file); $flag = true; } + if(strpos('暂无搜索结果,提交需求反馈', $file)!==false){ $file = str_replace('暂无搜索结果,提交需求反馈', '暂无搜索结果', $file); $flag = true; diff --git a/app/script/convert.sh b/app/script/convert.sh index 6d909f2..261dcdc 100644 --- a/app/script/convert.sh +++ b/app/script/convert.sh @@ -1,7 +1,7 @@ #!/bin/bash -Linux_Version="9.2.0" -Windows_Version="8.2.0" +Linux_Version="9.3.0" +Windows_Version="8.2.1" Btm_Version="2.3.0" FILES=( diff --git a/install.sql b/install.sql index 1eac1db..14af54f 100644 --- a/install.sql +++ b/install.sql @@ -12,12 +12,12 @@ INSERT INTO `cloud_config` (`key`, `value`) VALUES ('bt_key', ''), ('whitelist', '0'), ('download_page', '1'), -('new_version', '9.2.0'), +('new_version', '9.3.0'), ('update_msg', '暂无更新日志'), -('update_date', '2024-09-13'), -('new_version_win', '8.1.0'), +('update_date', '2024-12-06'), +('new_version_win', '8.2.1'), ('update_msg_win', '暂无更新日志'), -('update_date_win', '2024-07-17'), +('update_date_win', '2024-12-06'), ('new_version_btm', '2.3.0'), ('update_msg_btm', '暂无更新日志'), ('update_date_btm', '2024-04-24'), diff --git a/public/install/install_6.0.sh b/public/install/install_6.0.sh index 8aa70fd..ea899c5 100644 --- a/public/install/install_6.0.sh +++ b/public/install/install_6.0.sh @@ -483,7 +483,7 @@ Install_RPM_Pack(){ sed -i 's/SELINUX=enforcing/SELINUX=disabled/' /etc/selinux/config #yum remove -y python-requests python3-requests python-greenlet python3-greenlet - yumPacks="libcurl-devel wget tar gcc make zip unzip openssl openssl-devel gcc libxml2 libxml2-devel libxslt* zlib zlib-devel libjpeg-devel libpng-devel libwebp libwebp-devel freetype freetype-devel lsof pcre pcre-devel vixie-cron crontabs icu libicu-devel c-ares libffi-devel bzip2-devel ncurses-devel sqlite-devel readline-devel tk-devel gdbm-devel db4-devel libpcap-devel xz-devel qrencode" + yumPacks="libcurl-devel wget tar gcc make zip unzip openssl openssl-devel gcc libxml2 libxml2-devel libxslt* zlib zlib-devel libjpeg-devel libpng-devel libwebp libwebp-devel freetype freetype-devel lsof pcre pcre-devel vixie-cron crontabs icu libicu-devel c-ares libffi-devel bzip2-devel ncurses-devel sqlite-devel readline-devel tk-devel gdbm-devel db4-devel libpcap-devel xz-devel qrencode at mariadb rsyslog net-tools" yum install -y ${yumPacks} for yumPack in ${yumPacks} @@ -537,7 +537,7 @@ Install_Deb_Pack(){ apt-get install curl -y fi - debPacks="wget curl libcurl4-openssl-dev gcc make zip unzip tar openssl libssl-dev gcc libxml2 libxml2-dev zlib1g zlib1g-dev libjpeg-dev libpng-dev lsof libpcre3 libpcre3-dev cron net-tools swig build-essential libffi-dev libbz2-dev libncurses-dev libsqlite3-dev libreadline-dev tk-dev libgdbm-dev libdb-dev libdb++-dev libpcap-dev xz-utils git qrencode sqlite3"; + debPacks="wget curl libcurl4-openssl-dev gcc make zip unzip tar openssl libssl-dev gcc libxml2 libxml2-dev zlib1g zlib1g-dev libjpeg-dev libpng-dev lsof libpcre3 libpcre3-dev cron net-tools swig build-essential libffi-dev libbz2-dev libncurses-dev libsqlite3-dev libreadline-dev tk-dev libgdbm-dev libdb-dev libdb++-dev libpcap-dev xz-utils git qrencode sqlite3 at mariadb-client rsyslog net-tools"; apt-get install -y $debPacks --force-yes for debPack in ${debPacks} diff --git a/public/install/src/panel6.zip b/public/install/src/panel6.zip index d5bcd1f..70ec706 100644 Binary files a/public/install/src/panel6.zip and b/public/install/src/panel6.zip differ diff --git a/public/install/update/LinuxPanel-9.2.0.zip b/public/install/update/LinuxPanel-9.3.0.zip similarity index 66% rename from public/install/update/LinuxPanel-9.2.0.zip rename to public/install/update/LinuxPanel-9.3.0.zip index 38fe3b5..1593c70 100644 Binary files a/public/install/update/LinuxPanel-9.2.0.zip and b/public/install/update/LinuxPanel-9.3.0.zip differ diff --git a/public/install/update6.sh b/public/install/update6.sh index 0b2fbec..87620e6 100644 --- a/public/install/update6.sh +++ b/public/install/update6.sh @@ -103,7 +103,7 @@ fi setup_path=/www version=$(curl -Ss --connect-timeout 5 -m 2 $Btapi_Url/api/panel/get_version) if [ -z "$VERSION_CHECK" ];then - version='9.2.0' + version='9.3.0' fi armCheck=$(uname -m|grep arm) if [ "${armCheck}" ];then @@ -136,6 +136,33 @@ rm -f /www/server/panel/class/*.pyc #pip install flask_sqlalchemy #pip install itsdangerous==0.24 +if [ -f "/www/server/panel/pyenv/bin/pip3" ];then + btpip_path="/www/server/panel/pyenv/bin/pip3" + FlaskV=$($btpip_path list 2>/dev/null|grep "Flask " |awk '{print $2}'|cut -f 1 -d .) + piplist_count=$($btpip_path list 2>/dev/null|wc -l) + if [ "${FlaskV}" -le "2" ] && [ "${piplist_count}" -le "118" ];then + echo "检测到面板运行环境过老,正常尝试修复面板依赖" + pyenv_path="/www/server/panel" + wget -O $pyenv_path/pyenv/pip.txt $download_Url/install/pyenv/pip-3.7.16.txt -T 5 + $pyenv_path/pyenv/bin/pip install -U pip + $pyenv_path/pyenv/bin/pip install -U setuptools==65.5.0 + $pyenv_path/pyenv/bin/pip install -U wheel==0.34.2 + $pyenv_path/pyenv/bin/pip install -r $pyenv_path/pyenv/pip.txt + echo "依赖修复完成,如面板仍无法正常访问,请联系宝塔官方人员进行求助" + fi + + #wget -O pip-packs.txt $download_Url/install/pyenv/pip-packs.txt + #PIP_PACKS=$(cat pip-packs.txt) + #for P_PACK in ${PIP_PACKS}; + #do + # btpip show ${P_PACK} > /dev/null 2>&1 + # if [ "$?" == "1" ];then + # btpip install ${P_PACK} + # fi + #done +fi + + pip_list=$($mypip list 2>&1) request_v=$(btpip list 2>/dev/null|grep "requests "|awk '{print $2}'|cut -d '.' -f 2) if [ "$request_v" = "" ] || [ "${request_v}" -gt "28" ];then diff --git a/public/win/panel/panel_8.2.0.zip b/public/win/panel/panel_8.2.1.zip similarity index 96% rename from public/win/panel/panel_8.2.0.zip rename to public/win/panel/panel_8.2.1.zip index aaa7869..05d4cf6 100644 Binary files a/public/win/panel/panel_8.2.0.zip and b/public/win/panel/panel_8.2.1.zip differ diff --git a/wiki/files/linux/bt.js b/wiki/files/linux/bt.js index 6437730..37af3d2 100644 --- a/wiki/files/linux/bt.js +++ b/wiki/files/linux/bt.js @@ -88,396 +88,23 @@ if("undefined" != typeof bt && bt.hasOwnProperty("input_confirm")){ }); } } -if("undefined" != typeof database && database.hasOwnProperty("del_database")){ - database.del_database = function (wid, dbname, obj, callback) { - var is_db_type = false, del_data = [] - if (typeof wid === 'object') { - del_data = wid - is_db_type = wid.some(function (item) { - return item.db_type > 0 - }) - var ids = []; - for (var i = 0; i < wid.length; i++) { - ids.push(wid[i].id); - } - wid = ids - } - var type = $('.database-pos .tabs-item.active').data('type'), - title = '', - tips = ''; - title = typeof dbname === "function" ? '批量删除数据库' : '删除数据库 - [ ' + dbname + ' ]'; - tips = is_db_type || !recycle_bin_db_open || type !== 'mysql' ? '当前列表存在彻底删除后无法恢复的数据库,请仔细查看列表,以防误删,是否继续操作?' : '当前列表数据库将迁移至数据库回收站,如需彻底删除请前往数据库回收站,是否继续操作?' - var arrs = wid instanceof Array ? wid : [wid] - var ids = JSON.stringify(arrs), - countDown = 9; - if (arrs.length == 1) countDown = 4 - var loadT = bt.load('正在检测数据库数据信息,请稍候...'), - param = { url: 'database/' + bt.data.db_tab_name + '/check_del_data', data: { data: JSON.stringify({ ids: ids }) } } - if (bt.data.db_tab_name == 'mysql') param = { url: 'database?action=check_del_data', data: { ids: ids } } - bt_tools.send(param, function (res) { - loadT.close() - layer.open({ - type: 1, - title: title, - area: '740px', - skin: 'verify_site_layer_info', - closeBtn: 2, - shadeClose: true, - content: '
' + - "
\ - \ -
"+ tips + "
\ -
"+ - '
' + - '
' + - '
' + - (is_db_type ? '注意:远程数据库暂不支持数据库回收站,选中的数据库将彻底删除
' : '') + - (!recycle_bin_db_open ? '风险操作:当前数据库回收站未开启,删除数据库将永久消失
' : '') - + '请仔细阅读以上要删除信息,防止数据库被误删
' + - '
', - btn: ['下一步', lan.public.cancel], - success: function (layers) { - setTimeout(function () { $(layers).css('top', ($(window).height() - $(layers).height()) / 2); }, 50) - var rdata = res.data, - newTime = parseInt(new Date().getTime() / 1000), - t_icon = ' '; - for (var j = 0; j < rdata.length; j++) { - for (var i = 0; i < del_data.length; i++) { - if (rdata[j].id == del_data[i].id) { - var is_time_rule = (newTime - rdata[j].st_time) > (86400 * 30) && (rdata[j].total > 1024 * 10), - is_database_rule = res.db_size <= rdata[j].total, - database_time = bt.format_data(rdata[j].st_time, 'yyyy-MM-dd'), - database_size = bt.format_size(rdata[j].total); - var f_size = database_size - var t_size = '注意:此数据库较大,可能为重要数据,请谨慎操作.\n数据库:' + database_size; - if (rdata[j].total < 2048) t_size = '注意事项:当前数据库不为空,可能为重要数据,请谨慎操作.\n数据库:' + database_size; - if (rdata[j].total === 0) t_size = ''; - rdata[j]['t_size'] = t_size - rdata[j]['f_size'] = f_size - rdata[j]['database_time'] = database_time - rdata[j]['is_time_rule'] = is_time_rule - rdata[j]['is_database_rule'] = is_database_rule - rdata[j]['db_type'] = del_data[i].db_type - rdata[j]['conn_config'] = del_data[i].conn_config - } - } - } - var filterData = rdata.filter(function (el) { - return ids.indexOf(el.id) != -1 - }) - bt_tools.table({ - el: '#check_layer_content', - data: filterData, - height: '300px', - column: [ - { fid: 'name', title: '数据库名称' }, - { - title: '数据库大小', template: function (row) { - return '' + row.f_size + (row.is_database_rule ? t_icon : '') + '' - } - }, - { - title: '数据库位置', template: function (row) { - var type_column = '-' - switch (row.db_type) { - case 0: - type_column = '本地数据库' - break; - case 1: - case 2: - type_column = '远程数据库' - break; - } - return '' + type_column + '' - } - }, - { - title: '创建时间', template: function (row) { - return '' + row.database_time + '' - } - }, - { - title: '删除结果', align: 'right', template: function (row, index, ev, _that) { - var _html = '' - switch (row.db_type) { - case 0: - _html = type !== 'mysql' ? '彻底删除' : (!recycle_bin_db_open ? '彻底删除' : '移至回收站') - break; - case 1: - case 2: - _html = '彻底删除' - break; - } - return '' + _html + '' - } - } - ], - success: function () { - $('#check_layer_content').find('.glyphicon-info-sign').click(function (e) { - var msg = $(this).parent().prop('title') - msg = msg.replace('数据库:','
数据库:') - layer.tips(msg, $(this).parent(), { tips: [1, 'red'], time: 3000 }) - $(document).click(function (ev) { - layer.closeAll('tips'); - $(this).unbind('click'); - ev.stopPropagation(); - ev.preventDefault(); - }); - e.stopPropagation(); - e.preventDefault(); - }); - if ($('.remote_database').length) { - $('.remote_database').each(function (index, el) { - var id = $(el).parent().parent().parent().index() - $('#check_layer_content tbody tr').eq(id).css('background-color', '#ff00000a') - }) - } - } - }) - }, - yes: function (indes, layers) { - title = typeof dbname === "function" ? '二次验证信息,批量删除数据库' : '二次验证信息,删除数据库 - [ ' + dbname + ' ]'; - if (type !== 'mysql') { - tips = '当前数据库暂不支持数据库回收站,删除后将无法恢复,此操作不可逆,是否继续操作?'; - } else { - tips = is_db_type ? '远程数据库不支持数据库回收站,删除后将无法恢复,此操作不可逆,是否继续操作?' : recycle_bin_db_open ? '删除后如需彻底删除请前往数据库回收站,是否继续操作?' : '删除后可能会影响业务使用,此操作不可逆,是否继续操作?' - } - layer.open({ - type: 1, - title: title, - icon: 0, - skin: 'delete_site_layer', - area: "530px", - closeBtn: 2, - shadeClose: true, - content: "
" + - "
\ - \ -
"+ tips + "
\ -
"+ - "
注意:数据无价,请谨慎操作!!!" + (type === 'mysql' && !recycle_bin_db_open ? '
风险操作:当前数据库回收站未开启,删除数据库将永久消失!' : '') + "
"+ - "
", - btn: ['确认删除', '取消删除'], - yes: function (indexs) { - var data = { - id: wid, - name: dbname - }; - if (typeof dbname === "function") { - delete data.id; - delete data.name; - } - layer.close(indexs) - layer.close(indes) - if (typeof dbname === "function") { - dbname(data) - } else { - data.id = data.id[0] - bt.database.del_database(data, function (rdata) { - layer.closeAll() - if (callback) callback(rdata); - bt.msg(rdata); - }) - } - } - }) - } - }) - }) - } -} -if("undefined" != typeof site && site.hasOwnProperty("del_site")){ - site.del_site = function (wid, wname, callback) { - title = typeof wname === "function" ? '批量删除站点' : '删除站点 [ ' + wname + ' ]'; - layer.open({ +if(window.hasOwnProperty("SafeMessage")){ + window.SafeMessage = function(j, h, g, f) { + if (f == undefined) f = ''; + var mess = layer.open({ type: 1, - title: title, - icon: 0, - skin: 'delete_site_layer', - area: "440px", + title: j, + area: "350px", closeBtn: 2, shadeClose: true, - content: "
" + - '' + - "
是否要删除关联的FTP、数据库、站点目录!
" + - "
" + - "" + - "" + - "" + - "
" + - "
", - btn: [lan.public.ok, lan.public.cancel], - success: function (layers, indexs) { - $(layers).find('.check_type_group label').hover(function () { - var name = $(this).find('input').attr('name'); - if (name === 'database' && !recycle_bin_db_open) { - layer.tips('风险操作:当前数据库回收站未开启,删除数据库将永久消失!', this, { tips: [1, 'red'], time: 0 }) - } else if (name === 'path' && !recycle_bin_open) { - layer.tips('风险操作:当前文件回收站未开启,删除站点目录将永久消失!', this, { tips: [1, 'red'], time: 0 }) - } - }, function () { - layer.closeAll('tips'); - }); - }, - yes: function (indexs) { - var data = { id: wid, webname: wname }; - $('#site_delete_form input[type=checkbox]').each(function (index, item) { - if ($(item).is(':checked')) data[$(item).attr('name')] = 1 - }) - var is_database = data.hasOwnProperty('database'), is_path = data.hasOwnProperty('path'), is_ftp = data.hasOwnProperty('ftp'); - if ((!is_database && !is_path) && (!is_ftp || is_ftp)) { - if (typeof wname === "function") { - wname(data) - return false; - } - bt.site.del_site(data, function (rdata) { - layer.close(indexs); - if (callback) callback(rdata); - bt.msg(rdata); - }) - return false - } - if (typeof wname === "function") { - delete data.id; - delete data.webname; - } - layer.close(indexs) - var ids = JSON.stringify(wid instanceof Array ? wid : [wid]), countDown = typeof wname === 'string' ? 4 : 9; - title = typeof wname === "function" ? '二次验证信息,批量删除站点' : '二次验证信息,删除站点 [ ' + wname + ' ]'; - var loadT = bt.load('正在检测站点数据信息,请稍候...') - bt.send('check_del_data', 'site/check_del_data', { ids: ids }, function (res) { - loadT.close() - layer.open({ - type: 1, - title: title, - closeBtn: 2, - skin: 'verify_site_layer_info', - area: '740px', - content: '
' + - '' + - '
堡塔温馨提示您,请冷静几秒钟,确认以下要删除的数据。
' + - '
' + - '
' + - '
' + - '
' + - '
' + - '
' + - '
风险事项:当前未开启数据库回收站功能,删除数据库后,数据库将永久消失!
' + - '
风险事项:当前未开启文件回收站功能,删除站点目录后,站点目录将永久消失!
' + - '
注意:请仔细阅读以上要删除信息,防止网站数据被误删
' + - '
', - // recycle_bin_db_open && - // recycle_bin_open && - btn: ['确认删除', '取消删除'], - success: function (layers) { - var html = '', rdata = res.data; - for (var i = 0; i < rdata.length; i++) { - var item = rdata[i], newTime = parseInt(new Date().getTime() / 1000), - t_icon = ''; - - site_html = (function (item) { - if (!is_path) return '' - var is_time_rule = (newTime - item.st_time) > (86400 * 30) && (item.total > 1024 * 10), - is_path_rule = res.file_size <= item.total, - dir_time = bt.format_data(item.st_time, 'yyyy-MM-dd'), - dir_size = bt.format_size(item.total); - - var f_html = ' ' + (item.limit ? '大于50MB' : dir_size) + ' ' + (is_path_rule ? t_icon : ''); - var f_title = (is_path_rule ? '注意:此目录较大,可能为重要数据,请谨慎操作.\n' : '') + '目录:' + item.path + '(' + (item.limit ? '大于' : '') + dir_size + ')'; - - return '
' + - '站点名:' + item.name + '' + - '目录:' + item.path + ' (' + f_html + ')' + - '创建时间:' + dir_time + '' + - '
' - }(item)), - database_html = (function (item) { - if (!is_database || !item.database) return ''; - var is_time_rule = (newTime - item.st_time) > (86400 * 30) && (item.total > 1024 * 10), - is_database_rule = res.db_size <= item.database.total, - database_time = bt.format_data(item.database.st_time, 'yyyy-MM-dd'), - database_size = bt.format_size(item.database.total); - - var f_size = ' ' + database_size + ' ' + (is_database_rule ? t_icon : ''); - var t_size = '注意:此数据库较大,可能为重要数据,请谨慎操作.\n数据库:' + database_size; - - return '
' + - '数据库:' + item.database.name + '' + - '大小:' + f_size + '' + - '创建时间:' + database_time + '' + - '
' - }(item)) - if ((site_html + database_html) !== '') html += '
' + site_html + database_html + '
'; - } - if (html === '') html = '
无数据
' - $('.check_layer_content').html(html) - }, - yes: function (indes, layers) { - if (typeof wname === "function") { - wname(data) - } else { - bt.site.del_site(data, function (rdata) { - layer.closeAll() - if (rdata.status) site.get_list(); - if (callback) callback(rdata); - bt.msg(rdata); - }) - } - } - }) - }) - } + content: "

" + h + "

" + f + "
" + }); + $(".bt-cancel").click(function(){ + layer.close(mess); + }); + $("#toSubmit").click(function() { + layer.close(mess); + g(); }) } -} -if("undefined" != typeof bt && bt.hasOwnProperty("firewall") && bt.firewall.hasOwnProperty("add_accept_port")){ - bt.firewall.add_accept_port = function(type, port, ps, callback) { - var action = "AddDropAddress"; - if (type == 'port') { - ports = port.split(':'); - if (port.indexOf('-') != -1) ports = port.split('-'); - for (var i = 0; i < ports.length; i++) { - if (!bt.check_port(ports[i])) { - layer.msg('可用端口范围:1-65535', { icon: 2 }); - // layer.msg(lan.firewall.port_err, { - // icon: 5 - // }); - return; - } - } - action = "AddAcceptPort"; - } - - loading = bt.load(); - bt.send(action, 'firewall/' + action, { port: port, type: type, ps: ps }, function(rdata) { - loading.close(); - if (callback) callback(rdata); - }) - } -} -function SafeMessage(j, h, g, f) { - if(f == undefined) { - f = "" - } - var mess = layer.open({ - type: 1, - title: j, - area: "350px", - closeBtn: 2, - shadeClose: true, - content: "

" + h + "

" + f + "
" - }); - $(".bt-cancel").click(function(){ - layer.close(mess); - }); - $("#toSubmit").click(function() { - layer.close(mess); - g(); - }) -} -$(document).ready(function () { - if($('#updata_pro_info').length>0){ - $('#updata_pro_info').html(''); - bt.set_cookie('productPurchase', 1); - } -}) \ No newline at end of file +} \ No newline at end of file diff --git a/wiki/update.md b/wiki/update.md index 53ec6a0..6e1e79f 100644 --- a/wiki/update.md +++ b/wiki/update.md @@ -76,6 +76,8 @@ plugin_bin.pl 改成 plugin_list.json + 删除 public.run_thread(self.is_verify_unbinding, args=(get,)) + - class/plugin_deployment.py 文件,__setup_php_environment方法和GetJarPath方法内替换 public.GetConfigValue('home') => 'https://www.bt.cn' - class/config.py 文件,get_nps方法内data['nps'] = False改成True,get_nps_new方法下面加上 return public.returnMsg(False, "获取问卷失败") @@ -111,11 +113,7 @@ check_node_status() -- 去除WebRTC连接:BTPanel/static/js/public.js 删除stun.start();这一行 - -- 去除内页广告:BTPanel/templates/default/layout.html 删除两处getPaymentStatus(); - -- 删除问卷调查:BTPanel/templates/default/layout.html 删除if(window.localStorage.getItem('panelNPS') == null)以及下面的行 +- script/site_task.py 删除flush_ssh_log() - [可选]去除各种计算题:复制bt.js到 BTPanel/static/ ,在 BTPanel/templates/default/layout.html 的\前面加入 @@ -139,7 +137,7 @@ - [可选]关闭自动生成访问日志:在 BTPanel/\_\_init\_\_.py 删除public.write_request_log这一行 -- [可选]新版vite页面去除需求反馈、各种广告、计算题等,执行 php think cleanvitejs <面板BTPanel/static/vite/js路径> +- [可选]新版vite页面去除需求反馈、各种广告、计算题等,执行 php think cleanvitejs <面板BTPanel/static/js路径> 解压安装包[panel6.zip](http://download.bt.cn/install/src/panel6.zip),将更新包改好的文件覆盖到里面,然后重新打包,即可更新安装包。( diff --git a/wiki/updatewin.md b/wiki/updatewin.md index cf73790..c233044 100644 --- a/wiki/updatewin.md +++ b/wiki/updatewin.md @@ -42,6 +42,8 @@ Windows版宝塔由于加密文件太多,无法全部解密,因此无法做 - class/plugin_deployment.py 文件 get_icon 和 SetupPackage 方法内,替换 public.GetConfigValue('home') => 'https://www.bt.cn' +- script/reload_check.py 文件,在第2行插入sys.exit() + - 去除无用的定时任务:task.py 文件 删除 p = threading.Thread(target=check_files_panel) 以及下面2行