diff --git a/napcat.webui/src/pages/NetWork.vue b/napcat.webui/src/pages/NetWork.vue index b08f1f45..65d63160 100644 --- a/napcat.webui/src/pages/NetWork.vue +++ b/napcat.webui/src/pages/NetWork.vue @@ -149,8 +149,10 @@
- +
diff --git a/napcat.webui/src/pages/network/HttpClientComponent.vue b/napcat.webui/src/pages/network/HttpClientComponent.vue index b0fa36fe..2d2d3fa2 100644 --- a/napcat.webui/src/pages/network/HttpClientComponent.vue +++ b/napcat.webui/src/pages/network/HttpClientComponent.vue @@ -2,22 +2,22 @@
- + - + - + - + - + - +
@@ -34,14 +34,14 @@ const defaultConfig: HttpClientConfig = { messagePostFormat: 'array', reportSelfMessage: false, token: '', - debug: false + debug: false, }; const props = defineProps<{ - config: HttpClientConfig; + config: { data: HttpClientConfig }; }>(); -const config = ref(Object.assign({}, defaultConfig, props.config)); +props.config.data = { ...defaultConfig, ...props.config.data }; const messageFormatOptions = ref([ { label: 'Array', value: 'array' }, @@ -49,13 +49,13 @@ const messageFormatOptions = ref([ ]); watch( - () => config.value.messagePostFormat, + () => props.config.data.messagePostFormat, (newValue) => { if (newValue !== 'array' && newValue !== 'string') { - config.value.messagePostFormat = 'array'; + props.config.data.messagePostFormat = 'array'; } } ); - \ No newline at end of file + diff --git a/napcat.webui/src/pages/network/HttpServerComponent.vue b/napcat.webui/src/pages/network/HttpServerComponent.vue index 36100ce8..51ea5066 100644 --- a/napcat.webui/src/pages/network/HttpServerComponent.vue +++ b/napcat.webui/src/pages/network/HttpServerComponent.vue @@ -2,28 +2,28 @@
- + - + - + - + - + - + - + - +
@@ -42,14 +42,14 @@ const defaultConfig: HttpServerConfig = { enableWebsocket: true, messagePostFormat: 'array', token: '', - debug: false + debug: false, }; const props = defineProps<{ - config: HttpServerConfig; + config: { data: HttpServerConfig }; }>(); -const config = ref(Object.assign({}, defaultConfig, props.config)); +props.config.data = { ...defaultConfig, ...props.config.data }; const messageFormatOptions = ref([ { label: 'Array', value: 'array' }, @@ -57,13 +57,13 @@ const messageFormatOptions = ref([ ]); watch( - () => config.value.messagePostFormat, + () => props.config.data.messagePostFormat, (newValue) => { if (newValue !== 'array' && newValue !== 'string') { - config.value.messagePostFormat = 'array'; + props.config.data.messagePostFormat = 'array'; } } ); - \ No newline at end of file + diff --git a/napcat.webui/src/pages/network/HttpSseServerComponent.vue b/napcat.webui/src/pages/network/HttpSseServerComponent.vue index 3d1aa715..d86bf39f 100644 --- a/napcat.webui/src/pages/network/HttpSseServerComponent.vue +++ b/napcat.webui/src/pages/network/HttpSseServerComponent.vue @@ -2,31 +2,31 @@
- + - + - + - + - + - + - + - + - +
@@ -46,14 +46,14 @@ const defaultConfig: HttpSseServerConfig = { messagePostFormat: 'array', token: '', debug: false, - reportSelfMessage: false + reportSelfMessage: false, }; const props = defineProps<{ - config: HttpSseServerConfig; + config: { data: HttpSseServerConfig }; }>(); -const config = ref(Object.assign({}, defaultConfig, props.config)); +props.config.data = { ...defaultConfig, ...props.config.data }; const messageFormatOptions = ref([ { label: 'Array', value: 'array' }, @@ -61,13 +61,13 @@ const messageFormatOptions = ref([ ]); watch( - () => config.value.messagePostFormat, + () => props.config.data.messagePostFormat, (newValue) => { if (newValue !== 'array' && newValue !== 'string') { - config.value.messagePostFormat = 'array'; + props.config.data.messagePostFormat = 'array'; } } ); - \ No newline at end of file + diff --git a/napcat.webui/src/pages/network/WebsocketClientComponent.vue b/napcat.webui/src/pages/network/WebsocketClientComponent.vue index 424a86f8..95a3137d 100644 --- a/napcat.webui/src/pages/network/WebsocketClientComponent.vue +++ b/napcat.webui/src/pages/network/WebsocketClientComponent.vue @@ -2,25 +2,25 @@
- + - + - + - + - + - + - +
@@ -39,14 +39,14 @@ const defaultConfig: WebsocketClientConfig = { reconnectInterval: 5000, token: '', debug: false, - heartInterval: 30000 + heartInterval: 30000, }; const props = defineProps<{ - config: WebsocketClientConfig; + config: { data: WebsocketClientConfig }; }>(); -const config = ref(Object.assign({}, defaultConfig, props.config)); +props.config.data = { ...defaultConfig, ...props.config.data }; const messageFormatOptions = ref([ { label: 'Array', value: 'array' }, @@ -54,13 +54,13 @@ const messageFormatOptions = ref([ ]); watch( - () => config.value.messagePostFormat, + () => props.config.data.messagePostFormat, (newValue) => { if (newValue !== 'array' && newValue !== 'string') { - config.value.messagePostFormat = 'array'; + props.config.data.messagePostFormat = 'array'; } } ); - \ No newline at end of file + diff --git a/napcat.webui/src/pages/network/WebsocketServerComponent.vue b/napcat.webui/src/pages/network/WebsocketServerComponent.vue index 6f93191c..41d1c5b7 100644 --- a/napcat.webui/src/pages/network/WebsocketServerComponent.vue +++ b/napcat.webui/src/pages/network/WebsocketServerComponent.vue @@ -2,31 +2,31 @@
- + - + - + - + - + - + - + - + - +
@@ -46,14 +46,14 @@ const defaultConfig: WebsocketServerConfig = { token: '', enableForcePushEvent: true, debug: false, - heartInterval: 30000 + heartInterval: 30000, }; const props = defineProps<{ - config: WebsocketServerConfig; + config: { data: WebsocketServerConfig }; }>(); -const config = ref(Object.assign({}, defaultConfig, props.config)); +props.config.data = { ...defaultConfig, ...props.config.data }; const messageFormatOptions = ref([ { label: 'Array', value: 'array' }, @@ -61,13 +61,13 @@ const messageFormatOptions = ref([ ]); watch( - () => config.value.messagePostFormat, + () => props.config.data.messagePostFormat, (newValue) => { if (newValue !== 'array' && newValue !== 'string') { - config.value.messagePostFormat = 'array'; + props.config.data.messagePostFormat = 'array'; } } ); - \ No newline at end of file +