mirror of
https://github.com/usetrmnl/byos_laravel.git
synced 2026-01-13 15:07:49 +00:00
feat: set preferred_renderer when installing from catalog
This commit is contained in:
parent
3ae8a610a0
commit
b98cda881e
3 changed files with 14 additions and 4 deletions
|
|
@ -12,6 +12,9 @@ ENV APP_VERSION=${APP_VERSION}
|
|||
|
||||
ENV AUTORUN_ENABLED="true"
|
||||
|
||||
# Mark trmnl-liquid-cli as installed
|
||||
ENV TRMNL_LIQUID_ENABLED=1
|
||||
|
||||
# Switch to the root user so we can do root things
|
||||
USER root
|
||||
|
||||
|
|
@ -49,5 +52,6 @@ FROM base AS production
|
|||
COPY --chown=www-data:www-data --from=assets /app/public/build /var/www/html/public/build
|
||||
COPY --chown=www-data:www-data --from=assets /app/node_modules /var/www/html/node_modules
|
||||
|
||||
COPY --chown=www-data:www-data --from=bnussbau/trmnl-liquid-cli:latest /usr/local/bin/trmnl-liquid-cli /usr/local/bin/
|
||||
# Drop back to the www-data user
|
||||
USER www-data
|
||||
|
|
|
|||
|
|
@ -143,7 +143,7 @@ class PluginImportService
|
|||
*
|
||||
* @throws Exception If the ZIP file is invalid or required files are missing
|
||||
*/
|
||||
public function importFromUrl(string $zipUrl, User $user, ?string $zipEntryPath = null): Plugin
|
||||
public function importFromUrl(string $zipUrl, User $user, ?string $zipEntryPath = null, $preferredRenderer = null): Plugin
|
||||
{
|
||||
// Download the ZIP file
|
||||
$response = Http::timeout(60)->get($zipUrl);
|
||||
|
|
@ -232,6 +232,7 @@ class PluginImportService
|
|||
'render_markup' => $fullLiquid,
|
||||
'configuration_template' => $configurationTemplate,
|
||||
'data_payload' => json_decode($settings['static_data'] ?? '{}', true),
|
||||
'preferred_renderer' => $preferredRenderer,
|
||||
]);
|
||||
|
||||
if (! $plugin_updated) {
|
||||
|
|
|
|||
|
|
@ -91,11 +91,16 @@ new class extends Component {
|
|||
|
||||
try {
|
||||
$zipUrl = "https://usetrmnl.com/api/plugin_settings/{$recipeId}/archive";
|
||||
$plugin = $pluginImportService->importFromUrl($zipUrl, auth()->user());
|
||||
|
||||
|
||||
$plugin = $pluginImportService->importFromUrl(
|
||||
$zipUrl,
|
||||
auth()->user(),
|
||||
preferredRenderer: config('services.trmnl.liquid_enabled') ? 'trmnl-liquid' : null
|
||||
);
|
||||
|
||||
$this->dispatch('plugin-installed');
|
||||
Flux::modal('import-from-trmnl-catalog')->close();
|
||||
|
||||
|
||||
} catch (\Exception $e) {
|
||||
Log::error('Plugin installation failed: ' . $e->getMessage());
|
||||
$this->addError('installation', 'Error installing plugin: ' . $e->getMessage());
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue