Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
bobimicroweber committed Apr 26, 2024
1 parent 3ba3f1e commit c9ee806
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
8 changes: 8 additions & 0 deletions web/app/Filament/Pages/Modules.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,14 @@ public function getInstallLog()
}
}

public function openUnistallModal($module)
{
$findModule = Module::where('name', $module)->first();
if ($findModule) {
$findModule->delete();
}
}

public function openInstallModal($module)
{
$this->installModule = $module;
Expand Down
4 changes: 2 additions & 2 deletions web/resources/views/filament/pages/modules.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ class="w-12 h-12 text-primary-500"/>
</x-slot>

<x-filament::dropdown.list>
<x-filament::dropdown.list.item wire:click="openInstallModal('{{$module['name']}}')">
<x-filament::dropdown.list.item wire:key="btn-install-modal-{{md5($module['name'])}}" wire:click="openInstallModal('{{$module['name']}}')">
<div class="flex gap-2 items-center">
<svg xmlns="http://www.w3.org/2000/svg" class="w-6 h-6" viewBox="0 0 24 24">
<path fill="currentColor" d="M11 2v5H8l4 4l4-4h-3V2h7a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V3a1 1 0 0 1 1-1zm8 14H5v4h14zm-2 1v2h-2v-2z"></path>
Expand All @@ -84,7 +84,7 @@ class="w-12 h-12 text-primary-500"/>
</div>
</x-filament::dropdown.list.item>
@if ($module['installed'])
<x-filament::dropdown.list.item wire:click="openUnistallModal('{{$module['name']}}')">
<x-filament::dropdown.list.item wire:key="btn-unistall-modal-{{md5($module['name'])}}" wire:click="openUnistallModal('{{$module['name']}}')">
<div class="flex gap-2 items-center">
<svg xmlns="http://www.w3.org/2000/svg" class="w-6 h-6" viewBox="0 0 24 24">
<path fill="currentColor" d="M7.615 20q-.69 0-1.152-.462T6 18.385V6H5V5h4v-.77h6V5h4v1h-1v12.385q0 .69-.462 1.152T16.385 20zm2.193-3h1V8h-1zm3.384 0h1V8h-1z"></path>
Expand Down

0 comments on commit c9ee806

Please sign in to comment.