mirror of
https://github.com/pelican-dev/panel.git
synced 2025-05-20 04:04:45 +02:00
Time zone should always be UTC
Will implement display time zones on a per user basis
This commit is contained in:
parent
a050fbd2d3
commit
1b3017222e
@ -35,7 +35,6 @@ class AppSettingsCommand extends Command
|
|||||||
{--new-salt : Whether or not to generate a new salt for Hashids.}
|
{--new-salt : Whether or not to generate a new salt for Hashids.}
|
||||||
{--author= : The email that services created on this instance should be linked to.}
|
{--author= : The email that services created on this instance should be linked to.}
|
||||||
{--url= : The URL that this Panel is running on.}
|
{--url= : The URL that this Panel is running on.}
|
||||||
{--timezone= : The timezone to use for Panel times.}
|
|
||||||
{--cache= : The cache driver backend to use.}
|
{--cache= : The cache driver backend to use.}
|
||||||
{--session= : The session driver backend to use.}
|
{--session= : The session driver backend to use.}
|
||||||
{--queue= : The queue driver backend to use.}
|
{--queue= : The queue driver backend to use.}
|
||||||
@ -61,6 +60,8 @@ class AppSettingsCommand extends Command
|
|||||||
*/
|
*/
|
||||||
public function handle(): int
|
public function handle(): int
|
||||||
{
|
{
|
||||||
|
$this->variables['APP_TIMEZONE'] = 'UTC';
|
||||||
|
|
||||||
if (empty(config('hashids.salt')) || $this->option('new-salt')) {
|
if (empty(config('hashids.salt')) || $this->option('new-salt')) {
|
||||||
$this->variables['HASHIDS_SALT'] = str_random(20);
|
$this->variables['HASHIDS_SALT'] = str_random(20);
|
||||||
}
|
}
|
||||||
@ -83,12 +84,6 @@ class AppSettingsCommand extends Command
|
|||||||
config('app.url', 'https://example.com')
|
config('app.url', 'https://example.com')
|
||||||
);
|
);
|
||||||
|
|
||||||
$this->output->comment(__('commands.appsettings.comment.timezone'));
|
|
||||||
$this->variables['APP_TIMEZONE'] = $this->option('timezone') ?? $this->anticipate(
|
|
||||||
'Application Timezone',
|
|
||||||
\DateTimeZone::listIdentifiers(),
|
|
||||||
config('app.timezone')
|
|
||||||
);
|
|
||||||
|
|
||||||
$selected = config('cache.default', 'file');
|
$selected = config('cache.default', 'file');
|
||||||
$this->variables['CACHE_STORE'] = $this->option('cache') ?? $this->choice(
|
$this->variables['CACHE_STORE'] = $this->option('cache') ?? $this->choice(
|
||||||
|
@ -38,7 +38,6 @@ class InfoCommand extends Command
|
|||||||
['Debug Mode', $this->formatText(config('app.debug') ? 'Yes' : 'No', !config('app.debug') ?: 'bg=red')],
|
['Debug Mode', $this->formatText(config('app.debug') ? 'Yes' : 'No', !config('app.debug') ?: 'bg=red')],
|
||||||
['Installation URL', config('app.url')],
|
['Installation URL', config('app.url')],
|
||||||
['Installation Directory', base_path()],
|
['Installation Directory', base_path()],
|
||||||
['Timezone', config('app.timezone')],
|
|
||||||
['Cache Driver', config('cache.default')],
|
['Cache Driver', config('cache.default')],
|
||||||
['Queue Driver', config('queue.default')],
|
['Queue Driver', config('queue.default')],
|
||||||
['Session Driver', config('session.driver')],
|
['Session Driver', config('session.driver')],
|
||||||
|
@ -1,19 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace App\Providers;
|
|
||||||
|
|
||||||
use Illuminate\Support\ServiceProvider;
|
|
||||||
|
|
||||||
class BladeServiceProvider extends ServiceProvider
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* Perform post-registration booting of services.
|
|
||||||
*/
|
|
||||||
public function boot(): void
|
|
||||||
{
|
|
||||||
$this->app->make('blade.compiler')
|
|
||||||
->directive('datetimeHuman', function ($expression) {
|
|
||||||
return "<?php echo \Carbon\CarbonImmutable::createFromFormat(\Carbon\CarbonImmutable::DEFAULT_TO_STRING_FORMAT, $expression)->setTimezone(config('app.timezone'))->toDateTimeString(); ?>";
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
@ -4,7 +4,6 @@ return [
|
|||||||
App\Providers\ActivityLogServiceProvider::class,
|
App\Providers\ActivityLogServiceProvider::class,
|
||||||
App\Providers\AppServiceProvider::class,
|
App\Providers\AppServiceProvider::class,
|
||||||
App\Providers\BackupsServiceProvider::class,
|
App\Providers\BackupsServiceProvider::class,
|
||||||
App\Providers\BladeServiceProvider::class,
|
|
||||||
App\Providers\EventServiceProvider::class,
|
App\Providers\EventServiceProvider::class,
|
||||||
App\Providers\Filament\AdminPanelProvider::class,
|
App\Providers\Filament\AdminPanelProvider::class,
|
||||||
App\Providers\HashidsServiceProvider::class,
|
App\Providers\HashidsServiceProvider::class,
|
||||||
|
@ -37,12 +37,12 @@
|
|||||||
<td>{{ $key->memo }}</td>
|
<td>{{ $key->memo }}</td>
|
||||||
<td>
|
<td>
|
||||||
@if(!is_null($key->last_used_at))
|
@if(!is_null($key->last_used_at))
|
||||||
@datetimeHuman($key->last_used_at)
|
{{ $key->last_used_at }}
|
||||||
@else
|
@else
|
||||||
—
|
—
|
||||||
@endif
|
@endif
|
||||||
</td>
|
</td>
|
||||||
<td>@datetimeHuman($key->created_at)</td>
|
<td>{{ $key->created_at }}</td>
|
||||||
<td>
|
<td>
|
||||||
<a href="#" data-action="revoke-key" data-attr="{{ $key->identifier }}">
|
<a href="#" data-action="revoke-key" data-attr="{{ $key->identifier }}">
|
||||||
<i class="fa fa-trash-o text-danger"></i>
|
<i class="fa fa-trash-o text-danger"></i>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user