diff --git a/resources/views/livewire/plugins/receipt.blade.php b/resources/views/livewire/plugins/receipt.blade.php index 043f566..4b98611 100644 --- a/resources/views/livewire/plugins/receipt.blade.php +++ b/resources/views/livewire/plugins/receipt.blade.php @@ -85,7 +85,7 @@ new class extends Component { if ($this->plugin->data_strategy === 'polling') { // Parse headers from polling_header string $headers = ['User-Agent' => 'usetrmnl/byos_laravel', 'Accept' => 'application/json']; - + if ($this->plugin->polling_header) { $headerLines = explode("\n", trim($this->plugin->polling_header)); foreach ($headerLines as $line) { @@ -99,7 +99,7 @@ new class extends Component { $response = Http::withHeaders($headers) ->get($this->plugin->polling_url) ->json(); - + $this->plugin->update(['data_payload' => $response]); $this->data_payload = json_encode($response); } @@ -141,7 +141,7 @@ new class extends Component { } $this->reset(['checked_devices', 'playlist_name', 'selected_weekdays', 'active_from', 'active_until', 'selected_playlist']); - Flux::modal('add-plugin')->close(); + Flux::modal('add-to-playlist')->close(); } public function getDevicePlaylists($deviceId) @@ -187,6 +187,13 @@ HTML; HTML; } + + public function deletePlugin(): void + { + abort_unless(auth()->user()->plugins->contains($this->plugin), 403); + $this->plugin->delete(); + $this->redirect(route('plugins.index')); + } } ?> @@ -195,12 +202,24 @@ HTML;

{{$plugin->name}}

- - Add to Playlist - + + + + Add to Playlist + + + + + + + Delete Plugin + + + +
- +
Add to Playlist @@ -261,6 +280,21 @@ HTML;
+ +
+ Delete {{ $plugin->name }}? +

This will remove this plugin from your account.

+
+ +
+ + + Cancel + + Delete plugin +
+
+

Settings

@@ -304,12 +338,12 @@ HTML;
-