2025-06-17 07:28:07 +00:00
|
|
|
<div wire:poll.10000ms="checkStatus" class="pb-6">
|
2024-04-12 10:44:49 +00:00
|
|
|
<livewire:project.shared.configuration-checker :resource="$service" />
|
2024-03-21 11:44:32 +00:00
|
|
|
<x-slide-over @startservice.window="slideOverOpen = true" closeWithX fullScreen>
|
|
|
|
|
<x-slot:title>Service Startup</x-slot:title>
|
|
|
|
|
<x-slot:content>
|
2025-06-11 10:02:39 +00:00
|
|
|
<livewire:activity-monitor header="Logs" fullHeight />
|
2024-03-21 11:44:32 +00:00
|
|
|
</x-slot:content>
|
|
|
|
|
</x-slide-over>
|
2024-09-17 15:15:34 +00:00
|
|
|
<h1>{{ $title }}</h1>
|
2023-09-22 09:23:49 +00:00
|
|
|
<x-resources.breadcrumbs :resource="$service" :parameters="$parameters" />
|
2025-01-13 11:03:03 +00:00
|
|
|
<div class="navbar-main" x-data">
|
2026-02-23 13:17:15 +00:00
|
|
|
<nav class="flex shrink-0 gap-6 items-center whitespace-nowrap scrollbar min-h-10">
|
2025-12-17 11:09:13 +00:00
|
|
|
<a class="{{ request()->routeIs('project.service.configuration') ? 'dark:text-white' : '' }}" {{ wireNavigate() }}
|
2024-05-05 16:33:52 +00:00
|
|
|
href="{{ route('project.service.configuration', $parameters) }}">
|
|
|
|
|
<button>Configuration</button>
|
|
|
|
|
</a>
|
2025-12-17 17:13:18 +00:00
|
|
|
<a class="{{ request()->routeIs('project.service.logs') ? 'dark:text-white' : '' }}"
|
2024-12-17 10:13:13 +00:00
|
|
|
href="{{ route('project.service.logs', $parameters) }}">
|
|
|
|
|
<button>Logs</button>
|
|
|
|
|
</a>
|
2025-08-26 08:27:31 +00:00
|
|
|
@can('canAccessTerminal')
|
|
|
|
|
<a class="{{ request()->routeIs('project.service.command') ? 'dark:text-white' : '' }}"
|
|
|
|
|
href="{{ route('project.service.command', $parameters) }}">
|
|
|
|
|
<button>Terminal</button>
|
|
|
|
|
</a>
|
|
|
|
|
@endcan
|
2024-05-05 16:33:52 +00:00
|
|
|
<x-services.links :service="$service" />
|
|
|
|
|
</nav>
|
2024-10-11 12:38:22 +00:00
|
|
|
@if ($service->isDeployable)
|
|
|
|
|
<div class="flex flex-wrap order-first gap-2 items-center sm:order-last">
|
2025-01-13 11:03:03 +00:00
|
|
|
<x-services.advanced :service="$service" />
|
2025-11-19 12:24:02 +00:00
|
|
|
@if (str($service->status)->contains('running'))
|
2024-10-11 12:38:22 +00:00
|
|
|
<x-forms.button title="Restart" @click="$wire.dispatch('restartEvent')">
|
|
|
|
|
<svg class="w-5 h-5 dark:text-warning" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
|
|
|
|
|
<g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"
|
|
|
|
|
stroke-width="2">
|
2025-11-19 09:54:51 +00:00
|
|
|
<path d="M19.933 13.041 a8 8 0 1 1-9.925-8.788c3.899-1 7.935 1.007 9.425 4.747" />
|
2024-10-11 12:38:22 +00:00
|
|
|
<path d="M20 4v5h-5" />
|
|
|
|
|
</g>
|
2024-10-03 11:17:35 +00:00
|
|
|
</svg>
|
2024-10-11 12:38:22 +00:00
|
|
|
Restart
|
|
|
|
|
</x-forms.button>
|
2025-05-20 09:34:50 +00:00
|
|
|
<x-modal-confirmation title="Confirm Service Stopping?" buttonTitle="Stop" :dispatchEvent="true"
|
|
|
|
|
submitAction="stop" dispatchEventType="stopEvent" :checkboxes="$checkboxes" :actions="[__('service.stop'), __('resource.non_persistent')]"
|
2025-06-24 11:37:05 +00:00
|
|
|
:confirmWithText="false" :confirmWithPassword="false" step1ButtonText="Continue" step2ButtonText="Confirm">
|
2024-10-11 12:38:22 +00:00
|
|
|
<x-slot:button-title>
|
|
|
|
|
<svg xmlns="http://www.w3.org/2000/svg" class="w-5 h-5 text-error" viewBox="0 0 24 24"
|
|
|
|
|
stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round"
|
|
|
|
|
stroke-linejoin="round">
|
|
|
|
|
<path stroke="none" d="M0 0h24v24H0z" fill="none"></path>
|
|
|
|
|
<path d="M6 5m0 1a1 1 0 0 1 1 -1h2a1 1 0 0 1 1 1v12a1 1 0 0 1 -1 1h-2a1 1 0 0 1 -1 -1z">
|
|
|
|
|
</path>
|
|
|
|
|
<path
|
|
|
|
|
d="M14 5m0 1a1 1 0 0 1 1 -1h2a1 1 0 0 1 1 1v12a1 1 0 0 1 -1 1h-2a1 1 0 0 1 -1 -1z">
|
|
|
|
|
</path>
|
|
|
|
|
</svg>
|
|
|
|
|
Stop
|
|
|
|
|
</x-slot:button-title>
|
|
|
|
|
</x-modal-confirmation>
|
2024-12-13 11:03:05 +00:00
|
|
|
@elseif (str($service->status)->contains('degraded'))
|
2025-01-13 11:03:03 +00:00
|
|
|
<x-forms.button title="Restart" @click="$wire.dispatch('restartEvent')">
|
2024-10-11 12:38:22 +00:00
|
|
|
<svg class="w-5 h-5 dark:text-warning" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
|
|
|
|
|
<g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"
|
|
|
|
|
stroke-width="2">
|
|
|
|
|
<path d="M19.933 13.041a8 8 0 1 1-9.925-8.788c3.899-1 7.935 1.007 9.425 4.747" />
|
|
|
|
|
<path d="M20 4v5h-5" />
|
|
|
|
|
</g>
|
|
|
|
|
</svg>
|
2025-01-13 11:03:03 +00:00
|
|
|
Restart
|
|
|
|
|
</x-forms.button>
|
2025-05-20 09:34:50 +00:00
|
|
|
<x-modal-confirmation title="Confirm Service Stopping?" buttonTitle="Stop" :dispatchEvent="true"
|
|
|
|
|
submitAction="stop" dispatchEventType="stopEvent" :checkboxes="$checkboxes" :actions="[__('service.stop'), __('resource.non_persistent')]"
|
2025-06-24 11:37:05 +00:00
|
|
|
:confirmWithText="false" :confirmWithPassword="false" step1ButtonText="Continue" step2ButtonText="Confirm">
|
2024-10-11 12:38:22 +00:00
|
|
|
<x-slot:button-title>
|
|
|
|
|
<svg xmlns="http://www.w3.org/2000/svg" class="w-5 h-5 text-error" viewBox="0 0 24 24"
|
|
|
|
|
stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round"
|
|
|
|
|
stroke-linejoin="round">
|
|
|
|
|
<path stroke="none" d="M0 0h24v24H0z" fill="none"></path>
|
|
|
|
|
<path d="M6 5m0 1a1 1 0 0 1 1 -1h2a1 1 0 0 1 1 1v12a1 1 0 0 1 -1 1h-2a1 1 0 0 1 -1 -1z">
|
|
|
|
|
</path>
|
|
|
|
|
<path
|
|
|
|
|
d="M14 5m0 1a1 1 0 0 1 1 -1h2a1 1 0 0 1 1 1v12a1 1 0 0 1 -1 1h-2a1 1 0 0 1 -1 -1z">
|
|
|
|
|
</path>
|
|
|
|
|
</svg>
|
|
|
|
|
Stop
|
|
|
|
|
</x-slot:button-title>
|
|
|
|
|
</x-modal-confirmation>
|
2024-12-13 11:03:05 +00:00
|
|
|
@elseif (str($service->status)->contains('exited'))
|
2024-10-11 12:38:22 +00:00
|
|
|
<button @click="$wire.dispatch('startEvent')" class="gap-2 button">
|
|
|
|
|
<svg xmlns="http://www.w3.org/2000/svg" class="w-5 h-5 dark:text-warning" viewBox="0 0 24 24"
|
|
|
|
|
stroke-width="1.5" stroke="currentColor" fill="none" stroke-linecap="round"
|
2024-09-19 08:27:44 +00:00
|
|
|
stroke-linejoin="round">
|
2024-10-11 12:38:22 +00:00
|
|
|
<path stroke="none" d="M0 0h24v24H0z" fill="none" />
|
|
|
|
|
<path d="M7 4v16l13 -8z" />
|
2024-09-19 08:27:44 +00:00
|
|
|
</svg>
|
2024-10-11 12:38:22 +00:00
|
|
|
Deploy
|
|
|
|
|
</button>
|
|
|
|
|
@else
|
2025-05-20 09:34:50 +00:00
|
|
|
<x-modal-confirmation title="Confirm Service Stopping?" buttonTitle="Stop" :dispatchEvent="true"
|
|
|
|
|
submitAction="stop" dispatchEventType="stopEvent" :checkboxes="$checkboxes" :actions="[__('service.stop'), __('resource.non_persistent')]"
|
2025-06-24 11:37:05 +00:00
|
|
|
:confirmWithText="false" :confirmWithPassword="false" step1ButtonText="Continue" step2ButtonText="Confirm">
|
2024-10-11 12:38:22 +00:00
|
|
|
<x-slot:button-title>
|
|
|
|
|
<svg xmlns="http://www.w3.org/2000/svg" class="w-5 h-5 text-error" viewBox="0 0 24 24"
|
|
|
|
|
stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round"
|
|
|
|
|
stroke-linejoin="round">
|
|
|
|
|
<path stroke="none" d="M0 0h24v24H0z" fill="none"></path>
|
|
|
|
|
<path d="M6 5m0 1a1 1 0 0 1 1 -1h2a1 1 0 0 1 1 1v12a1 1 0 0 1 -1 1h-2a1 1 0 0 1 -1 -1z">
|
|
|
|
|
</path>
|
|
|
|
|
<path
|
|
|
|
|
d="M14 5m0 1a1 1 0 0 1 1 -1h2a1 1 0 0 1 1 1v12a1 1 0 0 1 -1 1h-2a1 1 0 0 1 -1 -1z">
|
|
|
|
|
</path>
|
|
|
|
|
</svg>
|
|
|
|
|
Stop
|
|
|
|
|
</x-slot:button-title>
|
|
|
|
|
</x-modal-confirmation>
|
|
|
|
|
<button @click="$wire.dispatch('startEvent')" class="gap-2 button">
|
|
|
|
|
<svg xmlns="http://www.w3.org/2000/svg" class="w-5 h-5 dark:text-warning" viewBox="0 0 24 24"
|
|
|
|
|
stroke-width="1.5" stroke="currentColor" fill="none" stroke-linecap="round"
|
2024-09-19 08:27:44 +00:00
|
|
|
stroke-linejoin="round">
|
2024-10-11 12:38:22 +00:00
|
|
|
<path stroke="none" d="M0 0h24v24H0z" fill="none" />
|
|
|
|
|
<path d="M7 4v16l13 -8z" />
|
2024-09-19 08:27:44 +00:00
|
|
|
</svg>
|
2024-10-11 12:38:22 +00:00
|
|
|
Deploy
|
|
|
|
|
</button>
|
|
|
|
|
@endif
|
|
|
|
|
</div>
|
|
|
|
|
@else
|
|
|
|
|
<div class="flex flex-wrap order-first gap-2 items-center sm:order-last">
|
|
|
|
|
<div class="text-error">
|
2025-12-17 11:09:13 +00:00
|
|
|
Unable to deploy. <a class="underline font-bold cursor-pointer" {{ wireNavigate() }}
|
2025-04-29 07:04:24 +00:00
|
|
|
href="{{ route('project.service.environment-variables', $parameters) }}">
|
2024-10-11 12:38:22 +00:00
|
|
|
Required environment variables missing.</a>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
@endif
|
2024-03-21 11:44:32 +00:00
|
|
|
</div>
|
|
|
|
|
@script
|
2024-09-19 08:27:44 +00:00
|
|
|
<script>
|
|
|
|
|
$wire.$on('stopEvent', () => {
|
2025-05-30 11:35:09 +00:00
|
|
|
$wire.$dispatch('info',
|
2025-06-24 10:52:22 +00:00
|
|
|
'Gracefully stopping service.<br/><br/>It could take a while depending on the service.');
|
2024-09-19 08:27:44 +00:00
|
|
|
$wire.$call('stop');
|
|
|
|
|
});
|
2025-01-13 11:03:03 +00:00
|
|
|
$wire.$on('startEvent', async () => {
|
|
|
|
|
const isDeploymentProgress = await $wire.$call('checkDeployments');
|
|
|
|
|
if (isDeploymentProgress) {
|
|
|
|
|
$wire.$dispatch('error',
|
|
|
|
|
'There is a deployment in progress.<br><br>You can force deploy in the "Advanced" section.'
|
|
|
|
|
);
|
|
|
|
|
return;
|
|
|
|
|
}
|
2024-09-19 08:27:44 +00:00
|
|
|
window.dispatchEvent(new CustomEvent('startservice'));
|
|
|
|
|
$wire.$call('start');
|
|
|
|
|
});
|
2025-01-13 11:03:03 +00:00
|
|
|
$wire.$on('forceDeployEvent', () => {
|
|
|
|
|
window.dispatchEvent(new CustomEvent('startservice'));
|
|
|
|
|
$wire.$call('forceDeploy');
|
|
|
|
|
});
|
|
|
|
|
$wire.$on('restartEvent', async () => {
|
|
|
|
|
const isDeploymentProgress = await $wire.$call('checkDeployments');
|
|
|
|
|
if (isDeploymentProgress) {
|
|
|
|
|
$wire.$dispatch('error',
|
|
|
|
|
'There is a deployment in progress.<br><br>You can force deploy in the "Advanced" section.'
|
|
|
|
|
);
|
|
|
|
|
return;
|
|
|
|
|
}
|
2025-05-30 11:35:09 +00:00
|
|
|
$wire.$dispatch('info',
|
2025-06-24 10:52:22 +00:00
|
|
|
'Gracefully stopping service.<br/><br/>It could take a while depending on the service.');
|
2025-02-04 13:34:34 +00:00
|
|
|
window.dispatchEvent(new CustomEvent('startservice'));
|
2024-09-19 08:27:44 +00:00
|
|
|
$wire.$call('restart');
|
|
|
|
|
});
|
2024-10-03 11:17:35 +00:00
|
|
|
$wire.$on('pullAndRestartEvent', () => {
|
2025-02-04 13:34:34 +00:00
|
|
|
$wire.$dispatch('info', 'Pulling new images and restarting service.');
|
|
|
|
|
window.dispatchEvent(new CustomEvent('startservice'));
|
2024-10-03 11:17:35 +00:00
|
|
|
$wire.$call('pullAndRestartEvent');
|
|
|
|
|
});
|
2024-09-19 08:27:44 +00:00
|
|
|
$wire.on('imagePulled', () => {
|
|
|
|
|
window.dispatchEvent(new CustomEvent('startservice'));
|
|
|
|
|
$wire.$dispatch('info', 'Restarting service.');
|
|
|
|
|
});
|
|
|
|
|
</script>
|
2024-03-21 11:44:32 +00:00
|
|
|
@endscript
|
2023-09-22 09:23:49 +00:00
|
|
|
</div>
|