mirror of
https://github.com/vitodeploy/vito.git
synced 2025-07-02 14:36:17 +00:00
added FTP support to storage providers (#58)
* added FTP support to storage providers * build and code style fix
This commit is contained in:
1
resources/commands/storage/download-from-ftp.sh
Normal file
1
resources/commands/storage/download-from-ftp.sh
Normal file
@ -0,0 +1 @@
|
||||
curl __passive__ -u "__username__:__password__" ftp__ssl__://__host__:__port__/__src__ -o "__dest__"
|
1
resources/commands/storage/upload-to-ftp.sh
Normal file
1
resources/commands/storage/upload-to-ftp.sh
Normal file
@ -0,0 +1 @@
|
||||
curl __passive__ -T "__src__" -u "__username__:__password__" ftp__ssl__://__host__:__port__/__dest__
|
@ -18,7 +18,7 @@
|
||||
<tr>
|
||||
<x-th>{{ __("Name") }}</x-th>
|
||||
<x-th>{{ __("Created") }}</x-th>
|
||||
<x-th>{{ __("Size") }}</x-th>
|
||||
{{--<x-th>{{ __("Size") }}</x-th>--}}
|
||||
<x-th>{{ __("Status") }}</x-th>
|
||||
<x-th>{{ __("Restored") }}</x-th>
|
||||
<x-th>{{ __("Restored To") }}</x-th>
|
||||
@ -30,7 +30,7 @@
|
||||
<x-td>
|
||||
<x-datetime :value="$file->created_at" />
|
||||
</x-td>
|
||||
<x-td>{{ $file->size }}</x-td>
|
||||
{{--<x-td>{{ $file->size }}</x-td>--}}
|
||||
<x-td>
|
||||
<div class="inline-flex">
|
||||
@include('livewire.databases.partials.backup-file-status', ['status' => $file->status])
|
||||
|
@ -32,13 +32,79 @@
|
||||
@enderror
|
||||
</div>
|
||||
|
||||
<div class="mt-6">
|
||||
<x-input-label for="token" value="API Key" />
|
||||
<x-text-input wire:model.defer="token" id="token" name="token" type="text" class="mt-1 w-full" />
|
||||
@error('token')
|
||||
<x-input-error class="mt-2" :messages="$message" />
|
||||
@enderror
|
||||
</div>
|
||||
@if($provider == \App\Enums\StorageProvider::DROPBOX)
|
||||
<div class="mt-6">
|
||||
<x-input-label for="token" value="API Key" />
|
||||
<x-text-input wire:model.defer="token" id="token" name="token" type="text" class="mt-1 w-full" />
|
||||
@error('token')
|
||||
<x-input-error class="mt-2" :messages="$message" />
|
||||
@enderror
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@if($provider == \App\Enums\StorageProvider::FTP)
|
||||
<div class="grid grid-cols-2 gap-2">
|
||||
<div class="mt-6">
|
||||
<x-input-label for="host" value="Host" />
|
||||
<x-text-input wire:model.defer="host" id="host" name="host" type="text" class="mt-1 w-full" />
|
||||
@error('host')
|
||||
<x-input-error class="mt-2" :messages="$message" />
|
||||
@enderror
|
||||
</div>
|
||||
<div class="mt-6">
|
||||
<x-input-label for="port" value="Port" />
|
||||
<x-text-input wire:model.defer="port" id="port" name="port" type="text" class="mt-1 w-full" />
|
||||
@error('port')
|
||||
<x-input-error class="mt-2" :messages="$message" />
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
<div class="mt-6">
|
||||
<x-input-label for="path" value="Path" />
|
||||
<x-text-input wire:model.defer="path" id="path" name="path" type="text" class="mt-1 w-full" />
|
||||
@error('path')
|
||||
<x-input-error class="mt-2" :messages="$message" />
|
||||
@enderror
|
||||
</div>
|
||||
<div class="grid grid-cols-2 gap-2">
|
||||
<div class="mt-6">
|
||||
<x-input-label for="username" value="Username" />
|
||||
<x-text-input wire:model.defer="username" id="username" name="username" type="text" class="mt-1 w-full" />
|
||||
@error('username')
|
||||
<x-input-error class="mt-2" :messages="$message" />
|
||||
@enderror
|
||||
</div>
|
||||
<div class="mt-6">
|
||||
<x-input-label for="password" value="Password" />
|
||||
<x-text-input wire:model.defer="password" id="password" name="password" type="text" class="mt-1 w-full" />
|
||||
@error('password')
|
||||
<x-input-error class="mt-2" :messages="$message" />
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
<div class="grid grid-cols-2 gap-2">
|
||||
<div class="mt-6">
|
||||
<x-input-label for="ssl" :value="__('SSL')" />
|
||||
<x-select-input wire:model="ssl" id="ssl" name="ssl" class="mt-1 w-full">
|
||||
<option value="1" @if($ssl) selected @endif>{{ __("Yes") }}</option>
|
||||
<option value="0" @if(!$ssl) selected @endif>{{ __("No") }}</option>
|
||||
</x-select-input>
|
||||
@error('ssl')
|
||||
<x-input-error class="mt-2" :messages="$message" />
|
||||
@enderror
|
||||
</div>
|
||||
<div class="mt-6">
|
||||
<x-input-label for="passive" :value="__('Passive')" />
|
||||
<x-select-input wire:model="passive" id="passive" name="passive" class="mt-1 w-full">
|
||||
<option value="1" @if($passive) selected @endif>{{ __("Yes") }}</option>
|
||||
<option value="0" @if(!$passive) selected @endif>{{ __("No") }}</option>
|
||||
</x-select-input>
|
||||
@error('passive')
|
||||
<x-input-error class="mt-2" :messages="$message" />
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<div class="mt-6 flex justify-end">
|
||||
<x-secondary-button type="button" x-on:click="$dispatch('close')">
|
||||
|
@ -11,12 +11,18 @@
|
||||
@foreach($providers as $provider)
|
||||
<x-item-card>
|
||||
<div class="flex-none">
|
||||
<img src="{{ asset('static/images/' . $provider->provider . '.svg') }}" class="h-10 w-10" alt="">
|
||||
@if($provider->provider == \App\Enums\StorageProvider::FTP)
|
||||
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="w-10 h-10 text-gray-600 dark:text-gray-200">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" d="M19.5 14.25v-2.625a3.375 3.375 0 00-3.375-3.375h-1.5A1.125 1.125 0 0113.5 7.125v-1.5a3.375 3.375 0 00-3.375-3.375H8.25m2.25 0H5.625c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 00-9-9z" />
|
||||
</svg>
|
||||
@else
|
||||
<img src="{{ asset('static/images/' . $provider->provider . '.svg') }}" class="h-10 w-10" alt="">
|
||||
@endif
|
||||
</div>
|
||||
<div class="ml-3 flex flex-grow flex-col items-start justify-center">
|
||||
<span class="mb-1">{{ $provider->profile }}</span>
|
||||
<span class="text-sm text-gray-400">
|
||||
<x-datetime :value="$provider->created_at"/>
|
||||
<x-datetime :value="$provider->created_at" />
|
||||
</span>
|
||||
</div>
|
||||
<div class="flex items-center">
|
||||
|
Reference in New Issue
Block a user