mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-26 23:34:08 +02:00
parent
7a7c10e8df
commit
6095a71a8d
@ -137,7 +137,6 @@ abstract class BaseQuery implements Filterable
|
|||||||
*
|
*
|
||||||
* @param string $expression Implementation specific search expression
|
* @param string $expression Implementation specific search expression
|
||||||
* @param mixed $parameters Implementation specific search value to use for query placeholders
|
* @param mixed $parameters Implementation specific search value to use for query placeholders
|
||||||
|
|
||||||
* @return self Fluent interface
|
* @return self Fluent interface
|
||||||
*/
|
*/
|
||||||
public function andWhere($expression, $parameters = null)
|
public function andWhere($expression, $parameters = null)
|
||||||
@ -160,7 +159,6 @@ abstract class BaseQuery implements Filterable
|
|||||||
*
|
*
|
||||||
* @param string $expression Implementation specific search expression
|
* @param string $expression Implementation specific search expression
|
||||||
* @param mixed $parameters Implementation specific search value to use for query placeholders
|
* @param mixed $parameters Implementation specific search value to use for query placeholders
|
||||||
|
|
||||||
* @return self Fluent interface
|
* @return self Fluent interface
|
||||||
*/
|
*/
|
||||||
public function orWhere($expression, $parameters = null)
|
public function orWhere($expression, $parameters = null)
|
||||||
|
@ -96,6 +96,4 @@ class Query extends BaseQuery
|
|||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -11,5 +11,4 @@ interface DatasourceInterface
|
|||||||
* @return BaseQuery
|
* @return BaseQuery
|
||||||
*/
|
*/
|
||||||
public function select();
|
public function select();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -184,6 +184,7 @@ class Query extends BaseQuery
|
|||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create the Zend_Db select and count query objects for this instance
|
* Create the Zend_Db select and count query objects for this instance
|
||||||
*/
|
*/
|
||||||
@ -318,6 +319,4 @@ class Query extends BaseQuery
|
|||||||
$parser->treeToSql($this->getFilter(), $this->baseQuery);
|
$parser->treeToSql($this->getFilter(), $this->baseQuery);
|
||||||
$this->clearFilter();
|
$this->clearFilter();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -130,7 +130,8 @@ class TreeToSqlParser
|
|||||||
if ($this->query->isAggregateColumn($node->left)) {
|
if ($this->query->isAggregateColumn($node->left)) {
|
||||||
$this->type = 'HAVING';
|
$this->type = 'HAVING';
|
||||||
}
|
}
|
||||||
$queryString .= ' ' . (is_integer($node->right) ? $node->operator : $this->getSqlOperator($node->operator)) . ' ';
|
$queryString .= ' ' . (is_integer($node->right) ?
|
||||||
|
$node->operator : $this->getSqlOperator($node->operator)) . ' ';
|
||||||
$queryString .= $this->getParameterValue($node);
|
$queryString .= $this->getParameterValue($node);
|
||||||
return $queryString;
|
return $queryString;
|
||||||
}
|
}
|
||||||
@ -152,11 +153,8 @@ class TreeToSqlParser
|
|||||||
if ($this->query->isTimestamp($node->left)) {
|
if ($this->query->isTimestamp($node->left)) {
|
||||||
$node->context = Node::CONTEXT_TIMESTRING;
|
$node->context = Node::CONTEXT_TIMESTRING;
|
||||||
}
|
}
|
||||||
switch($node->context) {
|
if ($node->context === Node::CONTEXT_TIMESTRING) {
|
||||||
case Node::CONTEXT_TIMESTRING:
|
|
||||||
$value = strtotime($value);
|
$value = strtotime($value);
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
return $this->query->getDatasource()->getConnection()->quote($value);
|
return $this->query->getDatasource()->getConnection()->quote($value);
|
||||||
}
|
}
|
||||||
|
@ -62,6 +62,4 @@ class Request extends Zend_Controller_Request_Http
|
|||||||
{
|
{
|
||||||
return $this->user;
|
return $this->user;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -34,7 +34,6 @@ use Zend_View_Abstract;
|
|||||||
use Icinga\Web\Form\Decorator\ConditionalHidden;
|
use Icinga\Web\Form\Decorator\ConditionalHidden;
|
||||||
use Zend_Form_Element_Submit;
|
use Zend_Form_Element_Submit;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sortbox widget
|
* Sortbox widget
|
||||||
*
|
*
|
||||||
|
@ -238,7 +238,8 @@ class Tab implements Widget
|
|||||||
$tagParams .= ' ' . $key . '="' . $value . '"';
|
$tagParams .= ' ' . $key . '="' . $value . '"';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$tab = '<a' . $tagParams .' href="' . $this->url->getAbsoluteUrl() . '" data-icinga-target="self">' . $caption . '</a>';
|
$tab = '<a' . $tagParams .' href="' . $this->url->getAbsoluteUrl()
|
||||||
|
. '" data-icinga-target="self">' . $caption . '</a>';
|
||||||
} else {
|
} else {
|
||||||
$tab = $caption;
|
$tab = $caption;
|
||||||
}
|
}
|
||||||
|
@ -19,4 +19,3 @@ class CommenthistoryQuery extends IdoQuery
|
|||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -80,8 +80,7 @@ class Controller extends ActionController
|
|||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
if ($this->_getParam('format') === 'json'
|
if ($this->_getParam('format') === 'json'
|
||||||
|| $this->_request->getHeader('Accept') === 'application/json')
|
|| $this->_request->getHeader('Accept') === 'application/json') {
|
||||||
{
|
|
||||||
header('Content-type: application/json');
|
header('Content-type: application/json');
|
||||||
echo json_encode($query->fetchAll());
|
echo json_encode($query->fetchAll());
|
||||||
exit;
|
exit;
|
||||||
|
@ -71,5 +71,4 @@ class Hostgroup extends DataView
|
|||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -65,6 +65,4 @@ class Servicegroup extends DataView
|
|||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
@ -105,7 +105,8 @@ class Registry implements FilterRegistry
|
|||||||
FilterAttribute::create(StatusFilter::createForHost())
|
FilterAttribute::create(StatusFilter::createForHost())
|
||||||
->setField('host_state')
|
->setField('host_state')
|
||||||
)->registerAttribute(
|
)->registerAttribute(
|
||||||
FilterAttribute::create(new BooleanFilter(
|
FilterAttribute::create(
|
||||||
|
new BooleanFilter(
|
||||||
array(
|
array(
|
||||||
'host_is_flapping' => 'Flapping',
|
'host_is_flapping' => 'Flapping',
|
||||||
'host_problem' => 'In Problem State',
|
'host_problem' => 'In Problem State',
|
||||||
@ -115,7 +116,8 @@ class Registry implements FilterRegistry
|
|||||||
'host_handled' => 'Handled',
|
'host_handled' => 'Handled',
|
||||||
'host_in_downtime' => 'In Downtime',
|
'host_in_downtime' => 'In Downtime',
|
||||||
)
|
)
|
||||||
))
|
)
|
||||||
|
)
|
||||||
)->registerAttribute(
|
)->registerAttribute(
|
||||||
FilterAttribute::create(self::getLastCheckFilterType())
|
FilterAttribute::create(self::getLastCheckFilterType())
|
||||||
->setHandledAttributes('Last Check', 'Check')
|
->setHandledAttributes('Last Check', 'Check')
|
||||||
@ -149,7 +151,8 @@ class Registry implements FilterRegistry
|
|||||||
->setHandledAttributes('Host')
|
->setHandledAttributes('Host')
|
||||||
->setField('host_state')
|
->setField('host_state')
|
||||||
)->registerAttribute(
|
)->registerAttribute(
|
||||||
FilterAttribute::create(new BooleanFilter(
|
FilterAttribute::create(
|
||||||
|
new BooleanFilter(
|
||||||
array(
|
array(
|
||||||
'service_is_flapping' => 'Flapping',
|
'service_is_flapping' => 'Flapping',
|
||||||
'service_problem' => 'In Problem State',
|
'service_problem' => 'In Problem State',
|
||||||
@ -160,7 +163,8 @@ class Registry implements FilterRegistry
|
|||||||
'service_in_downtime' => 'In Downtime',
|
'service_in_downtime' => 'In Downtime',
|
||||||
'host_in_downtime' => 'In Host Downtime'
|
'host_in_downtime' => 'In Host Downtime'
|
||||||
)
|
)
|
||||||
))
|
)
|
||||||
|
)
|
||||||
)->registerAttribute(
|
)->registerAttribute(
|
||||||
FilterAttribute::create(self::getLastCheckFilterType())
|
FilterAttribute::create(self::getLastCheckFilterType())
|
||||||
->setHandledAttributes('Last Check', 'Check')
|
->setHandledAttributes('Last Check', 'Check')
|
||||||
@ -226,5 +230,4 @@ class Registry implements FilterRegistry
|
|||||||
$urlString .= $urlParser->fromTree($filter);
|
$urlString .= $urlParser->fromTree($filter);
|
||||||
return '/' . $urlString;
|
return '/' . $urlString;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -26,10 +26,8 @@
|
|||||||
*/
|
*/
|
||||||
// {{{ICINGA_LICENSE_HEADER}}}
|
// {{{ICINGA_LICENSE_HEADER}}}
|
||||||
|
|
||||||
|
|
||||||
namespace Icinga\Module\Monitoring\Filter;
|
namespace Icinga\Module\Monitoring\Filter;
|
||||||
|
|
||||||
|
|
||||||
use Icinga\Filter\Filterable;
|
use Icinga\Filter\Filterable;
|
||||||
use Icinga\Filter\Query\Tree;
|
use Icinga\Filter\Query\Tree;
|
||||||
use Icinga\Filter\Query\Node;
|
use Icinga\Filter\Query\Node;
|
||||||
|
@ -27,5 +27,4 @@ class Host extends AbstractObject
|
|||||||
$this->view = HostStatus::fromRequest($this->getRequest());
|
$this->view = HostStatus::fromRequest($this->getRequest());
|
||||||
return $this->view->getQuery()->fetchRow();
|
return $this->view->getQuery()->fetchRow();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user