fix: dev compose files
This commit is contained in:
		
							
								
								
									
										28
									
								
								app/Http/Livewire/Dev/Compose.php
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										28
									
								
								app/Http/Livewire/Dev/Compose.php
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,28 @@
 | 
			
		||||
<?php
 | 
			
		||||
 | 
			
		||||
namespace App\Http\Livewire\Dev;
 | 
			
		||||
 | 
			
		||||
use Livewire\Component;
 | 
			
		||||
 | 
			
		||||
class Compose extends Component
 | 
			
		||||
{
 | 
			
		||||
    public string $compose = '';
 | 
			
		||||
    public string $base64 = '';
 | 
			
		||||
    public $services;
 | 
			
		||||
    public function mount() {
 | 
			
		||||
        $this->services = getServiceTemplates();
 | 
			
		||||
    }
 | 
			
		||||
    public function setService(string $selected) {
 | 
			
		||||
        $this->base64 = data_get($this->services, $selected . '.compose');
 | 
			
		||||
        if ($this->base64) {
 | 
			
		||||
            $this->compose = base64_decode($this->base64);
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
    public function updatedCompose($value) {
 | 
			
		||||
        $this->base64 = base64_encode($value);
 | 
			
		||||
    }
 | 
			
		||||
    public function render()
 | 
			
		||||
    {
 | 
			
		||||
        return view('livewire.dev.compose');
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
@@ -11,7 +11,8 @@ services:
 | 
			
		||||
      - database__connection__password=$SERVICE_PASSWORD_MYSQL
 | 
			
		||||
      - database__connection__database=${MYSQL_DATABASE-ghost}
 | 
			
		||||
    depends_on:
 | 
			
		||||
      - mysql
 | 
			
		||||
      mysql:
 | 
			
		||||
        condition: service_healthy
 | 
			
		||||
  mysql:
 | 
			
		||||
    image: mysql:8.0
 | 
			
		||||
    volumes:
 | 
			
		||||
@@ -20,4 +21,9 @@ services:
 | 
			
		||||
      - MYSQL_USER=${SERVICE_USER_MYSQL}
 | 
			
		||||
      - MYSQL_PASSWORD=${SERVICE_PASSWORD_MYSQL}
 | 
			
		||||
      - MYSQL_DATABASE=${MYSQL_DATABASE}
 | 
			
		||||
      - MYSQL_ROOT_PASSWORD=${SERVICE_PASSWORD_MYSQL_ROOT}
 | 
			
		||||
      - MYSQL_ROOT_PASSWORD=${SERVICE_PASSWORD_MYSQLROOT}
 | 
			
		||||
    healthcheck:
 | 
			
		||||
      test: ["CMD", "mysqladmin", "ping", "-h", "localhost"]
 | 
			
		||||
      interval: 5s
 | 
			
		||||
      timeout: 5s
 | 
			
		||||
      retries: 10
 | 
			
		||||
							
								
								
									
										13
									
								
								resources/views/livewire/dev/compose.blade.php
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										13
									
								
								resources/views/livewire/dev/compose.blade.php
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,13 @@
 | 
			
		||||
<div class="pb-10" x-data>
 | 
			
		||||
    <h1>Compose</h1>
 | 
			
		||||
    <div>All kinds of compose files.</div>
 | 
			
		||||
    <h3 class="pt-4">Services</h3>
 | 
			
		||||
    @foreach ($services as $serviceName => $value)
 | 
			
		||||
        <x-forms.button wire:click="setService('{{ $serviceName }}')">{{ Str::headline($serviceName) }}</x-forms.button>
 | 
			
		||||
    @endforeach
 | 
			
		||||
    <h3 class="pt-4">Base64 En/Decode</h3>
 | 
			
		||||
    <x-forms.button x-on:click="copyToClipboard('{{ $base64 }}')">Copy Base64 Compose</x-forms.button>
 | 
			
		||||
    <div class="pt-4">
 | 
			
		||||
        <x-forms.textarea realtimeValidation rows="40" id="compose"></x-forms.textarea>
 | 
			
		||||
    </div>
 | 
			
		||||
</div>
 | 
			
		||||
@@ -9,6 +9,7 @@ use App\Http\Controllers\ServerController;
 | 
			
		||||
use App\Http\Livewire\Boarding\Index as BoardingIndex;
 | 
			
		||||
use App\Http\Livewire\Project\Service\Index as ServiceIndex;
 | 
			
		||||
use App\Http\Livewire\Project\Service\Show as ServiceShow;
 | 
			
		||||
use App\Http\Livewire\Dev\Compose as Compose;
 | 
			
		||||
use App\Http\Livewire\Dashboard;
 | 
			
		||||
use App\Http\Livewire\Project\Shared\Logs;
 | 
			
		||||
use App\Http\Livewire\Server\All;
 | 
			
		||||
@@ -29,6 +30,9 @@ use Laravel\Fortify\Contracts\FailedPasswordResetLinkRequestResponse;
 | 
			
		||||
use Laravel\Fortify\Contracts\SuccessfulPasswordResetLinkRequestResponse;
 | 
			
		||||
use Laravel\Fortify\Fortify;
 | 
			
		||||
 | 
			
		||||
if (isDev()) {
 | 
			
		||||
    Route::get('/dev/compose', Compose::class)->name('dev.compose');
 | 
			
		||||
}
 | 
			
		||||
Route::post('/forgot-password', function (Request $request) {
 | 
			
		||||
    if (is_transactional_emails_active()) {
 | 
			
		||||
        $arrayOfRequest = $request->only(Fortify::email());
 | 
			
		||||
@@ -94,7 +98,6 @@ Route::middleware(['auth'])->group(function () {
 | 
			
		||||
    Route::get('/project/{project_uuid}/{environment_name}/service/{service_uuid}', ServiceIndex::class)->name('project.service');
 | 
			
		||||
    Route::get('/project/{project_uuid}/{environment_name}/service/{service_uuid}/{service_name}', ServiceShow::class)->name('project.service.show');
 | 
			
		||||
    Route::get('/project/{project_uuid}/{environment_name}/service/{service_uuid}/{service_name}/logs', Logs::class)->name('project.service.logs');
 | 
			
		||||
 | 
			
		||||
});
 | 
			
		||||
 | 
			
		||||
Route::middleware(['auth'])->group(function () {
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user