diff --git a/src/api/config.ts b/src/api/config.ts index 59796058..01b9df66 100644 --- a/src/api/config.ts +++ b/src/api/config.ts @@ -169,8 +169,8 @@ export const queryNodeConfig = async (node: string) => { } } -export const updateNodeLogLevelToDebug = (nodeName: string) => { - return http.put('/log/level', { node: nodeName }) +export const updateNodeLogLevelToDebug = (nodeName: string, logLevel: string) => { + return http.put('/log/level', { node: nodeName, level: logLevel }) } /* GROUP */ diff --git a/src/composables/config/useDriver.ts b/src/composables/config/useDriver.ts index c59b5fb3..279f72fa 100644 --- a/src/composables/config/useDriver.ts +++ b/src/composables/config/useDriver.ts @@ -151,9 +151,9 @@ export const dataStatistics = () => { export const useNodeDebugLogLevel = () => { const { t } = useI18n() - const modifyNodeLogLevelToDebug = async (nodeName: string) => { + const modifyNodeLogLevelToDebug = async (nodeName: string, logLevel: string) => { try { - await updateNodeLogLevelToDebug(nodeName) + await updateNodeLogLevelToDebug(nodeName, logLevel) EmqxMessage.success(t('config.modifyNodeLogLevelSuc')) return Promise.resolve() } catch (error) { diff --git a/src/composables/config/useNorthDriver.ts b/src/composables/config/useNorthDriver.ts index 219c354a..1f3d31cb 100644 --- a/src/composables/config/useNorthDriver.ts +++ b/src/composables/config/useNorthDriver.ts @@ -149,7 +149,7 @@ export default (autoLoad = true, needRefreshStatus = false) => { } const modifyNodeLogLevel = async (node: DriverItemInList) => { - await modifyNodeLogLevelToDebug(node.name) + await modifyNodeLogLevelToDebug(node.name, node.log_level) } if (autoLoad) { diff --git a/src/composables/config/useSouthDriver.ts b/src/composables/config/useSouthDriver.ts index 3be77149..ea55d37b 100644 --- a/src/composables/config/useSouthDriver.ts +++ b/src/composables/config/useSouthDriver.ts @@ -191,7 +191,7 @@ export default (autoLoad = true, needRefreshStatus = false) => { } const modifyNodeLogLevel = async (node: DriverItemInList) => { - await modifyNodeLogLevelToDebug(node.name) + await modifyNodeLogLevelToDebug(node.name, node.log_level) } const reloadDriverList = () => { diff --git a/src/types/config.d.ts b/src/types/config.d.ts index 26227f6f..3c3955f5 100644 --- a/src/types/config.d.ts +++ b/src/types/config.d.ts @@ -61,6 +61,7 @@ export interface DriverStateData { running: NodeState link: NodeLinkState rtt?: number + log_level: string } export interface DriverAllStatusData {