mirror of
https://github.com/vitodeploy/vito.git
synced 2025-07-02 14:36:17 +00:00
Built-in File Manager (#458)
This commit is contained in:
@ -5,6 +5,7 @@
|
||||
use App\Actions\Server\CheckConnection;
|
||||
use App\Enums\ServerStatus;
|
||||
use App\Enums\ServiceStatus;
|
||||
use App\Exceptions\SSHError;
|
||||
use App\Facades\SSH;
|
||||
use App\ServerTypes\ServerType;
|
||||
use App\SSH\Cron\Cron;
|
||||
@ -22,6 +23,7 @@
|
||||
use Illuminate\Support\Facades\File;
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
use Illuminate\Support\Str;
|
||||
use Throwable;
|
||||
|
||||
/**
|
||||
* @property int $project_id
|
||||
@ -146,7 +148,7 @@ public static function boot(): void
|
||||
}
|
||||
$server->provider()->delete();
|
||||
DB::commit();
|
||||
} catch (\Throwable $e) {
|
||||
} catch (Throwable $e) {
|
||||
DB::rollBack();
|
||||
throw $e;
|
||||
}
|
||||
@ -465,6 +467,9 @@ public function cron(): Cron
|
||||
return new Cron($this);
|
||||
}
|
||||
|
||||
/**
|
||||
* @throws SSHError
|
||||
*/
|
||||
public function checkForUpdates(): void
|
||||
{
|
||||
$this->updates = $this->os()->availableUpdates();
|
||||
@ -480,4 +485,15 @@ public function getAvailableUpdatesAttribute(?int $value): int
|
||||
|
||||
return $value;
|
||||
}
|
||||
|
||||
/**
|
||||
* @throws Throwable
|
||||
*/
|
||||
public function download(string $path, string $disk = 'tmp'): void
|
||||
{
|
||||
$this->ssh()->download(
|
||||
Storage::disk($disk)->path(basename($path)),
|
||||
$path
|
||||
);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user