mirror of
https://github.com/usetrmnl/byos_laravel.git
synced 2026-01-16 16:37:47 +00:00
chore: pint
This commit is contained in:
parent
a15645ad88
commit
d19a079b8a
30 changed files with 295 additions and 188 deletions
|
|
@ -4,12 +4,14 @@ use App\Jobs\GenerateScreenJob;
|
|||
use Illuminate\Support\Collection;
|
||||
use Livewire\Component;
|
||||
|
||||
new class extends Component {
|
||||
|
||||
new class extends Component
|
||||
{
|
||||
public string $blade_code = '';
|
||||
|
||||
public bool $isLoading = false;
|
||||
|
||||
public Collection $devices;
|
||||
|
||||
public array $checked_devices;
|
||||
|
||||
public function mount()
|
||||
|
|
@ -17,17 +19,16 @@ new class extends Component {
|
|||
$this->devices = auth()->user()->devices->pluck('id', 'name');
|
||||
}
|
||||
|
||||
|
||||
public function submit()
|
||||
{
|
||||
$this->isLoading = true;
|
||||
|
||||
$this->validate([
|
||||
'checked_devices' => 'required|array',
|
||||
'blade_code' => 'required|string'
|
||||
'blade_code' => 'required|string',
|
||||
]);
|
||||
|
||||
//only devices that are owned by the user
|
||||
// only devices that are owned by the user
|
||||
$this->checked_devices = array_intersect($this->checked_devices, auth()->user()->devices->pluck('id')->toArray());
|
||||
|
||||
try {
|
||||
|
|
@ -35,7 +36,7 @@ new class extends Component {
|
|||
foreach ($this->checked_devices as $device) {
|
||||
GenerateScreenJob::dispatchSync($device, null, $rendered);
|
||||
}
|
||||
} catch (\Exception $e) {
|
||||
} catch (Exception $e) {
|
||||
$this->addError('generate_screen', $e->getMessage());
|
||||
}
|
||||
|
||||
|
|
@ -66,7 +67,7 @@ new class extends Component {
|
|||
|
||||
public function renderHelloWorld(): string
|
||||
{
|
||||
return <<<HTML
|
||||
return <<<'HTML'
|
||||
<x-trmnl::screen>
|
||||
<x-trmnl::view>
|
||||
<x-trmnl::layout>
|
||||
|
|
@ -84,7 +85,7 @@ HTML;
|
|||
|
||||
public function renderQuote(): string
|
||||
{
|
||||
return <<<HTML
|
||||
return <<<'HTML'
|
||||
<x-trmnl::screen>
|
||||
<x-trmnl::view>
|
||||
<x-trmnl::layout>
|
||||
|
|
@ -102,7 +103,7 @@ HTML;
|
|||
|
||||
public function renderTrainMonitor()
|
||||
{
|
||||
return <<<HTML
|
||||
return <<<'HTML'
|
||||
<x-trmnl::screen>
|
||||
<x-trmnl::view>
|
||||
<x-trmnl::layout>
|
||||
|
|
@ -136,7 +137,7 @@ HTML;
|
|||
|
||||
public function renderHomeAssistant()
|
||||
{
|
||||
return <<<HTML
|
||||
return <<<'HTML'
|
||||
<x-trmnl::screen>
|
||||
<x-trmnl::view>
|
||||
<x-trmnl::layout class="layout--col gap--space-between">
|
||||
|
|
@ -162,8 +163,6 @@ HTML;
|
|||
HTML;
|
||||
|
||||
}
|
||||
|
||||
|
||||
};
|
||||
?>
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue