Welcome to mirror list, hosted at ThFree Co, Russian Federation.

administration.miscconfig.edit.php « views « app « ui - github.com/zabbix/zabbix.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 5bc136c70f26cbb64ed8f5e8e69ba2a22b3ebd77 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
<?php
/*
** Zabbix
** Copyright (C) 2001-2022 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.
**/


/**
 * @var CView $this
 * @var array $data
 */

$this->includeJsFile('administration.miscconfig.edit.js.php');

$html_page = (new CHtmlPage())
	->setTitle(_('Other configuration parameters'))
	->setTitleSubmenu(getAdministrationGeneralSubmenu())
	->setDocUrl(CDocHelper::getUrl(CDocHelper::ADMINISTRATION_MISCCONFIG_EDIT));

$from_list = (new CFormList())
	->addRow(new CLabel(_('Frontend URL'), 'url'),
		(new CTextBox('url', $data['url'], false, DB::getFieldLength('config', 'url')))
			->setWidth(ZBX_TEXTAREA_MEDIUM_WIDTH)
			->setAttribute('placeholder', _('Example: https://localhost/zabbix/ui/'))
			->setAttribute('autofocus', 'autofocus')
	)
	->addRow((new CLabel(_('Group for discovered hosts'), 'discovery_groupid'))->setAsteriskMark(),
		(new CMultiSelect([
			'name' => 'discovery_groupid',
			'object_name' => 'hostGroup',
			'data' => $data['discovery_group_data'],
			'multiple' => false,
			'popup' => [
				'parameters' => [
					'srctbl' => 'host_groups',
					'srcfld1' => 'name',
					'dstfrm' => 'otherForm',
					'dstfld1' => 'discovery_groupid',
					'normal_only' => '1'
				]
			]
		]))->setWidth(ZBX_TEXTAREA_MEDIUM_WIDTH)
	)
	->addRow(_('Default host inventory mode'),
		(new CRadioButtonList('default_inventory_mode', (int) $data['default_inventory_mode']))
			->addValue(_('Disabled'), HOST_INVENTORY_DISABLED)
			->addValue(_('Manual'), HOST_INVENTORY_MANUAL)
			->addValue(_('Automatic'), HOST_INVENTORY_AUTOMATIC)
			->setModern(true)
	)
	->addRow(_('User group for database down message'),
		(new CMultiSelect([
			'name' => 'alert_usrgrpid',
			'object_name' => 'usersGroups',
			'data' => $data['alert_usrgrp_data'],
			'multiple' => false,
			'popup' => [
				'parameters' => [
					'srctbl' => 'usrgrp',
					'srcfld1' => 'name',
					'dstfrm' => 'otherForm',
					'dstfld1' => 'alert_usrgrpid',
					'editable' => true
				]
			]
		]))->setWidth(ZBX_TEXTAREA_MEDIUM_WIDTH)
	)
	->addRow(_('Log unmatched SNMP traps'),
		(new CCheckBox('snmptrap_logging'))
			->setUncheckedValue('0')
			->setChecked($data['snmptrap_logging'] == 1)
	)
	->addRow((new CTag('h4', true, _('Authorization')))->addClass('input-section-header'))
	->addRow((new CLabel(_('Login attempts'), 'login_attempts'))->setAsteriskMark(),
		(new CNumericBox('login_attempts', $data['login_attempts'], 2))
			->setWidth(ZBX_TEXTAREA_NUMERIC_STANDARD_WIDTH)
			->setAriaRequired()
	)
	->addRow(
		(new CLabel(_('Login blocking interval'), 'login_block'))->setAsteriskMark(),
		(new CTextBox('login_block', $data['login_block'], false, DB::getFieldLength('config', 'login_block')))
			->setWidth(ZBX_TEXTAREA_TINY_WIDTH)
			->setAriaRequired()
	)
	->addRow((new CTag('h4', true, _('Storage of secrets')))->addClass('input-section-header'))
	->addRow(_('Vault provider'),
		(new CRadioButtonList('vault_provider', (int) $data['vault_provider']))
			->addValue(_('HashiCorp Vault'), ZBX_VAULT_TYPE_HASHICORP)
			->addValue(_('CyberArk Vault'), ZBX_VAULT_TYPE_CYBERARK)
			->setModern(true)
	)
	->addRow((new CTag('h4', true, _('Security')))->addClass('input-section-header'))
	->addRow(_('Validate URI schemes'),
		(new CCheckBox('validate_uri_schemes'))
			->setUncheckedValue('0')
			->setChecked($data['validate_uri_schemes'] == 1)
	)
	->addRow((new CLabel(_('Valid URI schemes'), 'uri_valid_schemes')),
		(new CTextBox('uri_valid_schemes', $data['uri_valid_schemes'], false,
			DB::getFieldLength('config', 'uri_valid_schemes')
		))
			->setWidth(ZBX_TEXTAREA_MEDIUM_WIDTH)
			->setEnabled($data['validate_uri_schemes'] == 1)
			->setAriaRequired()
	)
	->addRow((new CLabel(_('X-Frame-Options HTTP header'), 'x_frame_options'))->setAsteriskMark(),
		(new CTextBox('x_frame_options', $data['x_frame_options'], false,
			DB::getFieldLength('config', 'x_frame_options')
		))
			->setWidth(ZBX_TEXTAREA_MEDIUM_WIDTH)
			->setAriaRequired()
	)
	->addRow(_('Use iframe sandboxing'),
		(new CCheckBox('iframe_sandboxing_enabled'))
			->setUncheckedValue('0')
			->setChecked($data['iframe_sandboxing_enabled'] == 1)
	)
	->addRow((new CLabel(_('Iframe sandboxing exceptions'), 'iframe_sandboxing_exceptions')),
		(new CTextBox('iframe_sandboxing_exceptions', $data['iframe_sandboxing_exceptions'], false,
			DB::getFieldLength('config', 'iframe_sandboxing_exceptions')
		))
			->setWidth(ZBX_TEXTAREA_MEDIUM_WIDTH)
			->setEnabled($data['iframe_sandboxing_enabled'] == 1)
			->setAriaRequired()
	)
	->addRow((new CTag('h4', true, _('Communication with Zabbix server')))->addClass('input-section-header'))
	->addRow(
		(new CLabel(_('Network timeout'), 'socket_timeout'))->setAsteriskMark(),
		(new CTextBox('socket_timeout', $data['socket_timeout'], false, DB::getFieldLength('config', 'socket_timeout')))
			->setWidth(ZBX_TEXTAREA_TINY_WIDTH)
			->setAriaRequired()
	)
	->addRow(
		(new CLabel(_('Connection timeout'), 'connect_timeout'))->setAsteriskMark(),
		(new CTextBox('connect_timeout', $data['connect_timeout'], false,
			DB::getFieldLength('config', 'connect_timeout')
		))
			->setWidth(ZBX_TEXTAREA_TINY_WIDTH)
			->setAriaRequired()
	)
	->addRow(
		(new CLabel(_('Network timeout for media type test'), 'media_type_test_timeout'))->setAsteriskMark(),
		(new CTextBox('media_type_test_timeout', $data['media_type_test_timeout'], false,
			DB::getFieldLength('config', 'media_type_test_timeout')
		))
			->setWidth(ZBX_TEXTAREA_TINY_WIDTH)
			->setAriaRequired()
	)
	->addRow(
		(new CLabel(_('Network timeout for script execution'), 'script_timeout'))->setAsteriskMark(),
		(new CTextBox('script_timeout', $data['script_timeout'], false, DB::getFieldLength('config', 'script_timeout')))
			->setWidth(ZBX_TEXTAREA_TINY_WIDTH)
			->setAriaRequired()
	)
	->addRow(
		(new CLabel(_('Network timeout for item test'), 'item_test_timeout'))->setAsteriskMark(),
		(new CTextBox('item_test_timeout', $data['item_test_timeout'], false,
			DB::getFieldLength('config', 'item_test_timeout')
		))
			->setWidth(ZBX_TEXTAREA_TINY_WIDTH)
			->setAriaRequired()
	)
	->addRow(
		(new CLabel(_('Network timeout for scheduled report test'), 'report_test_timeout'))->setAsteriskMark(),
		(new CTextBox('report_test_timeout', $data['report_test_timeout'], false,
			DB::getFieldLength('config', 'report_test_timeout')
		))
			->setWidth(ZBX_TEXTAREA_TINY_WIDTH)
			->setAriaRequired()
	);

