diff --git a/pandora_console/include/functions_inventory.php b/pandora_console/include/functions_inventory.php index 2ac322a4fe..4146e9f2ac 100644 --- a/pandora_console/include/functions_inventory.php +++ b/pandora_console/include/functions_inventory.php @@ -687,6 +687,140 @@ function inventory_get_data( } +function inventory_get_datatable( + $agents_ids, + $inventory_module_name, + $utimestamp, + $inventory_search_string='', + $export_csv=false, + $return_mode=false, + $order_by_agent=false +) { + global $config; + + $offset = (int) get_parameter('offset'); + + $where = []; + + array_push( + $where, + 'tmodule_inventory.id_module_inventory = tagent_module_inventory.id_module_inventory' + ); + + // Discart empty first position. + if (isset($agents_ids[0]) === true && empty($agents_ids[0]) === true) { + unset($agents_ids[0]); + } + + // If there are no agents selected. + if (empty($agents_ids) === true) { + return ERR_NODATA; + } + + if (array_search(-1, $agents_ids) === false) { + array_push($where, 'id_agente IN ('.implode(',', $agents_ids).')'); + } + + if ($inventory_module_name[0] !== '0' + && $inventory_module_name !== '' + && $inventory_module_name !== 'all' + ) { + array_push($where, "tmodule_inventory.name IN ('".implode("','", (array) $inventory_module_name)."')"); + } + + if ($inventory_search_string != '') { + array_push($where, "tagent_module_inventory.data LIKE '%".$inventory_search_string."%'"); + } + + $sql = 'SELECT * + FROM tmodule_inventory, tagent_module_inventory + WHERE + '.implode(' AND ', $where).' + ORDER BY tmodule_inventory.id_module_inventory LIMIT '.$offset.', '.$config['block_size']; + + $sql_count = 'SELECT COUNT(*) + FROM tmodule_inventory, tagent_module_inventory + WHERE '.implode(' AND ', $where); + + $rows = db_get_all_rows_sql($sql); + $count = db_get_sql($sql_count); + + if ($order_by_agent === false) { + $modules = []; + $module_rows = []; + + foreach ($rows as $row) { + array_push($modules, $row['name']); + } + + foreach ($modules as $module) { + $rows_tmp = []; + foreach ($rows as $row) { + if ($row['name'] === $module) { + $agent_name = db_get_value_sql( + 'SELECT alias + FROM tagente + WHERE id_agente = '.$row['id_agente'] + ); + + $row['name_agent'] = $agent_name; + array_push($rows_tmp, $row); + $module_rows[$module] = $rows_tmp; + } + } + } + + return $module_rows; + } else { + $agents_rows = []; + $agent_data = []; + $rows_tmp = []; + foreach ($rows as $row) { + $agent_name = db_get_value_sql( + 'SELECT alias + FROM tagente + WHERE id_agente = '.$row['id_agente'] + ); + $row['name_agent'] = $agent_name; + $agent_data[$row['id_agente']][] = $row; + } + + foreach ($agent_data as $id_agent => $rows) { + $agent_name = db_get_value_sql( + 'SELECT alias + FROM tagente + WHERE id_agente = '.$id_agent + ); + + $rows_tmp['agent'] = $agent_name; + + foreach ($rows as $row) { + if ($utimestamp > 0) { + $data_row = db_get_row_sql( + "SELECT data, timestamp + FROM tagente_datos_inventory + WHERE utimestamp <= '".$utimestamp."' + AND id_agent_module_inventory = ".$row['id_agent_module_inventory'].' ORDER BY utimestamp DESC' + ); + + if ($data_row !== false) { + $row['data'] = $data_row['data']; + $row['timestamp'] = $data_row['timestamp']; + } else { + continue; + } + } + } + + $rows_tmp['row'] = $rows; + array_push($agents_rows, $rows_tmp); + } + + return $agents_rows; + } +} + + function inventory_get_dates($module_inventory_name, $inventory_agent, $inventory_id_group) { $sql = 'SELECT tagente_datos_inventory.utimestamp, diff --git a/pandora_console/include/functions_ui.php b/pandora_console/include/functions_ui.php index a08d6f4b32..b3e3085cec 100755 --- a/pandora_console/include/functions_ui.php +++ b/pandora_console/include/functions_ui.php @@ -3437,8 +3437,8 @@ function ui_print_datatable(array $parameters) throw new Exception('[ui_print_datatable]: Columns and columns names must have same length'); } - if (!isset($parameters['ajax_url'])) { - throw new Exception('[ui_print_datatable]: Parameter ajax_url is required'); + if (!isset($parameters['ajax_url']) && !isset($parameters['data_element'])) { + throw new Exception('[ui_print_datatable]: Parameter ajax_url or data_element is required'); } if (!isset($parameters['default_pagination'])) { @@ -3702,18 +3702,6 @@ function ui_print_datatable(array $parameters) $pagination_class = $parameters['pagination_class']; } - // Javascript controller. - $js = ''; + $output .= ''; } - $output .= ''; - if (!$return) { echo $output; } else { diff --git a/pandora_console/include/javascript/i18n/dataTables.ca.json b/pandora_console/include/javascript/i18n/dataTables.ca.json new file mode 100644 index 0000000000..53b476297e --- /dev/null +++ b/pandora_console/include/javascript/i18n/dataTables.ca.json @@ -0,0 +1,244 @@ +{ + "processing": "Processant...", + "lengthMenu": "Mostra _MENU_ registres", + "zeroRecords": "No s'han trobat registres", + "info": "Mostrant del _START_ al _END_ d'un total de _TOTAL_ registres", + "infoEmpty": "No hi ha registres disponibles", + "infoFiltered": "(filtrat de _MAX_ registres)", + "search": "Cerca:", + "infoThousands": ".", + "decimal": ",", + "loadingRecords": "Carregant...", + "paginate": { + "first": "Primer", + "previous": "Anterior", + "next": "Següent", + "last": "Darrer" + }, + "aria": { + "sortAscending": ": Activa per ordenar la columna de manera ascendent", + "sortDescending": ": Activa per ordenar la columna de manera descendent" + }, + "buttons": { + "print": "Imprimeix", + "copy": "Copia", + "colvis": "Columnes", + "copyTitle": "Copia al portapapers", + "copySuccess": { + "_": "%d files copiades", + "1": "1 fila copiada" + }, + "pageLength": { + "-1": "Mostra totes les files", + "_": "Mostra %d files" + }, + "pdf": "PDF", + "collection": "Col·lecció", + "colvisRestore": "Restaurar visibilitat", + "copyKeys": "Pressiona ctrl o poma + C per copiar les dades de la tabla al teu portapaper", + "csv": "CSV", + "excel": "Excel", + "createState": "Crear Estat", + "removeAllStates": "Borrar tots els Estats", + "removeState": "Borra", + "renameState": "Canviar nom", + "savedStates": "Estats gravats", + "stateRestore": "Restaura", + "updateState": "Actualitza" + }, + "select": { + "rows": { + "_": "%d files seleccionades", + "1": "1 fila seleccionada" + }, + "cells": { + "1": "1 fila seleccionada", + "_": "%d files seleccionades" + }, + "columns": { + "1": "1 columna seleccionada", + "_": "%d columnes seleccionades" + } + }, + "autoFill": { + "cancel": "Cancel·lar", + "fillHorizontal": "Omple les cel·les horitzontalment", + "fillVertical": "Omple les cel·les verticalment", + "fill": "Omple totes les cel·les amb %d<\/i>" + }, + "thousands": ".", + "datetime": { + "hours": "Hora", + "seconds": "Segons", + "unknown": "Desconegut", + "amPm": [ + "am", + "pm" + ], + "previous": "Anterior", + "next": "Següent", + "months": { + "11": "Desembre", + "10": "Novembre", + "9": "Octubre", + "7": "Agost", + "5": "Juny", + "4": "Maig", + "3": "Abril", + "2": "Març", + "1": "Febrer", + "0": "Gener", + "6": "Juliol", + "8": "Setembre" + }, + "weekdays": { + "0": "Dg", + "2": "Dt", + "3": "Dc", + "4": "Dj", + "5": "Dv", + "6": "Ds", + "1": "Dl" + }, + "minutes": "Minuts" + }, + "editor": { + "close": "Tancar", + "create": { + "button": "Nou", + "title": "Crear nova entrada", + "submit": "Crear" + }, + "edit": { + "button": "Editar", + "title": "Editar entrada", + "submit": "Actualitzar" + }, + "remove": { + "button": "Eliminar", + "title": "Eliminar", + "submit": "Eliminar", + "confirm": { + "_": "Està segur de voler eliminar %d files?", + "1": "Està segur de voler elmiminar 1 fila?" + } + }, + "error": { + "system": "Ha ocurregut un error de sistema (Més informació)" + }, + "multi": { + "title": "Múltiples valors", + "restore": "Desfés el canvi", + "info": "El ítems seleccionats contenen diferents valors per aquesta entrada. Per editar i configurar tots els ítems per a aquesta entrada al mateix valor, prem o clica tabular aquí, sino, mantindran els seus valors individuals", + "noMulti": "Aquest camp pot ser editat individualment; però no com a part d'un grup" + } + }, + "searchBuilder": { + "add": "Afegir condició", + "clearAll": "Eliminar tot", + "condition": "Condició", + "conditions": { + "date": { + "after": "Després", + "before": "Abans", + "between": "Entre", + "empty": "Buit", + "equals": "Iguals", + "not": "No", + "notBetween": "No entre", + "notEmpty": "No buit" + }, + "number": { + "between": "Entre", + "empty": "Buit", + "equals": "Iguals", + "gt": "Major que", + "gte": "Mejor o igual a", + "lt": "Menor que", + "lte": "Menor o igual a", + "not": "No", + "notBetween": "No entre", + "notEmpty": "No buit" + }, + "string": { + "contains": "Conté", + "empty": "Buit", + "endsWith": "Finalitza amb", + "equals": "Iguals", + "not": "No", + "notEmpty": "No buit", + "startsWith": "Comença amb", + "notEndsWith": "No acaba amb", + "notStartsWith": "No comença amb", + "notContains": "No inclou" + }, + "array": { + "equals": "Iguals", + "empty": "Buit", + "contains": "Conté", + "not": "No", + "notEmpty": "No buit", + "without": "Sense" + } + }, + "data": "Data", + "deleteTitle": "Esborrar regla de filtrat", + "leftTitle": "Criteri de desindentació", + "logicAnd": "I", + "logicOr": "O", + "rightTitle": "Criteri d'indentació", + "value": "Valor", + "title": { + "_": "Constructor de cerca (%d)", + "0": "Constructor de cerca" + }, + "button": { + "_": "Constructor de cerca (%d)", + "0": "Constructor de cerca" + } + }, + "searchPanes": { + "collapse": { + "0": "Panells de cerca", + "_": "Panells de cerca (%d)" + }, + "count": "{total}", + "countFiltered": "{monstrat} ({total})", + "loadMessage": "Carregant panells de cerca", + "collapseMessage": "Colapsar Tot", + "clearMessage": "Esborrar tot", + "emptyPanes": "No hi ha panells de cerca", + "showMessage": "Mostrar-ho tot", + "title": "Filtres actius - %d" + }, + "stateRestore": { + "removeSubmit": "Eliminar", + "removeJoiner": "i", + "removeError": "Error eliminant el registre", + "removeConfirm": "¿Segur que vol eliminar aquest %s?", + "emptyError": "El nom no pot estar buit", + "creationModal": { + "button": "Crear", + "columns": { + "search": "Cerca per columnes", + "visible": "Visibilitat de columnes" + }, + "name": "Nom", + "order": "Ordenar", + "toggleLabel": "Inclou:", + "paging": "Paginació", + "scroller": "Posició Scroll", + "search": "Bñusqueda", + "searchBuilder": "Generador Búsquedes", + "title": "Crear nou Estat", + "select": "Sel·lecció" + }, + "renameLabel": "Nou nom per %s", + "duplicateError": "Ja existeix un estat amb aquest nom", + "emptyStates": "No hi ha estats gravats", + "removeTitle": "Borrar Estat", + "renameButton": "Canviar nom", + "renameTitle": "Canviar nom" + }, + "emptyTable": "No hi ha registres disponibles en aquesta taula" +} \ No newline at end of file diff --git a/pandora_console/include/javascript/i18n/dataTables.en.json b/pandora_console/include/javascript/i18n/dataTables.en.json new file mode 100644 index 0000000000..9ccd76c4ad --- /dev/null +++ b/pandora_console/include/javascript/i18n/dataTables.en.json @@ -0,0 +1,239 @@ +{ + "emptyTable": "No data available in table", + "info": "Showing _START_ to _END_ of _TOTAL_ entries", + "infoEmpty": "Showing 0 to 0 of 0 entries", + "infoFiltered": "(filtered from _MAX_ total entries)", + "infoThousands": ",", + "lengthMenu": "Show _MENU_ entries", + "loadingRecords": "Loading...", + "processing": "Processing...", + "search": "Search:", + "zeroRecords": "No matching records found", + "thousands": ",", + "paginate": { + "first": "First", + "last": "Last", + "next": "Next", + "previous": "Previous" + }, + "aria": { + "sortAscending": ": activate to sort column ascending", + "sortDescending": ": activate to sort column descending" + }, + "autoFill": { + "cancel": "Cancel", + "fill": "Fill all cells with %d<\/i>", + "fillHorizontal": "Fill cells horizontally", + "fillVertical": "Fill cells vertically" + }, + "buttons": { + "collection": "Collection ", + "colvis": "Column Visibility", + "colvisRestore": "Restore visibility", + "copy": "Copy", + "copyKeys": "Press ctrl or u2318 + C to copy the table data to your system clipboard.

To cancel, click this message or press escape.", + "copySuccess": { + "1": "Copied 1 row to clipboard", + "_": "Copied %d rows to clipboard" + }, + "copyTitle": "Copy to Clipboard", + "csv": "CSV", + "excel": "Excel", + "pageLength": { + "-1": "Show all rows", + "_": "Show %d rows" + }, + "pdf": "PDF", + "print": "Print", + "updateState": "Update", + "stateRestore": "State %d", + "savedStates": "Saved States", + "renameState": "Rename", + "removeState": "Remove", + "removeAllStates": "Remove All States", + "createState": "Create State" + }, + "searchBuilder": { + "add": "Add Condition", + "button": { + "0": "Search Builder", + "_": "Search Builder (%d)" + }, + "clearAll": "Clear All", + "condition": "Condition", + "conditions": { + "date": { + "after": "After", + "before": "Before", + "between": "Between", + "empty": "Empty", + "equals": "Equals", + "not": "Not", + "notBetween": "Not Between", + "notEmpty": "Not Empty" + }, + "number": { + "between": "Between", + "empty": "Empty", + "equals": "Equals", + "gt": "Greater Than", + "gte": "Greater Than Equal To", + "lt": "Less Than", + "lte": "Less Than Equal To", + "not": "Not", + "notBetween": "Not Between", + "notEmpty": "Not Empty" + }, + "string": { + "contains": "Contains", + "empty": "Empty", + "endsWith": "Ends With", + "equals": "Equals", + "not": "Not", + "notEmpty": "Not Empty", + "startsWith": "Starts With", + "notContains": "Does Not Contain", + "notStartsWith": "Does Not Start With", + "notEndsWith": "Does Not End With" + }, + "array": { + "without": "Without", + "notEmpty": "Not Empty", + "not": "Not", + "contains": "Contains", + "empty": "Empty", + "equals": "Equals" + } + }, + "data": "Data", + "deleteTitle": "Delete filtering rule", + "leftTitle": "Outdent Criteria", + "logicAnd": "And", + "logicOr": "Or", + "rightTitle": "Indent Criteria", + "title": { + "0": "Search Builder", + "_": "Search Builder (%d)" + }, + "value": "Value" + }, + "searchPanes": { + "clearMessage": "Clear All", + "collapse": { + "0": "SearchPanes", + "_": "SearchPanes (%d)" + }, + "count": "{total}", + "countFiltered": "{shown} ({total})", + "emptyPanes": "No SearchPanes", + "loadMessage": "Loading SearchPanes", + "title": "Filters Active - %d", + "showMessage": "Show All", + "collapseMessage": "Collapse All" + }, + "select": { + "cells": { + "1": "1 cell selected", + "_": "%d cells selected" + }, + "columns": { + "1": "1 column selected", + "_": "%d columns selected" + } + }, + "datetime": { + "previous": "Previous", + "next": "Next", + "hours": "Hour", + "minutes": "Minute", + "seconds": "Second", + "unknown": "-", + "amPm": [ + "am", + "pm" + ], + "weekdays": [ + "Sun", + "Mon", + "Tue", + "Wed", + "Thu", + "Fri", + "Sat" + ], + "months": [ + "January", + "February", + "March", + "April", + "May", + "June", + "July", + "August", + "September", + "October", + "November", + "December" + ] + }, + "editor": { + "close": "Close", + "create": { + "button": "New", + "title": "Create new entry", + "submit": "Create" + }, + "edit": { + "button": "Edit", + "title": "Edit Entry", + "submit": "Update" + }, + "remove": { + "button": "Delete", + "title": "Delete", + "submit": "Delete", + "confirm": { + "_": "Are you sure you wish to delete %d rows?", + "1": "Are you sure you wish to delete 1 row?" + } + }, + "error": { + "system": "A system error has occurred (More information<\/a>)." + }, + "multi": { + "title": "Multiple Values", + "info": "The selected items contain different values for this input. To edit and set all items for this input to the same value, click or tap here, otherwise they will retain their individual values.", + "restore": "Undo Changes", + "noMulti": "This input can be edited individually, but not part of a group. " + } + }, + "stateRestore": { + "renameTitle": "Rename State", + "renameLabel": "New Name for %s:", + "renameButton": "Rename", + "removeTitle": "Remove State", + "removeSubmit": "Remove", + "removeJoiner": " and ", + "removeError": "Failed to remove state.", + "removeConfirm": "Are you sure you want to remove %s?", + "emptyStates": "No saved states", + "emptyError": "Name cannot be empty.", + "duplicateError": "A state with this name already exists.", + "creationModal": { + "toggleLabel": "Includes:", + "title": "Create New State", + "select": "Select", + "searchBuilder": "SearchBuilder", + "search": "Search", + "scroller": "Scroll Position", + "paging": "Paging", + "order": "Sorting", + "name": "Name:", + "columns": { + "visible": "Column Visibility", + "search": "Column Search" + }, + "button": "Create" + } + } +} \ No newline at end of file diff --git a/pandora_console/include/javascript/i18n/dataTables.es.json b/pandora_console/include/javascript/i18n/dataTables.es.json new file mode 100644 index 0000000000..f106d615da --- /dev/null +++ b/pandora_console/include/javascript/i18n/dataTables.es.json @@ -0,0 +1,242 @@ +{ + "processing": "Procesando...", + "lengthMenu": "Mostrar _MENU_ registros", + "zeroRecords": "No se encontraron resultados", + "emptyTable": "Ningún dato disponible en esta tabla", + "infoEmpty": "Mostrando registros del 0 al 0 de un total de 0 registros", + "infoFiltered": "(filtrado de un total de _MAX_ registros)", + "search": "Buscar:", + "infoThousands": ",", + "loadingRecords": "Cargando...", + "paginate": { + "first": "Primero", + "last": "Último", + "next": "Siguiente", + "previous": "Anterior" + }, + "aria": { + "sortAscending": ": Activar para ordenar la columna de manera ascendente", + "sortDescending": ": Activar para ordenar la columna de manera descendente" + }, + "buttons": { + "copy": "Copiar", + "colvis": "Visibilidad", + "collection": "Colección", + "colvisRestore": "Restaurar visibilidad", + "copyKeys": "Presione ctrl o u2318 + C para copiar los datos de la tabla al portapapeles del sistema.

Para cancelar, haga clic en este mensaje o presione escape.", + "copySuccess": { + "1": "Copiada 1 fila al portapapeles", + "_": "Copiadas %ds fila al portapapeles" + }, + "copyTitle": "Copiar al portapapeles", + "csv": "CSV", + "excel": "Excel", + "pageLength": { + "-1": "Mostrar todas las filas", + "_": "Mostrar %d filas" + }, + "pdf": "PDF", + "print": "Imprimir", + "renameState": "Cambiar nombre", + "updateState": "Actualizar", + "createState": "Crear Estado", + "removeAllStates": "Remover Estados", + "removeState": "Remover", + "savedStates": "Estados Guardados", + "stateRestore": "Estado %d" + }, + "autoFill": { + "cancel": "Cancelar", + "fill": "Rellene todas las celdas con %d<\/i>", + "fillHorizontal": "Rellenar celdas horizontalmente", + "fillVertical": "Rellenar celdas verticalmentemente" + }, + "decimal": ",", + "searchBuilder": { + "add": "Añadir condición", + "button": { + "0": "Constructor de búsqueda", + "_": "Constructor de búsqueda (%d)" + }, + "clearAll": "Borrar todo", + "condition": "Condición", + "conditions": { + "date": { + "after": "Despues", + "before": "Antes", + "between": "Entre", + "empty": "Vacío", + "equals": "Igual a", + "notBetween": "No entre", + "notEmpty": "No Vacio", + "not": "Diferente de" + }, + "number": { + "between": "Entre", + "empty": "Vacio", + "equals": "Igual a", + "gt": "Mayor a", + "gte": "Mayor o igual a", + "lt": "Menor que", + "lte": "Menor o igual que", + "notBetween": "No entre", + "notEmpty": "No vacío", + "not": "Diferente de" + }, + "string": { + "contains": "Contiene", + "empty": "Vacío", + "endsWith": "Termina en", + "equals": "Igual a", + "notEmpty": "No Vacio", + "startsWith": "Empieza con", + "not": "Diferente de", + "notContains": "No Contiene", + "notStartsWith": "No empieza con", + "notEndsWith": "No termina con" + }, + "array": { + "not": "Diferente de", + "equals": "Igual", + "empty": "Vacío", + "contains": "Contiene", + "notEmpty": "No Vacío", + "without": "Sin" + } + }, + "data": "Data", + "deleteTitle": "Eliminar regla de filtrado", + "leftTitle": "Criterios anulados", + "logicAnd": "Y", + "logicOr": "O", + "rightTitle": "Criterios de sangría", + "title": { + "0": "Constructor de búsqueda", + "_": "Constructor de búsqueda (%d)" + }, + "value": "Valor" + }, + "searchPanes": { + "clearMessage": "Borrar todo", + "collapse": { + "0": "Paneles de búsqueda", + "_": "Paneles de búsqueda (%d)" + }, + "count": "{total}", + "countFiltered": "{shown} ({total})", + "emptyPanes": "Sin paneles de búsqueda", + "loadMessage": "Cargando paneles de búsqueda", + "title": "Filtros Activos - %d", + "showMessage": "Mostrar Todo", + "collapseMessage": "Colapsar Todo" + }, + "select": { + "cells": { + "1": "1 celda seleccionada", + "_": "%d celdas seleccionadas" + }, + "columns": { + "1": "1 columna seleccionada", + "_": "%d columnas seleccionadas" + }, + "rows": { + "1": "1 fila seleccionada", + "_": "%d filas seleccionadas" + } + }, + "thousands": ".", + "datetime": { + "previous": "Anterior", + "next": "Proximo", + "hours": "Horas", + "minutes": "Minutos", + "seconds": "Segundos", + "unknown": "-", + "amPm": [ + "AM", + "PM" + ], + "months": { + "0": "Enero", + "1": "Febrero", + "10": "Noviembre", + "11": "Diciembre", + "2": "Marzo", + "3": "Abril", + "4": "Mayo", + "5": "Junio", + "6": "Julio", + "7": "Agosto", + "8": "Septiembre", + "9": "Octubre" + }, + "weekdays": [ + "Dom", + "Lun", + "Mar", + "Mie", + "Jue", + "Vie", + "Sab" + ] + }, + "editor": { + "close": "Cerrar", + "create": { + "button": "Nuevo", + "title": "Crear Nuevo Registro", + "submit": "Crear" + }, + "edit": { + "button": "Editar", + "title": "Editar Registro", + "submit": "Actualizar" + }, + "remove": { + "button": "Eliminar", + "title": "Eliminar Registro", + "submit": "Eliminar", + "confirm": { + "_": "¿Está seguro que desea eliminar %d filas?", + "1": "¿Está seguro que desea eliminar 1 fila?" + } + }, + "error": { + "system": "Ha ocurrido un error en el sistema (
Más información<\\\/a>).<\/a>" + }, + "multi": { + "title": "Múltiples Valores", + "info": "Los elementos seleccionados contienen diferentes valores para este registro. Para editar y establecer todos los elementos de este registro con el mismo valor, hacer click o tap aquí, de lo contrario conservarán sus valores individuales.", + "restore": "Deshacer Cambios", + "noMulti": "Este registro puede ser editado individualmente, pero no como parte de un grupo." + } + }, + "info": "Mostrando _START_ a _END_ de _TOTAL_ registros", + "stateRestore": { + "creationModal": { + "button": "Crear", + "name": "Nombre:", + "order": "Clasificación", + "paging": "Paginación", + "search": "Busqueda", + "select": "Seleccionar", + "columns": { + "search": "Búsqueda de Columna", + "visible": "Visibilidad de Columna" + }, + "title": "Crear Nuevo Estado", + "toggleLabel": "Incluir:" + }, + "emptyError": "El nombre no puede estar vacio", + "removeConfirm": "¿Seguro que quiere eliminar este %s?", + "removeError": "Error al eliminar el registro", + "removeJoiner": "y", + "removeSubmit": "Eliminar", + "renameButton": "Cambiar Nombre", + "renameLabel": "Nuevo nombre para %s", + "duplicateError": "Ya existe un Estado con este nombre.", + "emptyStates": "No hay Estados guardados", + "removeTitle": "Remover Estado", + "renameTitle": "Cambiar Nombre Estado" + } +} \ No newline at end of file diff --git a/pandora_console/include/javascript/i18n/dataTables.fr.json b/pandora_console/include/javascript/i18n/dataTables.fr.json new file mode 100644 index 0000000000..5ae4bc8e7f --- /dev/null +++ b/pandora_console/include/javascript/i18n/dataTables.fr.json @@ -0,0 +1,245 @@ +{ + "emptyTable": "Aucune donnée disponible dans le tableau", + "loadingRecords": "Chargement...", + "processing": "Traitement...", + "select": { + "rows": { + "_": "%d lignes sélectionnées", + "1": "1 ligne sélectionnée" + }, + "cells": { + "1": "1 cellule sélectionnée", + "_": "%d cellules sélectionnées" + }, + "columns": { + "1": "1 colonne sélectionnée", + "_": "%d colonnes sélectionnées" + } + }, + "autoFill": { + "cancel": "Annuler", + "fill": "Remplir toutes les cellules avec %d<\/i>", + "fillHorizontal": "Remplir les cellules horizontalement", + "fillVertical": "Remplir les cellules verticalement" + }, + "searchBuilder": { + "conditions": { + "date": { + "after": "Après le", + "before": "Avant le", + "between": "Entre", + "empty": "Vide", + "not": "Différent de", + "notBetween": "Pas entre", + "notEmpty": "Non vide", + "equals": "Égal à" + }, + "number": { + "between": "Entre", + "empty": "Vide", + "gt": "Supérieur à", + "gte": "Supérieur ou égal à", + "lt": "Inférieur à", + "lte": "Inférieur ou égal à", + "not": "Différent de", + "notBetween": "Pas entre", + "notEmpty": "Non vide", + "equals": "Égal à" + }, + "string": { + "contains": "Contient", + "empty": "Vide", + "endsWith": "Se termine par", + "not": "Différent de", + "notEmpty": "Non vide", + "startsWith": "Commence par", + "equals": "Égal à", + "notContains": "Ne contient pas", + "notEndsWith": "Ne termine pas par", + "notStartsWith": "Ne commence pas par" + }, + "array": { + "empty": "Vide", + "contains": "Contient", + "not": "Différent de", + "notEmpty": "Non vide", + "without": "Sans", + "equals": "Égal à" + } + }, + "add": "Ajouter une condition", + "button": { + "0": "Recherche avancée", + "_": "Recherche avancée (%d)" + }, + "clearAll": "Effacer tout", + "condition": "Condition", + "data": "Donnée", + "deleteTitle": "Supprimer la règle de filtrage", + "logicAnd": "Et", + "logicOr": "Ou", + "title": { + "0": "Recherche avancée", + "_": "Recherche avancée (%d)" + }, + "value": "Valeur", + "leftTitle": "Désindenter le critère", + "rightTitle": "Indenter le critère" + }, + "searchPanes": { + "clearMessage": "Effacer tout", + "count": "{total}", + "title": "Filtres actifs - %d", + "collapse": { + "0": "Volet de recherche", + "_": "Volet de recherche (%d)" + }, + "countFiltered": "{shown} ({total})", + "emptyPanes": "Pas de volet de recherche", + "loadMessage": "Chargement du volet de recherche...", + "collapseMessage": "Réduire tout", + "showMessage": "Montrer tout" + }, + "buttons": { + "collection": "Collection", + "colvis": "Visibilité colonnes", + "colvisRestore": "Rétablir visibilité", + "copy": "Copier", + "copySuccess": { + "1": "1 ligne copiée dans le presse-papier", + "_": "%d lignes copiées dans le presse-papier" + }, + "copyTitle": "Copier dans le presse-papier", + "csv": "CSV", + "excel": "Excel", + "pageLength": { + "-1": "Afficher toutes les lignes", + "_": "Afficher %d lignes", + "1": "Afficher 1 ligne" + }, + "pdf": "PDF", + "print": "Imprimer", + "copyKeys": "Appuyez sur ctrl ou u2318 + C pour copier les données du tableau dans votre presse-papier.", + "createState": "Créer un état", + "removeAllStates": "Supprimer tous les états", + "removeState": "Supprimer", + "renameState": "Renommer", + "savedStates": "États sauvegardés", + "stateRestore": "État %d", + "updateState": "Mettre à jour" + }, + "decimal": ",", + "datetime": { + "previous": "Précédent", + "next": "Suivant", + "hours": "Heures", + "minutes": "Minutes", + "seconds": "Secondes", + "unknown": "-", + "amPm": [ + "am", + "pm" + ], + "months": { + "0": "Janvier", + "2": "Mars", + "3": "Avril", + "4": "Mai", + "5": "Juin", + "6": "Juillet", + "8": "Septembre", + "9": "Octobre", + "10": "Novembre", + "1": "Février", + "11": "Décembre", + "7": "Août" + }, + "weekdays": [ + "Dim", + "Lun", + "Mar", + "Mer", + "Jeu", + "Ven", + "Sam" + ] + }, + "editor": { + "close": "Fermer", + "create": { + "title": "Créer une nouvelle entrée", + "button": "Nouveau", + "submit": "Créer" + }, + "edit": { + "button": "Editer", + "title": "Editer Entrée", + "submit": "Mettre à jour" + }, + "remove": { + "button": "Supprimer", + "title": "Supprimer", + "submit": "Supprimer", + "confirm": { + "_": "Êtes-vous sûr de vouloir supprimer %d lignes ?", + "1": "Êtes-vous sûr de vouloir supprimer 1 ligne ?" + } + }, + "multi": { + "title": "Valeurs multiples", + "info": "Les éléments sélectionnés contiennent différentes valeurs pour cette entrée. Pour modifier et définir tous les éléments de cette entrée à la même valeur, cliquez ou tapez ici, sinon ils conserveront leurs valeurs individuelles.", + "restore": "Annuler les modifications", + "noMulti": "Ce champ peut être modifié individuellement, mais ne fait pas partie d'un groupe. " + }, + "error": { + "system": "Une erreur système s'est produite (Plus d'information<\/a>)." + } + }, + "stateRestore": { + "removeSubmit": "Supprimer", + "creationModal": { + "button": "Créer", + "order": "Tri", + "paging": "Pagination", + "scroller": "Position du défilement", + "search": "Recherche", + "select": "Sélection", + "columns": { + "search": "Recherche par colonne", + "visible": "Visibilité des colonnes" + }, + "name": "Nom :", + "searchBuilder": "Recherche avancée", + "title": "Créer un nouvel état", + "toggleLabel": "Inclus :" + }, + "renameButton": "Renommer", + "duplicateError": "Il existe déjà un état avec ce nom.", + "emptyError": "Le nom ne peut pas être vide.", + "emptyStates": "Aucun état sauvegardé", + "removeConfirm": "Voulez vous vraiment supprimer %s ?", + "removeError": "Échec de la suppression de l'état.", + "removeJoiner": "et", + "removeTitle": "Supprimer l'état", + "renameLabel": "Nouveau nom pour %s :", + "renameTitle": "Renommer l'état" + }, + "info": "Affichage de _START_ à _END_ sur _TOTAL_ entrées", + "infoEmpty": "Affichage de 0 à 0 sur 0 entrées", + "infoFiltered": "(filtrées depuis un total de _MAX_ entrées)", + "lengthMenu": "Afficher _MENU_ entrées", + "paginate": { + "first": "Première", + "last": "Dernière", + "next": "Suivante", + "previous": "Précédente" + }, + "zeroRecords": "Aucune entrée correspondante trouvée", + "aria": { + "sortAscending": " : activer pour trier la colonne par ordre croissant", + "sortDescending": " : activer pour trier la colonne par ordre décroissant" + }, + "infoThousands": " ", + "search": "Rechercher :", + "thousands": " " +} \ No newline at end of file diff --git a/pandora_console/include/javascript/i18n/dataTables.ja.json b/pandora_console/include/javascript/i18n/dataTables.ja.json new file mode 100644 index 0000000000..41c8f8d61d --- /dev/null +++ b/pandora_console/include/javascript/i18n/dataTables.ja.json @@ -0,0 +1,78 @@ +{ + "emptyTable": "テーブルにデータがありません", + "info": " _TOTAL_ 件中 _START_ から _END_ まで表示", + "infoEmpty": " 0 件中 0 から 0 まで表示", + "infoFiltered": "(全 _MAX_ 件より抽出)", + "infoThousands": ",", + "lengthMenu": "_MENU_ 件表示", + "loadingRecords": "読み込み中...", + "processing": "処理中...", + "search": "検索:", + "zeroRecords": "一致するレコードがありません", + "paginate": { + "first": "先頭", + "last": "最終", + "next": "次", + "previous": "前" + }, + "aria": { + "sortAscending": ": 列を昇順に並べ替えるにはアクティブにする", + "sortDescending": ": 列を降順に並べ替えるにはアクティブにする" + }, + "thousands": ",", + "buttons": { + "colvis": "項目の表示\/非表示", + "csv": "CSVをダウンロード" + }, + "searchBuilder": { + "add": "条件を追加", + "button": { + "0": "カスタムサーチ", + "_": "カスタムサーチ (%d)" + }, + "clearAll": "すべての条件をクリア", + "condition": "条件", + "conditions": { + "date": { + "after": "次の日付以降", + "before": "次の日付以前", + "between": "次の期間に含まれる", + "empty": "空白", + "equals": "次の日付と等しい", + "not": "次の日付と等しくない", + "notBetween": "次の期間に含まれない", + "notEmpty": "空白ではない" + }, + "number": { + "between": "次の値の間に含まれる", + "empty": "空白", + "equals": "次の値と等しい", + "gt": "次の値よりも大きい", + "gte": "次の値以上", + "lt": "次の値未満", + "lte": "次の値以下", + "not": "次の値と等しくない", + "notBetween": "次の値の間に含まれない", + "notEmpty": "空白ではない" + }, + "string": { + "contains": "次の文字を含む", + "empty": "空白", + "endsWith": "次の文字で終わる", + "equals": "次の文字と等しい", + "not": "次の文字と等しくない", + "notEmpty": "空白ではない", + "startsWith": "次の文字から始まる", + "notContains": "次の文字を含まない", + "notStartsWith": "次の文字で始まらない", + "notEndsWith": "次の文字で終わらない" + } + }, + "data": "項目", + "title": { + "0": "カスタムサーチ", + "_": "カスタムサーチ (%d)" + }, + "value": "値" + } +} \ No newline at end of file diff --git a/pandora_console/include/javascript/i18n/dataTables.ru.json b/pandora_console/include/javascript/i18n/dataTables.ru.json new file mode 100644 index 0000000000..fdc5735d42 --- /dev/null +++ b/pandora_console/include/javascript/i18n/dataTables.ru.json @@ -0,0 +1,247 @@ +{ + "processing": "Подождите...", + "search": "Поиск:", + "lengthMenu": "Показать _MENU_ записей", + "info": "Записи с _START_ до _END_ из _TOTAL_ записей", + "infoEmpty": "Записи с 0 до 0 из 0 записей", + "infoFiltered": "(отфильтровано из _MAX_ записей)", + "loadingRecords": "Загрузка записей...", + "zeroRecords": "Записи отсутствуют.", + "emptyTable": "В таблице отсутствуют данные", + "paginate": { + "first": "Первая", + "previous": "Предыдущая", + "next": "Следующая", + "last": "Последняя" + }, + "aria": { + "sortAscending": ": активировать для сортировки столбца по возрастанию", + "sortDescending": ": активировать для сортировки столбца по убыванию" + }, + "select": { + "rows": { + "_": "Выбрано записей: %d", + "1": "Выбрана одна запись" + }, + "cells": { + "_": "Выбрано %d ячеек", + "1": "Выбрана 1 ячейка " + }, + "columns": { + "1": "Выбран 1 столбец ", + "_": "Выбрано %d столбцов " + } + }, + "searchBuilder": { + "conditions": { + "string": { + "startsWith": "Начинается с", + "contains": "Содержит", + "empty": "Пусто", + "endsWith": "Заканчивается на", + "equals": "Равно", + "not": "Не", + "notEmpty": "Не пусто", + "notContains": "Не содержит", + "notStartsWith": "Не начинается на", + "notEndsWith": "Не заканчивается на" + }, + "date": { + "after": "После", + "before": "До", + "between": "Между", + "empty": "Пусто", + "equals": "Равно", + "not": "Не", + "notBetween": "Не между", + "notEmpty": "Не пусто" + }, + "number": { + "empty": "Пусто", + "equals": "Равно", + "gt": "Больше чем", + "gte": "Больше, чем равно", + "lt": "Меньше чем", + "lte": "Меньше, чем равно", + "not": "Не", + "notEmpty": "Не пусто", + "between": "Между", + "notBetween": "Не между ними" + }, + "array": { + "equals": "Равно", + "empty": "Пусто", + "contains": "Содержит", + "not": "Не равно", + "notEmpty": "Не пусто", + "without": "Без" + } + }, + "data": "Данные", + "deleteTitle": "Удалить условие фильтрации", + "logicAnd": "И", + "logicOr": "Или", + "title": { + "0": "Конструктор поиска", + "_": "Конструктор поиска (%d)" + }, + "value": "Значение", + "add": "Добавить условие", + "button": { + "0": "Конструктор поиска", + "_": "Конструктор поиска (%d)" + }, + "clearAll": "Очистить всё", + "condition": "Условие", + "leftTitle": "Превосходные критерии", + "rightTitle": "Критерии отступа" + }, + "searchPanes": { + "clearMessage": "Очистить всё", + "collapse": { + "0": "Панели поиска", + "_": "Панели поиска (%d)" + }, + "count": "{total}", + "countFiltered": "{shown} ({total})", + "emptyPanes": "Нет панелей поиска", + "loadMessage": "Загрузка панелей поиска", + "title": "Фильтры активны - %d", + "showMessage": "Показать все", + "collapseMessage": "Скрыть все" + }, + "buttons": { + "pdf": "PDF", + "print": "Печать", + "collection": "Коллекция <\/span>", + "colvis": "Видимость столбцов", + "colvisRestore": "Восстановить видимость", + "copy": "Копировать", + "copyKeys": "Нажмите ctrl or u2318 + C, чтобы скопировать данные таблицы в буфер обмена. Для отмены, щелкните по сообщению или нажмите escape.", + "copyTitle": "Скопировать в буфер обмена", + "csv": "CSV", + "excel": "Excel", + "pageLength": { + "-1": "Показать все строки", + "_": "Показать %d строк", + "1": "Показать 1 строку" + }, + "removeState": "Удалить", + "renameState": "Переименовать", + "copySuccess": { + "1": "Строка скопирована в буфер обмена", + "_": "Скопировано %d строк в буфер обмена" + }, + "createState": "Создать состояние", + "removeAllStates": "Удалить все состояния", + "savedStates": "Сохраненные состояния", + "stateRestore": "Состояние %d", + "updateState": "Обновить" + }, + "decimal": ".", + "infoThousands": ",", + "autoFill": { + "cancel": "Отменить", + "fill": "Заполнить все ячейки %d<\/i><\/i>", + "fillHorizontal": "Заполнить ячейки по горизонтали", + "fillVertical": "Заполнить ячейки по вертикали", + "info": "Информация" + }, + "datetime": { + "previous": "Предыдущий", + "next": "Следующий", + "hours": "Часы", + "minutes": "Минуты", + "seconds": "Секунды", + "unknown": "Неизвестный", + "amPm": [ + "AM", + "PM" + ], + "months": { + "0": "Январь", + "1": "Февраль", + "10": "Ноябрь", + "11": "Декабрь", + "2": "Март", + "3": "Апрель", + "4": "Май", + "5": "Июнь", + "6": "Июль", + "7": "Август", + "8": "Сентябрь", + "9": "Октябрь" + }, + "weekdays": [ + "Вс", + "Пн", + "Вт", + "Ср", + "Чт", + "Пт", + "Сб" + ] + }, + "editor": { + "close": "Закрыть", + "create": { + "button": "Новый", + "title": "Создать новую запись", + "submit": "Создать" + }, + "edit": { + "button": "Изменить", + "title": "Изменить запись", + "submit": "Изменить" + }, + "remove": { + "button": "Удалить", + "title": "Удалить", + "submit": "Удалить", + "confirm": { + "_": "Вы точно хотите удалить %d строк?", + "1": "Вы точно хотите удалить 1 строку?" + } + }, + "multi": { + "restore": "Отменить изменения", + "title": "Несколько значений", + "noMulti": "Это поле должно редактироватся отдельно, а не как часть групы", + "info": "Выбранные элементы содержат разные значения для этого входа. Чтобы отредактировать и установить для всех элементов этого ввода одинаковое значение, нажмите или коснитесь здесь, в противном случае они сохранят свои индивидуальные значения." + }, + "error": { + "system": "Возникла системная ошибка (Подробнее<\/a>)." + } + }, + "searchPlaceholder": "Что ищете?", + "stateRestore": { + "creationModal": { + "button": "Создать", + "search": "Поиск", + "columns": { + "search": "Поиск по столбцам", + "visible": "Видимость столбцов" + }, + "name": "Имя:", + "order": "Сортировка", + "paging": "Страницы", + "scroller": "Позиция прокрутки", + "searchBuilder": "Редактор поиска", + "select": "Выделение", + "title": "Создать новое состояние", + "toggleLabel": "Включает:" + }, + "removeJoiner": "и", + "removeSubmit": "Удалить", + "renameButton": "Переименовать", + "duplicateError": "Состояние с таким именем уже существует.", + "emptyError": "Имя не может быть пустым.", + "emptyStates": "Нет сохраненных состояний", + "removeConfirm": "Вы уверены, что хотите удалить %s?", + "removeError": "Не удалось удалить состояние.", + "removeTitle": "Удалить состояние", + "renameLabel": "Новое имя для %s:", + "renameTitle": "Переименовать состояние" + }, + "thousands": " " +} \ No newline at end of file diff --git a/pandora_console/include/javascript/i18n/dataTables.zh.json b/pandora_console/include/javascript/i18n/dataTables.zh.json new file mode 100644 index 0000000000..46341cde95 --- /dev/null +++ b/pandora_console/include/javascript/i18n/dataTables.zh.json @@ -0,0 +1,244 @@ +{ + "search": "搜索:", + "paginate": { + "first": "首页", + "previous": "上页", + "next": "下页", + "last": "末页" + }, + "autoFill": { + "cancel": "取消", + "fill": "用 %d<\/i> 填充所有单元格", + "fillHorizontal": "水平填充单元格", + "fillVertical": "垂直填充单元格" + }, + "buttons": { + "colvis": "列可见性", + "copy": "复制", + "copyTitle": "复制到剪贴板", + "csv": "CSV", + "excel": "Excel", + "pdf": "PDF", + "pageLength": { + "-1": "显示所有行", + "_": "显示 %d 行" + }, + "print": "打印", + "collection": "集合 <\/span>", + "colvisRestore": "还原可见性", + "copyKeys": "按 Ctrl 或 u2318 + C 键将表中数据复制到系统剪贴板。

要取消,请单击此消息或按 Escape 键。", + "copySuccess": { + "1": "已复制 1 行到剪贴板", + "_": "已复制 %d 行到剪贴板" + }, + "createState": "创建状态", + "removeAllStates": "删除所有状态", + "removeState": "删除", + "renameState": "重命名", + "savedStates": "保存的状态", + "stateRestore": "状态 %d", + "updateState": "更新" + }, + "searchBuilder": { + "button": { + "0": "搜索生成器", + "_": "搜索生成器 (%d)" + }, + "clearAll": "全部清除", + "condition": "条件", + "data": "数据", + "title": { + "0": "搜索生成器", + "_": "搜索生成器 (%d)" + }, + "value": "值", + "conditions": { + "date": { + "equals": "等于", + "after": "早于", + "before": "晚于", + "between": "介于", + "empty": "为空", + "not": "非", + "notBetween": "不介于", + "notEmpty": "非空" + }, + "number": { + "between": "介于", + "empty": "为空", + "equals": "等于", + "gt": "大于", + "gte": "大于等于", + "lt": "小于", + "lte": "小于等于", + "not": "非", + "notBetween": "不介于", + "notEmpty": "非空" + }, + "string": { + "contains": "含有", + "empty": "为空", + "endsWith": "结尾为", + "equals": "等于", + "not": "非", + "notEmpty": "非空", + "startsWith": "开头为", + "notContains": "不含有", + "notStartsWith": "开头不为", + "notEndsWith": "结尾不为" + }, + "array": { + "equals": "等于", + "empty": "为空", + "contains": "含有", + "not": "非", + "notEmpty": "非空", + "without": "无" + } + }, + "add": "添加条件", + "deleteTitle": "删除筛选规则", + "leftTitle": "组合条件", + "logicAnd": "与", + "logicOr": "或", + "rightTitle": "取消组合" + }, + "searchPanes": { + "clearMessage": "全部清除", + "collapse": { + "0": "搜索面板", + "_": "搜索面板 (%d)" + }, + "count": "{total}", + "countFiltered": "{shown} ({total})", + "emptyPanes": "没有搜索面板", + "loadMessage": "正在加载搜索面板...", + "title": "激活的筛选条件 - %d", + "showMessage": "全部显示", + "collapseMessage": "全部折叠" + }, + "infoThousands": ",", + "thousands": ",", + "datetime": { + "amPm": [ + "上午", + "下午" + ], + "minutes": "分", + "months": { + "0": "1月", + "1": "2月", + "10": "11月", + "11": "12月", + "2": "3月", + "3": "4月", + "4": "5月", + "5": "6月", + "6": "7月", + "7": "8月", + "8": "9月", + "9": "10月" + }, + "seconds": "秒", + "previous": "上月", + "next": "下月", + "hours": "时", + "unknown": "-", + "weekdays": [ + "日", + "一", + "二", + "三", + "四", + "五", + "六" + ] + }, + "editor": { + "close": "关闭", + "create": { + "button": "新建", + "submit": "创建", + "title": "创建新记录" + }, + "edit": { + "button": "编辑", + "submit": "更新", + "title": "编辑记录" + }, + "multi": { + "restore": "撤销更改", + "title": "多个值", + "info": "选择的多个记录的此字段含有不同的值。要编辑并将所有记录的此字段设为相同的值,请单击或点按这里,否则它们会保留各自的值。", + "noMulti": "此字段可以单独编辑,不可以组合编辑。" + }, + "remove": { + "button": "删除", + "submit": "删除", + "title": "删除", + "confirm": { + "_": "确定要删除 %d 行?", + "1": "确定要删除 1 行?" + } + }, + "error": { + "system": "出现了系统错误 (
更多信息<\\\/a>)。<\/a>" + } + }, + "infoEmpty": "正在显示第 0 至 0 项数据,共 0 项", + "infoFiltered": "(筛选自全部_MAX_项数据)", + "lengthMenu": "显示 _MENU_ 项数据", + "loadingRecords": "正在加载...", + "processing": "正在处理...", + "aria": { + "sortAscending": ": 激活以升序排序此列", + "sortDescending": ": 激活以降序排序此列" + }, + "decimal": ".", + "emptyTable": "表中没有数据", + "info": "正在显示第 _START_ 至 _END_ 项数据,共 _TOTAL_ 项", + "select": { + "cells": { + "1": "已选择 1 个单元格", + "_": "已选择 %d 个单元格" + }, + "columns": { + "1": "已选择 1 列", + "_": "已选择 %d 列" + }, + "rows": { + "1": "已选择 1 行", + "_": "已选择 %d 行" + } + }, + "zeroRecords": "没有找到匹配的记录", + "stateRestore": { + "creationModal": { + "button": "创建", + "columns": { + "search": "列搜索", + "visible": "列可见性" + }, + "name": "名称:", + "order": "排序", + "paging": "分页", + "scroller": "滚动位置", + "search": "搜索", + "searchBuilder": "搜索生成器", + "select": "选择", + "title": "创建新状态", + "toggleLabel": "包括:" + }, + "duplicateError": "已存在使用此名称的状态。", + "emptyError": "名称不能为空。", + "emptyStates": "没有保存的状态", + "removeConfirm": "确定要删除 %s?", + "removeError": "删除状态失败。", + "removeJoiner": "和", + "removeSubmit": "删除", + "removeTitle": "删除状态", + "renameButton": "重命名", + "renameLabel": "%s 的新名称:", + "renameTitle": "重命名状态" + } +} \ No newline at end of file diff --git a/pandora_console/include/styles/pandora_black.css b/pandora_console/include/styles/pandora_black.css index 7c15fd03a9..b09d441686 100644 --- a/pandora_console/include/styles/pandora_black.css +++ b/pandora_console/include/styles/pandora_black.css @@ -1239,7 +1239,16 @@ input[type="image"] { font-family: source-code, mono, monospace; } -* table about dialog */ .table-about { +.title-blue { + text-transform: none !important; + font-size: 1em !important; + margin: 0px !important; + padding: 0px !important; + color: #95a3bf; +} + +/* Table about dialog */ +.table-about { background-color: #222 !important; width: 100%; border-collapse: collapse; diff --git a/pandora_console/operation/inventory/inventory.php b/pandora_console/operation/inventory/inventory.php index 7e17ffff3d..607e3fdd60 100755 --- a/pandora_console/operation/inventory/inventory.php +++ b/pandora_console/operation/inventory/inventory.php @@ -196,10 +196,12 @@ if ($is_metaconsole === true) { } if ($is_metaconsole === true) { + $nodo_image_url = $config['homeurl'].'/images/node.png'; if ($id_server > 0) { $connection = metaconsole_get_connection_by_id($id_server); $agents_node = metaconsole_get_agents_servers($connection['server_name'], $inventory_id_group); $node = metaconsole_get_servers($id_server); + $nodos = []; if (metaconsole_connect($connection) !== NOERR) { ui_print_error_message( @@ -216,7 +218,8 @@ if ($is_metaconsole === true) { $result_module = db_get_all_rows_sql($sql); if ($submit_filter === true) { - $inventory_data .= inventory_get_data( + // Get the data. + $rows_meta = inventory_get_datatable( array_keys($agents_node), $inventory_module, $utimestamp, @@ -224,15 +227,26 @@ if ($is_metaconsole === true) { $export, false, $order_by_agent, - $node, + $server, $pagination_url_parameters ); + + $data_tmp['server_name'] = $connection['server_name']; + $data_tmp['dbhost'] = $connection['dbhost']; + $data_tmp['server_uid'] = $connection['server_uid']; + $data_tmp['data'] = $rows_meta; + + $nodos[$connection['id']] = $data_tmp; + if ($result_data !== ERR_NODATA) { + $inventory_data .= $result_data; + } } // Restore db connection. metaconsole_restore_db(); } else { $result_module = []; + $nodos = []; foreach ($nodes_connection as $key => $server) { $agents_node = metaconsole_get_agents_servers($server['server_name'], $inventory_id_group); $connection = metaconsole_get_connection($server['server_name']); @@ -253,7 +267,7 @@ if ($is_metaconsole === true) { $result_module = array_merge($result_module, $result); if ($submit_filter === true) { // Get the data. - $result_data = inventory_get_data( + $rows_meta = inventory_get_datatable( array_keys($agents_node), $inventory_module, $utimestamp, @@ -264,6 +278,13 @@ if ($is_metaconsole === true) { $server, $pagination_url_parameters ); + + $data_tmp['server_name'] = $server['server_name']; + $data_tmp['dbhost'] = $server['dbhost']; + $data_tmp['server_uid'] = $server['server_uid']; + $data_tmp['data'] = $rows_meta; + + $nodos[$server['id']] = $data_tmp; if ($result_data !== ERR_NODATA) { $inventory_data .= $result_data; } @@ -360,7 +381,8 @@ $table->data[0][1] .= ''; $table->data[0][2] = ''.__('Module').''; if ($is_metaconsole === true) { - $table->data[0][3] = html_print_select($fields, 'module_inventory_general_view', $inventory_module, $filteringFunction, __('All'), 0, true, false, true, '', false, 'min-width: 194px; max-width: 200px;'); + array_unshift($fields, __('All')); + $table->data[0][3] = html_print_select($fields, 'module_inventory_general_view', $inventory_module, $filteringFunction, __('Basic info'), 'basic', true, false, true, '', false, 'min-width: 194px; max-width: 200px;'); } else { $sql = 'SELECT name as indexname, name FROM tmodule_inventory, tagent_module_inventory @@ -369,7 +391,20 @@ if ($is_metaconsole === true) { $sql .= ' AND id_agente = '.$inventory_id_agent; } - $table->data[0][3] = html_print_select_from_sql($sql, 'module_inventory_general_view', $inventory_module, '', __('All'), 'all', true, false, false); + $fields = []; + $result = db_get_all_rows_sql($sql); + if ($result === false) { + $result = []; + } + + foreach ($result as $row) { + $id = array_shift($row); + $value = array_shift($row); + $fields[$id] = $value; + } + + array_unshift($fields, __('All')); + $table->data[0][3] = html_print_select($fields, 'module_inventory_general_view', $inventory_module, '', __('Basic info'), 'basic', true, false, false); } @@ -454,20 +489,18 @@ if ($is_metaconsole === false) { $agents_ids = array_keys($agents); if (count($agents_ids) > 0) { - $inventory_data = inventory_get_data( + $rows = inventory_get_datatable( $agents_ids, $inventory_module, $utimestamp, $inventory_search_string, $export, false, - $order_by_agent, - '', - $pagination_url_parameters + $order_by_agent ); } - if (count($agents_ids) === 0 || (int) $inventory_data === ERR_NODATA) { + if (count($agents_ids) === 0 || (int) $rows === ERR_NODATA) { ui_print_info_message(['no_close' => true, 'message' => __('No data found.') ]); echo ' '; @@ -508,12 +541,732 @@ if ($is_metaconsole === false) { } true, 'message' => __('No data found.') ]); + if ($inventory_module !== 'basic') { + if ($order_by_agent === true) { + foreach ($rows as $agent_rows) { + foreach ($agent_rows['row'] as $row) { + $data = []; + + $columns = explode(';', io_safe_output($row['data_format'])); + array_push($columns, 'Timestamp'); + + $data_rows = explode(PHP_EOL, $row['data']); + foreach ($data_rows as $data_row) { + // Exclude results don't match filter. + if ($inventory_search_string && preg_match('/'.io_safe_output($inventory_search_string).'/', ($data_row)) == 0) { + continue; + } + + $column_data = explode(';', io_safe_output($data_row)); + + if ($column_data[0] !== '') { + $row_tmp = []; + foreach ($column_data as $key => $value) { + $row_tmp[$columns[$key]] = $value; + } + + $row_tmp['Timestamp'] = $row['timestamp']; + array_push($data, (object) $row_tmp); + } + } + + $id_table = 'id_'.$row['id_module_inventory']; + + $table = ui_print_datatable( + [ + 'id' => $id_table, + 'class' => 'info_table w100p', + 'style' => 'width: 100%', + 'columns' => $columns, + 'column_names' => $columns, + 'no_sortable_columns' => [], + 'data_element' => $data, + 'searching' => true, + 'dom_elements' => 'lftipB', + 'order' => [ + 'field' => $columns[0], + 'direction' => 'asc', + ], + 'zeroRecords' => __('No inventory found'), + 'emptyTable' => __('No inventory found'), + 'return' => true, + 'default_pagination' => 10, + 'no_sortable_columns' => [-1], + ] + ); + + $modules .= ui_toggle( + $table, + ''.$row['name'].'', + '', + '', + true, + true, + '', + 'white-box-content w100p', + 'box-shadow white_table_graph w100p', + 'images/arrow_down_green.png', + 'images/arrow_right_green.png', + false, + false, + false, + '', + '', + null, + null, + $id_table + ); + } + + ui_toggle( + $modules, + $agent_rows['agent'], + '', + '', + false, + false + ); + } + } else { + foreach ($rows as $module_rows) { + $agent = ''; + foreach ($module_rows as $row) { + $columns = explode(';', io_safe_output($row['data_format'])); + array_push($columns, 'Timestamp'); + $data = []; + + $data_explode = explode(PHP_EOL, $row['data']); + foreach ($data_explode as $values) { + // Exclude results don't match filter. + if ($inventory_search_string && preg_match('/'.io_safe_output($inventory_search_string).'/', ($values)) == 0) { + continue; + } + + $data_tmp = []; + if ($values !== '') { + $values_explode = explode(';', io_safe_output($values)); + + foreach ($values_explode as $key => $value) { + $data_tmp[$columns[$key]] = $value; + } + + $data_tmp['Timestamp'] = $row['timestamp']; + array_push($data, $data_tmp); + } + } + + + $id_table = 'id_'.$row['id_module_inventory']; + + $table = ui_print_datatable( + [ + 'id' => $id_table, + 'class' => 'info_table w100p', + 'style' => 'width: 100%', + 'columns' => $columns, + 'column_names' => $columns, + 'no_sortable_columns' => [], + 'data_element' => $data, + 'searching' => true, + 'dom_elements' => 'lftipB', + 'order' => [ + 'field' => $columns[0], + 'direction' => 'asc', + ], + 'zeroRecords' => __('No inventory found'), + 'emptyTable' => __('No inventory found'), + 'return' => true, + 'default_pagination' => 10, + 'no_sortable_columns' => [-1], + ] + ); + + $agent .= ui_toggle( + $table, + ''.$row['name_agent'].'', + '', + '', + true, + true, + '', + 'white-box-content w100p', + 'box-shadow white_table_graph w100p', + 'images/arrow_down_green.png', + 'images/arrow_right_green.png', + false, + false, + false, + '', + '', + null, + null, + $id_table + ); + } + + ui_toggle( + $agent, + $module_rows[0]['name'], + '', + '', + false, + false + ); + } + } } else { - echo $inventory_data; + $id_agente = $inventory_id_agent; + $agentes = []; + $data = []; + $class = 'info_table w100p'; + $style = 'width: 100%'; + $ordering = false; + $searching = false; + $dom = 't'; + $columns = [ + __('Alias'), + __('IP'), + __("IP's Secondary"), + __('Group'), + __('Secondary groups'), + __('Description'), + __('OS'), + __('Interval'), + __('Last contact'), + __('Last status change'), + __('Custom fields'), + __('Values Custom Fields'), + ]; + if ((int) $id_agente === 0) { + $class = 'databox info_table w100p'; + $style = 'width: 99%'; + $ordering = true; + $searching = true; + $dom = 'lftipB'; + $agentes = db_get_all_rows_sql('SELECT id_agente FROM tagente'); + } else { + array_push($agentes, $id_agente); + } + + foreach ($agentes as $id) { + if ((int) $id_agente === 0) { + $id = $id['id_agente']; + } + + $agent = db_get_row('tagente', 'id_agente', $id); + + $ip = ''.__('N/A').''; + if (empty($agent['direccion']) === false) { + $ip = $agent['direccion']; + } + + + $secondary_ips = ''; + foreach (agents_get_addresses($id) as $ip) { + if ($ip !== $agent['direccion']) { + $secondary_ips .= ''.$ip.''; + } + } + + $group = groups_get_name($agent['id_grupo']); + $secondary_groups = enterprise_hook('agents_get_secondary_groups', [$id]); + + if (empty($secondary_groups['for_select']) === true) { + $sec_group_data = ''.__('N/A').''; + } else { + $sec_group = []; + foreach ($secondary_groups['for_select'] as $name) { + $sec_group[] = $name; + } + + $sec_group_data = implode(', ', $sec_group); + } + + $os = ui_print_os_icon($agent['id_os'], false, true).' '; + $os .= io_safe_output(get_os_name($agent['id_os'])).' '.io_safe_output($agent['os_version']); + $interval = human_time_description_raw($agent['intervalo'], false, 'large'); + $last_contact = ui_print_timestamp($agent['ultimo_contacto'], true); + // $last_contact .= ' / '.date_w_fixed_tz($agent['ultimo_contacto_remoto']); + $last_status_change_agent = agents_get_last_status_change($agent['id_agente']); + $time_elapsed = !empty($last_status_change_agent) ? human_time_comparation($last_status_change_agent) : ''.__('N/A').''; + + $sql_fields = 'SELECT tcf.name, tcd.description, tcf.is_password_type + FROM tagent_custom_fields tcf + INNER JOIN tagent_custom_data tcd ON tcd.id_field=tcf.id_field + WHERE tcd.id_agent='.$id.' AND tcd.description!=""'; + $field_result = db_get_all_rows_sql($sql_fields); + + $custom_fields_names = ''; + $custom_fields_values = ''; + foreach ($field_result as $field) { + $field_name = str_replace(' ', ' ', io_safe_output($field['name'])); + $custom_fields_names .= ''.$field_name.''; + + $description = $field['description']; + $password_length = strlen(io_safe_output($field['description'])); + $asterisks = ''; + + if ((int) $field['is_password_type'] === 1) { + for ($i = 0; $i < $password_length; $i++) { + $asterisks .= '●'; + } + + $description = $asterisks; + } + + $custom_fields_values .= ''.$description.''; + } + + $data_tmp = [ + __('Alias') => $agent['alias'], + __('IP') => $ip, + __("IP's Secondary") => $secondary_ips, + __('Group') => $group, + __('Secondary groups') => $sec_group_data, + __('Description') => $agent['comentarios'], + __('OS') => $os, + __('Interval') => $interval, + __('Last contact') => $last_contact, + __('Last status change') => $time_elapsed, + __('Custom fields') => $custom_fields_names, + __('Values Custom Fields') => $custom_fields_values, + ]; + + array_push($data, $data_tmp); + } + + $table = ui_print_datatable( + [ + 'id' => 'basic_info', + 'class' => $class, + 'style' => $style, + 'columns' => $columns, + 'column_names' => $columns, + 'ordering' => $ordering, + 'data_element' => $data, + 'searching' => $searching, + 'dom_elements' => $dom, + 'order' => [ + 'field' => $columns[0], + 'direction' => 'asc', + ], + 'zeroRecords' => __('Agent info not found'), + 'emptyTable' => __('Agent info not found'), + 'default_pagination' => 10, + 'return' => true, + ] + ); + if ((int) $id_agente === 0) { + echo $table; + } else { + echo '
'.$table.'
'; + } + } + + // Metaconsole. +} else { + if ($inventory_module !== 'basic') { + if ($order_by_agent === true) { + $count_nodos_tmp = []; + foreach ($nodos as $count_value) { + array_push($count_nodos_tmp, $count_value['server_name']); + } + + $count = array_count_values($count_nodos_tmp); + + foreach ($nodos as $nodo) { + $agents = ''; + foreach ($nodo['data'] as $agent_rows) { + $modules = ''; + foreach ($agent_rows['row'] as $row) { + $data = []; + + $columns = explode(';', io_safe_output($row['data_format'])); + array_push($columns, 'Timestamp'); + + $data_rows = explode(PHP_EOL, $row['data']); + foreach ($data_rows as $data_row) { + // Exclude results don't match filter. + if ($inventory_search_string && preg_match('/'.io_safe_output($inventory_search_string).'/', ($data_row)) == 0) { + continue; + } + + $column_data = explode(';', io_safe_output($data_row)); + + if ($column_data[0] !== '') { + $row_tmp = []; + foreach ($column_data as $key => $value) { + $row_tmp[$columns[$key]] = $value; + } + + $row_tmp['Timestamp'] = $row['timestamp']; + array_push($data, (object) $row_tmp); + } + } + + $id_table = 'id_'.$row['id_module_inventory'].'_'.$nodo['server_uid']; + + $table = ui_print_datatable( + [ + 'id' => $id_table, + 'class' => 'info_table w100p', + 'style' => 'width: 100%', + 'columns' => $columns, + 'column_names' => $columns, + 'no_sortable_columns' => [], + 'data_element' => $data, + 'searching' => true, + 'dom_elements' => 'lftipB', + 'order' => [ + 'field' => $columns[0], + 'direction' => 'asc', + ], + 'zeroRecords' => __('No inventory found'), + 'emptyTable' => __('No inventory found'), + 'return' => true, + 'default_pagination' => 10, + 'no_sortable_columns' => [-1], + ] + ); + + $modules .= ui_toggle( + $table, + ''.$row['name'].'', + '', + '', + true, + true, + '', + 'white-box-content w100p', + 'box-shadow white_table_graph w100p', + 'images/arrow_down_green.png', + 'images/arrow_right_green.png', + false, + false, + false, + '', + '', + null, + null, + $id_table + ); + } + + $agents .= ui_toggle( + $modules, + $agent_rows['agent'], + '', + '', + true, + true + ); + } + + $node_name = $nodo['server_name']; + if ($count[$nodo['server_name']] > 1) { + $node_name .= ' ('.$nodo['dbhost'].')'; + } + + ui_toggle( + $agents, + ''.$node_name.'', + '', + '', + false, + false + ); + } + } else { + $count_nodos_tmp = []; + foreach ($nodos as $count_value) { + array_push($count_nodos_tmp, $count_value['server_name']); + } + + $count = array_count_values($count_nodos_tmp); + + foreach ($nodos as $nodo_key => $nodo) { + $agents = ''; + foreach ($nodo['data'] as $module_rows) { + $agent = ''; + foreach ($module_rows as $row) { + $columns = explode(';', io_safe_output($row['data_format'])); + array_push($columns, 'Timestamp'); + $data = []; + + $data_explode = explode(PHP_EOL, $row['data']); + foreach ($data_explode as $values) { + // Exclude results don't match filter. + if ($inventory_search_string && preg_match('/'.io_safe_output($inventory_search_string).'/', ($values)) == 0) { + continue; + } + + $data_tmp = []; + if ($values !== '') { + $values_explode = explode(';', io_safe_output($values)); + + foreach ($values_explode as $key => $value) { + $data_tmp[$columns[$key]] = $value; + } + + $data_tmp['Timestamp'] = $row['timestamp']; + array_push($data, $data_tmp); + } + } + + + $id_table = 'id_'.$row['id_module_inventory'].'_'.$nodo['server_uid']; + + $table = ui_print_datatable( + [ + 'id' => $id_table, + 'class' => 'info_table w100p', + 'style' => 'width: 100%', + 'columns' => $columns, + 'column_names' => $columns, + 'no_sortable_columns' => [], + 'data_element' => $data, + 'searching' => true, + 'dom_elements' => 'lftipB', + 'order' => [ + 'field' => $columns[0], + 'direction' => 'asc', + ], + 'zeroRecords' => __('No inventory found'), + 'emptyTable' => __('No inventory found'), + 'return' => true, + 'default_pagination' => 10, + 'no_sortable_columns' => [-1], + ] + ); + + $agent .= ui_toggle( + $table, + ''.$row['name_agent'].'', + '', + '', + true, + true, + '', + 'white-box-content w100p', + 'box-shadow white_table_graph w100p', + 'images/arrow_down_green.png', + 'images/arrow_right_green.png', + false, + false, + false, + '', + '', + null, + null, + $id_table + ); + } + + $agents .= ui_toggle( + $agent, + $module_rows[0]['name'], + '', + '', + true, + true + ); + } + + $node_name = $nodo['server_name']; + if ($count[$nodo['server_name']] > 1) { + $node_name .= ' ('.$nodo['dbhost'].')'; + } + + ui_toggle( + $agents, + ''.$node_name.'', + '', + '', + false, + false + ); + } + } + } else { + $id_agente = $inventory_id_agent; + $agentes = []; + $data = []; + $class = 'info_table w100p'; + $style = 'width: 100%'; + $ordering = false; + $searching = false; + $dom = 't'; + $columns = [ + __('Alias'), + __('IP'), + __("IP's Secondary"), + __('Group'), + __('Secondary groups'), + __('Description'), + __('OS'), + __('Interval'), + __('Last contact'), + __('Last status change'), + __('Custom fields'), + __('Values Custom Fields'), + ]; + + if ($id_server === 0) { + $servers_ids = array_column(metaconsole_get_servers(), 'id'); + } else { + $servers_ids = [$id_server]; + } + + foreach ($servers_ids as $server_id) { + if (is_metaconsole()) { + $server = metaconsole_get_connection_by_id($server_id); + + if ((int) $es_agent_server_filter !== 0 + && (int) $es_agent_server_filter !== (int) $server_id + ) { + continue; + } + + metaconsole_connect($server); + } + + if ((int) $id_agente === 0) { + $class = 'databox info_table w100p'; + $style = 'width: 99%'; + $ordering = true; + $searching = true; + $dom = 'lftipB'; + $sql_agentes = 'SELECT t.id_agente + FROM tagente t + LEFT JOIN tgrupo tg ON tg.id_grupo = t.id_grupo + WHERE (t.alias LIKE "%'.$inventory_search_string.'%") + OR (t.comentarios LIKE "%'.$inventory_search_string.'%") + OR (t.direccion LIKE "%'.$inventory_search_string.'%") + OR (t.os_version LIKE "%'.$inventory_search_string.'%") + OR (tg.nombre LIKE "%'.$inventory_search_string.'%")'; + $agentes = db_get_all_rows_sql($sql_agentes); + } else { + array_push($agentes, $id_agente); + } + + foreach ($agentes as $id) { + if ((int) $id_agente === 0) { + $id = $id['id_agente']; + } + + $agent = db_get_row('tagente', 'id_agente', $id); + + $ip = ''.__('N/A').''; + if (empty($agent['direccion']) === false) { + $ip = $agent['direccion']; + } + + + $secondary_ips = ''; + foreach (agents_get_addresses($id) as $ip) { + if ($ip !== $agent['direccion']) { + $secondary_ips .= ''.$ip.''; + } + } + + $group = groups_get_name($agent['id_grupo']); + $secondary_groups = enterprise_hook('agents_get_secondary_groups', [$id]); + + if (empty($secondary_groups['for_select']) === true) { + $sec_group_data = ''.__('N/A').''; + } else { + $sec_group = []; + foreach ($secondary_groups['for_select'] as $name) { + $sec_group[] = $name; + } + + $sec_group_data = implode(', ', $sec_group); + } + + $os = ui_print_os_icon($agent['id_os'], false, true).' '; + $os .= io_safe_output(get_os_name($agent['id_os'])).' '.io_safe_output($agent['os_version']); + $interval = human_time_description_raw($agent['intervalo'], false, 'large'); + $last_contact = ui_print_timestamp($agent['ultimo_contacto'], true); + // $last_contact .= ' / '.date_w_fixed_tz($agent['ultimo_contacto_remoto']); + $last_status_change_agent = agents_get_last_status_change($agent['id_agente']); + $time_elapsed = !empty($last_status_change_agent) ? human_time_comparation($last_status_change_agent) : ''.__('N/A').''; + + $sql_fields = 'SELECT tcf.name, tcd.description, tcf.is_password_type + FROM tagent_custom_fields tcf + INNER JOIN tagent_custom_data tcd ON tcd.id_field=tcf.id_field + WHERE tcd.id_agent='.$id.' AND tcd.description!=""'; + $field_result = db_get_all_rows_sql($sql_fields); + + $custom_fields_names = ''; + $custom_fields_values = ''; + foreach ($field_result as $field) { + $field_name = str_replace(' ', ' ', io_safe_output($field['name'])); + $custom_fields_names .= ''.$field_name.''; + + $description = $field['description']; + $password_length = strlen(io_safe_output($field['description'])); + $asterisks = ''; + + if ((int) $field['is_password_type'] === 1) { + for ($i = 0; $i < $password_length; $i++) { + $asterisks .= '●'; + } + + $description = $asterisks; + } + + $custom_fields_values .= ''.$description.''; + } + + $data_tmp = [ + __('Alias') => $agent['alias'], + __('IP') => $ip, + __("IP's Secondary") => $secondary_ips, + __('Group') => $group, + __('Secondary groups') => $sec_group_data, + __('Description') => $agent['comentarios'], + __('OS') => $os, + __('Interval') => $interval, + __('Last contact') => $last_contact, + __('Last status change') => $time_elapsed, + __('Custom fields') => $custom_fields_names, + __('Values Custom Fields') => $custom_fields_values, + ]; + + array_push($data, $data_tmp); + } + + if (is_metaconsole()) { + metaconsole_restore_db(); + } + } + + $table = ui_print_datatable( + [ + 'id' => 'basic_info', + 'class' => $class, + 'style' => $style, + 'columns' => $columns, + 'column_names' => $columns, + 'ordering' => $ordering, + 'data_element' => $data, + 'searching' => $searching, + 'dom_elements' => $dom, + 'order' => [ + 'field' => $columns[0], + 'direction' => 'asc', + ], + 'zeroRecords' => __('Agent info not found'), + 'emptyTable' => __('Agent info not found'), + 'default_pagination' => 10, + 'return' => true, + ] + ); + if ((int) $id_agente === 0) { + echo $table; + } else { + echo '
'.$table.'
'; + } } close_meta_frame(); @@ -539,6 +1292,27 @@ ui_require_jquery_file('bgiframe'); $("#id_group").blur (function () { $(this).css ("width", "180px"); }); + + // Reduce margins between table and pagination. + $('.dataTables_paginate.paging_simple_numbers').css('margin-top', 10); + $('.dataTables_paginate.paging_simple_numbers').css('margin-bottom', 10); + + // Change chevron for node icon. + let toggle = document.querySelectorAll('.toggle-inventory-nodo'); + let src = ''; + + toggle.forEach(img => { + img.parentElement.parentElement.style = 'cursor: pointer; border: 0'; + img.parentElement.previousElementSibling.src = src; + }); + + toggle.forEach(divParent => { + let div = divParent.parentElement.parentElement; + $(div).click(function (e) { + div.style = 'cursor: pointer; border: 0'; + div.firstChild.src = src; + }); + }); }); /* ]]> */