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)}
return jQuery('<span>').text(step.result);
function disableItemTestForm() {
jQuery('#value, #time, [name^=macros]').prop('disabled', true);
<?php if ($data['is_item_testable']): ?>
jQuery('#get_value, #get_value_btn').prop('disabled', true);
<?php if ($data['interface_address_enabled']): ?>
jQuery('#interface_address').prop('disabled', true);
<?php if ($data['interface_port_enabled']): ?>
jQuery('#interface_port').prop('disabled', true);
<?php if ($data['proxies_enabled']): ?>
for (const element of document.querySelectorAll('#test_with input')) {
jQuery('#proxyid').multiSelect('disable');
jQuery('#get_value, #get_value_btn').prop('disabled', true);
<?php if ($data['show_prev']): ?>
jQuery('#prev_time').prop('readonly', true);
jQuery('#eol input').prop('disabled', true);