Fix code style issues

This commit is contained in:
Eric Lippmann 2017-11-08 10:26:41 +01:00
parent 73a6750489
commit f4ce2a5d82
3 changed files with 13 additions and 6 deletions

View File

@ -148,7 +148,8 @@ class ListCommand extends Command
* icingacli monitoring list --problems * icingacli monitoring list --problems
* icingacli monitoring list --problems --service_state_type 0 * icingacli monitoring list --problems --service_state_type 0
* icingacli monitoring list --host=local* --service=*disk* * icingacli monitoring list --host=local* --service=*disk*
* icingacli monitoring list --columns 'host,service,service_output' --format='$host$: $service$ ($service_output$)' * icingacli monitoring list --columns 'host,service,service_output' \
--format='$host$: $service$ ($service_output$)'
*/ */
public function statusAction() public function statusAction()
{ {

View File

@ -68,7 +68,8 @@ class CommentController extends Controller
$this->view->comment = $this->comment; $this->view->comment = $this->comment;
if ($this->hasPermission('monitoring/command/comment/delete')) { if ($this->hasPermission('monitoring/command/comment/delete')) {
$listUrl = Url::fromPath('monitoring/list/comments')->setQueryString('comment_type=comment|comment_type=ack'); $listUrl = Url::fromPath('monitoring/list/comments')
->setQueryString('comment_type=comment|comment_type=ack');
$form = new DeleteCommentCommandForm(); $form = new DeleteCommentCommandForm();
$form $form
->populate(array( ->populate(array(

View File

@ -45,8 +45,7 @@ class Controller extends IcingaWebController
$query->limit(); // Resets any default limit and offset $query->limit(); // Resets any default limit and offset
} }
switch ($desiredFormat) switch ($desiredFormat) {
{
case 'sql': case 'sql':
echo '<pre>' echo '<pre>'
. htmlspecialchars(wordwrap($query->dump())) . htmlspecialchars(wordwrap($query->dump()))
@ -57,7 +56,10 @@ class Controller extends IcingaWebController
$response $response
->setHeader('Content-Type', 'application/json') ->setHeader('Content-Type', 'application/json')
->setHeader('Cache-Control', 'no-store') ->setHeader('Cache-Control', 'no-store')
->setHeader('Content-Disposition', 'inline; filename=' . $this->getRequest()->getActionName() . '.json') ->setHeader(
'Content-Disposition',
'inline; filename=' . $this->getRequest()->getActionName() . '.json'
)
->appendBody(Json::encode($query->getQuery()->fetchAll())) ->appendBody(Json::encode($query->getQuery()->fetchAll()))
->sendResponse(); ->sendResponse();
exit; exit;
@ -66,7 +68,10 @@ class Controller extends IcingaWebController
$response $response
->setHeader('Content-Type', 'text/csv') ->setHeader('Content-Type', 'text/csv')
->setHeader('Cache-Control', 'no-store') ->setHeader('Cache-Control', 'no-store')
->setHeader('Content-Disposition', 'attachment; filename=' . $this->getRequest()->getActionName() . '.csv') ->setHeader(
'Content-Disposition',
'attachment; filename=' . $this->getRequest()->getActionName() . '.csv'
)
->appendBody((string) Csv::fromQuery($query)) ->appendBody((string) Csv::fromQuery($query))
->sendResponse(); ->sendResponse();
exit; exit;