pull/718/head
dami 1 month ago
parent 142f0fc6c9
commit 628b65a569
  1. 13
      plugins/mysql/index.py
  2. 1
      requirements.txt

@ -10,6 +10,8 @@ import re
import json import json
from packaging import version
web_dir = os.getcwd() + "/web" web_dir = os.getcwd() + "/web"
if os.path.exists(web_dir): if os.path.exists(web_dir):
sys.path.append(web_dir) sys.path.append(web_dir)
@ -854,8 +856,8 @@ def runInfo(version):
return mw.getJson(result) return mw.getJson(result)
def myDbStatus(version): def myDbStatus(ver):
if status(version) == 'stop': if status(ver) == 'stop':
return mw.returnJson(False, 'MySQL未启动', []) return mw.returnJson(False, 'MySQL未启动', [])
result = {} result = {}
@ -868,7 +870,7 @@ def myDbStatus(version):
gets = ['table_open_cache', 'thread_cache_size', 'key_buffer_size', 'tmp_table_size', 'max_heap_table_size', 'innodb_buffer_pool_size', gets = ['table_open_cache', 'thread_cache_size', 'key_buffer_size', 'tmp_table_size', 'max_heap_table_size', 'innodb_buffer_pool_size',
'innodb_additional_mem_pool_size', 'innodb_log_buffer_size', 'max_connections', 'sort_buffer_size', 'read_buffer_size', 'read_rnd_buffer_size', 'join_buffer_size', 'thread_stack', 'binlog_cache_size'] 'innodb_additional_mem_pool_size', 'innodb_log_buffer_size', 'max_connections', 'sort_buffer_size', 'read_buffer_size', 'read_rnd_buffer_size', 'join_buffer_size', 'thread_stack', 'binlog_cache_size']
if version != "8.0": if version.parse(ver) < version.parse("8.0"):
gets.append('query_cache_size') gets.append('query_cache_size')
result['mem'] = {} result['mem'] = {}
@ -881,12 +883,11 @@ def myDbStatus(version):
return mw.getJson(result) return mw.getJson(result)
def setDbStatus(version): def setDbStatus(ver):
gets = ['key_buffer_size', 'tmp_table_size', 'max_heap_table_size', 'innodb_buffer_pool_size', 'innodb_log_buffer_size', 'max_connections', gets = ['key_buffer_size', 'tmp_table_size', 'max_heap_table_size', 'innodb_buffer_pool_size', 'innodb_log_buffer_size', 'max_connections',
'table_open_cache', 'thread_cache_size', 'sort_buffer_size', 'read_buffer_size', 'read_rnd_buffer_size', 'join_buffer_size', 'thread_stack', 'binlog_cache_size'] 'table_open_cache', 'thread_cache_size', 'sort_buffer_size', 'read_buffer_size', 'read_rnd_buffer_size', 'join_buffer_size', 'thread_stack', 'binlog_cache_size']
if version != "8.0": if version.parse(ver) < version.parse("8.0"):
# gets.append('query_cache_size')
gets = ['key_buffer_size', 'query_cache_size', 'tmp_table_size', 'max_heap_table_size', 'innodb_buffer_pool_size', 'innodb_log_buffer_size', 'max_connections', gets = ['key_buffer_size', 'query_cache_size', 'tmp_table_size', 'max_heap_table_size', 'innodb_buffer_pool_size', 'innodb_log_buffer_size', 'max_connections',
'table_open_cache', 'thread_cache_size', 'sort_buffer_size', 'read_buffer_size', 'read_rnd_buffer_size', 'join_buffer_size', 'thread_stack', 'binlog_cache_size'] 'table_open_cache', 'thread_cache_size', 'sort_buffer_size', 'read_buffer_size', 'read_rnd_buffer_size', 'join_buffer_size', 'thread_stack', 'binlog_cache_size']

@ -43,3 +43,4 @@ pyTelegramBotAPI
telebot telebot
pyyaml pyyaml
croniter croniter
packaging

Loading…
Cancel
Save