Source
<?php
/*
** Zabbix
** 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 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.
**/
class CopyWidgetsDashboards {
/**
* Create data for Copy widgets test.
*
* !!! Please, add new widgets to "Dashboard for Copying widgets _2" if necessary.
* If "Dashboard for Copying widgets _2" is run out of space, create new dashboard with this exact name:
* "Dashboard for Copying widgets _3", etc.
* Second page on new dashboard for paste widgets should be named "Test_page".
*
* @return array
*/
public static function load() {
CDataHelper::call('dashboard.create', [
[
'name' => 'Dashboard for Copying widgets _1',
'display_period' => 30,
'auto_start' => 0,
'pages' => [
[
'name' => 'Page 1',
'widgets' => [
[
'name' => 'Test copy Action log',
'type' => 'actionlog',
'x' => 0,
'y' => 0,
'width' => 7,
'height' => 4,
'view_mode' => 0,
'fields' => [
[
'type' => 0,
'name' => 'rf_rate',
'value' => '10'
],
[
'type' => 0,
'name' => 'show_lines',
'value' => 3
],
[
'type' => 0,
'name' => 'sort_triggers',
'value' => 7
]
]
],
[
'name' => 'Test copy Clock',
'type' => 'clock',
'x' => 18,
'y' => 7,
'width' => 2,
'height' => 3,
'view_mode' => 0,
'fields' => [
[
'type' => 0,
'name' => 'rf_rate',
'value' => '60'
],
[
'type' => 0,
'name' => 'time_type',
'value' => 2
],
[
'type' => 4,
'name' => 'itemid',
'value' => 42229