Skip to content

Commit

Permalink
Merge branch '7.x' of ssh://git.bt.cn:30001/root/linux-panel into 7.x
Browse files Browse the repository at this point in the history
  • Loading branch information
songchudong committed Apr 13, 2022
2 parents 91d7f15 + ee3355e commit c11c9da
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 11 deletions.
7 changes: 5 additions & 2 deletions BT-Panel
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,12 @@ if is_debug:
logger.debug('检测到文件: {} -> {}'.format(filename,in_type))

fname = os.path.basename(filename)
if fname in ['task.py','BT-Task']:
if fname in ['BT-Task']:
logger.debug('正在后台任务...')
public.ExecShell("{} {}/BT-Task".format(public.get_python_bin(),_PATH))
if os.path.getsize(filename) < 4096:
public.ExecShell("{} {}/BT-Task".format(public.get_python_bin(),_PATH))
else:
public.ExecShell("{}/BT-Task".format(_PATH))
logger.debug('后台任务已启动!')
else:
logger.debug('正在重启面板...')
Expand Down
4 changes: 3 additions & 1 deletion BT-Task
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,6 @@ import os
os.chdir("/www/server/panel")
os.system("cd task && make")
os.system("chmod 700 /www/server/panel/BT-Task")
os.system("/www/server/panel/BT-Task &")
os.system("/www/server/panel/BT-Task &")
if os.path.getsize("/www/server/panel/BT-Task") > 4096:
os.system("rm -rf /www/server/panel/task")
4 changes: 3 additions & 1 deletion BTPanel/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -594,8 +594,8 @@ def panel_warning(pdata=None):
if comReturn: return comReturn

get = get_input()
ikey = 'warning_list'
if get.action == 'get_list':
ikey = 'warning_list'
result = cache.get(ikey)
if not result or 'force' in get:
result = public.ExecShell("{} {}/script/warning_list.py".format(public.get_python_bin(),public.get_panel_path()))[0]
Expand All @@ -608,6 +608,8 @@ def panel_warning(pdata=None):
import panelWarning
dataObject = panelWarning.panelWarning()
defs = ('get_list', 'set_ignore', 'check_find')
if get.action == 'set_ignore':
cache.delete(ikey)
return publicObject(dataObject, defs, None, pdata)


Expand Down
10 changes: 6 additions & 4 deletions BTPanel/static/js/site.js
Original file line number Diff line number Diff line change
Expand Up @@ -7257,10 +7257,12 @@ var site = {
pay_status = product_recommend.get_pay_status(),
recom_Template = '', _introduce = '';
// 1.未安装
try {
if (!_config['isBuy'] || !_config['install']) {
$.each(_config['product_introduce'], function (index, item) {
_introduce += '<li>' + item + '</li>'
try{
if(!_config['isBuy'] || !_config['install']){
if ($('#webedit-con').find('.daily-thumbnail.recommend').length >= 1) return;

$.each(_config['product_introduce'],function(index,item){
_introduce +='<li>'+item+'</li>'
})
recom_Template = '<div class="daily-thumbnail recommend">\
<div class="thumbnail-box"><div class="pluginTipsGg"></div></div>\
Expand Down
2 changes: 0 additions & 2 deletions class/panelPlugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,6 @@ def __init__(self):
self.__replace_rule = public.get_plugin_replace_rules()




def input_package(self,get):
'''
@name 导入插件包到面板
Expand Down
4 changes: 3 additions & 1 deletion task/bt-task.c
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,11 @@ void get_task_list(struct task_info *task_list){
task_list[n].id = atoi(table_data[i]);
break;
case 1:
task_list[n].type[0] = '\0';
strcpy(task_list[n].type,table_data[i]);
break;
case 2:
task_list[n].execstr[0] = '\0';
strcpy(task_list[n].execstr,table_data[i]);
n++; // 行数加1
break;
Expand Down Expand Up @@ -131,10 +133,10 @@ void *start_task(void * arg){
char *_sql2 = sqlite3_mprintf("UPDATE tasks SET status=1,end=%d WHERE id=%d",end,task_list[i].id);
execute(_sql2,db_file);
sqlite3_free(_sql2);
task_list[i].id = 0;
}
sleep(_cycle);
}

}

/**
Expand Down

0 comments on commit c11c9da

Please sign in to comment.