本文整理汇总了PHP中Icinga\Web\Notification类的典型用法代码示例。如果您正苦于以下问题:PHP Notification类的具体用法?PHP Notification怎么用?PHP Notification使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Notification类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: onSuccess
/**
* (non-PHPDoc)
* @see \Icinga\Web\Form::onSuccess() For the method documentation.
*/
public function onSuccess()
{
foreach ($this->objects as $object) {
/** @var \Icinga\Module\Monitoring\Object\Host $object */
$childHosts = (int) $this->getElement('child_hosts')->getValue();
$allServices = $this->getElement('all_services')->isChecked();
if ($childHosts === 0) {
$hostDowntime = new ScheduleHostDowntimeCommand();
if ($allServices === true) {
$hostDowntime->setForAllServices();
}
} else {
$hostDowntime = new PropagateHostDowntimeCommand();
if ($childHosts === 1) {
$hostDowntime->setTriggered();
}
if ($allServices === true) {
foreach ($object->services as $service) {
$serviceDowntime = new ScheduleServiceDowntimeCommand();
$serviceDowntime->setObject($service);
$this->scheduleDowntime($serviceDowntime, $this->request);
}
}
}
$hostDowntime->setObject($object);
$this->scheduleDowntime($hostDowntime, $this->request);
}
Notification::success($this->translatePlural('Scheduling host downtime..', 'Scheduling host downtimes..', count($this->objects)));
return true;
}
开发者ID:NerdGZ,项目名称:icingaweb2,代码行数:34,代码来源:ScheduleHostDowntimeCommandForm.php
示例2: deployAction
public function deployAction()
{
$isApiRequest = $this->getRequest()->isApiRequest();
$checksum = $this->params->get('checksum');
if ($checksum) {
$config = IcingaConfig::load(Util::hex2binary($checksum), $this->db());
} else {
$config = IcingaConfig::generate($this->db());
$checksum = $config->getHexChecksum();
}
if ($this->api()->dumpConfig($config, $this->db())) {
if ($isApiRequest) {
return $this->sendJson((object) array('checksum' => $checksum));
} else {
$url = Url::fromPath('director/list/deploymentlog');
Notification::success($this->translate('Config has been submitted, validation is going on'));
$this->redirectNow($url);
}
} else {
if ($isApiRequest) {
return $this->sendJsonError('Config deployment failed');
} else {
$url = Url::fromPath('director/config/show', array('checksum' => $checksum));
Notification::success($this->translate('Config deployment failed'));
$this->redirectNow($url);
}
}
}
开发者ID:plarivee,项目名称:icingaweb2-module-director,代码行数:28,代码来源:ConfigController.php
示例3: onSuccess
public function onSuccess()
{
$name = $this->getValue('name');
$this->storage->deleteProcess($name);
$this->setRedirectUrl('businessprocess');
Notification::success(sprintf('Process %s has been deleted', $name));
}
开发者ID:0svald,项目名称:icingaweb2-module-businessprocess,代码行数:7,代码来源:DeleteConfigForm.php
示例4: onSuccess
/**
* (non-PHPDoc)
* @see \Icinga\Web\Form::onSuccess() For the method documentation.
*/
public function onSuccess()
{
$disableNotifications = new DisableNotificationsExpireCommand();
$disableNotifications->setExpireTime($this->getElement('expire_time')->getValue()->getTimestamp());
$this->getTransport($this->request)->send($disableNotifications);
Notification::success($this->translate('Disabling host and service notifications..'));
return true;
}
开发者ID:trigoesrodrigo,项目名称:icingaweb2,代码行数:12,代码来源:DisableNotificationsExpireCommandForm.php
示例5: runAction
public function runAction()
{
if ($runId = Sync::run(SyncRule::load($this->params->get('id'), $this->db()))) {
Notification::success('Source has successfully been synchronized');
$this->redirectNow('director/list/syncrule');
} else {
}
}
开发者ID:dgoeger,项目名称:icingadirector,代码行数:8,代码来源:SyncruleController.php
示例6: onSuccess
/**
* @see Form::onSuccess()
*/
public function onSuccess()
{
$this->config->setSection('security', $this->getValues());
if ($this->save()) {
Notification::success($this->translate('New security configuration has successfully been stored'));
} else {
return false;
}
}
开发者ID:0svald,项目名称:icingaweb2,代码行数:12,代码来源:SecurityConfigForm.php
示例7: onSuccess
/**
* (non-PHPDoc)
* @see \Icinga\Web\Form::onSuccess() For the method documentation.
*/
public function onSuccess()
{
foreach ($this->objects as $object) {
/** @var \Icinga\Module\Monitoring\Object\MonitoredObject $object */
$removeAck = new RemoveAcknowledgementCommand();
$removeAck->setObject($object);
$this->getTransport($this->request)->send($removeAck);
}
Notification::success(mtp('monitoring', 'Removing problem acknowledgement..', 'Removing problem acknowledgements..', count($this->objects)));
return true;
}
开发者ID:JakobGM,项目名称:icingaweb2,代码行数:15,代码来源:RemoveAcknowledgementCommandForm.php
示例8: onSuccess
/**
* (non-PHPDoc)
* @see \Icinga\Web\Form::onSuccess() For the method documentation.
*/
public function onSuccess()
{
foreach ($this->objects as $object) {
/** @var \Icinga\Module\Monitoring\Object\Service $object */
$check = new ScheduleServiceCheckCommand();
$check->setObject($object);
$this->scheduleCheck($check, $this->request);
}
Notification::success($this->translatePlural('Scheduling service check..', 'Scheduling service checks..', count($this->objects)));
return true;
}
开发者ID:0svald,项目名称:icingaweb2,代码行数:15,代码来源:ScheduleServiceCheckCommandForm.php
示例9: onSuccess
/**
* (non-PHPDoc)
* @see \Icinga\Web\Form::onSuccess() For the method documentation.
*/
public function onSuccess()
{
foreach ($this->objects as $object) {
/** @var \Icinga\Module\Monitoring\Object\Service $object */
$downtime = new ScheduleServiceDowntimeCommand();
$downtime->setObject($object);
$this->scheduleDowntime($downtime, $this->request);
}
Notification::success($this->translatePlural('Scheduling service downtime..', 'Scheduling service downtimes..', count($this->objects)));
return true;
}
开发者ID:kobmaki,项目名称:icingaweb2,代码行数:15,代码来源:ScheduleServiceDowntimeCommandForm.php
示例10: onSuccess
/**
* (non-PHPDoc)
* @see \Icinga\Web\Form::onSuccess() For the method documentation.
*/
public function onSuccess()
{
foreach ($this->objects as $object) {
/** @var \Icinga\Module\Monitoring\Object\Host $object */
$check = new ScheduleHostCheckCommand();
$check->setObject($object)->setOfAllServices($this->getElement('all_services')->isChecked());
$this->scheduleCheck($check, $this->request);
}
Notification::success($this->translatePlural('Scheduling host check..', 'Scheduling host checks..', count($this->objects)));
return true;
}
开发者ID:0svald,项目名称:icingaweb2,代码行数:15,代码来源:ScheduleHostCheckCommandForm.php
示例11: onSuccess
/**
* {@inheritdoc}
*/
public function onSuccess()
{
foreach ($this->objects as $object) {
/** @var \Icinga\Module\Monitoring\Object\MonitoredObject $object */
$notification = new SendCustomNotificationCommand();
$notification->setObject($object)->setComment($this->getElement('comment')->getValue())->setAuthor($this->request->getUser()->getUsername())->setForced($this->getElement('forced')->isChecked())->setBroadcast($this->getElement('broadcast')->isChecked());
$this->getTransport($this->request)->send($notification);
}
Notification::success($this->translatePlural('Sending custom notification..', 'Sending custom notifications..', count($this->objects)));
return true;
}
开发者ID:trigoesrodrigo,项目名称:icingaweb2,代码行数:14,代码来源:SendCustomNotificationCommandForm.php
示例12: loadModifiedBpConfig
protected function loadModifiedBpConfig()
{
$bp = $this->loadBpConfig();
$changes = ProcessChanges::construct($bp, $this->session());
if ($this->params->get('dismissChanges')) {
Notification::success(sprintf($this->translate('%d pending change(s) have been dropped'), $changes->count()));
$changes->clear();
$this->redirectNow($this->url()->without('dismissChanges')->without('unlocked'));
}
$bp->applyChanges($changes);
return $bp;
}
开发者ID:0svald,项目名称:icingaweb2-module-businessprocess,代码行数:12,代码来源:Controller.php
示例13: onSuccess
/**
* (non-PHPDoc)
* @see \Icinga\Web\Form::onSuccess() For the method documentation.
*/
public function onSuccess()
{
$cmd = new DeleteCommentCommand();
$cmd->setIsService($this->getElement('comment_is_service')->getValue())->setCommentId($this->getElement('comment_id')->getValue());
$this->getTransport($this->request)->send($cmd);
$redirect = $this->getElement('redirect')->getValue();
if (!empty($redirect)) {
$this->setRedirectUrl($redirect);
}
Notification::success($this->translate('Deleting comment..'));
return true;
}
开发者ID:kain64,项目名称:icingaweb2,代码行数:16,代码来源:DeleteCommentCommandForm.php
示例14: runAction
public function runAction()
{
$id = $this->params->get('id');
$import = new Import(ImportSource::load($id, $this->db()));
if ($runId = $import->run()) {
Notification::success('Import succeeded');
$this->redirectNow(Url::fromPath('director/importrun', array('id' => $runId)));
} else {
Notification::success('Import skipped, no changes detected');
$this->redirectNow('director/list/importrun');
}
}
开发者ID:dgoeger,项目名称:icingadirector,代码行数:12,代码来源:ImportsourceController.php
示例15: onSuccess
/**
* (non-PHPDoc)
* @see \Icinga\Web\Form::onSuccess() For the method documentation.
*/
public function onSuccess()
{
foreach ($this->objects as $object) {
/** @var \Icinga\Module\Monitoring\Object\MonitoredObject $object */
$ack = new AcknowledgeProblemCommand();
$ack->setObject($object)->setComment($this->getElement('comment')->getValue())->setAuthor($this->request->getUser()->getUsername())->setPersistent($this->getElement('persistent')->isChecked())->setSticky($this->getElement('sticky')->isChecked())->setNotify($this->getElement('notify')->isChecked());
if ($this->getElement('expire')->isChecked()) {
$ack->setExpireTime($this->getElement('expire_time')->getValue()->getTimestamp());
}
$this->getTransport($this->request)->send($ack);
}
Notification::success($this->translatePlural('Acknowledging problem..', 'Acknowledging problems..', count($this->objects)));
return true;
}
开发者ID:NerdGZ,项目名称:icingaweb2,代码行数:18,代码来源:AcknowledgeProblemCommandForm.php
示例16: onSuccess
/**
* {@inheritdoc}
*/
public function onSuccess()
{
foreach ($this->downtimes as $downtime) {
$delDowntime = new DeleteDowntimeCommand();
$delDowntime->setDowntimeId($downtime->id)->setIsService(isset($downtime->service_description));
$this->getTransport($this->request)->send($delDowntime);
}
$redirect = $this->getElement('redirect')->getValue();
if (!empty($redirect)) {
$this->setRedirectUrl($redirect);
}
Notification::success($this->translatePlural('Deleting downtime..', 'Deleting downtimes..', count($this->downtimes)));
return true;
}
开发者ID:trigoesrodrigo,项目名称:icingaweb2,代码行数:17,代码来源:DeleteDowntimesCommandForm.php
示例17: onSuccess
/**
* {@inheritdoc}
*/
public function onSuccess()
{
foreach ($this->comments as $comment) {
$cmd = new DeleteCommentCommand();
$cmd->setCommentId($comment->id)->setIsService(isset($comment->service_description));
$this->getTransport($this->request)->send($cmd);
}
$redirect = $this->getElement('redirect')->getValue();
if (!empty($redirect)) {
$this->setRedirectUrl($redirect);
}
Notification::success($this->translatePlural('Deleting comment..', 'Deleting comments..', count($this->comments)));
return true;
}
开发者ID:trigoesrodrigo,项目名称:icingaweb2,代码行数:17,代码来源:DeleteCommentsCommandForm.php
示例18: showAction
/**
* Show a business process tree
*/
public function showAction()
{
$this->redirectIfConfigChosen();
if ($this->params->get('unlocked')) {
$bp = $this->loadModifiedBpConfig();
$bp->unlock();
} else {
$bp = $this->loadBpConfig();
}
$this->setTitle('Business Process "%s"', $bp->getTitle());
$this->tabsForShow()->activate('show');
// Do not lock empty configs
if ($bp->isEmpty() && !$this->view->compact && $bp->isLocked()) {
$this->redirectNow($this->url()->with('unlocked', true));
}
if ($node = $this->params->get('node')) {
// Render a specific node
$this->view->nodeName = $node;
$this->view->bp = $bp->getNode($node);
} else {
// Render a single process
$this->view->bp = $bp;
if ($bp->hasWarnings()) {
$this->view->warnings = $bp->getWarnings();
}
}
$bp->retrieveStatesFromBackend();
if ($bp->isLocked()) {
$this->tabs()->extend(new DashboardAction());
} else {
$simulation = new Simulation($bp, $this->session());
if ($this->params->get('dismissSimulations')) {
Notification::success(sprintf($this->translate('%d applied simulation(s) have been dropped'), $simulation->count()));
$simulation->clear();
$this->redirectNow($this->url()->without('dismissSimulations')->without('unlocked'));
}
$bp->applySimulation($simulation);
}
if ($this->isXhr()) {
$this->setAutorefreshInterval(10);
} else {
// This will trigger the very first XHR refresh immediately on page
// load. Please not that this may hammer the server in case we would
// decide to use autorefreshInterval for HTML meta-refreshes also.
$this->setAutorefreshInterval(1);
}
if ($this->params->get('mode') === 'toplevel') {
$this->render('toplevel');
}
}
开发者ID:0svald,项目名称:icingaweb2-module-businessprocess,代码行数:53,代码来源:ProcessController.php
示例19: deployAction
public function deployAction()
{
$checksum = $this->params->get('checksum');
$config = IcingaConfig::load(Util::hex2binary($checksum), $this->db());
if ($this->api()->dumpConfig($config, $this->db())) {
$url = Url::fromPath('director/list/deploymentlog');
Notification::success($this->translate('Config has been submitted, validation is going on'));
$this->redirectNow($url);
} else {
$url = Url::fromPath('director/config/show', array('checksum' => $checksum));
Notification::success($this->translate('Config deployment failed'));
$this->redirectNow($url);
}
}
开发者ID:dgoeger,项目名称:icingadirector,代码行数:14,代码来源:ConfigController.php
示例20: onSuccess
/**
* (non-PHPDoc)
* @see \Icinga\Web\Form::onSuccess() For the method documentation.
*/
public function onSuccess()
{
foreach ($this->objects as $object) {
/** @var \Icinga\Module\Monitoring\Object\MonitoredObject $object */
$comment = new AddCommentCommand();
$comment->setObject($object);
$comment->setComment($this->getElement('comment')->getValue());
$comment->setAuthor($this->request->getUser()->getUsername());
$comment->setPersistent($this->getElement('persistent')->isChecked());
$this->getTransport($this->request)->send($comment);
}
Notification::success($this->translatePlural('Adding comment..', 'Adding comments..', count($this->objects)));
return true;
}
开发者ID:kobmaki,项目名称:icingaweb2,代码行数:18,代码来源:AddCommentCommandForm.php
注:本文中的Icinga\Web\Notification类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论