Source
<?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
*/
?>
window.trigger_edit_popup = new class {
init({triggerid, expression_popup_parameters, recovery_popup_parameters, readonly, dependencies, action,
context, db_trigger
}) {
this.triggerid = triggerid;
this.expression_popup_parameters = expression_popup_parameters;
this.recovery_popup_parameters = recovery_popup_parameters;
this.readonly = readonly;
this.dependencies = dependencies;
this.action = action;
this.context = context;
this.db_trigger = db_trigger;
this.overlay = overlays_stack.getById('trigger-edit');
this.dialogue = this.overlay.$dialogue[0];
this.form = this.overlay.$dialogue.$body[0].querySelector('form');
this.expression = this.form.querySelector('#expression');
this.expr_temp = this.form.querySelector('#expr_temp');
this.name = this.form.querySelector('#name');
this.recovery_expression = this.form.querySelector('#recovery_expression');
this.recovery_expr_temp = this.form.querySelector('#recovery_expr_temp');
this.expression_constructor_active = false;
this.recovery_expression_constructor_active = false;
this.selected_dependencies = [];
window.addPopupValues = (data) => {
this.addPopupValues(data.values);
}
this.#initActions();
this.#initTriggersTab();
this.#changeRecoveryMode();
this.#changeCorrelationMode();
if (this.dependencies) {
this.#loadDependencyTable(this.dependencies);
}
this.form.style.display = '';
this.overlay.recoverFocus();
}