Skip to content

Commit

Permalink
Add configuration settings for maximal number of characters in plugin…
Browse files Browse the repository at this point in the history
… output
  • Loading branch information
Lorenz Kästle committed May 7, 2024
1 parent 6029cc1 commit 1f0f14f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion library/Icingadb/Widget/Detail/ObjectDetail.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

use Exception;
use Icinga\Application\ClassLoader;
use Icinga\Application\Config;
use Icinga\Application\Hook;
use Icinga\Application\Hook\GrapherHook;
use Icinga\Application\Icinga;
Expand Down Expand Up @@ -420,12 +421,13 @@ protected function createPerformanceData(): array

protected function createPluginOutput(): array
{
$config = Config::module('icingadb');
if (empty($this->object->state->output) && empty($this->object->state->long_output)) {
$pluginOutput = new EmptyState(t('Output unavailable.'));
} else {
$pluginOutput = new PluginOutputContainer(
PluginOutput::fromObject($this->object)
->setCharacterLimit(10000)
->setCharacterLimit($config->get('settings', 'plugin_output_character_limit', 10000))

Check failure on line 430 in library/Icingadb/Widget/Detail/ObjectDetail.php

View workflow job for this annotation

GitHub Actions / phpstan / Static analysis with phpstan and php 7.2 on ubuntu-latest

Parameter #1 $limit of method Icinga\Module\Icingadb\Util\PluginOutput::setCharacterLimit() expects int, mixed given.

Check failure on line 430 in library/Icingadb/Widget/Detail/ObjectDetail.php

View workflow job for this annotation

GitHub Actions / phpstan / Static analysis with phpstan and php 7.3 on ubuntu-latest

Parameter #1 $limit of method Icinga\Module\Icingadb\Util\PluginOutput::setCharacterLimit() expects int, mixed given.

Check failure on line 430 in library/Icingadb/Widget/Detail/ObjectDetail.php

View workflow job for this annotation

GitHub Actions / phpstan / Static analysis with phpstan and php 7.4 on ubuntu-latest

Parameter #1 $limit of method Icinga\Module\Icingadb\Util\PluginOutput::setCharacterLimit() expects int, mixed given.

Check failure on line 430 in library/Icingadb/Widget/Detail/ObjectDetail.php

View workflow job for this annotation

GitHub Actions / phpstan / Static analysis with phpstan and php 8.0 on ubuntu-latest

Parameter #1 $limit of method Icinga\Module\Icingadb\Util\PluginOutput::setCharacterLimit() expects int, mixed given.

Check failure on line 430 in library/Icingadb/Widget/Detail/ObjectDetail.php

View workflow job for this annotation

GitHub Actions / phpstan / Static analysis with phpstan and php 8.1 on ubuntu-latest

Parameter #1 $limit of method Icinga\Module\Icingadb\Util\PluginOutput::setCharacterLimit() expects int, mixed given.

Check failure on line 430 in library/Icingadb/Widget/Detail/ObjectDetail.php

View workflow job for this annotation

GitHub Actions / phpstan / Static analysis with phpstan and php 8.2 on ubuntu-latest

Parameter #1 $limit of method Icinga\Module\Icingadb\Util\PluginOutput::setCharacterLimit() expects int, mixed given.

Check failure on line 430 in library/Icingadb/Widget/Detail/ObjectDetail.php

View workflow job for this annotation

GitHub Actions / phpstan / Static analysis with phpstan and php 8.3 on ubuntu-latest

Parameter #1 $limit of method Icinga\Module\Icingadb\Util\PluginOutput::setCharacterLimit() expects int, mixed given.
);
CopyToClipboard::attachTo($pluginOutput);
}
Expand Down

0 comments on commit 1f0f14f

Please sign in to comment.