Source
xxxxxxxxxx
$test_obj = jQuery('.preprocessing-list-item[data-step=<?= $data['step_obj'] ?>]', jQuery('#preprocessing'));
<?php
/*
** Copyright (C) 2001-2025 Zabbix SIA
**
** This program is free software: you can redistribute it and/or modify it under the terms of
** the GNU Affero General Public License as published by the Free Software Foundation, version 3.
**
** This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
** without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
** See the GNU Affero General Public License for more details.
**
** You should have received a copy of the GNU Affero General Public License along with this program.
** If not, see <https://www.gnu.org/licenses/>.
**/
/**
* @var CView $this
*/
?>
/**
* Make step result UI element.
*
* @param {array} step Step object returned from server.
*
* @return {jQuery}
*/
function makeStepResult(step) {
if (step.error !== undefined) {
return jQuery(new Template(jQuery('#preprocessing-step-error-icon').html()).evaluate(
{error: escapeHtml(step.error) || <?= json_encode(htmlspecialchars(_('<empty string>'))) ?>}
));
}
if (step.result === undefined || step.result === null) {
return jQuery('<span>', {'class': '<?= ZBX_STYLE_GREY ?>'}).text(<?= json_encode(_('No value')) ?>);
}
else if (step.result === '') {
return jQuery('<span>', {'class': '<?= ZBX_STYLE_GREY ?>'}).text(<?= json_encode(_('<empty string>')) ?>);
}
else if (step.warning !== undefined) {
return jQuery(new Template(jQuery('#preprocessing-step-result-warning').html()).evaluate(
{result: step.result, result_hint: escapeHtml(step.result), warning: step.warning}
));
}
else if (step.result.indexOf("\n") != -1 || step.result.length > 25) {
return jQuery(new Template(jQuery('#preprocessing-step-result').html()).evaluate(
{result: step.result, result_hint: escapeHtml(step.result)}
));
}
else {
return jQuery('<span>').text(step.result);
}
}
/**
* Disable item test form.
*/
function disableItemTestForm() {
jQuery('#value, #time, [name^=macros]').prop('disabled', true);
<?php if ($data['is_item_testable']): ?>