forked from pelican-dev/panel
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
24 changed files
with
957 additions
and
742 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
<?php | ||
|
||
namespace App\Filament\App\Pages; | ||
|
||
use Filament\Facades\Filament; | ||
use Filament\Pages\Page; | ||
use Illuminate\Contracts\Support\Htmlable; | ||
|
||
class Dashboard extends Page | ||
{ | ||
protected static string $routePath = '/'; | ||
|
||
protected static ?int $navigationSort = -2; | ||
|
||
protected static string $view = 'filament-panels::pages.dashboard'; | ||
|
||
public static function getNavigationLabel(): string | ||
{ | ||
return 'Dashboard'; | ||
} | ||
|
||
public static function getNavigationIcon(): string|Htmlable|null | ||
{ | ||
return 'tabler-home'; | ||
} | ||
|
||
public static function getRoutePath(): string | ||
{ | ||
return static::$routePath; | ||
} | ||
|
||
public function getWidgets(): array | ||
{ | ||
return Filament::getWidgets(); | ||
} | ||
|
||
public function getVisibleWidgets(): array | ||
{ | ||
return $this->filterVisibleWidgets($this->getWidgets()); | ||
} | ||
|
||
public function getColumns(): int|string|array | ||
{ | ||
return 2; | ||
} | ||
|
||
public function getTitle(): string|Htmlable | ||
{ | ||
return 'Welcome, '. auth()->user()->username; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
<?php | ||
|
||
namespace App\Filament\App\Pages; | ||
|
||
use Filament\Actions\Action; | ||
use Filament\Facades\Filament; | ||
use Filament\Pages\Page; | ||
|
||
class Index extends Page | ||
{ | ||
protected static ?string $navigationIcon = 'heroicon-o-document-text'; | ||
|
||
protected static string $view = 'filament.app.pages.index'; | ||
|
||
public array $history = []; | ||
public int $historyIndex = 0; | ||
public string $input = ''; | ||
|
||
protected function getViewData(): array | ||
{ | ||
return [ | ||
'server' => Filament::getTenant(), | ||
'user' => auth()->user(), | ||
]; | ||
} | ||
|
||
protected function getHeaderActions(): array | ||
{ | ||
return [ | ||
Action::make('start') | ||
->color('primary') | ||
->action(fn () => $this->dispatch('setServerState', state: 'start')), | ||
|
||
Action::make('restart') | ||
->color('gray') | ||
->action(fn () => $this->dispatch('setServerState', state: 'restart')), | ||
|
||
Action::make('stop') | ||
->color('danger') | ||
->action(fn () => $this->dispatch('setServerState', state: 'stop')), | ||
]; | ||
} | ||
|
||
public function up() | ||
{ | ||
$this->historyIndex = min($this->historyIndex + 1, count($this->history) - 1); | ||
|
||
// e.currentTarget.value = history![newIndex] || ''; | ||
// | ||
// // By default up arrow will also bring the cursor to the start of the line, so we'll preventDefault to keep it at the end. | ||
// e.preventDefault(); | ||
} | ||
|
||
public function down() | ||
{ | ||
$this->historyIndex = max($this->historyIndex - 1, -1); | ||
|
||
// e.currentTarget.value = history![newIndex] || ''; | ||
} | ||
|
||
public function enter() | ||
{ | ||
$this->dispatch('sendServerCommand', command: $this->input); | ||
|
||
$this->input = ''; | ||
|
||
// setHistory((prevHistory) => [command, ...prevHistory!].slice(0, 32)); | ||
// setHistoryIndex(-1); | ||
// | ||
// instance && instance.send('send command', command); | ||
// e.currentTarget.value = ''; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 0 additions & 11 deletions
11
app/Filament/App/Resources/BackupResource/Pages/CreateBackup.php
This file was deleted.
Oops, something went wrong.
20 changes: 0 additions & 20 deletions
20
app/Filament/App/Resources/BackupResource/Pages/EditBackup.php
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 0 additions & 19 deletions
19
app/Filament/App/Resources/BackupResource/Pages/ViewBackup.php
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.