Files

67 lines
3.1 KiB
HTML

<script type="text/javascript">
RED.nodes.registerType('XLSX-to-json',{
category: 'function',
color: '#0DC2B2',
defaults: {
name: {value: "xlsx to json"},
filepath: { value: ""},
rangecell: { value: ""},
columnkey: { value: ""},
sheet: { value: ""}
},
inputs:1,
outputs:1,
icon: "font-awesome/fa-file-excel-o",
label: function() {
return this.name||"XLSX-to-json";
}
});
</script>
<script type="text/html" data-template-name="XLSX-to-json">
<div class="form-row">
<label for="node-input-name"><i class="icon-tag"></i>Name</label>
<input type="text" id="node-input-name" placeholder="Name">
</div>
<!-- Pedimos el path -->
<div class="form-row">
<label for="node-input-filepath"><i class="icon-tag"></i>Filepath</label>
<input type="text" id="node-input-filepath" placeholder="filename.xlsx">
</div>
<!-- Pedimos el rango -->
<div class="form-row">
<label for="node-input-rangecell"><i class="icon-tag"></i>Rangecell</label>
<input type="text" id="node-input-rangecell" placeholder="A1:C5">
</div>
<!-- Pedimos las cabeceras -->
<div class="form-row">
<label for="node-input-columnkey"><i class="icon-tag"></i>Columkey</label>
<input type="text" id="node-input-columnkey" placeholder='{"A":"Title", "B":"Description"}'>
</div>
<!-- Pedimos las hojas -->
<div class="form-row">
<label for="node-input-sheet"><i class="icon-tag"></i>Sheet</label>
<input type="text" id="node-input-sheet" placeholder="Sheet 1">
</div>
</script>
<script type="text/html" data-help-name="XLSX-to-json">
<p> <b> Castellano </b></p>
<p> Nodo para convertir en JSON un archivo xlsx, pudiendo seleccionar una pestaña o un rango específico del excel.</p>
<p> Los parámetros que necesita para funcionar son: </p>
<p><b>msg.filepath:</b> La ruta donde se encuentra el archivo xlsx</p>
<p><b>msg.rangecell:</b> Opcional. El rango de celdas que se leeran del excel. Ejemplo -> "A2:M6"</p>
<p><b>msg.columkey:</b> Opcional. La cabecera para cada columna que se va a leer. Es un objeto. Ejemplo -> {"A":"Titulo","B":"Descripción"}</p>
<p><b>msg.sheet:</b> El nombre de la hoja del libro que se van a leer. Ejemplo -> Hoja 1</p>
<p>--------------------------</p>
<p> <b> English </b></p>
<p> Node to convert an xlsx file into JSON, being able to select a tab or a specific range of excel.</p>
<p> The parameters it needs to work are: </p>
<p><b>msg.filepath:</b>The path where the xlsx file is located</p>
<p><b>msg.rangecell:</b> Optional. The range of cells to be read from excel. Example -> "A2:M6"</p>
<p><b>msg.columkey:</b> Optional. The header for each column to be read. Its an object. Example -> {"A":"Titulo","B":"Descripción"}</p>
<p><b>msg.sheet:</b> The name of the book sheets to be read. Example -> Sheet 1</p>
</script>