From 1f0f14fb2c7df78fb7c2da5acc2e193277786fde Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lorenz=20K=C3=A4stle?= Date: Tue, 7 May 2024 12:14:33 +0200 Subject: [PATCH] Add configuration settings for maximal number of characters in plugin output --- library/Icingadb/Widget/Detail/ObjectDetail.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/library/Icingadb/Widget/Detail/ObjectDetail.php b/library/Icingadb/Widget/Detail/ObjectDetail.php index 4ba0e6984..85798aa2c 100644 --- a/library/Icingadb/Widget/Detail/ObjectDetail.php +++ b/library/Icingadb/Widget/Detail/ObjectDetail.php @@ -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; @@ -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)) ); CopyToClipboard::attachTo($pluginOutput); }