mirror of
https://github.com/usetrmnl/byos_laravel.git
synced 2026-03-15 12:53:29 +00:00
Compare commits
No commits in common. "e9037ef5d70a04077e9b6de0e5d56e9b6d9f825e" and "b7bcaf6febff778eb4e1099fc7de0653f0774cb7" have entirely different histories.
e9037ef5d7
...
b7bcaf6feb
4 changed files with 9 additions and 34 deletions
2
.github/workflows/docker-build.yml
vendored
2
.github/workflows/docker-build.yml
vendored
|
|
@ -43,7 +43,7 @@ jobs:
|
||||||
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
|
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
|
||||||
tags: |
|
tags: |
|
||||||
type=ref,event=tag
|
type=ref,event=tag
|
||||||
type=raw,value=latest,enable=${{ !github.event.release.prerelease }}
|
type=raw,value=latest,enable=${{ github.event.release.prerelease == false }}
|
||||||
|
|
||||||
- name: Build and push Docker image
|
- name: Build and push Docker image
|
||||||
uses: docker/build-push-action@v6
|
uses: docker/build-push-action@v6
|
||||||
|
|
|
||||||
|
|
@ -135,13 +135,10 @@ class PlaylistItem extends Model
|
||||||
/**
|
/**
|
||||||
* Render all plugins with appropriate layout
|
* Render all plugins with appropriate layout
|
||||||
*/
|
*/
|
||||||
public function render(?Device $device = null): string
|
public function render(): string
|
||||||
{
|
{
|
||||||
if (! $this->isMashup()) {
|
if (! $this->isMashup()) {
|
||||||
return view('trmnl-layouts.single', [
|
return view('trmnl-layouts.single', [
|
||||||
'colorDepth' => $device?->deviceModel?->color_depth,
|
|
||||||
'deviceVariant' => $device?->deviceModel?->name ?? 'og',
|
|
||||||
'scaleLevel' => $device?->deviceModel?->scale_level,
|
|
||||||
'slot' => $this->plugin instanceof Plugin
|
'slot' => $this->plugin instanceof Plugin
|
||||||
? $this->plugin->render('full', false)
|
? $this->plugin->render('full', false)
|
||||||
: throw new Exception('Invalid plugin instance'),
|
: throw new Exception('Invalid plugin instance'),
|
||||||
|
|
@ -163,9 +160,6 @@ class PlaylistItem extends Model
|
||||||
}
|
}
|
||||||
|
|
||||||
return view('trmnl-layouts.mashup', [
|
return view('trmnl-layouts.mashup', [
|
||||||
'colorDepth' => $device?->deviceModel?->color_depth,
|
|
||||||
'deviceVariant' => $device?->deviceModel?->name ?? 'og',
|
|
||||||
'scaleLevel' => $device?->deviceModel?->scale_level,
|
|
||||||
'mashupLayout' => $this->getMashupLayoutType(),
|
'mashupLayout' => $this->getMashupLayoutType(),
|
||||||
'slot' => implode('', $pluginMarkups),
|
'slot' => implode('', $pluginMarkups),
|
||||||
])->render();
|
])->render();
|
||||||
|
|
|
||||||
|
|
@ -343,22 +343,12 @@ class Plugin extends Model
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($standalone) {
|
if ($standalone) {
|
||||||
if ($size === 'full') {
|
|
||||||
return view('trmnl-layouts.single', [
|
return view('trmnl-layouts.single', [
|
||||||
'colorDepth' => $device?->deviceModel?->color_depth,
|
'colorDepth' => $device?->deviceModel?->color_depth,
|
||||||
'deviceVariant' => $device?->deviceModel?->name ?? 'og',
|
'deviceVariant' => $device?->deviceModel?->name ?? 'og',
|
||||||
'scaleLevel' => $device?->deviceModel?->scale_level,
|
'scaleLevel' => $device?->deviceModel?->scale_level,
|
||||||
'slot' => $renderedContent,
|
'slot' => $renderedContent,
|
||||||
])->render();
|
])->render();
|
||||||
} else {
|
|
||||||
return view('trmnl-layouts.mashup', [
|
|
||||||
'mashupLayout' => $this->getPreviewMashupLayoutForSize($size),
|
|
||||||
'colorDepth' => $device?->deviceModel?->color_depth,
|
|
||||||
'deviceVariant' => $device?->deviceModel?->name ?? 'og',
|
|
||||||
'scaleLevel' => $device?->deviceModel?->scale_level,
|
|
||||||
'slot' => $renderedContent,
|
|
||||||
])->render();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return $renderedContent;
|
return $renderedContent;
|
||||||
|
|
@ -396,13 +386,4 @@ class Plugin extends Model
|
||||||
{
|
{
|
||||||
return $this->configuration[$key] ?? $default;
|
return $this->configuration[$key] ?? $default;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getPreviewMashupLayoutForSize(string $size): string
|
|
||||||
{
|
|
||||||
return match ($size) {
|
|
||||||
'half_vertical' => '1Lx1R',
|
|
||||||
'quadrant' => '2x2',
|
|
||||||
default => '1Tx1B',
|
|
||||||
};
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -110,7 +110,7 @@ Route::get('/display', function (Request $request) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$markup = $playlistItem->render(device: $device);
|
$markup = $playlistItem->render();
|
||||||
GenerateScreenJob::dispatchSync($device->id, null, $markup);
|
GenerateScreenJob::dispatchSync($device->id, null, $markup);
|
||||||
|
|
||||||
$device->refresh();
|
$device->refresh();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue