mirror of
https://github.com/PhyreApps/PhyrePanel.git
synced 2024-11-22 07:30:25 +00:00
update
This commit is contained in:
parent
4818c9d37e
commit
6453687bce
5 changed files with 59 additions and 7 deletions
|
@ -34,7 +34,6 @@ class CronJobResource extends Resource
|
|||
->options(
|
||||
\App\Models\HostingSubscription::all()->pluck('domain', 'id')
|
||||
)
|
||||
->live()
|
||||
->disabled(function ($record) {
|
||||
return $record;
|
||||
})
|
||||
|
|
|
@ -13,6 +13,7 @@ use Filament\Tables;
|
|||
use Filament\Tables\Table;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
use Illuminate\Database\Eloquent\SoftDeletingScope;
|
||||
use phpseclib3\Crypt\RSA;
|
||||
|
||||
class GitSshKeyResource extends Resource
|
||||
{
|
||||
|
@ -24,15 +25,65 @@ class GitSshKeyResource extends Resource
|
|||
|
||||
public static function form(Form $form): Form
|
||||
{
|
||||
|
||||
|
||||
return $form
|
||||
->schema([
|
||||
|
||||
Forms\Components\Select::make('domain_id')
|
||||
->label('Domain')
|
||||
->options([])
|
||||
Forms\Components\Select::make('hosting_subscription_id')
|
||||
->label('Hosting Subscription')
|
||||
->options(
|
||||
\App\Models\HostingSubscription::all()->pluck('domain', 'id')
|
||||
)
|
||||
->disabled(function ($record) {
|
||||
return $record;
|
||||
})
|
||||
->columnSpanFull()
|
||||
->required(),
|
||||
|
||||
Forms\Components\TextInput::make('name')
|
||||
->autofocus()
|
||||
->required()
|
||||
->columnSpanFull()
|
||||
->label('Name'),
|
||||
|
||||
Forms\Components\Textarea::make('private_key')
|
||||
->required()
|
||||
->columnSpanFull()
|
||||
->label('Private Key')
|
||||
->rows(10)
|
||||
->disabled(function ($record) {
|
||||
return $record;
|
||||
})
|
||||
->hintAction(function ($record) {
|
||||
if ($record) {
|
||||
return null;
|
||||
}
|
||||
return Forms\Components\Actions\Action::make('generate')
|
||||
->icon('heroicon-m-key')
|
||||
->action(function (Forms\Set $set) {
|
||||
|
||||
|
||||
$private = RSA::createKey();
|
||||
$public = $private->getPublicKey();
|
||||
|
||||
$privateKeyString = $private->toString('OpenSSH');
|
||||
$publicKey = $public->toString('OpenSSH');
|
||||
|
||||
$set('private_key', $privateKeyString);
|
||||
$set('public_key', $publicKey);
|
||||
});
|
||||
}),
|
||||
|
||||
Forms\Components\Textarea::make('public_key')
|
||||
->required()
|
||||
->columnSpanFull()
|
||||
->rows(10)
|
||||
->disabled(function ($record) {
|
||||
return $record;
|
||||
})
|
||||
->label('Public Key'),
|
||||
|
||||
]);
|
||||
}
|
||||
|
||||
|
|
|
@ -10,7 +10,9 @@ class GitSshKey extends Model
|
|||
use HasFactory;
|
||||
|
||||
protected $fillable = [
|
||||
'hosting_subscription_id',
|
||||
'name',
|
||||
|
||||
'private_key',
|
||||
'public_key',
|
||||
];
|
||||
}
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
"monarobase/country-list": "^3.5",
|
||||
"nwidart/laravel-modules": "^10.0",
|
||||
"outerweb/filament-settings": "^1.2",
|
||||
"phpseclib/phpseclib": "^3.0",
|
||||
"phpseclib/phpseclib": "~3.0",
|
||||
"postare/blade-mdi": "^1.1",
|
||||
"riodwanto/filament-ace-editor": "^1.0",
|
||||
"spatie/ssh": "^1.10",
|
||||
|
|
|
@ -21,7 +21,7 @@ return new class extends Migration
|
|||
$table->string('status')->nullable();
|
||||
$table->string('status_message')->nullable();
|
||||
|
||||
$table->unsignedBigInteger('domain_id');
|
||||
$table->unsignedBigInteger('hosting_subscription_id');
|
||||
|
||||
$table->timestamps();
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue