Skip to content

Commit e937d30

Browse files
committed
fix: move terminal to separate view on services
1 parent 595a241 commit e937d30

File tree

5 files changed

+12
-13
lines changed

5 files changed

+12
-13
lines changed

app/Livewire/Project/Service/Navbar.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ class Navbar extends Component
2020

2121
public $isDeploymentProgress = false;
2222

23+
public $title = 'Configuration';
24+
2325
public function mount()
2426
{
2527
if (str($this->service->status())->contains('running') && is_null($this->service->config_hash)) {

resources/views/livewire/project/service/configuration.blade.php

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,6 @@
2323
@click.prevent="activeTab = 'scheduled-tasks'; window.location.hash = 'scheduled-tasks'"
2424
href="#">Scheduled Tasks
2525
</a>
26-
<a class="menu-item sm:min-w-fit" :class="activeTab === 'terminal' && 'menu-item-active'"
27-
@click.prevent="activeTab = 'terminal';
28-
window.location.hash = 'terminal'"
29-
href="#">Terminal</a>
3026
<a class="menu-item sm:min-w-fit" :class="activeTab === 'logs' && 'menu-item-active'"
3127
@click.prevent="activeTab = 'logs';
3228
window.location.hash = 'logs'"
@@ -191,9 +187,6 @@ class="w-4 h-4 dark:text-warning text-coollabs"
191187
<div x-cloak x-show="activeTab === 'logs'">
192188
<livewire:project.shared.logs :resource="$service" />
193189
</div>
194-
<div x-cloak x-show="activeTab === 'terminal'">
195-
<livewire:project.shared.execute-container-command :resource="$service" />
196-
</div>
197190
<div x-cloak x-show="activeTab === 'environment-variables'">
198191
<livewire:project.shared.environment-variable.all :resource="$service" />
199192
</div>

resources/views/livewire/project/service/navbar.blade.php

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,21 @@
66
<livewire:activity-monitor header="Logs" showWaiting fullHeight />
77
</x-slot:content>
88
</x-slide-over>
9-
<h1>Configuration</h1>
9+
<h1>{{ $title }}</h1>
1010
<x-resources.breadcrumbs :resource="$service" :parameters="$parameters" />
1111
<div class="navbar-main" x-data>
12-
<nav class="flex items-center flex-shrink-0 gap-6 scrollbar min-h-10 whitespace-nowrap">
12+
<nav class="flex flex-shrink-0 gap-6 items-center whitespace-nowrap scrollbar min-h-10">
1313
<a class="{{ request()->routeIs('project.service.configuration') ? 'dark:text-white' : '' }}"
1414
href="{{ route('project.service.configuration', $parameters) }}">
1515
<button>Configuration</button>
1616
</a>
17+
<a class="{{ request()->routeIs('project.service.command') ? 'dark:text-white' : '' }}"
18+
href="{{ route('project.service.command', $parameters) }}">
19+
<button>Terminal</button>
20+
</a>
1721
<x-services.links :service="$service" />
1822
</nav>
19-
<div class="flex flex-wrap items-center order-first gap-2 sm:order-last">
23+
<div class="flex flex-wrap order-first gap-2 items-center sm:order-last">
2024
@if (str($service->status())->contains('running'))
2125
<button @click="$wire.dispatch('restartEvent')" class="gap-2 button">
2226
<svg class="w-5 h-5 dark:text-warning" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
@@ -71,7 +75,7 @@
7175
</x-modal-confirmation>
7276
@elseif (str($service->status())->contains('exited'))
7377
<button wire:click='stop(true)' class="gap-2 button">
74-
<svg class="w-5 h-5 " viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg">
78+
<svg class="w-5 h-5" viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg">
7579
<path fill="red" d="M26 20h-6v-2h6zm4 8h-6v-2h6zm-2-4h-6v-2h6z" />
7680
<path fill="red"
7781
d="M17.003 20a4.895 4.895 0 0 0-2.404-4.173L22 3l-1.73-1l-7.577 13.126a5.699 5.699 0 0 0-5.243 1.503C3.706 20.24 3.996 28.682 4.01 29.04a1 1 0 0 0 1 .96h14.991a1 1 0 0 0 .6-1.8c-3.54-2.656-3.598-8.146-3.598-8.2Zm-5.073-3.003A3.11 3.11 0 0 1 15.004 20c0 .038.002.208.017.469l-5.9-2.624a3.8 3.8 0 0 1 2.809-.848ZM15.45 28A5.2 5.2 0 0 1 14 25h-2a6.5 6.5 0 0 0 .968 3h-2.223A16.617 16.617 0 0 1 10 24H8a17.342 17.342 0 0 0 .665 4H6c.031-1.836.29-5.892 1.803-8.553l7.533 3.35A13.025 13.025 0 0 0 17.596 28Z" />

resources/views/livewire/project/shared/execute-container-command.blade.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<h1>Terminal</h1>
1111
<livewire:project.database.heading :database="$resource" />
1212
@elseif ($type === 'service')
13-
<h2>Terminal</h2>
13+
<livewire:project.service.navbar :service="$resource" :parameters="$parameters" title="Terminal" />
1414
@endif
1515
<div x-init="$wire.loadContainers">
1616
<div class="pt-4" wire:loading wire:target='loadContainers'>

routes/web.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,8 +195,8 @@
195195
});
196196
Route::prefix('project/{project_uuid}/{environment_name}/service/{service_uuid}')->group(function () {
197197
Route::get('/', ServiceConfiguration::class)->name('project.service.configuration');
198-
Route::get('/{stack_service_uuid}', ServiceIndex::class)->name('project.service.index');
199198
Route::get('/terminal', ExecuteContainerCommand::class)->name('project.service.command');
199+
Route::get('/{stack_service_uuid}', ServiceIndex::class)->name('project.service.index');
200200
Route::get('/tasks/{task_uuid}', ScheduledTaskShow::class)->name('project.service.scheduled-tasks');
201201
});
202202

0 commit comments

Comments
 (0)