Graph container create styles

This commit is contained in:
Jonathan 2023-03-07 11:21:25 +01:00
parent 70cf44cb8f
commit d6a461acb8
3 changed files with 166 additions and 116 deletions

View File

@ -496,7 +496,7 @@ if ($edit_container) {
$single_table .= "<td id='row_type_graphs' width='30%'>"; $single_table .= "<td id='row_type_graphs' width='30%'>";
$single_table .= html_print_label_input_block( $single_table .= html_print_label_input_block(
__('Type of graph'), __('Type of graph'),
html_print_select($type_graphs, 'simple_type_graph', '', '', '', 0, true) html_print_select($type_graphs, 'simple_type_graph2', '', '', '', 0, true, false, true, '', false, 'width:100%')
); );
$single_table .= '</td>'; $single_table .= '</td>';
@ -543,21 +543,22 @@ if ($edit_container) {
$table->width = '100%'; $table->width = '100%';
$table->cellspacing = 4; $table->cellspacing = 4;
$table->cellpadding = 4; $table->cellpadding = 4;
$table->class = 'dat'; $table->class = 'filter-table-adv';
$table->styleTable = 'font-weight: bold;'; $table->styleTable = 'font-weight: bold;';
$table->style[0] = 'width: 13%'; $table->style[0] = 'width: 13%';
$table->data = []; $table->data = [];
$table->size[0] = '30%';
$table->size[1] = '30%';
$table->size[2] = '30%';
$data = []; $table->data[0][0] = html_print_label_input_block(
$data[0] = __('Time lapse'); __('Time lapse').ui_print_help_tip(
$data[0] .= ui_print_help_tip(__('This is the interval or period of time with which the graph data will be obtained. For example, a week means data from a week ago from now. '), true); __('This is the interval or period of time with which the graph data will be obtained. For example, a week means data from a week ago from now. '),
$data[1] = html_print_extended_select_for_time('period_custom', $period, '', '', '0', 10, true, false, true, '', false, $periods); true
$table->data[] = $data; ),
$table->rowclass[] = ''; html_print_extended_select_for_time('period_custom', $period, '', '', '0', 10, true, 'width:100%', true, '', false, $periods)
);
$data = [];
$data[0] = __('Custom graph');
$list_custom_graphs = custom_graphs_get_user($config['id_user'], false, true, 'RR'); $list_custom_graphs = custom_graphs_get_user($config['id_user'], false, true, 'RR');
@ -566,29 +567,45 @@ if ($edit_container) {
$graphs[$custom_graph['id_graph']] = $custom_graph['name']; $graphs[$custom_graph['id_graph']] = $custom_graph['name'];
} }
$data[1] = html_print_select($graphs, 'id_custom_graph', $idCustomGraph, '', __('None'), 0, true); $table->data[0][1] = html_print_label_input_block(
$table->data[] = $data; __('Custom graph'),
$table->rowclass[] = ''; html_print_select($graphs, 'id_custom_graph', $idCustomGraph, '', __('None'), 0, true, '', true, '', false, 'width:100%')
);
$data = []; $table->data[0][2] = html_print_label_input_block(
$data[0] = __('Show full scale graph (TIP)').ui_print_help_tip('This option may cause performance issues', true); __('Show full scale graph (TIP)').ui_print_help_tip('This option may cause performance issues', true),
$data[1] = html_print_checkbox('fullscale_2', 1, false, true); html_print_checkbox('fullscale_2', 1, false, true)
$table->data[] = $data; );
$table->rowclass[] = '';
$data = []; $data_toggle = html_print_table($table, true);
$data[0] = ''; $data_toggle .= html_print_div(
$data[1] = "<input style='float:right;' type=submit name='add_custom' class='sub add' value='".__('Add item')."'>"; [
$table->data[] = $data; 'class' => 'action-buttons-right-forced mrgn_right_10px',
$table->rowclass[] = ''; 'content' => html_print_submit_button(
__('Add item'),
'add_custom',
false,
[
'mode' => 'mini',
'icon' => 'next',
],
true
),
],
true
);
echo "<table width='100%' cellpadding=4 cellspacing=4 class='databox filters'>"; ui_toggle(
echo '<tr>'; $data_toggle,
echo '<td>'; '<span class="subsection_header_title">'.__('Custom graph').'</span>',
echo ui_toggle(html_print_table($table, true), 'Custom graph', '', '', true); 'container',
echo '</td>'; '',
echo '</tr>'; true,
echo '</table>'; false,
'',
'white-box-content',
'box-flat white_table_graph'
);
unset($table); unset($table);
@ -597,55 +614,59 @@ if ($edit_container) {
$table->width = '100%'; $table->width = '100%';
$table->cellspacing = 4; $table->cellspacing = 4;
$table->cellpadding = 4; $table->cellpadding = 4;
$table->class = 'dat'; $table->class = 'filter-table-adv';
$table->styleTable = 'font-weight: bold;'; $table->styleTable = 'font-weight: bold;';
$table->style[0] = 'width: 13%';
$table->data = []; $table->data = [];
$table->size[0] = '30%';
$table->size[1] = '30%';
$table->size[2] = '30%';
$data = [];
$data[0] = __('Time lapse');
$data[0] .= ui_print_help_tip(__('This is the interval or period of time with which the graph data will be obtained. For example, a week means data from a week ago from now. '), true);
$data[1] = html_print_extended_select_for_time('period_dynamic', $period, '', '', '0', 10, true, false, true, '', false, $periods);
$table->data[] = $data;
$table->rowclass[] = '';
$data = []; $table->data[0][0] = html_print_label_input_block(
$data[0] = __('Group'); __('Time lapse').ui_print_help_tip(
$data[1] = '<div class="w250px">'.html_print_select_groups($config['id_user'], 'RW', $return_all_groups, 'container_id_group', $id_group, '', '', '', true).'</div>'; __('This is the interval or period of time with which the graph data will be obtained. For example, a week means data from a week ago from now. '),
$table->data[] = $data; true
$table->rowclass[] = ''; ),
html_print_extended_select_for_time('period_custom', $period, '', '', '0', 10, true, 'width:100%', true, '', false, $periods)
);
$data = []; $table->data[0][1] = html_print_label_input_block(
$data[0] = __('Module group'); __('Group'),
$data[1] = html_print_select_from_sql( html_print_select_groups($config['id_user'], 'RW', $return_all_groups, 'container_id_group', $id_group, '', '', '', true)
);
$table->data[0][2] = html_print_label_input_block(
__('Module group'),
html_print_select_from_sql(
'SELECT * FROM tmodule_group ORDER BY name', 'SELECT * FROM tmodule_group ORDER BY name',
'combo_modulegroup', 'combo_modulegroup',
$modulegroup, $modulegroup,
'', '',
__('All'), __('All'),
false, false,
true true,
false,
true,
false,
'width:100%'
)
); );
$table->data[] = $data;
$table->rowclass[] = '';
$data = []; $table->data[1][0] = html_print_label_input_block(
$data[0] = __('Agent'); __('Agent'),
$data[1] = html_print_input_text('text_agent', $textAgent, '', 30, 100, true); html_print_input_text('text_agent', $textAgent, '', 30, 100, true)
$table->data[] = $data; );
$table->rowclass[] = '';
$data = []; $table->data[1][1] = html_print_label_input_block(
$data[0] = __('Module'); __('Module'),
$data[1] = html_print_input_text('text_agent_module', $textModule, '', 30, 100, true); html_print_input_text('text_agent_module', $textModule, '', 30, 100, true)
$table->data[] = $data; );
$table->rowclass[] = '';
$data = [];
$data[0] = __('Tag');
$select_tags = tags_search_tag(false, false, true); $select_tags = tags_search_tag(false, false, true);
$data[1] = html_print_select( $table->data[1][2] = html_print_label_input_block(
__('Tag'),
html_print_select(
$select_tags, $select_tags,
'tag', 'tag',
$tag, $tag,
@ -654,36 +675,52 @@ if ($edit_container) {
0, 0,
true, true,
false, false,
false false,
'',
false,
'width:100%'
)
); );
$table->data[] = $data;
$table->rowclass[] = '';
$data = []; $table->data[2][0] = html_print_label_input_block(
$data[0] = __('Type of graph'); __('Type of graph'),
$data[1] = html_print_select($type_graphs, 'simple_type_graph2', '', '', '', 0, true); html_print_select($type_graphs, 'simple_type_graph2', '', '', '', 0, true, false, true, '', false, 'width:100%')
$table->data[] = $data; );
$table->rowclass[] = '';
$data = []; $table->data[2][1] = html_print_label_input_block(
$data[0] = __('Show full scale graph (TIP)').ui_print_help_tip('This option may cause performance issues', true); __('Show full scale graph (TIP)').ui_print_help_tip('This option may cause performance issues', true),
$data[1] = html_print_checkbox('fullscale_3', 1, false, true); html_print_checkbox('fullscale_3', 1, false, true)
$table->data[] = $data; );
$table->rowclass[] = '';
$data = []; $data_toggle = html_print_table($table, true);
$data[0] = ''; $data_toggle .= html_print_div(
$data[1] = "<input style='float:right;' type=submit name='add_dynamic' class='sub add' value='".__('Add item')."'>"; [
$table->data[] = $data; 'class' => 'action-buttons-right-forced mrgn_right_10px',
$table->rowclass[] = ''; 'content' => html_print_submit_button(
__('Add item'),
'add_dynamic',
false,
[
'mode' => 'mini',
'icon' => 'next',
],
true
),
],
true
);
echo "<table width='100%' cellpadding=4 cellspacing=4 class='databox filters'>"; ui_toggle(
echo '<tr>'; $data_toggle,
echo '<td>'; '<span class="subsection_header_title">'.__('Dynamic rules for simple module graph').'</span>',
echo ui_toggle(html_print_table($table, true), 'Dynamic rules for simple module graph', '', '', true); 'container',
echo '</td>'; '',
echo '</tr>'; true,
echo '</table>'; false,
'',
'white-box-content',
'box-flat white_table_graph'
);
if ((bool) $id_container !== false) { if ((bool) $id_container !== false) {
$total_item = db_get_all_rows_sql('SELECT count(*) FROM tcontainer_item WHERE id_container = '.$id_container); $total_item = db_get_all_rows_sql('SELECT count(*) FROM tcontainer_item WHERE id_container = '.$id_container);
@ -696,7 +733,7 @@ if ($edit_container) {
ui_pagination($total_item[0]['count(*)'], false, $offset, 10); ui_pagination($total_item[0]['count(*)'], false, $offset, 10);
$table = new stdClass(); $table = new stdClass();
$table->width = '100%'; $table->width = '100%';
$table->class = 'databox data'; $table->class = 'info_table';
$table->id = 'item_table'; $table->id = 'item_table';
$table->align = []; $table->align = [];
$table->head = []; $table->head = [];
@ -710,7 +747,7 @@ if ($edit_container) {
$table->head[7] = __('Delete'); $table->head[7] = __('Delete');
$table->data = []; $table->data = [];
$i = 0;
foreach ($result_item as $item) { foreach ($result_item as $item) {
$data = []; $data = [];
@ -759,6 +796,8 @@ if ($edit_container) {
break; break;
} }
$table->cellclass[$i][7] = 'table_action_buttons';
$i++;
$data[7] = '<a href="index.php?sec=reporting&sec2=godmode/reporting/create_container&edit_container=1&delete_item=1&id_item='.$item['id_ci'].'&id='.$id_container.'" onClick="if (!confirm(\''.__('Are you sure?').'\')) $data[7] = '<a href="index.php?sec=reporting&sec2=godmode/reporting/create_container&edit_container=1&delete_item=1&id_item='.$item['id_ci'].'&id='.$id_container.'" onClick="if (!confirm(\''.__('Are you sure?').'\'))
return false;">'.html_print_image('images/delete.svg', true, ['alt' => __('Delete'), 'title' => __('Delete'), 'class' => 'invert_filter main_menu_icon']).'</a>'; return false;">'.html_print_image('images/delete.svg', true, ['alt' => __('Delete'), 'title' => __('Delete'), 'class' => 'invert_filter main_menu_icon']).'</a>';
@ -801,7 +840,7 @@ echo html_print_input_hidden('id_agent', 0);
} }
}); });
$("input[name=add_custom]").click (function () { $("#button-add_custom").click (function () {
var id_custom = $("#id_custom_graph").val(); var id_custom = $("#id_custom_graph").val();
var fullscale = $("#checkbox-fullscale_2").prop("checked"); var fullscale = $("#checkbox-fullscale_2").prop("checked");
if (id_custom !== '0'){ if (id_custom !== '0'){
@ -824,7 +863,7 @@ echo html_print_input_hidden('id_agent', 0);
} }
}); });
$("input[name=add_dynamic]").click (function () { $("#button-add_dynamic").click (function () {
var agent_alias = $("#text-text_agent").val(); var agent_alias = $("#text-text_agent").val();
var module_name = $("#text-text_agent_module").val(); var module_name = $("#text-text_agent_module").val();
var time_lapse = $("#hidden-period_dynamic").attr('value'); var time_lapse = $("#hidden-period_dynamic").attr('value');

View File

@ -129,11 +129,22 @@ $container = folder_get_folders();
$tree = folder_get_folders_tree_recursive($container); $tree = folder_get_folders_tree_recursive($container);
echo folder_togge_tree_folders($tree); echo folder_togge_tree_folders($tree);
if ($report_r && $report_w) { if ($report_r && $report_w) {
echo "<div class='right'>"; $ActionButtons[] = '<form method="post" class="right" action="index.php?sec=reporting&sec2=godmode/reporting/create_container">';
echo '<form method="post" class="right" action="index.php?sec=reporting&sec2=godmode/reporting/create_container">'; $ActionButtons[] = '<div class="action-buttons">';
html_print_submit_button(__('Create container'), 'create', false, 'class="sub next mrgn_right_5px mrgn_top_15px"'); $ActionButtons[] = html_print_submit_button(
echo '</form>'; __('Create container'),
echo '</div>'; 'create',
false,
[
'class' => 'sub ok submitButton',
'icon' => 'next',
],
true
);
$ActionButtons[] = '</div>';
$ActionButtons[] = '</form>';
html_print_action_buttons(implode('', $ActionButtons), ['type' => 'form_action']);
} }
?> ?>

View File

@ -316,13 +316,13 @@ function ui_toggle_container($code, $name, $title='', $hidden_default=true, $ret
$data[0] = '<a href="javascript:" id="tgl_ctrl_'.$uniqid.'">'.html_print_image($original, true, ['title' => $title, 'id' => 'image_'.$uniqid, 'class' => 'invert_filter']).'&nbsp;&nbsp;<b>'.$name.'</b></a>'; $data[0] = '<a href="javascript:" id="tgl_ctrl_'.$uniqid.'">'.html_print_image($original, true, ['title' => $title, 'id' => 'image_'.$uniqid, 'class' => 'invert_filter']).'&nbsp;&nbsp;<b>'.$name.'</b></a>';
$data[1] = ui_print_group_icon($group, true); $data[1] = ui_print_group_icon($group, true);
if ($report_r && $report_w) { if ($report_r && $report_w) {
$data[2] = '<a href="index.php?sec=reporting&sec2=godmode/reporting/create_container&edit_container=1&id='.$id_container.'">'.html_print_image('images/config.png', true, ['class' => 'invert_filter']).'</a>'; $data[2] = '<a href="index.php?sec=reporting&sec2=godmode/reporting/create_container&edit_container=1&id='.$id_container.'">'.html_print_image('images/edit.svg', true, ['class' => 'invert_filter main_menu_icon']).'</a>';
} }
if ($report_r && $report_w && $report_m) { if ($report_r && $report_w && $report_m) {
if ($id_container !== '1') { if ($id_container !== '1') {
$data[2] .= '&nbsp;&nbsp;&nbsp;&nbsp'.'<a href="index.php?sec=reporting&sec2=godmode/reporting/graph_container&delete_container=1&id='.$id_container.'" onClick="if (!confirm(\''.__('Are you sure?').'\')) $data[2] .= '&nbsp;&nbsp;&nbsp;&nbsp'.'<a href="index.php?sec=reporting&sec2=godmode/reporting/graph_container&delete_container=1&id='.$id_container.'" onClick="if (!confirm(\''.__('Are you sure?').'\'))
return false;">'.html_print_image('images/cross.png', true, ['alt' => __('Delete'), 'title' => __('Delete'), 'class' => 'invert_filter']).'</a>'; return false;">'.html_print_image('images/delete.svg', true, ['alt' => __('Delete'), 'title' => __('Delete'), 'class' => 'invert_filter main_menu_icon']).'</a>';
} }
} }