path deployments
This commit is contained in:
parent
28cf89627d
commit
8651d02651
@ -46,6 +46,9 @@ public function resources()
|
||||
if (!$environment) {
|
||||
return redirect()->route('dashboard');
|
||||
}
|
||||
return view('project.resources', ['project' => $project, 'environment' => $environment]);
|
||||
return view('project.resources', [
|
||||
'project' => $project,
|
||||
'environment' => $environment
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
@ -73,7 +73,11 @@ public function mount()
|
||||
}
|
||||
public function submit()
|
||||
{
|
||||
try {
|
||||
$this->validate();
|
||||
$this->application->save();
|
||||
} catch (\Exception $e) {
|
||||
return generalErrorHandler($e, $this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -383,9 +383,11 @@ private function set_labels_for_applications()
|
||||
$path = $url->getPath();
|
||||
$labels[] = 'traefik.enable=true';
|
||||
if ($path === '/') {
|
||||
$labels[] = "traefik.http.routers.container.rule=Host(`{$host}`) && PathPrefix(`{$path}`)";
|
||||
$labels[] = "traefik.http.routers.{$this->application->uuid}.rule=Host(`{$host}`) && Path(`{$path}`)";
|
||||
} else {
|
||||
$labels[] = "traefik.http.routers.container.rule=Host(`{$host}`) && PathPrefix(`{$path}`)";
|
||||
$labels[] = "traefik.http.routers.{$this->application->uuid}.rule=Host(`{$host}`) && PathPrefix(`{$path}`)";
|
||||
$labels[] = "traefik.http.routers.{$this->application->uuid}.middlewares={$this->application->uuid}-stripprefix";
|
||||
$labels[] = "traefik.http.middlewares.{$this->application->uuid}-stripprefix.stripprefix.prefixes={$path}";
|
||||
}
|
||||
}
|
||||
return $labels;
|
||||
|
@ -33,7 +33,7 @@ function generalErrorHandler(\Throwable $e, $that = null, $isJson = false)
|
||||
}
|
||||
} catch (\Throwable $error) {
|
||||
if ($that) {
|
||||
$that->emit('error', $error->getMessage());
|
||||
return $that->emit('error', $error->getMessage());
|
||||
} elseif ($isJson) {
|
||||
return response()->json([
|
||||
'code' => $error->getCode(),
|
||||
|
@ -6,8 +6,8 @@
|
||||
@if ($environment->applications->count() === 0)
|
||||
<p>No resources yet.</p>
|
||||
@endif
|
||||
<div class="flex">
|
||||
@foreach ($environment->applications as $application)
|
||||
<div class="flex gap-2">
|
||||
@foreach ($environment->applications->sortBy('name') as $application)
|
||||
<a class="box"
|
||||
href="{{ route('project.application.configuration', [$project->uuid, $environment->name, $application->uuid]) }}">
|
||||
{{ $application->name }}
|
||||
|
Loading…
Reference in New Issue
Block a user