Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
flucout committed Aug 31, 2024
1 parent aba885f commit e304e9a
Show file tree
Hide file tree
Showing 8 changed files with 64 additions and 75 deletions.
14 changes: 6 additions & 8 deletions app/command/CleanViteJs.php
Original file line number Diff line number Diff line change
Expand Up @@ -129,13 +129,11 @@ private function handlefile($filepath){
}

if(strpos($file, '"calc"') !== false && strpos($file, '"checkConfirm"') !== false){ //main2
$file = preg_replace('!,isCalc:\w+,isInput:\w+,isCheck:\w+,!', ',isCalc:!1,isInput:!1,isCheck:!1,', $file);
$file = preg_replace('!\w+\(\(\(\)=>"calc"===\w+\.type\|\|"checkConfirm"===\w+\.type\)\)!', '!1', $file);
$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+\(\(\(\)=>"check"===\w+\.type\|\|"checkConfirm"===\w+\.type\)\)!', '!1', $file);
$file = preg_replace('!\w+\(\(function\(\)\{return"calc"===\w+\.type\|\|"checkConfirm"===\w+\.type\}\)\)!', '!1', $file);
$file = preg_replace('!"calc"===\w+\.type!', '!1', $file);
$file = preg_replace('!\w+\(\(function\(\)\{return"input"===\w+\.type\}\)\)!', '!1', $file);
$file = preg_replace('!\w+\(\(function\(\)\{return"check"===\w+\.type\|\|"checkConfirm"===\w+\.type\}\)\)!', '!1', $file);
$flag = true;
}

Expand All @@ -152,13 +150,13 @@ private function handlefile($filepath){
$flag = true;
}

/*if(strpos($file, '"bt-waf-gray"')!==false){ //site.popup
$code = $this->getExtendCode($file, '"bt-waf-gray"', 2);
if(strpos($file, 'svgtofont-left-waf')!==false){ //site.table
$code = $this->getExtendCode($file, 'svgtofont-left-waf');
$code = $this->getExtendCode($file, $code, 1, '[', ']');
$code = $this->getExtendFunction($file, $code);
$file = str_replace($code, '""', $file);
$flag = true;
}*/
}

