mirror of
https://github.com/aaPanel/aaPanel.git
synced 2026-09-28 12:24:50 +02:00
Update to v8.3.0
This commit is contained in:
+29
-24
@@ -7,29 +7,34 @@ import http_requests
|
||||
http_requests.DEFAULT_TYPE = 'src'
|
||||
os.environ['BT_TASK'] = '1'
|
||||
|
||||
import panelMessage
|
||||
import re
|
||||
msgObj = panelMessage.panelMessage()
|
||||
data = msgObj.get_messages()
|
||||
for x in data:
|
||||
if x['level'] in ['danger', 'error'] and not x['send'] and x['retry_num'] < 5:
|
||||
msg = '服务器IP【{}】: {}'.format(
|
||||
public.GetLocalIp(), re.sub(r',?<a\s*.+</a>', '', x['msg']))
|
||||
is_send = False
|
||||
def main():
|
||||
import panelMessage
|
||||
import re
|
||||
msgObj = panelMessage.panelMessage()
|
||||
data = msgObj.get_messages()
|
||||
for x in data:
|
||||
if x['level'] in ['danger', 'error'] and not x['send'] and x['retry_num'] < 5:
|
||||
msg = '服务器IP【{}】: {}'.format(
|
||||
public.GetLocalIp(), re.sub(r',?<a\s*.+</a>', '', x['msg']))
|
||||
is_send = False
|
||||
|
||||
ret = public.return_is_send_info()
|
||||
for key in ret:
|
||||
if ret[key]:
|
||||
ret = public.send_body_words(key, '宝塔消息提醒', msg)
|
||||
if ret:
|
||||
is_send = True
|
||||
pdata = {}
|
||||
if is_send:
|
||||
pdata['send'] = 1
|
||||
pdata['retry_num'] = 0
|
||||
else:
|
||||
pdata['send'] = 0
|
||||
pdata['retry_num'] = x['retry_num'] + 1
|
||||
ret = public.return_is_send_info()
|
||||
for key in ret:
|
||||
if ret[key]:
|
||||
ret = public.send_body_words(key, '宝塔消息提醒', msg)
|
||||
if ret:
|
||||
is_send = True
|
||||
pdata = {}
|
||||
if is_send:
|
||||
pdata['send'] = 1
|
||||
pdata['retry_num'] = 0
|
||||
else:
|
||||
pdata['send'] = 0
|
||||
pdata['retry_num'] = x['retry_num'] + 1
|
||||
|
||||
msgObj.set_send_status(x['id'], pdata)
|
||||
time.sleep(5)
|
||||
msgObj.set_send_status(x['id'], pdata)
|
||||
time.sleep(5)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
Reference in New Issue
Block a user