Add confirmations for service disabling
This commit is contained in:
@@ -575,7 +575,9 @@ class Security extends Page implements HasActions, HasForms, HasTable
|
||||
->visible(fn () => $this->fail2banRunning)
|
||||
->requiresConfirmation()
|
||||
->modalHeading(__('Disable Fail2ban'))
|
||||
->modalDescription(__('Fail2ban will be stopped and disabled. You can re-enable it later from this tab.'))
|
||||
->modalIcon('heroicon-o-exclamation-triangle')
|
||||
->modalIconColor('warning')
|
||||
->modalDescription(__('Warning: Fail2ban will be stopped and disabled. You can re-enable it later from this tab.'))
|
||||
->action('disableFail2ban'),
|
||||
])
|
||||
->schema([
|
||||
@@ -665,9 +667,12 @@ class Security extends Page implements HasActions, HasForms, HasTable
|
||||
->color(fn () => $this->clamavRunning ? 'warning' : 'success')
|
||||
->size('sm')
|
||||
->action(fn () => $this->clamavRunning ? $this->disableClamav() : $this->enableClamav())
|
||||
->requiresConfirmation(fn () => ! $this->clamavRunning)
|
||||
->requiresConfirmation()
|
||||
->modalHeading(fn () => $this->clamavRunning ? __('Disable ClamAV') : __('Enable ClamAV'))
|
||||
->modalIcon('heroicon-o-exclamation-triangle')
|
||||
->modalIconColor('warning')
|
||||
->modalDescription(fn () => $this->clamavRunning
|
||||
? __('ClamAV will be stopped and disabled. You can re-enable it later.')
|
||||
? __('Warning: This will stop and disable ClamAV. You can re-enable it later.')
|
||||
: __('Starting ClamAV daemon uses ~500MB RAM. Continue?')),
|
||||
FormAction::make('updateSignatures')
|
||||
->label(__('Update Signatures'))
|
||||
|
||||
@@ -208,7 +208,9 @@ class Services extends Page implements HasActions, HasForms, HasTable
|
||||
->visible(fn (array $record): bool => $record['is_active'])
|
||||
->requiresConfirmation()
|
||||
->modalHeading(__('Stop Service'))
|
||||
->modalDescription(fn (array $record): string => __('Are you sure you want to stop :service? This may affect running websites and services.', ['service' => $record['name']]))
|
||||
->modalIcon('heroicon-o-exclamation-triangle')
|
||||
->modalIconColor('warning')
|
||||
->modalDescription(fn (array $record): string => __('Warning: This will stop :service and may affect running websites and services. Are you sure you want to continue?', ['service' => $record['name']]))
|
||||
->modalSubmitActionLabel(__('Stop Service'))
|
||||
->action(fn (array $record) => $this->executeServiceAction($record['service'], 'stop')),
|
||||
Action::make('restart')
|
||||
@@ -236,7 +238,9 @@ class Services extends Page implements HasActions, HasForms, HasTable
|
||||
->visible(fn (array $record): bool => $record['is_enabled'])
|
||||
->requiresConfirmation()
|
||||
->modalHeading(__('Disable Service'))
|
||||
->modalDescription(fn (array $record): string => __("Are you sure you want to disable :service? It won't start automatically on boot.", ['service' => $record['name']]))
|
||||
->modalIcon('heroicon-o-exclamation-triangle')
|
||||
->modalIconColor('warning')
|
||||
->modalDescription(fn (array $record): string => __('Warning: This will disable :service and it will not start automatically on boot. Are you sure you want to continue?', ['service' => $record['name']]))
|
||||
->modalSubmitActionLabel(__('Disable Service'))
|
||||
->action(fn (array $record) => $this->executeServiceAction($record['service'], 'disable')),
|
||||
])
|
||||
|
||||
@@ -16,7 +16,7 @@ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
if [[ -f "$SCRIPT_DIR/VERSION" ]]; then
|
||||
JABALI_VERSION="$(sed -n 's/^VERSION=//p' "$SCRIPT_DIR/VERSION")"
|
||||
fi
|
||||
JABALI_VERSION="${JABALI_VERSION:-0.9-rc54}"
|
||||
JABALI_VERSION="${JABALI_VERSION:-0.9-rc55}"
|
||||
|
||||
# Colors
|
||||
RED='\033[0;31m'
|
||||
|
||||
Reference in New Issue
Block a user