2016-02-13 21:09:45 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
$no_refresh = true;
|
|
|
|
|
|
|
|
$config_groups = get_config_by_group('webui');
|
|
|
|
|
|
|
|
$search_conf = array(
|
|
|
|
array('name' => 'webui.global_search_result_limit',
|
|
|
|
'descr' => 'Set the max search result limit',
|
2018-01-17 05:21:21 +01:00
|
|
|
'type' => 'numeric',
|
|
|
|
'required' => true,
|
2016-02-13 21:09:45 +01:00
|
|
|
),
|
|
|
|
);
|
|
|
|
|
2018-08-29 15:25:16 +02:00
|
|
|
$graph_conf = [
|
|
|
|
[
|
|
|
|
'name' => 'webui.min_graph_height',
|
|
|
|
'descr' => 'Set the minimum graph height',
|
|
|
|
'type' => 'numeric',
|
|
|
|
'required' => true,
|
|
|
|
],
|
|
|
|
[
|
|
|
|
'name' => 'webui.graph_type',
|
|
|
|
'descr' => 'Set the graph type',
|
|
|
|
'type' => 'select',
|
|
|
|
'options' => [
|
|
|
|
'png' => 'png',
|
|
|
|
'svg' => 'svg',
|
|
|
|
],
|
|
|
|
],
|
|
|
|
[
|
|
|
|
'name' => 'webui.graph_stacked',
|
|
|
|
'descr' => 'Use stacked graphs',
|
|
|
|
'type' => 'checkbox',
|
|
|
|
],
|
|
|
|
[
|
|
|
|
'name' => 'webui.dynamic_graphs',
|
|
|
|
'descr' => 'Enable dynamic graphs',
|
|
|
|
'type' => 'checkbox',
|
|
|
|
]
|
|
|
|
];
|
2016-04-26 12:56:58 -07:00
|
|
|
|
2016-08-22 21:12:44 +03:00
|
|
|
$availability_map_conf = array(
|
2016-09-15 00:07:03 +03:00
|
|
|
array('name' => 'webui.availability_map_compact',
|
|
|
|
'descr' => 'Availability map compact view',
|
2016-08-22 21:12:44 +03:00
|
|
|
'type' => 'checkbox',
|
|
|
|
),
|
2016-08-28 23:48:06 +03:00
|
|
|
array('name' => 'webui.availability_map_sort_status',
|
2016-09-15 00:07:03 +03:00
|
|
|
'descr' => 'Sort devices by status',
|
2016-09-02 20:42:45 +03:00
|
|
|
'type' => 'checkbox',
|
|
|
|
),
|
|
|
|
array('name' => 'webui.availability_map_use_device_groups',
|
2016-09-15 00:07:03 +03:00
|
|
|
'descr' => 'Use device groups filter',
|
2016-09-02 20:42:45 +03:00
|
|
|
'type' => 'checkbox',
|
2016-08-28 23:48:06 +03:00
|
|
|
),
|
2016-09-22 00:11:16 +03:00
|
|
|
array('name' => 'webui.availability_map_box_size',
|
|
|
|
'descr' => 'Availability box width',
|
|
|
|
'type' => 'numeric',
|
|
|
|
),
|
2016-08-22 21:12:44 +03:00
|
|
|
);
|
|
|
|
|
2016-08-23 12:37:12 -06:00
|
|
|
$dashboard_conf = array(
|
|
|
|
array('name' => 'webui.default_dashboard_id',
|
|
|
|
'descr' => 'Set global default dashboard id',
|
|
|
|
'type' => 'select',
|
|
|
|
'options' => dbFetchRows(
|
|
|
|
"SELECT 0 as `value`, 'no default dashboard' as `description`
|
|
|
|
UNION ALL
|
|
|
|
SELECT `dashboards`.`dashboard_id` as `value`,
|
|
|
|
CONCAT( `users`.`username`, ':', `dashboards`.`dashboard_name`,
|
|
|
|
CASE
|
|
|
|
WHEN `dashboards`.`access` = 1 THEN ' (shared, read-only)'
|
|
|
|
WHEN `dashboards`.`access` = 2 THEN ' (shared, read-write)'
|
|
|
|
ELSE ''
|
|
|
|
END
|
|
|
|
) as `description`
|
|
|
|
FROM `dashboards` JOIN `users` ON `users`.`user_id` = `dashboards`.`user_id`
|
|
|
|
WHERE `dashboards`.`access` > 0;"
|
|
|
|
),
|
|
|
|
),
|
|
|
|
);
|
|
|
|
|
2016-02-13 21:09:45 +01:00
|
|
|
echo '
|
|
|
|
<div class="panel-group" id="accordion">
|
|
|
|
<form class="form-horizontal" role="form" action="" method="post">
|
|
|
|
';
|
|
|
|
|
2016-08-18 20:28:22 -05:00
|
|
|
echo generate_dynamic_config_panel('Graph settings', $config_groups, $graph_conf);
|
|
|
|
echo generate_dynamic_config_panel('Search settings', $config_groups, $search_conf);
|
2016-08-22 21:12:44 +03:00
|
|
|
echo generate_dynamic_config_panel('Availability map settings', $config_groups, $availability_map_conf);
|
2016-08-23 12:37:12 -06:00
|
|
|
echo generate_dynamic_config_panel('Dashboard settings', $config_groups, $dashboard_conf);
|
2016-02-13 21:09:45 +01:00
|
|
|
|
|
|
|
echo '
|
|
|
|
</form>
|
|
|
|
</div>
|
|
|
|
';
|