mirror of
https://github.com/pelican-dev/panel.git
synced 2025-05-20 11:04:45 +02:00
Update p:info
command (#389)
This commit is contained in:
parent
7a6edab79a
commit
42ecd2951d
@ -7,12 +7,12 @@ use App\Services\Helpers\SoftwareVersionService;
|
|||||||
|
|
||||||
class InfoCommand extends Command
|
class InfoCommand extends Command
|
||||||
{
|
{
|
||||||
protected $description = 'Displays the application, database, and email configurations along with the panel version.';
|
protected $description = 'Displays the application, database, email and backup configurations along with the panel version.';
|
||||||
|
|
||||||
protected $signature = 'p:info';
|
protected $signature = 'p:info';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* VersionCommand constructor.
|
* InfoCommand constructor.
|
||||||
*/
|
*/
|
||||||
public function __construct(private SoftwareVersionService $versionService)
|
public function __construct(private SoftwareVersionService $versionService)
|
||||||
{
|
{
|
||||||
@ -33,19 +33,25 @@ class InfoCommand extends Command
|
|||||||
|
|
||||||
$this->output->title('Application Configuration');
|
$this->output->title('Application Configuration');
|
||||||
$this->table([], [
|
$this->table([], [
|
||||||
['Environment', $this->formatText(config('app.env'), config('app.env') === 'production' ?: 'bg=red')],
|
['Environment', config('app.env') === 'production' ? config('app.env') : $this->formatText(config('app.env'), 'bg=red')],
|
||||||
['Debug Mode', $this->formatText(config('app.debug') ? 'Yes' : 'No', !config('app.debug') ?: 'bg=red')],
|
['Debug Mode', config('app.debug') ? $this->formatText('Yes', 'bg=red') : 'No'],
|
||||||
['Installation URL', config('app.url')],
|
['Application Name', config('app.name')],
|
||||||
|
['Application URL', config('app.url')],
|
||||||
['Installation Directory', base_path()],
|
['Installation Directory', base_path()],
|
||||||
['Cache Driver', config('cache.default')],
|
['Cache Driver', config('cache.default')],
|
||||||
['Queue Driver', config('queue.default')],
|
['Queue Driver', config('queue.default') === 'sync' ? $this->formatText(config('queue.default'), 'bg=red') : config('queue.default')],
|
||||||
['Session Driver', config('session.driver')],
|
['Session Driver', config('session.driver')],
|
||||||
['Filesystem Driver', config('filesystems.default')],
|
['Filesystem Driver', config('filesystems.default')],
|
||||||
['Default Theme', config('themes.active')],
|
|
||||||
], 'compact');
|
], 'compact');
|
||||||
|
|
||||||
$this->output->title('Database Configuration');
|
$this->output->title('Database Configuration');
|
||||||
$driver = config('database.default');
|
$driver = config('database.default');
|
||||||
|
if ($driver === 'sqlite') {
|
||||||
|
$this->table([], [
|
||||||
|
['Driver', $driver],
|
||||||
|
['Database', config("database.connections.$driver.database")],
|
||||||
|
], 'compact');
|
||||||
|
} else {
|
||||||
$this->table([], [
|
$this->table([], [
|
||||||
['Driver', $driver],
|
['Driver', $driver],
|
||||||
['Host', config("database.connections.$driver.host")],
|
['Host', config("database.connections.$driver.host")],
|
||||||
@ -53,18 +59,43 @@ class InfoCommand extends Command
|
|||||||
['Database', config("database.connections.$driver.database")],
|
['Database', config("database.connections.$driver.database")],
|
||||||
['Username', config("database.connections.$driver.username")],
|
['Username', config("database.connections.$driver.username")],
|
||||||
], 'compact');
|
], 'compact');
|
||||||
|
}
|
||||||
|
|
||||||
// TODO: Update this to handle other mail drivers
|
|
||||||
$this->output->title('Email Configuration');
|
$this->output->title('Email Configuration');
|
||||||
|
$driver = config('mail.default');
|
||||||
|
if ($driver === 'smtp') {
|
||||||
$this->table([], [
|
$this->table([], [
|
||||||
['Driver', config('mail.default')],
|
['Driver', $driver],
|
||||||
['Host', config('mail.mailers.smtp.host')],
|
['Host', config("mail.mailers.$driver.host")],
|
||||||
['Port', config('mail.mailers.smtp.port')],
|
['Port', config("mail.mailers.$driver.port")],
|
||||||
['Username', config('mail.mailers.smtp.username')],
|
['Username', config("mail.mailers.$driver.username")],
|
||||||
|
['Encryption', config("mail.mailers.$driver.encryption")],
|
||||||
['From Address', config('mail.from.address')],
|
['From Address', config('mail.from.address')],
|
||||||
['From Name', config('mail.from.name')],
|
['From Name', config('mail.from.name')],
|
||||||
['Encryption', config('mail.mailers.smtp.encryption')],
|
|
||||||
], 'compact');
|
], 'compact');
|
||||||
|
} else {
|
||||||
|
$this->table([], [
|
||||||
|
['Driver', $driver],
|
||||||
|
['From Address', config('mail.from.address')],
|
||||||
|
['From Name', config('mail.from.name')],
|
||||||
|
], 'compact');
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->output->title('Backup Configuration');
|
||||||
|
$driver = config('backups.default');
|
||||||
|
if ($driver === 's3') {
|
||||||
|
$this->table([], [
|
||||||
|
['Driver', $driver],
|
||||||
|
['Region', config("backups.disks.$driver.region")],
|
||||||
|
['Bucket', config("backups.disks.$driver.bucket")],
|
||||||
|
['Endpoint', config("backups.disks.$driver.endpoint")],
|
||||||
|
['Use path style endpoint', config("backups.disks.$driver.use_path_style_endpoint") ? 'Yes' : 'No'],
|
||||||
|
], 'compact');
|
||||||
|
} else {
|
||||||
|
$this->table([], [
|
||||||
|
['Driver', $driver],
|
||||||
|
], 'compact');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user