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)
|
->visible(fn () => $this->fail2banRunning)
|
||||||
->requiresConfirmation()
|
->requiresConfirmation()
|
||||||
->modalHeading(__('Disable Fail2ban'))
|
->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'),
|
->action('disableFail2ban'),
|
||||||
])
|
])
|
||||||
->schema([
|
->schema([
|
||||||
@@ -665,9 +667,12 @@ class Security extends Page implements HasActions, HasForms, HasTable
|
|||||||
->color(fn () => $this->clamavRunning ? 'warning' : 'success')
|
->color(fn () => $this->clamavRunning ? 'warning' : 'success')
|
||||||
->size('sm')
|
->size('sm')
|
||||||
->action(fn () => $this->clamavRunning ? $this->disableClamav() : $this->enableClamav())
|
->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
|
->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?')),
|
: __('Starting ClamAV daemon uses ~500MB RAM. Continue?')),
|
||||||
FormAction::make('updateSignatures')
|
FormAction::make('updateSignatures')
|
||||||
->label(__('Update Signatures'))
|
->label(__('Update Signatures'))
|
||||||
|
|||||||
@@ -208,7 +208,9 @@ class Services extends Page implements HasActions, HasForms, HasTable
|
|||||||
->visible(fn (array $record): bool => $record['is_active'])
|
->visible(fn (array $record): bool => $record['is_active'])
|
||||||
->requiresConfirmation()
|
->requiresConfirmation()
|
||||||
->modalHeading(__('Stop Service'))
|
->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'))
|
->modalSubmitActionLabel(__('Stop Service'))
|
||||||
->action(fn (array $record) => $this->executeServiceAction($record['service'], 'stop')),
|
->action(fn (array $record) => $this->executeServiceAction($record['service'], 'stop')),
|
||||||
Action::make('restart')
|
Action::make('restart')
|
||||||
@@ -236,7 +238,9 @@ class Services extends Page implements HasActions, HasForms, HasTable
|
|||||||
->visible(fn (array $record): bool => $record['is_enabled'])
|
->visible(fn (array $record): bool => $record['is_enabled'])
|
||||||
->requiresConfirmation()
|
->requiresConfirmation()
|
||||||
->modalHeading(__('Disable Service'))
|
->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'))
|
->modalSubmitActionLabel(__('Disable Service'))
|
||||||
->action(fn (array $record) => $this->executeServiceAction($record['service'], 'disable')),
|
->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
|
if [[ -f "$SCRIPT_DIR/VERSION" ]]; then
|
||||||
JABALI_VERSION="$(sed -n 's/^VERSION=//p' "$SCRIPT_DIR/VERSION")"
|
JABALI_VERSION="$(sed -n 's/^VERSION=//p' "$SCRIPT_DIR/VERSION")"
|
||||||
fi
|
fi
|
||||||
JABALI_VERSION="${JABALI_VERSION:-0.9-rc54}"
|
JABALI_VERSION="${JABALI_VERSION:-0.9-rc55}"
|
||||||
|
|
||||||
# Colors
|
# Colors
|
||||||
RED='\033[0;31m'
|
RED='\033[0;31m'
|
||||||
|
|||||||
Reference in New Issue
Block a user