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 =" topicInput" type =" textarea" placeholder =" testtopic/#" size =" small" > </el-input >
115+ <el-input
116+ v-model =" topicInput"
117+ type =" textarea"
118+ placeholder =" testtopic/#"
119+ size =" small"
120+ @keydown.enter.native.prevent
121+ @keyup.enter.native.prevent
122+ >
123+ </el-input >
116124 <div v-if =" topicHasWhitespace" class =" topic-whitespace-hint" >
117125 <span class =" topic-whitespace-label" >{{ $t('connections.topicWhitespaceHint') }}</span >
118126 <span class =" topic-whitespace-marker" >
159167 <i class =" el-icon-warning-outline" ></i >
160168 </a >
161169 </el-tooltip >
162- <el-input v-model.trim =" subRecord.alias" type =" textarea" size =" small" > </el-input >
170+ <el-input
171+ v-model.trim =" subRecord.alias"
172+ type =" textarea"
173+ size =" small"
174+ @keydown.enter.native.prevent
175+ @keyup.enter.native.prevent
176+ >
177+ </el-input >
163178 </el-form-item >
164179 </el-col >
165180 <!-- MQTT 5.0 -->
@@ -380,6 +395,8 @@ export default class SubscriptionsList extends Vue {
380395
381396 private saveSubs(): void | boolean {
382397 this .getCurrentConnection (this .connectionId )
398+ this .subRecord .topic = this .subRecord .topic .replace (/ [\r\n ] + / g , ' ' )
399+ this .subRecord .alias = this .subRecord .alias ?.replace (/ [\r\n ] + / g , ' ' ) || ' '
383400 const form = this .getSubForm ()
384401 form .validate (async (valid : boolean ) => {
385402 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 =" topicInput" type =" textarea" placeholder =" testtopic/#" size =" small" > </el-input >
104+ <el-input
105+ v-model =" topicInput"
106+ type =" textarea"
107+ placeholder =" testtopic/#"
108+ size =" small"
109+ @keydown.enter.native.prevent
110+ @keyup.enter.native.prevent
111+ >
112+ </el-input >
105113 <div v-if =" topicHasWhitespace" class =" topic-whitespace-hint" >
106114 <span class =" topic-whitespace-label" >{{ $t('connections.topicWhitespaceHint') }}</span >
107115 <span class =" topic-whitespace-marker" >
148156 <i class =" el-icon-warning-outline" ></i >
149157 </a >
150158 </el-tooltip >
151- <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 >
152167 </el-form-item >
153168 </el-col >
154169 <!-- MQTT 5.0 -->
@@ -346,6 +361,8 @@ export default class SubscriptionsList extends Vue {
346361
347362 private saveSubs(): void | boolean {
348363 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 , ' ' ) || ' '
349366 if (! this .client || ! this .client .connected ) {
350367 this .$message .warning (this .$tc (' connections.notConnect' ))
351368 return false
You can’t perform that action at this time.
0 commit comments