if(strpos($file, '"商用SSL证书"')!==false){ //site-ssl
$code = $this->getExtendFunction($file, '"商用SSL证书"', '{', '}');
Expand Down
2 changes: 1 addition & 1 deletion app/script/convert.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash

Linux_Version="9.1.0"
Windows_Version="8.1.0"
Windows_Version="8.2.0"
Btm_Version="2.3.0"

FILES=(
Expand Down
Binary file modified public/install/src/panel6.zip
Binary file not shown.
Binary file modified public/install/update/LinuxPanel-9.1.0.zip
Binary file not shown.
Binary file not shown.
119 changes: 53 additions & 66 deletions wiki/files/linux/PluginLoader.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,50 +40,43 @@ def plugin_run(plugin_name,def_name,args):
# 添加插件目录到系统路径
public.sys_path_append(plugin_path)

try:
if not is_php:
# 引用插件入口文件
_name = "{}_main".format(plugin_name)
plugin_main = __import__(_name)

# 检查类名是否符合规范
if not hasattr(plugin_main,_name):
return public.returnMsg(False,'指定插件入口文件不符合规范')

try:
if sys.version_info[0] == 2:
reload(plugin_main)
else:
from imp import reload
reload(plugin_main)
except:
pass

# 实例化插件类
plugin_obj = getattr(plugin_main,_name)()

# 检查方法是否存在
if not hasattr(plugin_obj,def_name):
return public.returnMsg(False,'在[%s]插件中找不到[%s]方法' % (plugin_name,def_name))

if 'plugin_get_object' in args and args.plugin_get_object == 1:
return getattr(plugin_obj, def_name)

# 执行方法
return getattr(plugin_obj,def_name)(args)
else:
if 'plugin_get_object' in args and args.plugin_get_object == 1:
return None
import panelPHP
args.s = def_name
args.name = plugin_name
return panelPHP.panelPHP(plugin_name).exec_php_script(args)

except SyntaxError as ex:
return public.returnMsg(False,'指定插件不兼容当前操作系统')
except Exception as ex:
public.print_error()
return public.returnMsg(False,'指定插件不存在')
if not is_php:
# 引用插件入口文件
_name = "{}_main".format(plugin_name)
plugin_main = __import__(_name)

# 检查类名是否符合规范
if not hasattr(plugin_main,_name):
return public.returnMsg(False,'指定插件入口文件不符合规范')

try:
if sys.version_info[0] == 2:
reload(plugin_main)
else:
from imp import reload
reload(plugin_main)
except:
pass

# 实例化插件类
plugin_obj = getattr(plugin_main,_name)()

# 检查方法是否存在
if not hasattr(plugin_obj,def_name):
return public.returnMsg(False,'在[%s]插件中找不到[%s]方法' % (plugin_name,def_name))

if 'plugin_get_object' in args and args.plugin_get_object == 1:
return getattr(plugin_obj, def_name)

# 执行方法
return getattr(plugin_obj,def_name)(args)
else:
if 'plugin_get_object' in args and args.plugin_get_object == 1:
return None
import panelPHP
args.s = def_name
args.name = plugin_name
return panelPHP.panelPHP(plugin_name).exec_php_script(args)


def get_module_list():
Expand Down Expand Up @@ -117,7 +110,7 @@ def module_run(module_name,def_name,args):
if model_index:
# 新模块目录
if model_index in ['mod']:
_name = "{}Mod".format(module_name)
_name = "{}Mod".format(module_name.split('/')[1])
module_file = os.path.join(panel_path,'mod','project',module_name + 'Mod.py')
elif model_index:
# 旧模块目录
Expand All @@ -144,31 +137,25 @@ def module_run(module_name,def_name,args):
return public.returnMsg(False,'模块路径不合法')

public.sys_path_append(os.path.dirname(module_file))
try:
# 引用模块入口文件
module_main = __import__(_name)
# 引用模块入口文件
module_main = __import__(_name)

# 检查模块是否符合规范
if not hasattr(module_main,'main'):
return public.returnMsg(False,'指定模块入口文件不符合规范')
# 检查模块是否符合规范
if not hasattr(module_main,'main'):
return public.returnMsg(False,'指定模块入口文件不符合规范')

# 实例化模块类
module_obj = getattr(module_main,'main')()
# 实例化模块类
module_obj = getattr(module_main,'main')()

# 检查方法是否存在
if not hasattr(module_obj,def_name):
return public.returnMsg(False,'在[%s]模块中找不到[%s]方法' % (module_name,def_name))
if 'module_get_object' in args and args.module_get_object == 1:
return getattr(module_obj,def_name)
# 检查方法是否存在
if not hasattr(module_obj,def_name):
return public.returnMsg(False,'在[%s]模块中找不到[%s]方法' % (module_name,def_name))

if 'module_get_object' in args and args.module_get_object == 1:
return getattr(module_obj,def_name)

# 执行方法
return getattr(module_obj,def_name)(args)
except SyntaxError as ex:
return public.returnMsg(False,'指定模块不兼容当前操作系统')
except Exception as ex:
public.print_error()
return public.returnMsg(False,'指定模块不存在')
# 执行方法
return getattr(module_obj,def_name)(args)


def get_plugin_list(upgrade_force = False):
Expand Down
2 changes: 2 additions & 0 deletions wiki/update.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,8 @@
<script src="/static/bt.js"></script>
```

在 BTPanel/templates/default/software.html 的 <script>window.vite_public_request_token 前面加入

- [可选]去除创建网站自动创建的垃圾文件:在class/panelSite.py,分别删除

htaccess = self.sitePath + '/.htaccess'
Expand Down
2 changes: 2 additions & 0 deletions wiki/updatewin.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ Windows版宝塔由于加密文件太多,无法全部解密,因此无法做

删除 p = threading.Thread(target=update_software_list) 以及下面2行

- tools.py,删除#尝试删除本地hosts文件中的宝塔域名解析

- 去除面板日志上报:script/site_task.py 文件

- 删除最下面 logs_analysis() 这1行
Expand Down

0 comments on commit e304e9a

Please sign in to comment.