Migrate to HTMX (#114)

Dropped Livewire
Added HTMX
Added Blade code lint
Drop Mysql and Redis
Migrate to SQLite
This commit is contained in:
Saeed Vaziry
2024-03-06 17:02:59 +01:00
committed by GitHub
parent 5b2c419e91
commit b2083fc6b2
486 changed files with 8609 additions and 8707 deletions

View File

@ -24,10 +24,10 @@ public function create($type, Server $server, array $input): Backup
$backup = new Backup([
'type' => $type,
'server_id' => $server->id,
'database_id' => $input['database'] ?? null,
'storage_id' => $input['storage'],
'interval' => $input['interval'] == 'custom' ? $input['custom'] : $input['interval'],
'keep_backups' => $input['keep'],
'database_id' => $input['backup_database'] ?? null,
'storage_id' => $input['backup_storage'],
'interval' => $input['backup_interval'] == 'custom' ? $input['backup_custom'] : $input['backup_interval'],
'keep_backups' => $input['backup_keep'],
'status' => BackupStatus::RUNNING,
]);
$backup->save();
@ -43,16 +43,16 @@ public function create($type, Server $server, array $input): Backup
private function validate($type, Server $server, array $input): void
{
$rules = [
'storage' => [
'backup_storage' => [
'required',
Rule::exists('storage_providers', 'id'),
],
'keep' => [
'backup_keep' => [
'required',
'numeric',
'min:1',
],
'interval' => [
'backup_interval' => [
'required',
Rule::in([
'0 * * * *',
@ -63,13 +63,13 @@ private function validate($type, Server $server, array $input): void
]),
],
];
if ($input['interval'] == 'custom') {
$rules['custom'] = [
if ($input['backup_interval'] == 'custom') {
$rules['backup_custom'] = [
'required',
];
}
if ($type === 'database') {
$rules['database'] = [
$rules['backup_database'] = [
'required',
Rule::exists('databases', 'id')
->where('server_id', $server->id)