From fdd25845807ee5b31037788e878373c5cc95a1eb Mon Sep 17 00:00:00 2001 From: Jan Kvetina Date: Mon, 27 Dec 2021 20:02:06 +0100 Subject: [PATCH] Users chart based on DA (for Active today report only) --- apex/f770/application/pages/page_00920.sql | 344 ++++++++++++++++----- views/users_chart.sql | 53 ++++ 2 files changed, 312 insertions(+), 85 deletions(-) create mode 100644 views/users_chart.sql diff --git a/apex/f770/application/pages/page_00920.sql b/apex/f770/application/pages/page_00920.sql index 9654a3b..76f6c4d 100644 --- a/apex/f770/application/pages/page_00920.sql +++ b/apex/f770/application/pages/page_00920.sql @@ -22,7 +22,7 @@ wwv_flow_api.create_page( ,p_page_template_options=>'#DEFAULT#' ,p_required_role=>wwv_flow_api.id(9823062898204869) ,p_last_updated_by=>'DEV' -,p_last_upd_yyyymmddhh24miss=>'20211226220826' +,p_last_upd_yyyymmddhh24miss=>'20211227171131' ); wwv_flow_api.create_page_plug( p_id=>wwv_flow_api.id(9563395243581646) @@ -39,7 +39,7 @@ wwv_flow_api.create_page_plug( ); wwv_flow_api.create_page_plug( p_id=>wwv_flow_api.id(9563449091581647) -,p_plug_name=>'Users' +,p_plug_name=>'Users [GRID]' ,p_region_name=>'USERS' ,p_region_template_options=>'#DEFAULT#' ,p_component_template_options=>'#DEFAULT#' @@ -52,12 +52,14 @@ wwv_flow_api.create_page_plug( ,p_include_rowid_column=>false ,p_plug_source_type=>'NATIVE_IG' ,p_plug_query_options=>'DERIVED_REPORT_COLUMNS' +,p_prn_content_disposition=>'ATTACHMENT' +,p_prn_document_header=>'APEX' ,p_prn_units=>'INCHES' ,p_prn_paper_size=>'LETTER' ,p_prn_width=>11 ,p_prn_height=>8.5 ,p_prn_orientation=>'HORIZONTAL' -,p_prn_page_header=>'Users' +,p_prn_page_header=>'Users [GRID]' ,p_prn_page_header_font_color=>'#000000' ,p_prn_page_header_font_family=>'Helvetica' ,p_prn_page_header_font_weight=>'normal' @@ -446,7 +448,7 @@ wwv_flow_api.create_region_column( ,p_value_alignment=>'RIGHT' ,p_attribute_02=>'VALUE' ,p_attribute_05=>'PLAIN' -,p_link_target=>'f?p=&APP_ID.:921:&SESSION.::&DEBUG.:921:P921_USER_ID:&USER_ID.' +,p_link_target=>'f?p=&APP_ID.:940:&SESSION.::&DEBUG.:940:P940_USER_ID:&USER_ID.' ,p_link_text=>'&COUNT_EVENTS.' ,p_enable_filter=>true ,p_filter_is_required=>false @@ -485,6 +487,11 @@ wwv_flow_api.create_interactive_grid( ,p_fixed_header=>'PAGE' ,p_show_icon_view=>false ,p_show_detail_view=>false +,p_javascript_code=>wwv_flow_string.join(wwv_flow_t_varchar2( +'function(config) {', +' return unified_ig_toolbar(config);', +'}', +'')) ); wwv_flow_api.create_ig_report( p_id=>wwv_flow_api.id(9618832830238094) @@ -645,7 +652,7 @@ wwv_flow_api.create_ig_report( ,p_type=>'ALTERNATIVE' ,p_default_view=>'GRID' ,p_show_row_number=>false -,p_settings_area_expanded=>true +,p_settings_area_expanded=>false ); wwv_flow_api.create_ig_report_view( p_id=>wwv_flow_api.id(20587673837464693) @@ -803,7 +810,7 @@ wwv_flow_api.create_page_plug( ,p_icon_css_classes=>'fa-lock' ,p_region_template_options=>'#DEFAULT#' ,p_plug_template=>wwv_flow_api.id(9070356145569920) -,p_plug_display_sequence=>80 +,p_plug_display_sequence=>90 ,p_include_in_reg_disp_sel_yn=>'Y' ,p_plug_display_point=>'BODY' ,p_plug_query_options=>'DERIVED_REPORT_COLUMNS' @@ -813,12 +820,12 @@ wwv_flow_api.create_page_plug( ); wwv_flow_api.create_page_plug( p_id=>wwv_flow_api.id(9717142482455624) -,p_plug_name=>'Auth Schemes' +,p_plug_name=>'Auth Schemes [GRID]' ,p_region_name=>'AUTH_SCHEMES' ,p_region_template_options=>'#DEFAULT#' ,p_component_template_options=>'#DEFAULT#' ,p_plug_template=>wwv_flow_api.id(9078290074569925) -,p_plug_display_sequence=>90 +,p_plug_display_sequence=>100 ,p_include_in_reg_disp_sel_yn=>'Y' ,p_plug_display_point=>'BODY' ,p_query_type=>'TABLE' @@ -827,12 +834,14 @@ wwv_flow_api.create_page_plug( ,p_plug_source_type=>'NATIVE_IG' ,p_plug_query_options=>'DERIVED_REPORT_COLUMNS' ,p_plug_required_role=>wwv_flow_api.id(9556407311505078) +,p_prn_content_disposition=>'ATTACHMENT' +,p_prn_document_header=>'APEX' ,p_prn_units=>'INCHES' ,p_prn_paper_size=>'LETTER' ,p_prn_width=>11 ,p_prn_height=>8.5 ,p_prn_orientation=>'HORIZONTAL' -,p_prn_page_header=>'Auth Schemes' +,p_prn_page_header=>'Auth Schemes [GRID]' ,p_prn_page_header_font_color=>'#000000' ,p_prn_page_header_font_family=>'Helvetica' ,p_prn_page_header_font_weight=>'normal' @@ -1099,6 +1108,18 @@ wwv_flow_api.create_region_column( ,p_duplicate_value=>true ,p_include_in_export=>true ); +wwv_flow_api.component_end; +end; +/ +begin +wwv_flow_api.component_begin ( + p_version_yyyy_mm_dd=>'2021.04.15' +,p_release=>'21.1.6' +,p_default_workspace_id=>9014660246496943 +,p_default_application_id=>770 +,p_default_id_offset=>0 +,p_default_owner=>'CORE' +); wwv_flow_api.create_region_column( p_id=>wwv_flow_api.id(9964521125802044) ,p_name=>'COUNT_REGIONS' @@ -1126,18 +1147,6 @@ wwv_flow_api.create_region_column( ,p_duplicate_value=>true ,p_include_in_export=>true ); -wwv_flow_api.component_end; -end; -/ -begin -wwv_flow_api.component_begin ( - p_version_yyyy_mm_dd=>'2021.04.15' -,p_release=>'21.1.6' -,p_default_workspace_id=>9014660246496943 -,p_default_application_id=>770 -,p_default_id_offset=>0 -,p_default_owner=>'CORE' -); wwv_flow_api.create_region_column( p_id=>wwv_flow_api.id(9964641560802045) ,p_name=>'COUNT_USERS' @@ -1336,6 +1345,11 @@ wwv_flow_api.create_interactive_grid( ,p_fixed_header=>'PAGE' ,p_show_icon_view=>false ,p_show_detail_view=>false +,p_javascript_code=>wwv_flow_string.join(wwv_flow_t_varchar2( +'function(config) {', +' return unified_ig_toolbar(config);', +'}', +'')) ); wwv_flow_api.create_ig_report( p_id=>wwv_flow_api.id(9814006082101179) @@ -1358,9 +1372,9 @@ wwv_flow_api.create_ig_report_view( wwv_flow_api.create_ig_report_column( p_id=>wwv_flow_api.id(3421853826929) ,p_view_id=>wwv_flow_api.id(9814223779101180) -,p_display_seq=>16 +,p_display_seq=>14 ,p_column_id=>wwv_flow_api.id(10890672836121615) -,p_is_visible=>true +,p_is_visible=>false ,p_is_frozen=>false ,p_sort_order=>1 ,p_sort_direction=>'ASC' @@ -1369,7 +1383,7 @@ wwv_flow_api.create_ig_report_column( wwv_flow_api.create_ig_report_column( p_id=>wwv_flow_api.id(9814707172101182) ,p_view_id=>wwv_flow_api.id(9814223779101180) -,p_display_seq=>3 +,p_display_seq=>2 ,p_column_id=>wwv_flow_api.id(9719130728455644) ,p_is_visible=>true ,p_is_frozen=>false @@ -1461,7 +1475,7 @@ wwv_flow_api.create_ig_report_column( wwv_flow_api.create_ig_report_column( p_id=>wwv_flow_api.id(11016971490000638) ,p_view_id=>wwv_flow_api.id(9814223779101180) -,p_display_seq=>1 +,p_display_seq=>0 ,p_column_id=>wwv_flow_api.id(10889945447121608) ,p_is_visible=>true ,p_is_frozen=>false @@ -1505,16 +1519,16 @@ wwv_flow_api.create_ig_report_column( ,p_column_id=>wwv_flow_api.id(10890324065121612) ,p_is_visible=>true ,p_is_frozen=>false -,p_width=>360 +,p_width=>280 ); wwv_flow_api.create_page_plug( p_id=>wwv_flow_api.id(9904026934658832) -,p_plug_name=>'User Roles (DYNAMIC PIVOT)' +,p_plug_name=>'User Roles (DYNAMIC PIVOT) [GRID]' ,p_region_name=>'USER_ROLES' ,p_region_template_options=>'#DEFAULT#' ,p_component_template_options=>'#DEFAULT#' ,p_plug_template=>wwv_flow_api.id(9078290074569925) -,p_plug_display_sequence=>40 +,p_plug_display_sequence=>50 ,p_include_in_reg_disp_sel_yn=>'Y' ,p_plug_display_point=>'BODY' ,p_query_type=>'SQL' @@ -1539,7 +1553,7 @@ wwv_flow_api.create_page_plug( ,p_prn_width=>11 ,p_prn_height=>8.5 ,p_prn_orientation=>'HORIZONTAL' -,p_prn_page_header=>'User Roles (DYNAMIC PIVOT)' +,p_prn_page_header=>'User Roles (DYNAMIC PIVOT) [GRID]' ,p_prn_page_header_font_color=>'#000000' ,p_prn_page_header_font_family=>'Helvetica' ,p_prn_page_header_font_weight=>'normal' @@ -2246,6 +2260,18 @@ wwv_flow_api.create_region_column( ,p_display_condition_type=>'ITEM_IS_NOT_NULL' ,p_display_condition=>'P920_C023' ); +wwv_flow_api.component_end; +end; +/ +begin +wwv_flow_api.component_begin ( + p_version_yyyy_mm_dd=>'2021.04.15' +,p_release=>'21.1.6' +,p_default_workspace_id=>9014660246496943 +,p_default_application_id=>770 +,p_default_id_offset=>0 +,p_default_owner=>'CORE' +); wwv_flow_api.create_region_column( p_id=>wwv_flow_api.id(9960933072802008) ,p_name=>'C024' @@ -2275,18 +2301,6 @@ wwv_flow_api.create_region_column( ,p_display_condition_type=>'ITEM_IS_NOT_NULL' ,p_display_condition=>'P920_C024' ); -wwv_flow_api.component_end; -end; -/ -begin -wwv_flow_api.component_begin ( - p_version_yyyy_mm_dd=>'2021.04.15' -,p_release=>'21.1.6' -,p_default_workspace_id=>9014660246496943 -,p_default_application_id=>770 -,p_default_id_offset=>0 -,p_default_owner=>'CORE' -); wwv_flow_api.create_region_column( p_id=>wwv_flow_api.id(9961056128802009) ,p_name=>'C025' @@ -3081,6 +3095,11 @@ wwv_flow_api.create_interactive_grid( ,p_fixed_header=>'PAGE' ,p_show_icon_view=>false ,p_show_detail_view=>false +,p_javascript_code=>wwv_flow_string.join(wwv_flow_t_varchar2( +'function(config) {', +' return unified_ig_toolbar(config);', +'}', +'')) ); wwv_flow_api.create_ig_report( p_id=>wwv_flow_api.id(9965844948802453) @@ -3384,6 +3403,18 @@ wwv_flow_api.create_ig_report_column( ,p_is_visible=>true ,p_is_frozen=>false ); +wwv_flow_api.component_end; +end; +/ +begin +wwv_flow_api.component_begin ( + p_version_yyyy_mm_dd=>'2021.04.15' +,p_release=>'21.1.6' +,p_default_workspace_id=>9014660246496943 +,p_default_application_id=>770 +,p_default_id_offset=>0 +,p_default_owner=>'CORE' +); wwv_flow_api.create_ig_report_column( p_id=>wwv_flow_api.id(9997910113802546) ,p_view_id=>wwv_flow_api.id(9966073400802454) @@ -3416,18 +3447,6 @@ wwv_flow_api.create_ig_report_column( ,p_is_visible=>true ,p_is_frozen=>false ); -wwv_flow_api.component_end; -end; -/ -begin -wwv_flow_api.component_begin ( - p_version_yyyy_mm_dd=>'2021.04.15' -,p_release=>'21.1.6' -,p_default_workspace_id=>9014660246496943 -,p_default_application_id=>770 -,p_default_id_offset=>0 -,p_default_owner=>'CORE' -); wwv_flow_api.create_ig_report_column( p_id=>wwv_flow_api.id(10001530144802555) ,p_view_id=>wwv_flow_api.id(9966073400802454) @@ -3549,14 +3568,97 @@ wwv_flow_api.create_page_plug( ,p_plug_query_options=>'DERIVED_REPORT_COLUMNS' ,p_plug_display_condition_type=>'NEVER' ); +wwv_flow_api.create_page_plug( + p_id=>wwv_flow_api.id(10893124980121640) +,p_plug_name=>'Users [CHART]' +,p_region_template_options=>'#DEFAULT#:t-Region--removeHeader js-removeLandmark:t-Region--scrollBody' +,p_escape_on_http_output=>'Y' +,p_plug_template=>wwv_flow_api.id(9080157814569926) +,p_plug_display_sequence=>30 +,p_include_in_reg_disp_sel_yn=>'Y' +,p_plug_display_point=>'BODY' +,p_query_type=>'TABLE' +,p_query_table=>'SESSIONS_CHART' +,p_query_order_by=>'CHART_LABEL' +,p_include_rowid_column=>false +,p_plug_source_type=>'NATIVE_JET_CHART' +,p_plug_query_num_rows=>15 +,p_plug_query_options=>'DERIVED_REPORT_COLUMNS' +); +wwv_flow_api.create_jet_chart( + p_id=>wwv_flow_api.id(10893251519121641) +,p_region_id=>wwv_flow_api.id(10893124980121640) +,p_chart_type=>'line' +,p_height=>'400' +,p_animation_on_display=>'none' +,p_animation_on_data_change=>'none' +,p_orientation=>'vertical' +,p_data_cursor=>'auto' +,p_data_cursor_behavior=>'auto' +,p_hover_behavior=>'dim' +,p_stack=>'off' +,p_fill_multi_series_gaps=>false +,p_zoom_and_scroll=>'off' +,p_tooltip_rendered=>'Y' +,p_show_series_name=>true +,p_show_group_name=>true +,p_show_value=>true +,p_legend_rendered=>'off' +); +wwv_flow_api.create_jet_chart_series( + p_id=>wwv_flow_api.id(10893379331121642) +,p_chart_id=>wwv_flow_api.id(10893251519121641) +,p_seq=>10 +,p_name=>'Users' +,p_location=>'REGION_SOURCE' +,p_items_value_column_name=>'COUNT_USERS' +,p_items_label_column_name=>'CHART_LABEL' +,p_line_style=>'solid' +,p_line_type=>'auto' +,p_marker_rendered=>'auto' +,p_marker_shape=>'circle' +,p_assigned_to_y2=>'off' +,p_items_label_rendered=>false +); +wwv_flow_api.create_jet_chart_axis( + p_id=>wwv_flow_api.id(10893487984121643) +,p_chart_id=>wwv_flow_api.id(10893251519121641) +,p_axis=>'x' +,p_is_rendered=>'on' +,p_format_scaling=>'auto' +,p_scaling=>'linear' +,p_baseline_scaling=>'zero' +,p_major_tick_rendered=>'on' +,p_minor_tick_rendered=>'off' +,p_tick_label_rendered=>'on' +,p_tick_label_rotation=>'auto' +,p_tick_label_position=>'outside' +); +wwv_flow_api.create_jet_chart_axis( + p_id=>wwv_flow_api.id(10893570097121644) +,p_chart_id=>wwv_flow_api.id(10893251519121641) +,p_axis=>'y' +,p_is_rendered=>'on' +,p_min=>0 +,p_format_type=>'decimal' +,p_decimal_places=>0 +,p_format_scaling=>'none' +,p_scaling=>'linear' +,p_baseline_scaling=>'zero' +,p_step=>1 +,p_position=>'auto' +,p_major_tick_rendered=>'on' +,p_minor_tick_rendered=>'off' +,p_tick_label_rendered=>'on' +); wwv_flow_api.create_page_plug( p_id=>wwv_flow_api.id(19158887874813927) -,p_plug_name=>'Application Roles' +,p_plug_name=>'Application Roles [GRID]' ,p_region_name=>'ROLES' ,p_region_template_options=>'#DEFAULT#' ,p_component_template_options=>'#DEFAULT#' ,p_plug_template=>wwv_flow_api.id(9078290074569925) -,p_plug_display_sequence=>70 +,p_plug_display_sequence=>80 ,p_include_in_reg_disp_sel_yn=>'Y' ,p_plug_display_point=>'BODY' ,p_query_type=>'TABLE' @@ -3571,7 +3673,7 @@ wwv_flow_api.create_page_plug( ,p_prn_width=>11 ,p_prn_height=>8.5 ,p_prn_orientation=>'HORIZONTAL' -,p_prn_page_header=>'Application Roles' +,p_prn_page_header=>'Application Roles [GRID]' ,p_prn_page_header_font_color=>'#000000' ,p_prn_page_header_font_family=>'Helvetica' ,p_prn_page_header_font_weight=>'normal' @@ -3896,6 +3998,11 @@ wwv_flow_api.create_interactive_grid( ,p_fixed_header=>'PAGE' ,p_show_icon_view=>false ,p_show_detail_view=>false +,p_javascript_code=>wwv_flow_string.join(wwv_flow_t_varchar2( +'function(config) {', +' return unified_ig_toolbar(config);', +'}', +'')) ); wwv_flow_api.create_ig_report( p_id=>wwv_flow_api.id(19171015780973960) @@ -4029,11 +4136,12 @@ wwv_flow_api.create_ig_report_column( ); wwv_flow_api.create_page_plug( p_id=>wwv_flow_api.id(19160020814813939) -,p_plug_name=>'User Roles (RAW)' +,p_plug_name=>'User Roles (RAW) [GRID]' +,p_region_name=>'USER_ROLES_RAW' ,p_region_template_options=>'#DEFAULT#' ,p_component_template_options=>'#DEFAULT#' ,p_plug_template=>wwv_flow_api.id(9078290074569925) -,p_plug_display_sequence=>50 +,p_plug_display_sequence=>60 ,p_include_in_reg_disp_sel_yn=>'Y' ,p_plug_display_point=>'BODY' ,p_query_type=>'TABLE' @@ -4049,7 +4157,7 @@ wwv_flow_api.create_page_plug( ,p_prn_width=>11 ,p_prn_height=>8.5 ,p_prn_orientation=>'HORIZONTAL' -,p_prn_page_header=>'User Roles (RAW)' +,p_prn_page_header=>'User Roles (RAW) [GRID]' ,p_prn_page_header_font_color=>'#000000' ,p_prn_page_header_font_family=>'Helvetica' ,p_prn_page_header_font_weight=>'normal' @@ -4248,6 +4356,11 @@ wwv_flow_api.create_interactive_grid( ,p_fixed_header=>'PAGE' ,p_show_icon_view=>false ,p_show_detail_view=>false +,p_javascript_code=>wwv_flow_string.join(wwv_flow_t_varchar2( +'function(config) {', +' return unified_ig_toolbar(config);', +'}', +'')) ); wwv_flow_api.create_ig_report( p_id=>wwv_flow_api.id(19186860186432768) @@ -4328,7 +4441,7 @@ wwv_flow_api.create_page_plug( ,p_icon_css_classes=>'fa-id-badge' ,p_region_template_options=>'#DEFAULT#' ,p_plug_template=>wwv_flow_api.id(9070356145569920) -,p_plug_display_sequence=>30 +,p_plug_display_sequence=>40 ,p_include_in_reg_disp_sel_yn=>'Y' ,p_plug_display_point=>'BODY' ,p_plug_query_options=>'DERIVED_REPORT_COLUMNS' @@ -4341,7 +4454,7 @@ wwv_flow_api.create_page_plug( ,p_icon_css_classes=>'fa-clipboard-lock' ,p_region_template_options=>'#DEFAULT#' ,p_plug_template=>wwv_flow_api.id(9070356145569920) -,p_plug_display_sequence=>60 +,p_plug_display_sequence=>70 ,p_include_in_reg_disp_sel_yn=>'Y' ,p_plug_display_point=>'BODY' ,p_plug_query_options=>'DERIVED_REPORT_COLUMNS' @@ -4404,6 +4517,18 @@ wwv_flow_api.create_page_item( ,p_attribute_04=>'TEXT' ,p_attribute_05=>'BOTH' ); +wwv_flow_api.component_end; +end; +/ +begin +wwv_flow_api.component_begin ( + p_version_yyyy_mm_dd=>'2021.04.15' +,p_release=>'21.1.6' +,p_default_workspace_id=>9014660246496943 +,p_default_application_id=>770 +,p_default_id_offset=>0 +,p_default_owner=>'CORE' +); wwv_flow_api.create_page_item( p_id=>wwv_flow_api.id(9810280652099819) ,p_name=>'P920_C002' @@ -4536,18 +4661,6 @@ wwv_flow_api.create_page_item( ,p_attribute_04=>'TEXT' ,p_attribute_05=>'BOTH' ); -wwv_flow_api.component_end; -end; -/ -begin -wwv_flow_api.component_begin ( - p_version_yyyy_mm_dd=>'2021.04.15' -,p_release=>'21.1.6' -,p_default_workspace_id=>9014660246496943 -,p_default_application_id=>770 -,p_default_id_offset=>0 -,p_default_owner=>'CORE' -); wwv_flow_api.create_page_item( p_id=>wwv_flow_api.id(9810805376099825) ,p_name=>'P920_C008' @@ -5526,6 +5639,18 @@ wwv_flow_api.create_page_da_action( 'apex.region(''ROLES'').widget().interactiveGrid(''getActions'').invoke(''save'');', '')) ); +wwv_flow_api.component_end; +end; +/ +begin +wwv_flow_api.component_begin ( + p_version_yyyy_mm_dd=>'2021.04.15' +,p_release=>'21.1.6' +,p_default_workspace_id=>9014660246496943 +,p_default_application_id=>770 +,p_default_id_offset=>0 +,p_default_owner=>'CORE' +); wwv_flow_api.create_page_da_action( p_id=>wwv_flow_api.id(10171770804691493) ,p_event_id=>wwv_flow_api.id(10170943324691484) @@ -5536,6 +5661,46 @@ wwv_flow_api.create_page_da_action( ,p_affected_elements_type=>'REGION' ,p_affected_region_id=>wwv_flow_api.id(19158887874813927) ); +wwv_flow_api.create_page_da_event( + p_id=>wwv_flow_api.id(10894131864121650) +,p_name=>'SELECTED_OTHERS' +,p_event_sequence=>10 +,p_triggering_element_type=>'REGION' +,p_triggering_region_id=>wwv_flow_api.id(9563449091581647) +,p_bind_type=>'live' +,p_bind_event_type=>'NATIVE_IG|REGION TYPE|interactivegridreportchange' +); +wwv_flow_api.create_page_da_action( + p_id=>wwv_flow_api.id(11138963672125801) +,p_event_id=>wwv_flow_api.id(10894131864121650) +,p_event_result=>'TRUE' +,p_action_sequence=>10 +,p_execute_on_page_init=>'Y' +,p_action=>'NATIVE_HIDE' +,p_affected_elements_type=>'REGION' +,p_affected_region_id=>wwv_flow_api.id(10893124980121640) +,p_client_condition_type=>'JAVASCRIPT_EXPRESSION' +,p_client_condition_expression=>'$(''#USERS option:selected'').text() != ''Active today''' +); +wwv_flow_api.create_page_da_event( + p_id=>wwv_flow_api.id(11139026172125802) +,p_name=>'HIDE_CHART_ON_LOAD' +,p_event_sequence=>10 +,p_bind_type=>'bind' +,p_bind_event_type=>'ready' +); +wwv_flow_api.create_page_da_action( + p_id=>wwv_flow_api.id(11139107802125803) +,p_event_id=>wwv_flow_api.id(11139026172125802) +,p_event_result=>'TRUE' +,p_action_sequence=>10 +,p_execute_on_page_init=>'Y' +,p_action=>'NATIVE_HIDE' +,p_affected_elements_type=>'REGION' +,p_affected_region_id=>wwv_flow_api.id(10893124980121640) +,p_client_condition_type=>'JAVASCRIPT_EXPRESSION' +,p_client_condition_expression=>'$(''#USERS option:selected'').text() != ''Active today''' +); wwv_flow_api.create_page_da_event( p_id=>wwv_flow_api.id(10241257867410301) ,p_name=>'SAVE_USER_ROLES' @@ -5579,6 +5744,27 @@ wwv_flow_api.create_page_da_action( ,p_affected_elements_type=>'REGION' ,p_affected_region_id=>wwv_flow_api.id(9904026934658832) ); +wwv_flow_api.create_page_da_event( + p_id=>wwv_flow_api.id(10893646599121645) +,p_name=>'SELECTED_ACTIVE' +,p_event_sequence=>20 +,p_triggering_element_type=>'REGION' +,p_triggering_region_id=>wwv_flow_api.id(9563449091581647) +,p_bind_type=>'live' +,p_bind_event_type=>'NATIVE_IG|REGION TYPE|interactivegridreportchange' +); +wwv_flow_api.create_page_da_action( + p_id=>wwv_flow_api.id(10893751103121646) +,p_event_id=>wwv_flow_api.id(10893646599121645) +,p_event_result=>'TRUE' +,p_action_sequence=>10 +,p_execute_on_page_init=>'Y' +,p_action=>'NATIVE_SHOW' +,p_affected_elements_type=>'REGION' +,p_affected_region_id=>wwv_flow_api.id(10893124980121640) +,p_client_condition_type=>'JAVASCRIPT_EXPRESSION' +,p_client_condition_expression=>'$(''#USERS option:selected'').text() == ''Active today''' +); wwv_flow_api.create_page_process( p_id=>wwv_flow_api.id(9963606352802035) ,p_process_sequence=>10 @@ -5672,18 +5858,6 @@ wwv_flow_api.create_page_process( ,p_attribute_06=>'N' ,p_error_display_location=>'INLINE_IN_NOTIFICATION' ); -wwv_flow_api.component_end; -end; -/ -begin -wwv_flow_api.component_begin ( - p_version_yyyy_mm_dd=>'2021.04.15' -,p_release=>'21.1.6' -,p_default_workspace_id=>9014660246496943 -,p_default_application_id=>770 -,p_default_id_offset=>0 -,p_default_owner=>'CORE' -); wwv_flow_api.create_page_process( p_id=>wwv_flow_api.id(9608185962232328) ,p_process_sequence=>30 diff --git a/views/users_chart.sql b/views/users_chart.sql new file mode 100644 index 0000000..599edd4 --- /dev/null +++ b/views/users_chart.sql @@ -0,0 +1,53 @@ +CREATE OR REPLACE VIEW users_chart AS +WITH t AS ( + SELECT + NVL(d.user_id, LOWER(l.apex_user)) AS user_id, + l.application_id AS app_id, + l.application_name AS app_name, -- NULL for APEX Builder + l.page_id, + l.page_name, + SUBSTR(l.page_view_type, 1, 1) AS request_type, + l.page_view_type, + l.request_value, + l.view_timestamp AS requested_at + FROM apex_workspace_activity_log l + JOIN apex_workspaces w + ON w.workspace_id = l.workspace_id + JOIN apex_applications a + ON a.workspace = w.workspace + AND a.application_id = l.application_id + LEFT JOIN ( + SELECT + UPPER(d.user_name) AS user_name, + LOWER(d.email) AS user_id + FROM apex_workspace_developers d + WHERE d.is_application_developer = 'Yes' + AND d.account_locked = 'No' + ) d + ON d.user_name = l.apex_user + WHERE (a.application_id = app.get_app_id() OR a.application_id >= 4000) + AND l.page_view_type IN ('Rendering', 'Processing', 'Ajax') + AND l.apex_user NOT IN ('nobody') + AND l.view_timestamp >= TRUNC(app.get_date_item('G_TODAY')) + AND l.view_timestamp < TRUNC(app.get_date_item('G_TODAY')) + 1 +), +z AS ( + SELECT + LEVEL AS bucket_id, + TRUNC(SYSDATE) + NUMTODSINTERVAL((LEVEL - 1) * 10, 'MINUTE') AS start_at, + TRUNC(SYSDATE) + NUMTODSINTERVAL( LEVEL * 10, 'MINUTE') AS end_at + FROM DUAL + CONNECT BY LEVEL <= (1440 / 10) +) +SELECT + z.bucket_id, + TO_CHAR(z.start_at, 'HH24:MI') AS chart_label, + NULLIF(COUNT(DISTINCT t.user_id), 0) AS count_users, + -- + NULLIF(SUM(CASE WHEN t.app_id = app.get_app_id() THEN 1 ELSE 0 END), 0) AS count_requests, + NULLIF(SUM(CASE WHEN t.app_id IS NOT NULL AND t.app_name IS NULL THEN 1 ELSE 0 END), 0) AS count_others +FROM z +LEFT JOIN t + ON app.get_time_bucket(t.requested_at, 10) = z.bucket_id +GROUP BY z.bucket_id, TO_CHAR(z.start_at, 'HH24:MI'); +