File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 112112 <i class =" el-icon-warning-outline" ></i >
113113 </a >
114114 </el-tooltip >
115- <el-input v-model.trim =" subRecord.topic" type =" textarea" placeholder =" testtopic/#" size =" small" >
115+ <el-input
116+ v-model.trim =" subRecord.topic"
117+ type =" textarea"
118+ placeholder =" testtopic/#"
119+ size =" small"
120+ @keydown.enter.native.prevent
121+ @keyup.enter.native.prevent
122+ >
116123 </el-input >
117124 </el-form-item >
118125 </el-col >
149156 <i class =" el-icon-warning-outline" ></i >
150157 </a >
151158 </el-tooltip >
152- <el-input v-model.trim =" subRecord.alias" type =" textarea" size =" small" > </el-input >
159+ <el-input
160+ v-model.trim =" subRecord.alias"
161+ type =" textarea"
162+ size =" small"
163+ @keydown.enter.native.prevent
164+ @keyup.enter.native.prevent
165+ >
166+ </el-input >
153167 </el-form-item >
154168 </el-col >
155169 <!-- MQTT 5.0 -->
@@ -347,6 +361,8 @@ export default class SubscriptionsList extends Vue {
347361
348362 private saveSubs(): void | boolean {
349363 this .getCurrentConnection (this .connectionId )
364+ this .subRecord .topic = this .subRecord .topic .replace (/ [\r\n ] + / g , ' ' )
365+ this .subRecord .alias = this .subRecord .alias ?.replace (/ [\r\n ] + / g , ' ' ) || ' '
350366 const form = this .getSubForm ()
351367 form .validate (async (valid : boolean ) => {
352368 if (! valid ) {
Original file line number Diff line number Diff line change 101101 <i class =" el-icon-warning-outline" ></i >
102102 </a >
103103 </el-tooltip >
104- <el-input v-model.trim =" subRecord.topic" type =" textarea" placeholder =" testtopic/#" size =" small" >
104+ <el-input
105+ v-model.trim =" subRecord.topic"
106+ type =" textarea"
107+ placeholder =" testtopic/#"
108+ size =" small"
109+ @keydown.enter.native.prevent
110+ @keyup.enter.native.prevent
111+ >
105112 </el-input >
106113 </el-form-item >
107114 </el-col >
138145 <i class =" el-icon-warning-outline" ></i >
139146 </a >
140147 </el-tooltip >
141- <el-input v-model.trim =" subRecord.alias" type =" textarea" size =" small" > </el-input >
148+ <el-input
149+ v-model.trim =" subRecord.alias"
150+ type =" textarea"
151+ size =" small"
152+ @keydown.enter.native.prevent
153+ @keyup.enter.native.prevent
154+ >
155+ </el-input >
142156 </el-form-item >
143157 </el-col >
144158 <!-- MQTT 5.0 -->
@@ -313,6 +327,8 @@ export default class SubscriptionsList extends Vue {
313327
314328 private saveSubs(): void | boolean {
315329 this .getCurrentConnection (this .connectionId )
330+ this .subRecord .topic = this .subRecord .topic .replace (/ [\r\n ] + / g , ' ' )
331+ this .subRecord .alias = this .subRecord .alias ?.replace (/ [\r\n ] + / g , ' ' ) || ' '
316332 if (! this .client || ! this .client .connected ) {
317333 this .$message .warning (this .$tc (' connections.notConnect' ))
318334 return false
You can’t perform that action at this time.
0 commit comments