Schedule: Make URLs klickable on overview and handle connection errors
This commit is contained in:
parent
700d841a87
commit
d92733f658
|
@ -21,6 +21,7 @@ use Engelsystem\Models\Shifts\ShiftType;
|
|||
use Engelsystem\Models\User\User;
|
||||
use ErrorException;
|
||||
use GuzzleHttp\Client as GuzzleClient;
|
||||
use GuzzleHttp\Exception\ConnectException;
|
||||
use Illuminate\Database\Connection as DatabaseConnection;
|
||||
use Illuminate\Database\Eloquent\Builder as QueryBuilder;
|
||||
use Illuminate\Database\Eloquent\Collection as DatabaseCollection;
|
||||
|
@ -445,7 +446,12 @@ class ImportSchedule extends BaseController
|
|||
/** @var ScheduleUrl $scheduleUrl */
|
||||
$scheduleUrl = ScheduleUrl::findOrFail($scheduleId);
|
||||
|
||||
try {
|
||||
$scheduleResponse = $this->guzzle->get($scheduleUrl->url);
|
||||
} catch (ConnectException $e) {
|
||||
throw new ErrorException('schedule.import.request-error');
|
||||
}
|
||||
|
||||
if ($scheduleResponse->getStatusCode() != 200) {
|
||||
throw new ErrorException('schedule.import.request-error');
|
||||
}
|
||||
|
|
|
@ -35,7 +35,7 @@
|
|||
{% for schedule in schedules %}
|
||||
<tr>
|
||||
<td>{{ schedule.name }}</td>
|
||||
<td>{{ schedule.url }}</td>
|
||||
<td><a href="{{ schedule.url }}" target="_blank">{{ schedule.url }}</a></td>
|
||||
<td>
|
||||
<div class="btn-group">
|
||||
<a
|
||||
|
|
Loading…
Reference in New Issue