mirror of
https://github.com/pelican-dev/panel.git
synced 2025-11-09 12:39:30 +01:00
add plugin dev mode
This commit is contained in:
parent
4759c62432
commit
e970ae3767
@ -22,6 +22,7 @@ use Filament\Panel;
|
|||||||
* @method static void updateLoadOrder(array<int, string> $order)
|
* @method static void updateLoadOrder(array<int, string> $order)
|
||||||
* @method static bool hasThemePluginEnabled()
|
* @method static bool hasThemePluginEnabled()
|
||||||
* @method static string[] getPluginLanguages()
|
* @method static string[] getPluginLanguages()
|
||||||
|
* @method static bool isDevModeActive()
|
||||||
*
|
*
|
||||||
* @see \App\Services\Helpers\PluginService
|
* @see \App\Services\Helpers\PluginService
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -113,6 +113,10 @@ class PluginService
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
} catch (Exception $exception) {
|
} catch (Exception $exception) {
|
||||||
|
if ($this->isDevModeActive()) {
|
||||||
|
throw ($exception);
|
||||||
|
}
|
||||||
|
|
||||||
report($exception);
|
report($exception);
|
||||||
|
|
||||||
$this->setStatus($plugin, PluginStatus::Errored, $exception->getMessage());
|
$this->setStatus($plugin, PluginStatus::Errored, $exception->getMessage());
|
||||||
@ -144,6 +148,10 @@ class PluginService
|
|||||||
|
|
||||||
$this->enablePlugin($plugin);
|
$this->enablePlugin($plugin);
|
||||||
} catch (Exception $exception) {
|
} catch (Exception $exception) {
|
||||||
|
if ($this->isDevModeActive()) {
|
||||||
|
throw ($exception);
|
||||||
|
}
|
||||||
|
|
||||||
report($exception);
|
report($exception);
|
||||||
|
|
||||||
$this->setStatus($plugin, PluginStatus::Errored, $exception->getMessage());
|
$this->setStatus($plugin, PluginStatus::Errored, $exception->getMessage());
|
||||||
@ -181,6 +189,10 @@ class PluginService
|
|||||||
|
|
||||||
return true;
|
return true;
|
||||||
} catch (Exception $exception) {
|
} catch (Exception $exception) {
|
||||||
|
if ($this->isDevModeActive()) {
|
||||||
|
throw ($exception);
|
||||||
|
}
|
||||||
|
|
||||||
report($exception);
|
report($exception);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -200,6 +212,10 @@ class PluginService
|
|||||||
$this->enablePlugin($plugin);
|
$this->enablePlugin($plugin);
|
||||||
}
|
}
|
||||||
} catch (Exception $exception) {
|
} catch (Exception $exception) {
|
||||||
|
if ($this->isDevModeActive()) {
|
||||||
|
throw ($exception);
|
||||||
|
}
|
||||||
|
|
||||||
report($exception);
|
report($exception);
|
||||||
|
|
||||||
$this->setStatus($plugin, PluginStatus::Errored, $exception->getMessage());
|
$this->setStatus($plugin, PluginStatus::Errored, $exception->getMessage());
|
||||||
@ -215,6 +231,10 @@ class PluginService
|
|||||||
|
|
||||||
cache()->forget("plugins.$plugin->id.update");
|
cache()->forget("plugins.$plugin->id.update");
|
||||||
} catch (Exception $exception) {
|
} catch (Exception $exception) {
|
||||||
|
if ($this->isDevModeActive()) {
|
||||||
|
throw ($exception);
|
||||||
|
}
|
||||||
|
|
||||||
report($exception);
|
report($exception);
|
||||||
|
|
||||||
$this->setStatus($plugin, PluginStatus::Errored, $exception->getMessage());
|
$this->setStatus($plugin, PluginStatus::Errored, $exception->getMessage());
|
||||||
@ -328,4 +348,9 @@ class PluginService
|
|||||||
|
|
||||||
return array_unique($languages);
|
return array_unique($languages);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function isDevModeActive(): bool
|
||||||
|
{
|
||||||
|
return config('panel.plugin.dev_mode', false);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -68,4 +68,8 @@ return [
|
|||||||
'webhook' => [
|
'webhook' => [
|
||||||
'prune_days' => env('APP_WEBHOOK_PRUNE_DAYS', 30),
|
'prune_days' => env('APP_WEBHOOK_PRUNE_DAYS', 30),
|
||||||
],
|
],
|
||||||
|
|
||||||
|
'plugin' => [
|
||||||
|
'dev_mode' => env('PANEL_PLUGIN_DEV_MODE', false),
|
||||||
|
],
|
||||||
];
|
];
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user