summaryrefslogtreecommitdiffstats
path: root/admin/WebConsole/comandos
diff options
context:
space:
mode:
authorJavier Sánchez Parra <jsanchez@soleta.eu>2020-08-25 13:10:23 +0200
committerOpenGnSys Support Team <soporte-og@soleta.eu>2020-08-25 16:03:14 +0200
commitce83ea497b648f3195a6a194e496dc9ba0292d7a (patch)
tree763f35f8c20d5cf84587f688ee5f22e3977b48a4 /admin/WebConsole/comandos
parentb1ef1351553bdc43077d001a759b62b720d11ae2 (diff)
#1001 Remove trailing \r and \n in some scripts
We find that scripts sent by "Assistants"/"Asistentes" are losing the last character and scripts send by "Run Script"/"Ejecutar Script" have a trailing line feed (\n). This is happening because shell() function, which calls "/shell/run" of ogServer REST API, expects scripts send by "Asistentes" and "Run Script" to have two trailing characters and removes them. But "Assistants" only put one trailing char (\r) and "Run Script" put three trailing chars (\n\n\r). To avoid problems when running scripts without the last char or with trailing line feed this patch updates WebConsole to: 1) "Assistants" no longer put one trailing character at the end of the script 2) "Run Script" no longer puts three trailing characters at the end of the script 3) shell() expects no trailing chars in scripts sent by "Assistants" and "Run Script".
Diffstat (limited to 'admin/WebConsole/comandos')
-rw-r--r--admin/WebConsole/comandos/jscripts/EjecutarScripts.js4
1 files changed, 1 insertions, 3 deletions
diff --git a/admin/WebConsole/comandos/jscripts/EjecutarScripts.js b/admin/WebConsole/comandos/jscripts/EjecutarScripts.js
index e97e6f2a..b03ee991 100644
--- a/admin/WebConsole/comandos/jscripts/EjecutarScripts.js
+++ b/admin/WebConsole/comandos/jscripts/EjecutarScripts.js
@@ -9,9 +9,7 @@
// ***********************************************************************************************************
function confirmar(){
if (comprobar_datos()){
- var RC='@';
- document.fdatos.codigo.value+="\n";
- document.fdatosejecucion.atributos.value="scp="+escape(document.fdatos.codigo.value+"\n")+RC;
+ document.fdatosejecucion.atributos.value="scp="+escape(document.fdatos.codigo.value);
filtrado();
// Incluimos el modo de ejecución en fdatosejecucion.
var modoejecucion=document.createElement('input');