chore: Refactor scheduled task view to improve code readability and maintainability
This commit is contained in:
		@@ -7,15 +7,27 @@
 | 
				
			|||||||
    </div>
 | 
					    </div>
 | 
				
			||||||
    <div class="flex flex-wrap gap-2 pt-4">
 | 
					    <div class="flex flex-wrap gap-2 pt-4">
 | 
				
			||||||
        @forelse($resource->scheduled_tasks as $task)
 | 
					        @forelse($resource->scheduled_tasks as $task)
 | 
				
			||||||
            <a class="flex flex-col box"
 | 
					            @if ($resource->type() == 'application')
 | 
				
			||||||
                @if ($resource->type() == 'application') href="{{ route('project.application.scheduled-tasks', [...$parameters, 'task_uuid' => $task->uuid]) }}">
 | 
					                <a class="box"
 | 
				
			||||||
                @elseif  ($resource->type() == 'service')
 | 
					                    href="{{ route('project.application.scheduled-tasks', [...$parameters, 'task_uuid' => $task->uuid]) }}">
 | 
				
			||||||
                href="{{ route('project.service.scheduled-tasks', [...$parameters, 'task_uuid' => $task->uuid]) }}"> @endif
 | 
					                    <span class="flex flex-col">
 | 
				
			||||||
                <div><span class="font-bold dark:text-warning">{{ $task->name }}<span>
 | 
					                        <span class="font-bold">{{ $task->name }}</span>
 | 
				
			||||||
    </div>
 | 
					                        <span>Frequency: {{ $task->frequency }}</span>
 | 
				
			||||||
    <div>Frequency: {{ $task->frequency }}</div>
 | 
					                        <span>Last run: {{ data_get($task->latest_log, 'status', 'No runs yet') }}
 | 
				
			||||||
    <div>Last run: {{ data_get($task->latest_log, 'status', 'No runs yet') }}</div>
 | 
					                        </span>
 | 
				
			||||||
 | 
					                    </span>
 | 
				
			||||||
                </a>
 | 
					                </a>
 | 
				
			||||||
 | 
					            @elseif ($resource->type() == 'service')
 | 
				
			||||||
 | 
					                <a class="box"
 | 
				
			||||||
 | 
					                    href="{{ route('project.service.scheduled-tasks', [...$parameters, 'task_uuid' => $task->uuid]) }}">
 | 
				
			||||||
 | 
					                    <span class="flex flex-col">
 | 
				
			||||||
 | 
					                        <span class="font-bold">{{ $task->name }}</span>
 | 
				
			||||||
 | 
					                        <span>Frequency: {{ $task->frequency }}</span>
 | 
				
			||||||
 | 
					                        <span>Last run: {{ data_get($task->latest_log, 'status', 'No runs yet') }}
 | 
				
			||||||
 | 
					                        </span>
 | 
				
			||||||
 | 
					                    </span>
 | 
				
			||||||
 | 
					                </a>
 | 
				
			||||||
 | 
					            @endif
 | 
				
			||||||
        @empty
 | 
					        @empty
 | 
				
			||||||
            <div>No scheduled tasks configured.</div>
 | 
					            <div>No scheduled tasks configured.</div>
 | 
				
			||||||
        @endforelse
 | 
					        @endforelse
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user