Feat: service confirmation

This commit is contained in:
ayntk-ai
2024-09-03 16:59:51 +02:00
parent d5b7e9ed83
commit d94e39ccc7
3 changed files with 21 additions and 13 deletions

View File

@@ -51,7 +51,7 @@ class Configuration extends Component
$application = $this->service->applications->find($id); $application = $this->service->applications->find($id);
if ($application) { if ($application) {
$application->restart(); $application->restart();
$this->dispatch('success', 'Application restarted successfully.'); $this->dispatch('success', 'Service application restarted successfully.');
} }
} catch (\Exception $e) { } catch (\Exception $e) {
return handleError($e, $this); return handleError($e, $this);
@@ -64,7 +64,7 @@ class Configuration extends Component
$database = $this->service->databases->find($id); $database = $this->service->databases->find($id);
if ($database) { if ($database) {
$database->restart(); $database->restart();
$this->dispatch('success', 'Database restarted successfully.'); $this->dispatch('success', 'Service database restarted successfully.');
} }
} catch (\Exception $e) { } catch (\Exception $e) {
return handleError($e, $this); return handleError($e, $this);

View File

@@ -33,7 +33,7 @@
title="Confirm Database Restart?" title="Confirm Database Restart?"
buttonTitle="Restart" buttonTitle="Restart"
submitAction="restart" submitAction="restart"
:actions="['This database will be restarted.', 'If the database is currently in use data could be lost.']" :actions="['This database will be unavailable during the restart.', 'If the database is currently in use data could be lost.']"
:confirmWithText="false" :confirmWithText="false"
:confirmWithPassword="false" :confirmWithPassword="false"
step2ButtonText="Restart Database" step2ButtonText="Restart Database"

View File

@@ -111,11 +111,15 @@
Settings Settings
</a> </a>
@if (str($application->status)->contains('running')) @if (str($application->status)->contains('running'))
<x-modal-confirmation action="restartApplication({{ $application->id }})" <x-modal-confirmation
isErrorButton buttonTitle="Restart"> title="Confirm Service Application Restart?"
This application will be unavailable during the restart. <br>Please think buttonTitle="Restart"
again. submitAction="restartApplication({{ $application->id }})"
</x-modal-confirmation> :actions="['The selected service application will be unavailable during the restart.', 'If the service application is currently in use data could be lost.']"
:confirmWithText="false"
:confirmWithPassword="false"
step2ButtonText="Restart Service Container"
/>
@endif @endif
</div> </div>
</div> </div>
@@ -155,11 +159,15 @@
Settings Settings
</a> </a>
@if (str($database->status)->contains('running')) @if (str($database->status)->contains('running'))
<x-modal-confirmation action="restartDatabase({{ $database->id }})" <x-modal-confirmation
isErrorButton buttonTitle="Restart"> title="Confirm Service Database Restart?"
This database will be unavailable during the restart. <br>Please think buttonTitle="Restart"
again. submitAction="restartDatabase({{ $database->id }})"
</x-modal-confirmation> :actions="['This service database will be unavailable during the restart.', 'If the service database is currently in use data could be lost.']"
:confirmWithText="false"
:confirmWithPassword="false"
step2ButtonText="Restart Database"
/>
@endif @endif
</div> </div>
</div> </div>