Download index.html from Deanmuriarti/https-huggingface-co-deanmuriarti: direct link, hf CLI and curl.
- Browser
- Download file 61.7 kB
-
https://huggingface.co/spaces/Deanmuriarti/https-huggingface-co-deanmuriarti/resolve/main/index.html
- Command line
-
hf download hf://spaces/Deanmuriarti/https-huggingface-co-deanmuriarti/index.html
-
curl -L -o index.html https://huggingface.co/spaces/Deanmuriarti/https-huggingface-co-deanmuriarti/resolve/main/index.html
61.7 kB
| <html lang="es"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
| <title>CRM Supabase</title> | |
| <script src="https://cdn.tailwindcss.com"></script> | |
| <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css"> | |
| <script src="https://cdn.jsdelivr.net/npm/@supabase/supabase-js@2"></script> | |
| <script> | |
| tailwind.config = { | |
| theme: { | |
| extend: { | |
| colors: { | |
| primary: '#4F46E5', | |
| secondary: '#10B981', | |
| dark: '#1F2937', | |
| light: '#F9FAFB' | |
| } | |
| } | |
| } | |
| } | |
| // Configuración de Supabase (reemplaza con tus credenciales) | |
| const supabaseUrl = 'https://your-project.supabase.co'; | |
| const supabaseKey = 'your-anon-key'; | |
| const supabase = supabase.createClient(supabaseUrl, supabaseKey); | |
| // Variables globales | |
| let currentUser = null; | |
| // DOM Ready | |
| document.addEventListener('DOMContentLoaded', function() { | |
| // Elementos de autenticación | |
| const authContainer = document.getElementById('authContainer'); | |
| const appContainer = document.getElementById('appContainer'); | |
| const loginForm = document.getElementById('loginForm'); | |
| const registerForm = document.getElementById('registerForm'); | |
| const showRegister = document.getElementById('showRegister'); | |
| const showLogin = document.getElementById('showLogin'); | |
| const loginBtn = document.getElementById('loginBtn'); | |
| const registerBtn = document.getElementById('registerBtn'); | |
| const logoutBtn = document.getElementById('logoutBtn'); | |
| // Mostrar/ocultar formularios de login/registro | |
| showRegister.addEventListener('click', function(e) { | |
| e.preventDefault(); | |
| loginForm.classList.add('hidden'); | |
| registerForm.classList.remove('hidden'); | |
| }); | |
| showLogin.addEventListener('click', function(e) { | |
| e.preventDefault(); | |
| registerForm.classList.add('hidden'); | |
| loginForm.classList.remove('hidden'); | |
| }); | |
| // Login | |
| loginBtn.addEventListener('click', async function() { | |
| const email = document.getElementById('email').value; | |
| const password = document.getElementById('password').value; | |
| if (!email || !password) { | |
| alert('Por favor ingresa email y contraseña'); | |
| return; | |
| } | |
| try { | |
| const { data, error } = await supabase.auth.signInWithPassword({ | |
| email: email, | |
| password: password | |
| }); | |
| if (error) throw error; | |
| currentUser = data.user; | |
| authContainer.classList.add('hidden'); | |
| appContainer.classList.remove('hidden'); | |
| updateUserInfo(); | |
| loadDashboardData(); | |
| } catch (error) { | |
| alert('Error al iniciar sesión: ' + error.message); | |
| } | |
| }); | |
| // Registro | |
| registerBtn.addEventListener('click', async function() { | |
| const name = document.getElementById('regName').value; | |
| const email = document.getElementById('regEmail').value; | |
| const password = document.getElementById('regPassword').value; | |
| if (!name || !email || !password) { | |
| alert('Por favor completa todos los campos'); | |
| return; | |
| } | |
| try { | |
| // Paso 1: Registrar usuario en Auth | |
| const { data, error } = await supabase.auth.signUp({ | |
| email: email, | |
| password: password | |
| }); | |
| if (error) throw error; | |
| // Paso 2: Guardar información adicional en la tabla de perfiles | |
| const { error: profileError } = await supabase | |
| .from('profiles') | |
| .insert([ | |
| { | |
| id: data.user.id, | |
| full_name: name, | |
| email: email, | |
| avatar_url: `https://ui-avatars.com/api/?name=${encodeURIComponent(name)}&background=random` | |
| } | |
| ]); | |
| if (profileError) throw profileError; | |
| alert('Registro exitoso! Por favor verifica tu email antes de iniciar sesión.'); | |
| registerForm.classList.add('hidden'); | |
| loginForm.classList.remove('hidden'); | |
| } catch (error) { | |
| alert('Error al registrarse: ' + error.message); | |
| } | |
| }); | |
| // Logout | |
| logoutBtn.addEventListener('click', async function() { | |
| try { | |
| const { error } = await supabase.auth.signOut(); | |
| if (error) throw error; | |
| currentUser = null; | |
| authContainer.classList.remove('hidden'); | |
| appContainer.classList.add('hidden'); | |
| // Reset forms | |
| document.getElementById('email').value = ''; | |
| document.getElementById('password').value = ''; | |
| document.getElementById('regName').value = ''; | |
| document.getElementById('regEmail').value = ''; | |
| document.getElementById('regPassword').value = ''; | |
| loginForm.classList.remove('hidden'); | |
| registerForm.classList.add('hidden'); | |
| } catch (error) { | |
| alert('Error al cerrar sesión: ' + error.message); | |
| } | |
| }); | |
| // Verificar sesión al cargar la página | |
| async function checkSession() { | |
| try { | |
| const { data, error } = await supabase.auth.getSession(); | |
| if (error) throw error; | |
| if (data.session) { | |
| currentUser = data.session.user; | |
| authContainer.classList.add('hidden'); | |
| appContainer.classList.remove('hidden'); | |
| updateUserInfo(); | |
| loadDashboardData(); | |
| } | |
| } catch (error) { | |
| console.log('Error al verificar sesión:', error.message); | |
| } | |
| } | |
| // Actualizar información del usuario en la UI | |
| function updateUserInfo() { | |
| if (currentUser) { | |
| document.getElementById('userName').textContent = currentUser.email; | |
| // Aquí podrías cargar más información del perfil si la tienes | |
| } | |
| } | |
| // Cargar datos del dashboard (simulado) | |
| function loadDashboardData() { | |
| // Simular carga de datos | |
| setTimeout(() => { | |
| document.getElementById('totalClients').textContent = '125'; | |
| document.getElementById('clientGrowth').textContent = '12%'; | |
| document.getElementById('monthlySales').textContent = '$34,500'; | |
| document.getElementById('salesGrowth').textContent = '8%'; | |
| document.getElementById('pendingTasks').textContent = '15'; | |
| document.getElementById('taskChange').textContent = '+3'; | |
| document.getElementById('newLeads').textContent = '24'; | |
| document.getElementById('leadGrowth').textContent = '20%'; | |
| }, 500); | |
| } | |
| // Inicializar | |
| checkSession(); | |
| }); | |
| </script> | |
| <style> | |
| .sidebar { | |
| transition: all 0.3s ease; | |
| } | |
| .chart-container { | |
| position: relative; | |
| height: 300px; | |
| } | |
| .customer-card:hover { | |
| transform: translateY(-5px); | |
| box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1); | |
| } | |
| .auth-container { | |
| display: flex; | |
| justify-content: center; | |
| align-items: center; | |
| height: 100vh; | |
| background-color: #f3f4f6; | |
| } | |
| .auth-card { | |
| width: 100%; | |
| max-width: 400px; | |
| background: white; | |
| border-radius: 0.5rem; | |
| box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06); | |
| padding: 2rem; | |
| } | |
| </style> | |
| </head> | |
| <body class="bg-gray-50 font-sans"> | |
| <!-- Contenedor de autenticación (visible inicialmente) --> | |
| <div id="authContainer" class="auth-container"> | |
| <div class="auth-card"> | |
| <div class="text-center mb-8"> | |
| <h1 class="text-3xl font-bold text-primary">CRM Supabase</h1> | |
| <p class="text-gray-600 mt-2">Gestión de clientes y leads</p> | |
| </div> | |
| <div id="loginForm"> | |
| <div class="mb-4"> | |
| <label for="email" class="block text-sm font-medium text-gray-700 mb-1">Email</label> | |
| <input type="email" id="email" class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-primary focus:border-transparent" placeholder="tu@email.com"> | |
| </div> | |
| <div class="mb-6"> | |
| <label for="password" class="block text-sm font-medium text-gray-700 mb-1">Contraseña</label> | |
| <input type="password" id="password" class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-primary focus:border-transparent" placeholder="••••••••"> | |
| </div> | |
| <button id="loginBtn" class="w-full bg-primary text-white py-2 px-4 rounded-md hover:bg-indigo-700 focus:outline-none focus:ring-2 focus:ring-primary focus:ring-offset-2"> | |
| Iniciar sesión | |
| </button> | |
| <p class="text-center mt-4 text-sm text-gray-600"> | |
| ¿No tienes cuenta? <a href="#" id="showRegister" class="text-primary font-medium hover:underline">Regístrate</a> | |
| </p> | |
| </div> | |
| <div id="registerForm" class="hidden"> | |
| <div class="mb-4"> | |
| <label for="regName" class="block text-sm font-medium text-gray-700 mb-1">Nombre completo</label> | |
| <input type="text" id="regName" class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-primary focus:border-transparent" placeholder="Tu nombre"> | |
| </div> | |
| <div class="mb-4"> | |
| <label for="regEmail" class="block text-sm font-medium text-gray-700 mb-1">Email</label> | |
| <input type="email" id="regEmail" class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-primary focus:border-transparent" placeholder="tu@email.com"> | |
| </div> | |
| <div class="mb-6"> | |
| <label for="regPassword" class="block text-sm font-medium text-gray-700 mb-1">Contraseña</label> | |
| <input type="password" id="regPassword" class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-primary focus:border-transparent" placeholder="••••••••"> | |
| </div> | |
| <button id="registerBtn" class="w-full bg-primary text-white py-2 px-4 rounded-md hover:bg-indigo-700 focus:outline-none focus:ring-2 focus:ring-primary focus:ring-offset-2"> | |
| Registrarse | |
| </button> | |
| <p class="text-center mt-4 text-sm text-gray-600"> | |
| ¿Ya tienes cuenta? <a href="#" id="showLogin" class="text-primary font-medium hover:underline">Inicia sesión</a> | |
| </p> | |
| </div> | |
| </div> | |
| </div> | |
| <!-- Aplicación CRM (oculta inicialmente) --> | |
| <div id="appContainer" class="hidden"> | |
| <div class="flex h-screen overflow-hidden"> | |
| <!-- Sidebar --> | |
| <div class="sidebar bg-white w-64 md:w-72 border-r border-gray-200 flex-shrink-0"> | |
| <div class="p-4 border-b border-gray-200"> | |
| <h1 class="text-2xl font-bold text-primary flex items-center"> | |
| <i class="fas fa-cube mr-2"></i> | |
| <span>CRM Supabase</span> | |
| </h1> | |
| </div> | |
| <nav class="p-4"> | |
| <div class="mb-6"> | |
| <p class="text-xs uppercase text-gray-500 font-semibold mb-3">Principal</p> | |
| <ul> | |
| <li class="mb-2"> | |
| <a href="#" class="flex items-center p-2 text-primary bg-indigo-50 rounded-lg dashboard-link"> | |
| <i class="fas fa-tachometer-alt mr-3"></i> | |
| <span>Dashboard</span> | |
| </a> | |
| </li> | |
| <li class="mb-2"> | |
| <a href="#" class="flex items-center p-2 text-gray-600 hover:bg-gray-100 rounded-lg clients-link"> | |
| <i class="fas fa-users mr-3"></i> | |
| <span>Clientes</span> | |
| </a> | |
| </li> | |
| <li class="mb-2"> | |
| <a href="#" class="flex items-center p-2 text-gray-600 hover:bg-gray-100 rounded-lg leads-link"> | |
| <i class="fas fa-list-alt mr-3"></i> | |
| <span>Leads</span> | |
| </a> | |
| </li> | |
| <li class="mb-2"> | |
| <a href="#" class="flex items-center p-2 text-gray-600 hover:bg-gray-100 rounded-lg activities-link"> | |
| <i class="fas fa-calendar-alt mr-3"></i> | |
| <span>Actividades</span> | |
| </a> | |
| </li> | |
| <li class="mb-2"> | |
| <a href="#" class="flex items-center p-2 text-gray-600 hover:bg-gray-100 rounded-lg reports-link"> | |
| <i class="fas fa-chart-line mr-3"></i> | |
| <span>Reportes</span> | |
| </a> | |
| </li> | |
| </ul> | |
| </div> | |
| <div class="mb-6"> | |
| <p class="text-xs uppercase text-gray-500 font-semibold mb-3">Herramientas</p> | |
| <ul> | |
| <li class="mb-2"> | |
| <a href="#" class="flex items-center p-2 text-gray-600 hover:bg-gray-100 rounded-lg"> | |
| <i class="fas fa-envelope mr-3"></i> | |
| <span>Correos</span> | |
| </a> | |
| </li> | |
| <li class="mb-2"> | |
| <a href="#" class="flex items-center p-2 text-gray-600 hover:bg-gray-100 rounded-lg"> | |
| <i class="fas fa-file-invoice mr-3"></i> | |
| <span>Facturas</span> | |
| </a> | |
| </li> | |
| <li class="mb-2"> | |
| <a href="#" class="flex items-center p-2 text-gray-600 hover:bg-gray-100 rounded-lg settings-link"> | |
| <i class="fas fa-cog mr-3"></i> | |
| <span>Ajustes</span> | |
| </a> | |
| </li> | |
| </ul> | |
| </div> | |
| </nav> | |
| </div> | |
| <!-- Main Content --> | |
| <div class="flex-1 flex flex-col overflow-hidden"> | |
| <!-- Top Navigation --> | |
| <header class="bg-white border-b border-gray-200 py-4 px-6 flex items-center justify-between"> | |
| <div class="flex items-center"> | |
| <button id="sidebarToggle" class="text-gray-500 mr-4 md:hidden"> | |
| <i class="fas fa-bars text-xl"></i> | |
| </button> | |
| <h2 id="pageTitle" class="text-xl font-semibold text-gray-800">Dashboard</h2> | |
| </div> | |
| <div class="flex items-center space-x-4"> | |
| <div class="relative"> | |
| <button class="text-gray-500 hover:text-gray-700"> | |
| <i class="fas fa-bell text-xl"></i> | |
| <span class="absolute top-0 right-0 h-2 w-2 rounded-full bg-red-500"></span> | |
| </button> | |
| </div> | |
| <div class="relative"> | |
| <button class="text-gray-500 hover:text-gray-700"> | |
| <i class="fas fa-envelope text-xl"></i> | |
| <span class="absolute top-0 right-0 h-2 w-2 rounded-full bg-blue-500"></span> | |
| </button> | |
| </div> | |
| <div class="flex items-center"> | |
| <img id="userAvatar" src="https://randomuser.me/api/portraits/women/44.jpg" alt="User" class="h-8 w-8 rounded-full mr-2"> | |
| <span id="userName" class="text-gray-700 font-medium">Cargando...</span> | |
| <button id="logoutBtn" class="ml-4 text-gray-500 hover:text-gray-700"> | |
| <i class="fas fa-sign-out-alt"></i> | |
| </button> | |
| </div> | |
| </div> | |
| </header> | |
| <!-- Main Content Area --> | |
| <main class="flex-1 overflow-y-auto p-6 bg-gray-50"> | |
| <!-- Dashboard View --> | |
| <div id="dashboardView"> | |
| <!-- Stats Cards --> | |
| <div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6 mb-6"> | |
| <div class="bg-white rounded-lg shadow p-6"> | |
| <div class="flex items-center justify-between"> | |
| <div> | |
| <p class="text-gray-500">Clientes totales</p> | |
| <h3 id="totalClients" class="text-2xl font-bold text-gray-800">Cargando...</h3> | |
| <p class="text-green-500 text-sm mt-1"><i class="fas fa-arrow-up mr-1"></i> <span id="clientGrowth">0%</span> desde el mes pasado</p> | |
| </div> | |
| <div class="bg-blue-100 p-3 rounded-full"> | |
| <i class="fas fa-users text-blue-600 text-xl"></i> | |
| </div> | |
| </div> | |
| </div> | |
| <div class="bg-white rounded-lg shadow p-6"> | |
| <div class="flex items-center justify-between"> | |
| <div> | |
| <p class="text-gray-500">Ventas este mes</p> | |
| <h3 id="monthlySales" class="text-2xl font-bold text-gray-800">Cargando...</h3> | |
| <p class="text-green-500 text-sm mt-1"><i class="fas fa-arrow-up mr-1"></i> <span id="salesGrowth">0%</span> desde el mes pasado</p> | |
| </div> | |
| <div class="bg-green-100 p-3 rounded-full"> | |
| <i class="fas fa-chart-line text-green-600 text-xl"></i> | |
| </div> | |
| </div> | |
| </div> | |
| <div class="bg-white rounded-lg shadow p-6"> | |
| <div class="flex items-center justify-between"> | |
| <div> | |
| <p class="text-gray-500">Tareas pendientes</p> | |
| <h3 id="pendingTasks" class="text-2xl font-bold text-gray-800">Cargando...</h3> | |
| <p class="text-red-500 text-sm mt-1"><i class="fas fa-arrow-down mr-1"></i> <span id="taskChange">0</span> desde ayer</p> | |
| </div> | |
| <div class="bg-yellow-100 p-3 rounded-full"> | |
| <i class="fas fa-tasks text-yellow-600 text-xl"></i> | |
| </div> | |
| </div> | |
| </div> | |
| <div class="bg-white rounded-lg shadow p-6"> | |
| <div class="flex items-center justify-between"> | |
| <div> | |
| <p class="text-gray-500">Nuevos leads</p> | |
| <h3 id="newLeads" class="text-2xl font-bold text-gray-800">Cargando...</h3> | |
| <p class="text-green-500 text-sm mt-1"><i class="fas fa-arrow-up mr-1"></i> <span id="leadGrowth">0%</span> desde ayer</p> | |
| </div> | |
| <div class="bg-purple-100 p-3 rounded-full"> | |
| <i class="fas fa-address-book text-purple-600 text-xl"></i> | |
| </div> | |
| </div> | |
| </div> | |
| </div> | |
| <!-- Charts and Recent Activity --> | |
| <div class="grid grid-cols-1 lg:grid-cols-3 gap-6 mb-6"> | |
| <!-- Sales Chart --> | |
| <div class="bg-white rounded-lg shadow p-6 lg:col-span-2"> | |
| <div class="flex items-center justify-between mb-4"> | |
| <h3 class="text-lg font-semibold text-gray-800">Ventas mensuales</h3> | |
| <div class="flex space-x-2"> | |
| <button class="px-3 py-1 text-xs bg-indigo-50 text-primary rounded">Mes</button> | |
| <button class="px-3 py-1 text-xs bg-gray-100 text-gray-600 rounded">Año</button> | |
| </div> | |
| </div> | |
| <div class="chart-container"> | |
| <canvas id="salesChart"></canvas> | |
| </div> | |
| </div> | |
| <!-- Recent Activity --> | |
| <div class="bg-white rounded-lg shadow p-6"> | |
| <h3 class="text-lg font-semibold text-gray-800 mb-4">Actividad reciente</h3> | |
| <div id="recentActivities" class="space-y-4"> | |
| <div class="animate-pulse flex items-start"> | |
| <div class="bg-gray-200 p-2 rounded-full mr-3"> | |
| <i class="fas fa-circle text-transparent text-sm"></i> | |
| </div> | |
| <div class="flex-1"> | |
| <div class="h-4 bg-gray-200 rounded w-3/4"></div> | |
| <div class="h-3 bg-gray-200 rounded w-1/2 mt-2"></div> | |
| </div> | |
| </div> | |
| <div class="animate-pulse flex items-start"> | |
| <div class="bg-gray-200 p-2 rounded-full mr-3"> | |
| <i class="fas fa-circle text-transparent text-sm"></i> | |
| </div> | |
| <div class="flex-1"> | |
| <div class="h-4 bg-gray-200 rounded w-3/4"></div> | |
| <div class="h-3 bg-gray-200 rounded w-1/2 mt-2"></div> | |
| </div> | |
| </div> | |
| </div> | |
| </div> | |
| </div> | |
| <!-- Recent Customers --> | |
| <div class="bg-white rounded-lg shadow overflow-hidden"> | |
| <div class="p-6 border-b border-gray-200 flex justify-between items-center"> | |
| <h3 class="text-lg font-semibold text-gray-800">Clientes recientes</h3> | |
| <button id="addClientBtn" class="px-4 py-2 bg-primary text-white rounded-lg text-sm font-medium hover:bg-indigo-700"> | |
| <i class="fas fa-plus mr-1"></i> Agregar cliente | |
| </button> | |
| </div> | |
| <div class="overflow-x-auto"> | |
| <table class="min-w-full divide-y divide-gray-200"> | |
| <thead class="bg-gray-50"> | |
| <tr> | |
| <th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Nombre</th> | |
| <th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Empresa</th> | |
| <th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Email</th> | |
| <th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Teléfono</th> | |
| <th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Estado</th> | |
| <th scope="col" class="px-6 py-3 text-right text-xs font-medium text-gray-500 uppercase tracking-wider">Acciones</th> | |
| </tr> | |
| </thead> | |
| <tbody id="clientsTableBody" class="bg-white divide-y divide-gray-200"> | |
| <!-- Los clientes se cargarán aquí dinámicamente --> | |
| </tbody> | |
| </table> | |
| </div> | |
| </div> | |
| </div> | |
| <!-- Clients View --> | |
| <div id="clientsView" class="hidden"> | |
| <div class="flex justify-between items-center mb-6"> | |
| <h2 class="text-2xl font-bold text-gray-800">Gestión de Clientes</h2> | |
| <button id="addClientBtn2" class="px-4 py-2 bg-primary text-white rounded-lg text-sm font-medium hover:bg-indigo-700"> | |
| <i class="fas fa-plus mr-1"></i> Agregar cliente | |
| </button> | |
| </div> | |
| <div class="bg-white rounded-lg shadow overflow-hidden"> | |
| <div class="p-4 border-b border-gray-200"> | |
| <div class="flex flex-col md:flex-row md:items-center md:justify-between"> | |
| <div class="mb-4 md:mb-0"> | |
| <div class="relative"> | |
| <div class="absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none"> | |
| <i class="fas fa-search text-gray-400"></i> | |
| </div> | |
| <input id="clientSearch" type="text" class="pl-10 pr-4 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-primary focus:border-transparent" placeholder="Buscar clientes..."> | |
| </div> | |
| </div> | |
| <div class="flex space-x-2"> | |
| <select id="clientStatusFilter" class="border border-gray-300 rounded-md px-3 py-2 focus:outline-none focus:ring-2 focus:ring-primary focus:border-transparent"> | |
| <option value="all">Todos los estados</option> | |
| <option value="active">Activo</option> | |
| <option value="inactive">Inactivo</option> | |
| <option value="prospect">Prospecto</option> | |
| </select> | |
| <button id="exportClientsBtn" class="px-4 py-2 bg-gray-100 text-gray-700 rounded-lg text-sm font-medium hover:bg-gray-200"> | |
| <i class="fas fa-download mr-1"></i> Exportar | |
| </button> | |
| </div> | |
| </div> | |
| </div> | |
| <div class="overflow-x-auto"> | |
| <table class="min-w-full divide-y divide-gray-200"> | |
| <thead class="bg-gray-50"> | |
| <tr> | |
| <th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Nombre</th> | |
| <th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Empresa</th> | |
| <th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Email</th> | |
| <th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Teléfono</th> | |
| <th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Valor</th> | |
| <th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Estado</th> | |
| <th scope="col" class="px-6 py-3 text-right text-xs font-medium text-gray-500 uppercase tracking-wider">Acciones</th> | |
| </tr> | |
| </thead> | |
| <tbody id="allClientsTableBody" class="bg-white divide-y divide-gray-200"> | |
| <!-- Todos los clientes se cargarán aquí dinámicamente --> | |
| </tbody> | |
| </table> | |
| </div> | |
| <div class="px-6 py-4 border-t border-gray-200 flex items-center justify-between"> | |
| <div class="text-sm text-gray-500"> | |
| Mostrando <span id="clientStart">1</span> a <span id="clientEnd">10</span> de <span id="clientTotal">0</span> clientes | |
| </div> | |
| <div class="flex space-x-2"> | |
| <button id="clientPrevPage" class="px-3 py-1 border border-gray-300 rounded-md text-sm font-medium text-gray-700 bg-white hover:bg-gray-50"> | |
| Anterior | |
| </button> | |
| <button id="clientNextPage" class="px-3 py-1 border border-gray-300 rounded-md text-sm font-medium text-gray-700 bg-white hover:bg-gray-50"> | |
| Siguiente | |
| </button> | |
| </div> | |
| </div> | |
| </div> | |
| </div> | |
| <!-- Leads View --> | |
| <div id="leadsView" class="hidden"> | |
| <div class="flex justify-between items-center mb-6"> | |
| <h2 class="text-2xl font-bold text-gray-800">Gestión de Leads</h2> | |
| <button id="addLeadBtn" class="px-4 py-2 bg-primary text-white rounded-lg text-sm font-medium hover:bg-indigo-700"> | |
| <i class="fas fa-plus mr-1"></i> Agregar lead | |
| </button> | |
| </div> | |
| <div class="grid grid-cols-1 md:grid-cols-4 gap-4 mb-6"> | |
| <div class="bg-white rounded-lg shadow p-4"> | |
| <div class="flex items-center justify-between"> | |
| <div> | |
| <p class="text-sm text-gray-500">Nuevos</p> | |
| <h3 id="newLeadsCount" class="text-xl font-bold text-gray-800">0</h3> | |
| </div> | |
| <div class="bg-blue-100 p-2 rounded-full"> | |
| <i class="fas fa-plus-circle text-blue-600"></i> | |
| </div> | |
| </div> | |
| </div> | |
| <div class="bg-white rounded-lg shadow p-4"> | |
| <div class="flex items-center justify-between"> | |
| <div> | |
| <p class="text-sm text-gray-500">En contacto</p> | |
| <h3 id="contactedLeadsCount" class="text-xl font-bold text-gray-800">0</h3> | |
| </div> | |
| <div class="bg-yellow-100 p-2 rounded-full"> | |
| <i class="fas fa-comments text-yellow-600"></i> | |
| </div> | |
| </div> | |
| </div> | |
| <div class="bg-white rounded-lg shadow p-4"> | |
| <div class="flex items-center justify-between"> | |
| <div> | |
| <p class="text-sm text-gray-500">Calificados</p> | |
| <h3 id="qualifiedLeadsCount" class="text-xl font-bold text-gray-800">0</h3> | |
| </div> | |
| <div class="bg-green-100 p-2 rounded-full"> | |
| <i class="fas fa-check-circle text-green-600"></i> | |
| </div> | |
| </div> | |
| </div> | |
| <div class="bg-white rounded-lg shadow p-4"> | |
| <div class="flex items-center justify-between"> | |
| <div> | |
| <p class="text-sm text-gray-500">Convertidos</p> | |
| <h3 id="convertedLeadsCount" class="text-xl font-bold text-gray-800">0</h3> | |
| </div> | |
| <div class="bg-purple-100 p-2 rounded-full"> | |
| <i class="fas fa-user-check text-purple-600"></i> | |
| </div> | |
| </div> | |
| </div> | |
| </div> | |
| <div class="bg-white rounded-lg shadow overflow-hidden"> | |
| <div class="p-4 border-b border-gray-200"> | |
| <div class="flex flex-col md:flex-row md:items-center md:justify-between"> | |
| <div class="mb-4 md:mb-0"> | |
| <div class="relative"> | |
| <div class="absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none"> | |
| <i class="fas fa-search text-gray-400"></i> | |
| </div> | |
| <input id="leadSearch" type="text" class="pl-10 pr-4 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-primary focus:border-transparent" placeholder="Buscar leads..."> | |
| </div> | |
| </div> | |
| <div class="flex space-x-2"> | |
| <select id="leadStatusFilter" class="border border-gray-300 rounded-md px-3 py-2 focus:outline-none focus:ring-2 focus:ring-primary focus:border-transparent"> | |
| <option value="all">Todos los estados</option> | |
| <option value="new">Nuevo</option> | |
| <option value="contacted">En contacto</option> | |
| <option value="qualified">Calificado</option> | |
| <option value="converted">Convertido</option> | |
| <option value="lost">Perdido</option> | |
| </select> | |
| <select id="leadSourceFilter" class="border border-gray-300 rounded-md px-3 py-2 focus:outline-none focus:ring-2 focus:ring-primary focus:border-transparent"> | |
| <option value="all">Todas las fuentes</option> | |
| <option value="web">Sitio web</option> | |
| <option value="social">Redes sociales</option> | |
| <option value="referral">Referencia</option> | |
| <option value="event">Evento</option> | |
| <option value="other">Otro</option> | |
| </select> | |
| </div> | |
| </div> | |
| </div> | |
| <div class="overflow-x-auto"> | |
| <table class="min-w-full divide-y divide-gray-200"> | |
| <thead class="bg-gray-50"> | |
| <tr> | |
| <th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Nombre</th> | |
| <th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Empresa</th> | |
| <th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Email</th> | |
| <th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Teléfono</th> | |
| <th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Fuente</th> | |
| <th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Estado</th> | |
| <th scope="col" class="px-6 py-3 text-right text-xs font-medium text-gray-500 uppercase tracking-wider">Acciones</th> | |
| </tr> | |
| </thead> | |
| <tbody id="leadsTableBody" class="bg-white divide-y divide-gray-200"> | |
| <!-- Los leads se cargarán aquí dinámicamente --> | |
| </tbody> | |
| </table> | |
| </div> | |
| <div class="px-6 py-4 border-t border-gray-200 flex items-center justify-between"> | |
| <div class="text-sm text-gray-500"> | |
| Mostrando <span id="leadStart">1</span> a <span id="leadEnd">10</span> de <span id="leadTotal">0</span> leads | |
| </div> | |
| <div class="flex space-x-2"> | |
| <button id="leadPrevPage" class="px-3 py-1 border border-gray-300 rounded-md text-sm font-medium text-gray-700 bg-white hover:bg-gray-50"> | |
| Anterior | |
| </button> | |
| <button id="leadNextPage" class="px-3 py-1 border border-gray-300 rounded-md text-sm font-medium text-gray-700 bg-white hover:bg-gray-50"> | |
| Siguiente | |
| </button> | |
| </div> | |
| </div> | |
| </div> | |
| </div> | |
| <!-- Activities View --> | |
| <div id="activitiesView" class="hidden"> | |
| <div class="flex justify-between items-center mb-6"> | |
| <h2 class="text-2xl font-bold text-gray-800">Actividades</h2> | |
| <button id="addActivityBtn" class="px-4 py-2 bg-primary text-white rounded-lg text-sm font-medium hover:bg-indigo-700"> | |
| <i class="fas fa-plus mr-1"></i> Agregar actividad | |
| </button> | |
| </div> | |
| <div class="grid grid-cols-1 lg:grid-cols-3 gap-6"> | |
| <div class="lg:col-span-2"> | |
| <div class="bg-white rounded-lg shadow overflow-hidden"> | |
| <div class="p-4 border-b border-gray-200"> | |
| <div class="flex items-center justify-between"> | |
| <h3 class="text-lg font-semibold text-gray-800">Calendario</h3> | |
| <div class="flex space-x-2"> | |
| <button id="prevMonth" class="p-1 rounded-full hover:bg-gray-100"> | |
| <i class="fas fa-chevron-left"></i> | |
| </button> | |
| <button id="nextMonth" class="p-1 rounded-full hover:bg-gray-100"> | |
| <i class="fas fa-chevron-right"></i> | |
| </button> | |
| </div> | |
| </div> | |
| </div> | |
| <div class="p-4"> | |
| <div id="calendar" class="grid grid-cols-7 gap-1"> | |
| <!-- Calendar will be generated here --> | |
| </div> | |
| </div> | |
| </div> | |
| </div> | |
| <div> | |
| <div class="bg-white rounded-lg shadow overflow-hidden"> | |
| <div class="p-4 border-b border-gray-200"> | |
| <h3 class="text-lg font-semibold text-gray-800">Actividades de hoy</h3> | |
| </div> | |
| <div id="todayActivities" class="divide-y divide-gray-200"> | |
| <!-- Today's activities will be loaded here --> | |
| <div class="p-4 text-center text-gray-500"> | |
| No hay actividades programadas para hoy | |
| </div> | |
| </div> | |
| </div> | |
| </div> | |
| </div> | |
| </div> | |
| <!-- Reports View --> | |
| <div id="reportsView" class="hidden"> | |
| <div class="mb-6"> | |
| <h2 class="text-2xl font-bold text-gray-800">Reportes y Análisis</h2> | |
| <p class="text-gray-600">Visualiza el rendimiento de tu equipo y tus clientes</p> | |
| </div> | |
| <div class="grid grid-cols-1 lg:grid-cols-2 gap-6 mb-6"> | |
| <div class="bg-white rounded-lg shadow p-6"> | |
| <div class="flex items-center justify-between mb-4"> | |
| <h3 class="text-lg font-semibold text-gray-800">Conversión de Leads</h3> | |
| <select id="leadConversionPeriod" class="border border-gray-300 rounded-md px-3 py-1 text-sm focus:outline-none focus:ring-2 focus:ring-primary focus:border-transparent"> | |
| <option value="week">Esta semana</option> | |
| <option value="month">Este mes</option> | |
| <option value="quarter">Este trimestre</option> | |
| <option value="year">Este año</option> | |
| </select> | |
| </div> | |
| <div class="chart-container"> | |
| <canvas id="leadConversionChart"></canvas> | |
| </div> | |
| </div> | |
| <div class="bg-white rounded-lg shadow p-6"> | |
| <div class="flex items-center justify-between mb-4"> | |
| <h3 class="text-lg font-semibold text-gray-800">Ventas por Vendedor</h3> | |
| <select id="salesByRepPeriod" class="border border-gray-300 rounded-md px-3 py-1 text-sm focus:outline-none focus:ring-2 focus:ring-primary focus:border-transparent"> | |
| <option value="week">Esta semana</option> | |
| <option value="month">Este mes</option> | |
| <option value="quarter">Este trimestre</option> | |
| <option value="year">Este año</option> | |
| </select> | |
| </div> | |
| <div class="chart-container"> | |
| <canvas id="salesByRepChart"></canvas> | |
| </div> | |
| </div> | |
| </div> | |
| <div class="bg-white rounded-lg shadow p-6 mb-6"> | |
| <div class="flex items-center justify-between mb-4"> | |
| <h3 class="text-lg font-semibold text-gray-800">Tendencias de Ventas</h3> | |
| <select id="salesTrendsPeriod" class="border border-gray-300 rounded-md px-3 py-1 text-sm focus:outline-none focus:ring-2 focus:ring-primary focus:border-transparent"> | |
| <option value="month">Últimos 6 meses</option> | |
| <option value="quarter">Últimos 4 trimestres</option> | |
| <option value="year">Últimos 3 años</option> | |
| </select> | |
| </div> | |
| <div class="chart-container"> | |
| <canvas id="salesTrendsChart"></canvas> | |
| </div> | |
| </div> | |
| <div class="grid grid-cols-1 md:grid-cols-2 gap-6"> | |
| <div class="bg-white rounded-lg shadow p-6"> | |
| <h3 class="text-lg font-semibold text-gray-800 mb-4">Clientes por Industria</h3> | |
| <div class="chart-container"> | |
| <canvas id="clientsByIndustryChart"></canvas> | |
| </div> | |
| </div> | |
| <div class="bg-white rounded-lg shadow p-6"> | |
| <h3 class="text-lg font-semibold text-gray-800 mb-4">Fuentes de Leads</h3> | |
| <div class="chart-container"> | |
| <canvas id="leadSourcesChart"></canvas> | |
| </div> | |
| </div> | |
| </div> | |
| </div> | |
| <!-- Settings View --> | |
| <div id="settingsView" class="hidden"> | |
| <div class="mb-6"> | |
| <h2 class="text-2xl font-bold text-gray-800">Configuración</h2> | |
| <p class="text-gray-600">Administra la configuración de tu cuenta y preferencias</p> | |
| </div> | |
| <div class="bg-white rounded-lg shadow overflow-hidden"> | |
| <div class="border-b border-gray-200"> | |
| <nav class="flex -mb-px"> | |
| <button data-tab="profile" class="tab-button py-4 px-6 text-center border-b-2 font-medium text-sm border-primary text-primary"> | |
| Perfil | |
| </button> | |
| <button data-tab="account" class="tab-button py-4 px-6 text-center border-b-2 font-medium text-sm border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300"> | |
| Cuenta | |
| </button> | |
| <button data-tab="team" class="tab-button py-4 px-6 text-center border-b-2 font-medium text-sm border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300"> | |
| Equipo | |
| </button> | |
| <button data-tab="notifications" class="tab-button py-4 px-6 text-center border-b-2 font-medium text-sm border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300"> | |
| Notificaciones | |
| </button> | |
| </nav> | |
| </div> | |
| <!-- Profile Tab --> | |
| <div id="profileTab" class="tab-content p-6"> | |
| <div class="md:grid md:grid-cols-3 md:gap-6"> | |
| <div class="md:col-span-1"> | |
| <h3 class="text-lg font-medium leading-6 text-gray-900">Información Personal</h3> | |
| <p class="mt-1 text-sm text-gray-500">Actualiza tu información personal y foto de perfil.</p> | |
| </div> | |
| <div class="mt-5 md:mt-0 md:col-span-2"> | |
| <form> | |
| <div class="shadow overflow-hidden sm:rounded-md"> | |
| <div class="px-4 py-5 bg-white sm:p-6"> | |
| <div class="grid grid-cols-6 gap-6"> | |
| <div class="col-span-6 sm:col-span-3"> | |
| <label for="first-name" class="block text-sm font-medium text-gray-700">Nombre</label> | |
| <input type="text" name="first-name" id="first-name" autocomplete="given-name" class="mt-1 focus:ring-primary focus:border-primary block w-full shadow-sm sm:text-sm border-gray-300 rounded-md"> | |
| </div> | |
| <div class="col-span-6 sm:col-span-3"> | |
| <label for="last-name" class="block text-sm font-medium text-gray-700">Apellido</label> | |
| <input type="text" name="last-name" id="last-name" autocomplete="family-name" class="mt-1 focus:ring-primary focus:border-primary block w-full shadow-sm sm:text-sm border-gray-300 rounded-md"> | |
| </div> | |
| <div class="col-span-6 sm:col-span-4"> | |
| <label for="email-address" class="block text-sm font-medium text-gray-700">Email</label> | |
| <input type="text" name="email-address" id="email-address" autocomplete="email" class="mt-1 focus:ring-primary focus:border-primary block w-full shadow-sm sm:text-sm border-gray-300 rounded-md"> | |
| </div> | |
| <div class="col-span-6 sm:col-span-4"> | |
| <label for="phone" class="block text-sm font-medium text-gray-700">Teléfono</label> | |
| <input type="text" name="phone" id="phone" autocomplete="tel" class="mt-1 focus:ring-primary focus:border-primary block w-full shadow-sm sm:text-sm border-gray-300 rounded-md"> | |
| </div> | |
| <div class="col-span-6"> | |
| <label class="block text-sm font-medium text-gray-700">Foto</label> | |
| <div class="mt-1 flex items-center"> | |
| <span class="inline-block h-12 w-12 rounded-full overflow-hidden bg-gray-100"> | |
| <img id="profileImage" src="https://randomuser.me/api/portraits/women/44.jpg" alt="" class="h-full w-full text-gray-300"> | |
| </span> | |
| <button type="button" class="ml-5 bg-white py-2 px-3 border border-gray-300 rounded-md shadow-sm text-sm leading-4 font-medium text-gray-700 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-primary"> | |
| Cambiar | |
| </button> | |
| </div> | |
| </div> | |
| </div> | |
| </div> | |
| <div class="px-4 py-3 bg-gray-50 text-right sm:px-6"> | |
| <button type="submit" class="inline-flex justify-center py-2 px-4 border border-transparent shadow-sm text-sm font-medium rounded-md text-white bg-primary hover:bg-indigo-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-primary"> | |
| Guardar | |
| </button> | |
| </div> | |
| </div> | |
| </form> | |
| </div> | |
| </div> | |
| </div> | |
| <!-- Account Tab --> | |
| <div id="accountTab" class="tab-content hidden p-6"> | |
| <div class="md:grid md:grid-cols-3 md:gap-6"> | |
| <div class="md:col-span-1"> | |
| <h3 class="text-lg font-medium leading-6 text-gray-900">Configuración de Cuenta</h3> | |
| <p class="mt-1 text-sm text-gray-500">Actualiza tu información de cuenta y preferencias.</p> | |
| </div> | |
| <div class="mt-5 md:mt-0 md:col-span-2"> | |
| <form> | |
| <div class="shadow overflow-hidden sm:rounded-md"> | |
| <div class="px-4 py-5 bg-white sm:p-6"> | |
| <div class="grid grid-cols-6 gap-6"> | |
| <div class="col-span-6 sm:col-span-3"> | |
| <label for="language" class="block text-sm font-medium text-gray-700">Idioma</label> | |
| <select id="language" name="language" autocomplete="language" class="mt-1 block w-full py-2 px-3 border border-gray-300 bg-white rounded-md shadow-sm focus:outline-none focus:ring-primary focus:border-primary sm:text-sm"> | |
| <option>Español</option> | |
| <option>Inglés</option> | |
| <option>Francés</option> | |
| </select> | |
| </div> | |
| <div class="col-span-6 sm:col-span-3"> | |
| <label for="timezone" class="block text-sm font-medium text-gray-700">Zona horaria</label> | |
| <select id="timezone" name="timezone" autocomplete="timezone" class="mt-1 block w-full py-2 px-3 border border-gray-300 bg-white rounded-md shadow-sm focus:outline-none focus:ring-primary focus:border-primary sm:text-sm"> | |
| <option>UTC-05:00 (Bogotá, Lima)</option> | |
| <option>UTC-03:00 (Buenos Aires)</option> | |
| <option>UTC-06:00 (Ciudad de México)</option> | |
| </select> | |
| </div> | |
| <div class="col-span-6 sm:col-span-4"> | |
| <label for="current-password" class="block text-sm font-medium text-gray-700">Contraseña actual</label> | |
| <input type="password" name="current-password" id="current-password" autocomplete="current-password" class="mt-1 focus:ring-primary focus:border-primary block w-full shadow-sm sm:text-sm border-gray-300 rounded-md"> | |
| </div> | |
| <div class="col-span-6 sm:col-span-3"> | |
| <label for="new-password" class="block text-sm font-medium text-gray-700">Nueva contraseña</label> | |
| <input type="password | |
| </html> |