diff --git a/app/Livewire/Admin/Client/DeleteClient.php b/app/Livewire/Admin/Client/DeleteClient.php index 85b722f..e1ad1f6 100644 --- a/app/Livewire/Admin/Client/DeleteClient.php +++ b/app/Livewire/Admin/Client/DeleteClient.php @@ -19,7 +19,6 @@ public function deleteClient($payload) } $this->dispatch('client-deleted'); - // (Opcional) Envia uma notificação de sucesso $this->dispatch('notify', message: 'Cliente excluído com sucesso!'); } diff --git a/app/Livewire/Admin/Client/DetailClient.php b/app/Livewire/Admin/Client/DetailClient.php new file mode 100644 index 0000000..5a905c2 --- /dev/null +++ b/app/Livewire/Admin/Client/DetailClient.php @@ -0,0 +1,30 @@ +client = Client::findOrFail($id); + $decryptedPassword = Crypt::decryptString($this->client->root_password); + $this->client->root_password = $decryptedPassword; + + } + + public function render() + { + return view('livewire.admin.clients.detail-client'); + } +} diff --git a/app/Livewire/Admin/Client/EditClient.php b/app/Livewire/Admin/Client/EditClient.php index 811ee00..0dc71da 100644 --- a/app/Livewire/Admin/Client/EditClient.php +++ b/app/Livewire/Admin/Client/EditClient.php @@ -21,8 +21,6 @@ class EditClient extends Component // public ClientService $clientService; #[On('update-client')] - - public function loadClient($id) { try { diff --git a/app/Models/Client.php b/app/Models/Client.php index 8ca4daf..3ccf58e 100644 --- a/app/Models/Client.php +++ b/app/Models/Client.php @@ -28,6 +28,9 @@ class Client extends Model 'carrier', 'access_type', 'server_ip', + 'port', + 'ddr_key', + 'ddr_out', 'root_password', // Lembre-se de criptografar isso! 'has_call_center', 'has_voice_gateway', @@ -35,8 +38,18 @@ class Client extends Model 'modules', 'whatsapp_number', 'whatsapp_activation_date', + 'observation', ]; + /* + + - Número chave, número de saída + - Credenciais de acesso VPN + - Anexos + - Porta de acesso + + */ + /** * Os atributos que devem ser convertidos para tipos nativos. * diff --git a/app/Services/ClientService.php b/app/Services/ClientService.php index 11d53c8..aabe59c 100644 --- a/app/Services/ClientService.php +++ b/app/Services/ClientService.php @@ -25,4 +25,10 @@ public function updateClient(Client $client, $data) $data['name'] = $data['client_name']; return $client->update($data); } + + public function detailClient(Client $client) + { + //Detail method + return $client->all(); + } } diff --git a/database/migrations/0001_01_01_000000_create_users_table.php b/database/migrations/0001_01_01_000000_create_users_table.php index 3a6f800..e01ce60 100644 --- a/database/migrations/0001_01_01_000000_create_users_table.php +++ b/database/migrations/0001_01_01_000000_create_users_table.php @@ -12,7 +12,7 @@ public function up(): void { Schema::create('users', function (Blueprint $table) { - $table->id(); + $table->uuid('id')->primary(); $table->string('name'); $table->json('permissions')->nullable(); $table->string('email')->unique(); diff --git a/database/migrations/2025_11_06_142841_create_clients_table.php b/database/migrations/2025_11_06_142841_create_clients_table.php index ff53844..58a3fd8 100644 --- a/database/migrations/2025_11_06_142841_create_clients_table.php +++ b/database/migrations/2025_11_06_142841_create_clients_table.php @@ -12,45 +12,40 @@ public function up(): void { Schema::create('clients', function (Blueprint $table) { - // 1. Alterado de $table->id() para $table->uuid() - $table->uuid('id')->primary(); + $table->uuid('id')->primary(); - // Informações de Cadastro - $table->string('name'); - $table->string('legal_name'); - $table->string('cnpj')->unique()->nullable(); - - // 2. Adicionado o path da imagem - $table->string('profile_image_path')->nullable(); // "path da imagem do cliente" + $table->string('name'); + $table->string('legal_name'); + $table->string('cnpj')->unique()->nullable(); + + $table->string('profile_image_path')->nullable(); // Informações Técnicas - $table->string('pbx_hosting')->nullable(); - $table->date('activation_date')->nullable(); - $table->string('carrier')->nullable(); - $table->string('access_type')->nullable(); - $table->ipAddress('server_ip')->nullable(); - $table->text('root_password')->nullable(); + $table->string('pbx_hosting')->nullable(); + $table->date('activation_date')->nullable(); + $table->string('carrier')->nullable(); + $table->string('access_type')->nullable(); + $table->ipAddress('server_ip')->nullable(); + $table->text('root_password')->nullable(); + $table->text('ddr_out')->nullable(); + $table->text('ddr_key')->nullable(); + $table->longText('observation')->nullable(); - // Módulos e Features - $table->boolean('has_call_center')->default(false); - $table->boolean('has_voice_gateway')->default(false); - $table->boolean('has_fop2')->default(false); + $table->boolean('has_call_center')->default(false); + $table->boolean('has_voice_gateway')->default(false); + $table->boolean('has_fop2')->default(false); - // Módulos - $table->json('modules')->nullable(); - $table->string('whatsapp_number')->nullable(); - $table->date('whatsapp_activation_date')->nullable(); + $table->json('modules')->nullable(); + $table->string('whatsapp_number')->nullable(); + $table->date('whatsapp_activation_date')->nullable(); $table->timestamps(); $table->softDeletes(); }); } - /** - * Reverse the migrations. - */ public function down(): void { Schema::dropIfExists('clients'); } -}; \ No newline at end of file +}; diff --git a/resources/views/dashboard.blade.php b/resources/views/dashboard.blade.php index 9060843..5faa88e 100644 --- a/resources/views/dashboard.blade.php +++ b/resources/views/dashboard.blade.php @@ -8,6 +8,7 @@ + diff --git a/resources/views/layouts/app.blade.php b/resources/views/layouts/app.blade.php index 4b99110..5b14c93 100644 --- a/resources/views/layouts/app.blade.php +++ b/resources/views/layouts/app.blade.php @@ -76,6 +76,12 @@ + + + VPN's + + + @endauth diff --git a/resources/views/livewire/admin/clients/add-client.blade.php b/resources/views/livewire/admin/clients/add-client.blade.php index 4b62956..af17eb7 100644 --- a/resources/views/livewire/admin/clients/add-client.blade.php +++ b/resources/views/livewire/admin/clients/add-client.blade.php @@ -22,7 +22,7 @@ class="fixed inset-y-0 right-0 flex max-w-full pl-10" @click.away="showClientMod Adicionar Novo Cliente + class="rounded-md text-blue-400 hover:text-white cursor-pointer focus:outline-none focus:ring-2 focus:ring-white"> Fechar painel @@ -44,7 +44,7 @@ class="rounded-md text-blue-200 hover:text-white cursor-pointer focus:outline-no Nome Fantasia * + class="form-input" placeholder="Eletrônicos Mota"> @error('form.client_name') {{ $message }} @enderror @@ -52,14 +52,14 @@ class="text-red-500 text-sm">{{ $message }} Razão Social * + class="form-input" placeholder="Mota Germano Eletrônicos LTDA"> @error('form.legal_name') {{ $message }} @enderror + class="text-red-500 text-sm">{{ $message }} @enderror CNPJ * - + @error('form.cnpj') {{ $message }} @enderror @@ -73,7 +73,7 @@ class="text-sm text-blue-600 mt-1"> Enviando... @error('form.profile_image_path') {{ $message }} @enderror + class="text-red-500 text-sm">{{ $message }} @enderror @@ -94,37 +94,61 @@ class="form-input"> Operadora - + Tipo de Acesso + + + Número de saída chave + + + + Número de entrada chave + + + IP do Servidor + class="form-input" placeholder="10.0.0.1"> @error('form.server_ip') {{ $message }} @enderror + class="text-red-500 text-sm">{{ $message }} @enderror Senha (root) + class="form-input" placeholder="************"> + + Observações e Credenciais Internas + + Detalhes da Configuração, VPN, ou Notas + + @error('form.observation') {{ $message }} @enderror + + + + + + WhatsApp Número do WhatsApp + class="form-input" placeholder="(71) 3034-8350"> Data Ativação diff --git a/resources/views/livewire/admin/clients/detail-client.blade.php b/resources/views/livewire/admin/clients/detail-client.blade.php new file mode 100644 index 0000000..7cd5837 --- /dev/null +++ b/resources/views/livewire/admin/clients/detail-client.blade.php @@ -0,0 +1,197 @@ + + + + + + + + + + + + + Detalhes do cliente + + + Fechar painel + + + + + + + + @if($client) + + + + + Informações Principais + + + + Nome Fantasia + + + + Razão Social + + + + CNPJ + + + + Logo + + @if($client->profile_image_path) + + + + Abrir imagem + @else + Sem logo + @endif + + + + + + + + + Detalhes do Servidor PBX + + + Hospedagem PBX + + + + Data de Ativação + + + + Operadora + + + + Tipo de Acesso + + + + + Número de saída chave + + + + Número de entrada chave + + + + + IP do Servidor + + + + Senha (root) + + + + + + + + + + + + + + Observações e Credenciais Internas + + {{ $client->observation }} + + + + + + + WhatsApp + + + Número do WhatsApp + + + + Data Ativação WhatsApp + + + + + + + + + Módulos & Recursos + + + + has_call_center ? 'checked' : '' }} class="form-checkbox"> + Possui Call Center? + + + has_voice_gateway ? 'checked' : '' }} class="form-checkbox"> + Possui Gateway de Voz? + + + has_fop2 ? 'checked' : '' }} class="form-checkbox"> + Possui FOP2? + + + + + Módulos Adicionais (JSON) + {{ json_encode($client->modules, JSON_PRETTY_PRINT) }} + + + + + + + + @else + + + + Carregando... + + + @endif + + + + + Fechar + + + + + + + + \ No newline at end of file diff --git a/resources/views/livewire/admin/clients/edit-client.blade.php b/resources/views/livewire/admin/clients/edit-client.blade.php index b3641b5..144031d 100644 --- a/resources/views/livewire/admin/clients/edit-client.blade.php +++ b/resources/views/livewire/admin/clients/edit-client.blade.php @@ -22,7 +22,7 @@ class="fixed inset-y-0 right-0 flex max-w-full pl-10" @click.away="showEditClien Edição de cliente + class="rounded-md text-blue-400 hover:text-white cursor-pointer focus:outline-none focus:ring-2 focus:ring-white"> Fechar painel @@ -44,14 +44,14 @@ class="rounded-md text-blue-200 hover:text-white cursor-pointer focus:outline-no Nome Fantasia * + class="form-input" placeholder="Eletrônicos Mota"> @error('clientForm.client_name') {{ $message }} @enderror Razão Social * - @error('clientForm.legal_name') {{ $message }} @enderror @@ -59,7 +59,7 @@ class="text-red-500 text-sm">{{ $message }} @enderror CNPJ * - + @error('clientForm.cnpj') {{ $message }} @enderror @@ -94,37 +94,57 @@ class="form-input"> Operadora - + Tipo de Acesso + + Número de saída chave + + + + Número de entrada chave + + + IP do Servidor - @error('clientForm.server_ip') + @error('form.server_ip') {{ $message }} @enderror Senha (root) + class="form-input" placeholder="************"> + + Observações e Credenciais Internas + + Detalhes da Configuração, VPN, ou Notas + + @error('clientForm.observation') {{ $message }} @enderror + + + WhatsApp Número do WhatsApp + class="form-input" placeholder="(71) 3034-8350"> Data Ativação diff --git a/resources/views/livewire/admin/show-client.blade.php b/resources/views/livewire/admin/show-client.blade.php index c23f392..7561221 100644 --- a/resources/views/livewire/admin/show-client.blade.php +++ b/resources/views/livewire/admin/show-client.blade.php @@ -1,37 +1,37 @@ @foreach ($clients as $client) - - - - - - - - - - - - - - Ver Detalhes - - Editar - Cliente - Excluir Cliente - - - - + + + + - - {{ $client->name }} + + + + + + + + + Ver Detalhes + + Editar + Cliente + Excluir Cliente + + + + + {{ $client->name }} + + @endforeach \ No newline at end of file diff --git a/resources/views/livewire/admin/show-users.blade.php b/resources/views/livewire/admin/show-users.blade.php index ef699eb..467fb74 100644 --- a/resources/views/livewire/admin/show-users.blade.php +++ b/resources/views/livewire/admin/show-users.blade.php @@ -10,43 +10,43 @@ @forelse ($users as $user) - - - {{ $user->name }} - {{ $user->email }} - - - {{-- {{ ucfirst($user->permissions) }} --}} - Ativo + + + {{ $user->name }} + {{ $user->email }} + + + {{-- {{ $user->permissions }} --}} + Ativo - + - id }}' }); showUsers = false" - class="action-button text-blue-600 hover:text-blue-800 cursor-pointer" - title="Editar Usuário"> - - - - + id }}' }); showUsers = false" + class="action-button text-blue-600 hover:text-blue-800 cursor-pointer" + title="Editar Usuário"> + + + + - id }}', isUser: true }); showUsers = false" - class="action-button text-red-600 hover:text-red-800 cursor-pointer" - title="Excluir Usuário"> - - - - - + id }}', isUser: true }); showUsers = false" + class="action-button text-red-600 hover:text-red-800 cursor-pointer" + title="Excluir Usuário"> + + + + + @empty - Nenhum usuário cadastrado. + Nenhum usuário cadastrado. @endforelse
Nenhum usuário cadastrado.