$form = (new CForm())
	->setName('otherForm')
	->setAction((new CUrl('zabbix.php'))
		->setArgument('action', 'miscconfig.update')
		->getUrl()
	)
	->setAttribute('aria-labelledby', CHtmlPage::PAGE_TITLE_ID)
	->addItem(
		(new CTabView())
			->addTab('other', _('Other parameters'), $from_list)
			->setFooter(makeFormFooter(
				new CSubmit('update', _('Update')),
				[new CButton('resetDefaults', _('Reset defaults'))]
			))
	);

$html_page
	->addItem($form)
	->show();

(new CScriptTag('
	view.init('.json_encode([
		'connect_timeout' => DB::getDefault('config', 'connect_timeout'),
		'default_inventory_mode' => DB::getDefault('config', 'default_inventory_mode'),
		'iframe_sandboxing_enabled' => DB::getDefault('config', 'iframe_sandboxing_enabled'),
		'iframe_sandboxing_exceptions' => DB::getDefault('config', 'iframe_sandboxing_exceptions'),
		'item_test_timeout' => DB::getDefault('config', 'item_test_timeout'),
		'login_attempts' => DB::getDefault('config', 'login_attempts'),
		'login_block' => DB::getDefault('config', 'login_block'),
		'media_type_test_timeout' => DB::getDefault('config', 'media_type_test_timeout'),
		'report_test_timeout' => DB::getDefault('config', 'report_test_timeout'),
		'script_timeout' => DB::getDefault('config', 'script_timeout'),
		'snmptrap_logging' => DB::getDefault('config', 'snmptrap_logging'),
		'socket_timeout' => DB::getDefault('config', 'socket_timeout'),
		'uri_valid_schemes' => DB::getDefault('config', 'uri_valid_schemes'),
		'url' => DB::getDefault('config', 'url'),
		'validate_uri_schemes' => DB::getDefault('config', 'validate_uri_schemes'),
		'vault_provider' => DB::getDefault('config', 'vault_provider'),
		'x_frame_options' => DB::getDefault('config', 'x_frame_options')
	]).');
'))
	->setOnDocumentReady()
	->show();