mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-28 16:24:54 +02:00
Added cache_expiration in builder items
This commit is contained in:
parent
0aa8bcda30
commit
c2b8ad22d3
@ -1178,6 +1178,7 @@ function readFields() {
|
|||||||
values["timezone"] = $("select[name=timezone]").val();
|
values["timezone"] = $("select[name=timezone]").val();
|
||||||
values["clock_animation"] = $("select[name=clock_animation]").val();
|
values["clock_animation"] = $("select[name=clock_animation]").val();
|
||||||
values["show_last_value"] = $("select[name=last_value]").val();
|
values["show_last_value"] = $("select[name=last_value]").val();
|
||||||
|
values["cache_expiration"] = $("select[name=cache_expiration]").val();
|
||||||
|
|
||||||
// Color Cloud values
|
// Color Cloud values
|
||||||
if (selectedItem == "color_cloud" || creationItem == "color_cloud") {
|
if (selectedItem == "color_cloud" || creationItem == "color_cloud") {
|
||||||
@ -1221,7 +1222,6 @@ function readFields() {
|
|||||||
|
|
||||||
function create_button_palette_callback() {
|
function create_button_palette_callback() {
|
||||||
var values = readFields();
|
var values = readFields();
|
||||||
|
|
||||||
//VALIDATE DATA
|
//VALIDATE DATA
|
||||||
var validate = true;
|
var validate = true;
|
||||||
switch (creationItem) {
|
switch (creationItem) {
|
||||||
@ -2209,6 +2209,10 @@ function loadFieldsFromDB(item) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (key == "cache_expiration") {
|
||||||
|
$("select[name=cache_expiration]").val(val);
|
||||||
|
}
|
||||||
|
|
||||||
if (key == "value_show") {
|
if (key == "value_show") {
|
||||||
$("select[name=value_show]").val(val);
|
$("select[name=value_show]").val(val);
|
||||||
}
|
}
|
||||||
|
@ -176,6 +176,7 @@ $default_color = get_parameter('default_color', '#FFFFFF');
|
|||||||
$color_range_from_values = get_parameter('color_range_from_values', []);
|
$color_range_from_values = get_parameter('color_range_from_values', []);
|
||||||
$color_range_to_values = get_parameter('color_range_to_values', []);
|
$color_range_to_values = get_parameter('color_range_to_values', []);
|
||||||
$color_range_colors = get_parameter('color_range_colors', []);
|
$color_range_colors = get_parameter('color_range_colors', []);
|
||||||
|
$cache_expiration = get_parameter('cache_expiration', 0);
|
||||||
|
|
||||||
switch ($action) {
|
switch ($action) {
|
||||||
case 'get_font':
|
case 'get_font':
|
||||||
@ -580,6 +581,7 @@ switch ($action) {
|
|||||||
|
|
||||||
$values['label_position'] = $label_position;
|
$values['label_position'] = $label_position;
|
||||||
$values['show_on_top'] = $show_on_top;
|
$values['show_on_top'] = $show_on_top;
|
||||||
|
$values['cache_expiration'] = $cache_expiration;
|
||||||
|
|
||||||
// In Graphs, background color is stored in column image (sorry)
|
// In Graphs, background color is stored in column image (sorry)
|
||||||
if ($type == 'module_graph') {
|
if ($type == 'module_graph') {
|
||||||
@ -997,6 +999,7 @@ switch ($action) {
|
|||||||
unset($values['id_layout_linked']);
|
unset($values['id_layout_linked']);
|
||||||
unset($values['element_group']);
|
unset($values['element_group']);
|
||||||
unset($values['id_layout_linked_weight']);
|
unset($values['id_layout_linked_weight']);
|
||||||
|
unset($values['cache_expiration']);
|
||||||
// Don't change background color in graphs when move
|
// Don't change background color in graphs when move
|
||||||
switch ($type) {
|
switch ($type) {
|
||||||
case 'group_item':
|
case 'group_item':
|
||||||
@ -1406,6 +1409,7 @@ switch ($action) {
|
|||||||
$values['type_graph'] = $type_graph;
|
$values['type_graph'] = $type_graph;
|
||||||
|
|
||||||
$values['id_custom_graph'] = $id_custom_graph;
|
$values['id_custom_graph'] = $id_custom_graph;
|
||||||
|
$values['cache_expiration'] = $cache_expiration;
|
||||||
|
|
||||||
switch ($type) {
|
switch ($type) {
|
||||||
case 'line_item':
|
case 'line_item':
|
||||||
|
@ -1128,6 +1128,34 @@ function visual_map_editor_print_item_palette($visualConsole_id, $background)
|
|||||||
true
|
true
|
||||||
).'</td>';
|
).'</td>';
|
||||||
|
|
||||||
|
$interval = [];
|
||||||
|
$interval[0] = __('No cache');
|
||||||
|
$interval[10] = '10 '.__('seconds');
|
||||||
|
$interval[30] = '30 '.__('seconds');
|
||||||
|
$interval[60] = '1 '.__('minutes');
|
||||||
|
$interval[300] = '5 '.__('minutes');
|
||||||
|
$interval[900] = '15 '.__('minutes');
|
||||||
|
$interval[1800] = '30 '.__('minutes');
|
||||||
|
$interval[3600] = '1 '.__('hour');
|
||||||
|
|
||||||
|
$form_items_advance['cache_expiration_row'] = [];
|
||||||
|
$form_items_advance['cache_expiration_row']['items'] = [
|
||||||
|
'group_item',
|
||||||
|
'static_graph',
|
||||||
|
'percentile_bar',
|
||||||
|
'percentile_item',
|
||||||
|
'module_graph',
|
||||||
|
'simple_value',
|
||||||
|
'label',
|
||||||
|
'icon',
|
||||||
|
'datos',
|
||||||
|
'auto_sla_graph',
|
||||||
|
'bars_graph',
|
||||||
|
'donut_graph',
|
||||||
|
];
|
||||||
|
$form_items_advance['cache_expiration_row']['html'] = '<td align="left">'.__('Cache expiration').'</td>
|
||||||
|
<td align="left">'.html_print_select($interval, 'cache_expiration', $jeje, '', '', '0', 10, false, false, false).'</td>';
|
||||||
|
|
||||||
// Insert and modify before the buttons to create or update.
|
// Insert and modify before the buttons to create or update.
|
||||||
if (enterprise_installed()) {
|
if (enterprise_installed()) {
|
||||||
enterprise_visual_map_editor_modify_form_items_advance_palette($form_items_advance);
|
enterprise_visual_map_editor_modify_form_items_advance_palette($form_items_advance);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user