const $ = require('jquery'); const axios = require('axios'); const os = require('os'); $('#loader').css('display', 'flex'); $(document).on("click", ".app_click", function () { ipcRenderer.send('newNotification', { 'title': 'Abriendo aplicativo', 'body': $(this).attr('name_app') }); if ($(this).attr('integrado') == 'true') { data_code = $(this).attr('code') console.log(data_code); ipcRenderer.send('openNewWindow', data_code); } else { error_window = { title: 'Error de aplicativo', content: 'No tienes habilitado este aplicativo, informa al coordinador' } ipcRenderer.send('error_window', error_window); } }); $('#search-input').on('input', function () { var textoBusqueda = $(this).val().toUpperCase(); $('.shortcut').each(function () { var textoElemento = $(this).find('h5').text().toUpperCase(); var elemento = $(this); elemento.toggle(textoElemento.includes(textoBusqueda)); }); }); function updateButtonCounts() { const totalCount = $('.shortcut').length; const activeCount = $('.shortcut[integrado="true"]').length; const inactiveCount = $('.shortcut[integrado="false"]').length; $('#all_apps span').text(`Todos (${totalCount})`); $('#active_apps span').text(`Activos (${activeCount})`); $('#inactive_apps span').text(`Inactivos (${inactiveCount})`); } $(document).ready(function () { $('#active_apps').on('click', function () { var elementosFiltrados = $('.shortcut[integrado="true"]'); $('.shortcut').hide(); elementosFiltrados.show(); }); $('#inactive_apps').on('click', function () { var elementosFiltrados = $('.shortcut[integrado="false"]'); $('.shortcut').hide(); elementosFiltrados.show(); }); $('#all_apps').on('click', function () { $('.shortcut').show(); }); $('#search-input').on('input', function () { var textoBusqueda = $(this).val().toUpperCase(); $('.shortcut').each(function () { var textoElemento = $(this).find('h5').text().toUpperCase(); var elemento = $(this); elemento.toggle(textoElemento.includes(textoBusqueda)); }); }); });