Source
xxxxxxxxxx
.querySelectorAll('#lld_macro_paths tbody tr.form_row > td:first-child > textarea:not(:placeholder-shown)')
/*
** Zabbix
** Copyright (C) 2001-2024 Zabbix SIA
**
** This program is free software; you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation; either version 2 of the License, or
** (at your option) any later version.
**
** 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 General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program; if not, write to the Free Software
** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
**/
'use strict';
const TAB_INDICATOR_ATTR_TYPE = 'data-indicator';
const TAB_INDICATOR_ATTR_VALUE = 'data-indicator-value';
const TAB_INDICATOR_TYPE_COUNT = 'count';
const TAB_INDICATOR_TYPE_MARK = 'mark';
const TAB_INDICATOR_UPDATE_EVENT = 'tab-indicator-update';
/**
* Main class to initialize tab indicators.
*/
class TabIndicators {
constructor(tabs_id = 'tabs') {
try {
this.tabs_id = tabs_id;
this.form = this.getForm();
this.activateIndicators();
} catch (error) {
return false;
}
}
/**
* Get main form.
*
* @return {HTMLElement} Main form
*/
getForm() {
const ACTION = document.querySelector('#action-form');
const AUTHENTICATION = document.querySelector('#authentication-form');
const GRAPH = document.querySelector('#widget-dialogue-form');
const HOST = document.querySelector('#host-form');
const HOST_DISCOVERY = document.querySelector('#host-discovery-form');
const HOST_PROTOTYPE = document.querySelector('#host-prototype-form');
const ITEM = document.querySelector('#item-form');
const ITEM_PROTOTYPE = document.querySelector('#item-prototype-form');
const MAP = document.querySelector('#sysmap-form');
const MEDIA_TYPE = document.querySelector('#media-type-form');
const PIE_CHART = document.querySelector('#widget-dialogue-form');
const PROXY = document.querySelector('#proxy-form');
const SERVICE = document.querySelector('#service-form');
const SLA = document.querySelector('#sla-form');
const TEMPLATE = document.querySelector('#templates-form');
const TRIGGER = document.querySelector('#trigger-form');
const TRIGGER_PROTOTYPE = document.querySelector('#trigger-prototype-form');
const USER = document.querySelector('#user-form');
const USER_GROUP = document.querySelector('#user-group-form');
const WEB_SCENARIO = document.querySelector('#webscenario-form');
switch (true) {
case !!ACTION:
return ACTION;
case !!AUTHENTICATION:
return AUTHENTICATION;
case !!GRAPH:
return GRAPH;
case !!TEMPLATE:
return TEMPLATE;
case !!HOST:
return HOST;
case !!HOST_DISCOVERY:
return HOST_DISCOVERY;
case !!HOST_PROTOTYPE:
return HOST_PROTOTYPE;
case !!PROXY:
return PROXY;
case !!ITEM:
return ITEM;