Commit 26560e62 authored by Roman Ondráček's avatar Roman Ondráček

Gateway: refactor unattended upgrade control panel

Signed-off-by: Roman Ondráček's avatarRoman Ondráček <ondracek.roman@centrum.cz>
parent 40ea1847
......@@ -46,31 +46,31 @@ class UnattendedUpgradesPresenter extends ProtectedPresenter {
}
/**
* Disables and stops PIXLA client
* Disables and stops unattended upgrades
*/
public function actionDisable(): void {
public function handleDisable(): void {
$this->manager->disableService();
$this->flashSuccess('gateway.unattendedUpgrades.messages.disable');
$this->setView('default');
$this->redirect('UnattendedUpgrades:default');
}
/**
* Enables and starts PIXLA client
* Enables and starts unattended upgrades
*/
public function actionEnable(): void {
public function handleEnable(): void {
$this->manager->enableService();
$this->flashSuccess('gateway.unattendedUpgrades.messages.enable');
$this->setView('default');
$this->redirect('UnattendedUpgrades:default');
}
/**
* Renders unattended upgrade control panel
*/
public function renderDefault(): void {
$this->template->status = $this->manager->getServiceStatus();
$this->redrawControl('status');
}
/**
* Checks if the PIXLA manager is enabled
* Checks if the unattended upgrades is enabled
*/
protected function startup(): void {
parent::startup();
......
......@@ -18,7 +18,7 @@
{block title}{_gateway.unattendedUpgrades.title}{/block}
{block content}
<div class='panel panel-default'>
<div class='panel-body'>
<div n:snippet='status' class='panel-body'>
<table class='table table-striped'>
<tr>
<th>{_gateway.unattendedUpgrades.status}</th>
......@@ -26,8 +26,8 @@
</tr>
</table>
{if $status !== ''}
<a class='ajax btn btn-success' n:href='enable' role='button'>{_gateway.unattendedUpgrades.enable}</a>
<a class='ajax btn btn-danger' n:href='disable' role='button'>{_gateway.unattendedUpgrades.disable}</a>
<a class='ajax btn btn-success' n:href='enable!' role='button'>{_gateway.unattendedUpgrades.enable}</a>
<a class='ajax btn btn-danger' n:href='disable!' role='button'>{_gateway.unattendedUpgrades.disable}</a>
{/if}
</div>
</div>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment