@electerm/electerm-react 1.101.16 → 1.101.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -35,7 +35,25 @@ export default function AIOutput ({ item }) {
|
|
|
35
35
|
}
|
|
36
36
|
|
|
37
37
|
const runInTerminal = () => {
|
|
38
|
-
|
|
38
|
+
// Filter out comments from the code before running
|
|
39
|
+
const filteredCode = code
|
|
40
|
+
.split('\n')
|
|
41
|
+
.map(line => line.trim())
|
|
42
|
+
.filter(line => {
|
|
43
|
+
// Remove empty lines and comments
|
|
44
|
+
if (!line) {
|
|
45
|
+
return false
|
|
46
|
+
}
|
|
47
|
+
if (line.startsWith('#')) {
|
|
48
|
+
return false
|
|
49
|
+
}
|
|
50
|
+
return true
|
|
51
|
+
})
|
|
52
|
+
.join('\n') // Join multiple commands with &&
|
|
53
|
+
|
|
54
|
+
if (filteredCode) {
|
|
55
|
+
window.store.runCommandInTerminal(filteredCode)
|
|
56
|
+
}
|
|
39
57
|
}
|
|
40
58
|
|
|
41
59
|
return (
|
|
@@ -270,12 +270,13 @@ export const sshAuthFields = [
|
|
|
270
270
|
// Telnet auth fields - similar to SSH but with filtered auth types (no privateKey)
|
|
271
271
|
export const telnetAuthFields = [
|
|
272
272
|
commonFields.category,
|
|
273
|
+
commonFields.title,
|
|
273
274
|
commonFields.host,
|
|
274
275
|
commonFields.username,
|
|
275
276
|
commonFields.password,
|
|
276
277
|
{ type: 'profileItem', name: '__profile__', label: '', profileFilter: d => !isEmpty(d.telnet) },
|
|
277
278
|
commonFields.port,
|
|
278
|
-
commonFields.
|
|
279
|
+
commonFields.runScripts,
|
|
279
280
|
commonFields.description,
|
|
280
281
|
commonFields.setEnv,
|
|
281
282
|
commonFields.startDirectoryLocal,
|
|
@@ -45,6 +45,7 @@ const serialConfig = {
|
|
|
45
45
|
{ type: 'switch', name: 'xon', label: 'xon', valuePropName: 'checked' },
|
|
46
46
|
{ type: 'switch', name: 'xoff', label: 'xoff', valuePropName: 'checked' },
|
|
47
47
|
{ type: 'switch', name: 'xany', label: 'xany', valuePropName: 'checked' },
|
|
48
|
+
commonFields.runScripts,
|
|
48
49
|
commonFields.description,
|
|
49
50
|
{ type: 'input', name: 'type', label: 'type', hidden: true }
|
|
50
51
|
]
|