diff --git a/frontend/src/views/database/mysql/password/index.vue b/frontend/src/views/database/mysql/password/index.vue index a7703b473..6dbc92ef0 100644 --- a/frontend/src/views/database/mysql/password/index.vue +++ b/frontend/src/views/database/mysql/password/index.vue @@ -2,7 +2,7 @@
@@ -78,6 +78,7 @@ const loading = ref(); const changeVisiable = ref(false); type FormInstance = InstanceType; const changeFormRef = ref(); +const title = ref(); const changeForm = reactive({ id: 0, mysqlName: '', @@ -101,6 +102,10 @@ interface DialogProps { value: string; } const acceptParams = (params: DialogProps): void => { + title.value = + params.operation === 'password' + ? i18n.global.t('database.changePassword') + : i18n.global.t('database.permission'); changeForm.id = params.id; changeForm.mysqlName = params.mysqlName; changeForm.userName = params.username; diff --git a/frontend/src/views/database/mysql/setting/slow-log/index.vue b/frontend/src/views/database/mysql/setting/slow-log/index.vue index 850b789f8..3f3595ef2 100644 --- a/frontend/src/views/database/mysql/setting/slow-log/index.vue +++ b/frontend/src/views/database/mysql/setting/slow-log/index.vue @@ -17,9 +17,11 @@ {{ $t('commons.button.save') }}
- {{ $t('commons.button.watch') }} + + {{ $t('commons.button.watch') }} +
- + {{ $t('file.download') }} @@ -29,7 +31,7 @@ :placeholder="$t('database.noData')" :indent-with-tab="true" :tabSize="4" - style="height: calc(100vh - 427px); width: 100%" + style="height: calc(100vh - 428px); width: 100%" :lineWrapping="true" :matchBrackets="true" theme="cobalt" @@ -77,7 +79,6 @@ const variables = reactive({ slow_query_log: 'OFF', long_query_time: 10, }); -const oldVariables = ref(); interface DialogProps { mysqlName: string; @@ -100,7 +101,6 @@ const acceptParams = async (params: DialogProps): Promise => { } }, 1000 * 5); } - oldVariables.value = { ...variables }; }; const emit = defineEmits(['loading']); @@ -132,13 +132,12 @@ const changeSlowLogs = () => { const onCancle = async () => { variables.slow_query_log = currentStatus.value ? 'ON' : 'OFF'; + detailShow.value = currentStatus.value; }; const onSave = async () => { let param = [] as Array; - if (variables.slow_query_log !== oldVariables.value.slow_query_log) { - param.push({ param: 'slow_query_log', value: variables.slow_query_log }); - } + param.push({ param: 'slow_query_log', value: variables.slow_query_log }); if (variables.slow_query_log === 'ON') { param.push({ param: 'long_query_time', value: variables.long_query_time + '' }); param.push({ param: 'slow_query_log_file', value: '/var/lib/mysql/1Panel-slow.log' }); @@ -149,7 +148,6 @@ const onSave = async () => { emit('loading', false); currentStatus.value = variables.slow_query_log === 'ON'; detailShow.value = variables.slow_query_log === 'ON'; - oldVariables.value.slow_query_log = variables.slow_query_log; MsgSuccess(i18n.global.t('commons.msg.operationSuccess')); }) .catch(() => { diff --git a/frontend/src/views/database/mysql/setting/variables/index.vue b/frontend/src/views/database/mysql/setting/variables/index.vue index 033c1af33..f7e1e2c60 100644 --- a/frontend/src/views/database/mysql/setting/variables/index.vue +++ b/frontend/src/views/database/mysql/setting/variables/index.vue @@ -152,7 +152,7 @@ let mysqlVariables = reactive({ }); const variablesRules = reactive({ key_buffer_size: [Rules.number, checkNumberRange(1, 102400)], - query_cache_size: [Rules.number, checkNumberRange(1, 102400)], + query_cache_size: [Rules.number, checkNumberRange(0, 102400)], tmp_table_size: [Rules.number, checkNumberRange(1, 102400)], innodb_buffer_pool_size: [Rules.number, checkNumberRange(1, 102400)], innodb_log_buffer_size: [Rules.number, checkNumberRange(1, 102400)],