Merge branch 'main' of github.com:pelican-dev/panel

This commit is contained in:
Lance Pioch 2024-05-15 22:33:59 -04:00
commit 095fff7ad6
13 changed files with 184 additions and 169 deletions

View File

@ -2,7 +2,11 @@
namespace App\Filament\Resources\DatabaseHostResource\RelationManagers; namespace App\Filament\Resources\DatabaseHostResource\RelationManagers;
use App\Models\Database;
use App\Models\DatabaseHost;
use App\Services\Databases\DatabasePasswordService;
use Filament\Forms; use Filament\Forms;
use Filament\Forms\Components\Actions\Action;
use Filament\Forms\Form; use Filament\Forms\Form;
use Filament\Resources\RelationManagers\RelationManager; use Filament\Resources\RelationManagers\RelationManager;
use Filament\Tables; use Filament\Tables;
@ -12,21 +16,32 @@ class DatabasesRelationManager extends RelationManager
{ {
protected static string $relationship = 'databases'; protected static string $relationship = 'databases';
protected $listeners = ['refresh'=>'refreshForm'];
public function form(Form $form): Form public function form(Form $form): Form
{ {
return $form return $form
->schema([ ->schema([
Forms\Components\TextInput::make('database')->columnSpanFull(), Forms\Components\TextInput::make('database')->columnSpanFull(),
Forms\Components\TextInput::make('username'), Forms\Components\TextInput::make('username'),
Forms\Components\TextInput::make('password')->default('Soon™'), Forms\Components\TextInput::make('password')
->hintAction(
Action::make('rotate')
->icon('tabler-refresh')
->requiresConfirmation()
->action(fn (DatabasePasswordService $service, Database $db) => $service->handle($db))
)
->formatStateUsing(fn (Database $database) => decrypt($database->password)),
Forms\Components\TextInput::make('remote')->label('Connections From'), Forms\Components\TextInput::make('remote')->label('Connections From'),
Forms\Components\TextInput::make('max_connections'), Forms\Components\TextInput::make('max_connections'),
Forms\Components\TextInput::make('JDBC')->label('JDBC Connection String')->columnSpanFull()->default('Soon™'), Forms\Components\TextInput::make('JDBC')
->label('JDBC Connection String')
->columnSpanFull()
->formatStateUsing(fn (Forms\Get $get, Database $database) => 'jdbc:mysql://' . $get('username') . ':' . urlencode(decrypt($database->password)) . '@' . $database->host->host . ':' . $database->host->port . '/' . $get('database')),
Forms\Components\TextInput::make('created_at'), Forms\Components\TextInput::make('created_at'),
Forms\Components\TextInput::make('updated_at'), Forms\Components\TextInput::make('updated_at'),
]); ]);
} }
public function table(Table $table): Table public function table(Table $table): Table
{ {
return $table return $table
@ -36,8 +51,7 @@ class DatabasesRelationManager extends RelationManager
Tables\Columns\TextColumn::make('username'), Tables\Columns\TextColumn::make('username'),
//Tables\Columns\TextColumn::make('password'), //Tables\Columns\TextColumn::make('password'),
Tables\Columns\TextColumn::make('remote'), Tables\Columns\TextColumn::make('remote'),
Tables\Columns\TextColumn::make('server_id') Tables\Columns\TextColumn::make('server.name'),
->label('Belongs To'),
// TODO ->url(route('filament.admin.resources.servers.edit', ['record', ''])), // TODO ->url(route('filament.admin.resources.servers.edit', ['record', ''])),
Tables\Columns\TextColumn::make('max_connections'), Tables\Columns\TextColumn::make('max_connections'),
Tables\Columns\TextColumn::make('created_at'), Tables\Columns\TextColumn::make('created_at'),

View File

@ -26,7 +26,7 @@ class AdminPanelProvider extends PanelProvider
public function boot() public function boot()
{ {
FilamentAsset::registerCssVariables([ FilamentAsset::registerCssVariables([
'sidebar-width' => '12rem !important', 'sidebar-width' => '14rem !important',
]); ]);
} }

View File

@ -9,20 +9,20 @@
"ext-pdo": "*", "ext-pdo": "*",
"ext-pdo_mysql": "*", "ext-pdo_mysql": "*",
"ext-zip": "*", "ext-zip": "*",
"abdelhamiderrahmouni/filament-monaco-editor": "^0.2.0", "abdelhamiderrahmouni/filament-monaco-editor": "0.2.1",
"aws/aws-sdk-php": "~3.288.1", "aws/aws-sdk-php": "~3.288.1",
"chillerlan/php-qrcode": "^5.0", "chillerlan/php-qrcode": "^5.0.2",
"dedoc/scramble": "^0.9.0", "dedoc/scramble": "^0.9.0",
"doctrine/dbal": "~3.6.0", "doctrine/dbal": "~3.6.0",
"filament/filament": "^3.2", "filament/filament": "^3.2",
"guzzlehttp/guzzle": "^7.5", "guzzlehttp/guzzle": "^7.8.1",
"hashids/hashids": "~5.0.0", "hashids/hashids": "~5.0.0",
"laracasts/utilities": "~3.2.2", "laracasts/utilities": "~3.2.2",
"laravel/framework": "^11.0", "laravel/framework": "^11.7",
"laravel/helpers": "^1.7", "laravel/helpers": "^1.7",
"laravel/sanctum": "^4.0", "laravel/sanctum": "^4.0.2",
"laravel/tinker": "^2.9", "laravel/tinker": "^2.9",
"laravel/ui": "^4.4", "laravel/ui": "^4.5.1",
"lcobucci/jwt": "~4.3.0", "lcobucci/jwt": "~4.3.0",
"league/flysystem-aws-s3-v3": "~3.12.2", "league/flysystem-aws-s3-v3": "~3.12.2",
"league/flysystem-memory": "~3.10.3", "league/flysystem-memory": "~3.10.3",
@ -32,26 +32,26 @@
"prologue/alerts": "^1.2", "prologue/alerts": "^1.2",
"ryangjchandler/blade-tabler-icons": "^2.3", "ryangjchandler/blade-tabler-icons": "^2.3",
"s1lentium/iptools": "~1.2.0", "s1lentium/iptools": "~1.2.0",
"saade/filament-laravel-log": "^3.2", "saade/filament-laravel-log": "^3.2.1",
"spatie/laravel-fractal": "^6.1", "spatie/laravel-fractal": "^6.2",
"spatie/laravel-query-builder": "^5.8", "spatie/laravel-query-builder": "^5.8.1",
"symfony/mailgun-mailer": "^7.0", "symfony/mailgun-mailer": "^7.0.7",
"symfony/postmark-mailer": "^7.0", "symfony/postmark-mailer": "^7.0.7",
"symfony/yaml": "^7.0", "symfony/yaml": "^7.0.7",
"webbingbrasil/filament-copyactions": "^3.0", "webbingbrasil/filament-copyactions": "^3.0.1",
"webmozart/assert": "~1.11.0" "webmozart/assert": "~1.11.0"
}, },
"require-dev": { "require-dev": {
"barryvdh/laravel-ide-helper": "^3.0", "barryvdh/laravel-ide-helper": "^3.0",
"fakerphp/faker": "^1.23", "fakerphp/faker": "^1.23.1",
"itsgoingd/clockwork": "~5.1.12", "itsgoingd/clockwork": "~5.1.12",
"larastan/larastan": "^2.8", "larastan/larastan": "^2.9.6",
"laravel/pint": "^1.14", "laravel/pint": "^1.15.3",
"laravel/sail": "^1.26", "laravel/sail": "^1.29.1",
"mockery/mockery": "^1.6", "mockery/mockery": "^1.6.11",
"nunomaduro/collision": "^8.0", "nunomaduro/collision": "^8.1.1",
"phpunit/phpunit": "^10.5", "phpunit/phpunit": "^10.5.20",
"spatie/laravel-ignition": "^2.4" "spatie/laravel-ignition": "^2.7"
}, },
"autoload": { "autoload": {
"files": [ "files": [

14
composer.lock generated
View File

@ -4,20 +4,20 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically" "This file is @generated automatically"
], ],
"content-hash": "0b864c9d70ba4b0ee467ef915d36d92f", "content-hash": "b42081b535003bee230744894b97bc31",
"packages": [ "packages": [
{ {
"name": "abdelhamiderrahmouni/filament-monaco-editor", "name": "abdelhamiderrahmouni/filament-monaco-editor",
"version": "v0.2.3", "version": "v0.2.1",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/abdelhamiderrahmouni/filament-monaco-editor.git", "url": "https://github.com/abdelhamiderrahmouni/filament-monaco-editor.git",
"reference": "9968be3a59a6532e46f6332a990921c4af527c8a" "reference": "3a74de11f74bee5b782df74c998c071c64a17ac0"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/abdelhamiderrahmouni/filament-monaco-editor/zipball/9968be3a59a6532e46f6332a990921c4af527c8a", "url": "https://api.github.com/repos/abdelhamiderrahmouni/filament-monaco-editor/zipball/3a74de11f74bee5b782df74c998c071c64a17ac0",
"reference": "9968be3a59a6532e46f6332a990921c4af527c8a", "reference": "3a74de11f74bee5b782df74c998c071c64a17ac0",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -88,7 +88,7 @@
"type": "github" "type": "github"
} }
], ],
"time": "2024-04-20T02:45:00+00:00" "time": "2024-04-20T01:01:49+00:00"
}, },
{ {
"name": "anourvalar/eloquent-serialize", "name": "anourvalar/eloquent-serialize",
@ -13137,5 +13137,5 @@
"ext-zip": "*" "ext-zip": "*"
}, },
"platform-dev": [], "platform-dev": [],
"plugin-api-version": "2.6.0" "plugin-api-version": "2.3.0"
} }

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long