generated from github/welcome-to-github
-
-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
22 changed files
with
644 additions
and
215 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<?php | ||
|
||
namespace Controllers\Host; | ||
|
||
use Exception; | ||
|
||
class Package | ||
{ | ||
private $model; | ||
|
||
public function __construct(int $hostId) | ||
{ | ||
$this->model = new \Models\Host\Package($hostId); | ||
} | ||
|
||
/** | ||
* Retrieve the list of inventoried packages on the host | ||
*/ | ||
public function getInventory() : array | ||
{ | ||
return $this->model->getInventory(); | ||
} | ||
|
||
/** | ||
* Retrieve the list of installed packages on the host | ||
*/ | ||
public function getInstalled() : array | ||
{ | ||
return $this->model->getInstalled(); | ||
} | ||
|
||
/** | ||
* Retrieve the list of packages available for update on the host | ||
* It is possible to add an offset to the request | ||
*/ | ||
public function getAvailable(bool $withOffset = false, int $offset = 0) : array | ||
{ | ||
return $this->model->getAvailable($withOffset, $offset); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<?php | ||
if (!IS_ADMIN) { | ||
throw new Exception('You are not allowed to access this panel'); | ||
} | ||
|
||
$myEditForm = new \Controllers\Repo\Edit\Form(); | ||
|
||
/** | ||
* Check that action and repos params have been sent | ||
*/ | ||
if (empty($item['repos'])) { | ||
throw new Exception('Task repositories required'); | ||
} | ||
|
||
$slidePanelTitle = 'EDIT REPOSITORY & SNAPSHOT PROPERTIES'; | ||
|
||
/** | ||
* Get form content | ||
*/ | ||
$formContent = $myEditForm->get(json_decode($item['repos'], true)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.