Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: modal implementation for data ingestion table #1244

Merged
merged 43 commits into from
Oct 16, 2024
Merged
Show file tree
Hide file tree
Changes from 23 commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
bfede7e
feat: part 1
soleksy-splunk Jun 19, 2024
36a829a
chore: add definition json
sgoral-splunk Jun 20, 2024
b0a37f1
feat: spike for dashboard side panel
soleksy-splunk Jun 20, 2024
03941cc
feat(timerange): added timeframe, new search button and refactor code…
rohanm-crest Aug 16, 2024
dc90b5e
refactor: change the background color for modal timeframe and visuali…
rohanm-crest Aug 20, 2024
ea61259
merge with develop
rohanm-crest Aug 20, 2024
bdc9d6c
Merge branch 'develop' into feat/spike-poc-dashboard-side-panel
rohanm-crest Aug 21, 2024
4d1e511
refactor: added styling to the button in the modal footer
rohanm-crest Aug 29, 2024
5d3c742
update screenshots
srv-rr-github-token Aug 29, 2024
93ee9c5
Merge branch 'develop' into feat/spike-poc-dashboard-side-panel
rohanm-crest Sep 3, 2024
74a4801
feat(modal): added styling to search ingested events button
rohanm-crest Sep 3, 2024
5dd173d
Merge branch 'feat/spike-poc-dashboard-side-panel' of https://github.…
rohanm-crest Sep 3, 2024
a69e6b6
chore: rename the variables
rohanm-crest Sep 3, 2024
04392bd
chore: remove unwanted code
rohanm-crest Sep 3, 2024
38b98ec
fix: fix test case for data ingestion tab
rohanm-crest Sep 4, 2024
1ee66ba
Merge branch 'develop' into feat/spike-poc-dashboard-side-panel
rohanm-crest Sep 4, 2024
a624091
fix(testcase): added support for data ingestion modal definition in e…
rohanm-crest Sep 5, 2024
50f5734
refactor(modal): added the color variables in modal
rohanm-crest Sep 9, 2024
1aafc8e
feat(modal): added dynamic implementation for the modal queries and s…
rohanm-crest Sep 16, 2024
b54847f
Merge branch 'develop' into feat/spike-poc-dashboard-side-panel
rohanm-crest Sep 16, 2024
043307b
feat(modal): change the logic for modal values dynamically and added …
rohanm-crest Sep 20, 2024
4db569a
Merge branch 'develop' into feat/spike-poc-dashboard-side-panel
rohanm-crest Sep 20, 2024
07e4252
feat(dropdown): added custom dropdown in data ingestion modal
rohanm-crest Sep 30, 2024
a38bc12
fix: resolve the globalconfig issue
rohanm-crest Oct 1, 2024
3fb32e6
feat: refactor code for dashboardModal
rohanm-crest Oct 4, 2024
b8df285
Merge branch 'develop' into feat/spike-poc-dashboard-side-panel
rohanm-crest Oct 4, 2024
7d78f6d
refactor: change the code for modular input
rohanm-crest Oct 7, 2024
b7b1a27
Merge branch 'develop' into feat/spike-poc-dashboard-side-panel
rohanm-crest Oct 7, 2024
712cc27
fix: added test case for expected input
rohanm-crest Oct 7, 2024
08362cb
Merge branch 'feat/spike-poc-dashboard-side-panel' of https://github.…
rohanm-crest Oct 7, 2024
6dc9a27
refactor code for data ingestion modal
rohanm-crest Oct 8, 2024
cd37b67
Merge branch 'develop' into feat/spike-poc-dashboard-side-panel
rohanm-crest Oct 8, 2024
9da1b3d
update screenshots
srv-rr-github-token Oct 8, 2024
bc6e7db
Merge branch 'develop' into feat/spike-poc-dashboard-side-panel
rohanm-crest Oct 9, 2024
019d14b
refactor: updated the unit test case for dashboard modal
rohanm-crest Oct 10, 2024
3c758f3
Merge branch 'feat/spike-poc-dashboard-side-panel' of https://github.…
rohanm-crest Oct 10, 2024
fb7b683
Merge branch 'develop' into feat/spike-poc-dashboard-side-panel
rohanm-crest Oct 10, 2024
f6f4101
Merge branch 'develop' into feat/spike-poc-dashboard-side-panel
rohanm-crest Oct 15, 2024
02652f5
refactor: update the logic for dashboard for faster loading
rohanm-crest Oct 15, 2024
a0b8fb4
Merge branch 'develop' into feat/spike-poc-dashboard-side-panel
rohanm-crest Oct 15, 2024
e193da8
chore: added console error for test
rohanm-crest Oct 15, 2024
099cf36
Merge branch 'feat/spike-poc-dashboard-side-panel' of https://github.…
rohanm-crest Oct 15, 2024
1d211b7
Merge branch 'develop' into feat/spike-poc-dashboard-side-panel
rohanm-crest Oct 16, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions docs/dashboard.md
Original file line number Diff line number Diff line change
Expand Up @@ -435,3 +435,7 @@ e.g. of globalConfig.json:

the above configuration will create the following filter query:
`...source=*license_usage.log type=Usage (st IN ("*addon123*","my_custom_condition*"))...`

> Note:

> - In the Data Ingestion table, the first column displays the `View by` options list. When you click on any row in this column, a modal opens, showing detailed information such as `Data volume` and the `Number of events` over time, visualized in charts. The modal allows you to adjust the options via a dropdown to view data for different View by options. This enables dynamic exploration of data trends for various selected inputs.
16 changes: 16 additions & 0 deletions splunk_add_on_ucc_framework/dashboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
"data_ingestion_tab": "data_ingestion_tab_definition.json",
"errors_tab": "errors_tab_definition.json",
"resources_tab": "resources_tab_definition.json",
"data_ingestion_modal_definition": "data_ingestion_modal_definition.json",
}

data_ingestion = (
Expand Down Expand Up @@ -242,6 +243,21 @@ def generate_dashboard_content(
)
)

if (
definition_json_name
== default_definition_json_filename["data_ingestion_modal_definition"]
):
content = (
utils.get_j2_env()
.get_template(definition_json_name)
.render(
data_ingestion=data_ingestion.format(
lic_usg_condition=lic_usg_condition, determine_by=determine_by
),
events_count=events_count.format(addon_name=addon_name.lower()),
)
)

return content


Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,150 @@
{
"visualizations": {
"data_ingestion_modal_timerange_label_start_viz": {
"type": "splunk.singlevalue",
"options": {
"majorFontSize": 12,
"backgroundColor": "transparent",
"majorColor": "#9fa4af"
},
"dataSources": {
"primary": "data_ingestion_modal_data_time_label_start_ds"
}
},
"data_ingestion_modal_timerange_label_end_viz": {
"type": "splunk.singlevalue",
"options": {
"majorFontSize": 12,
"backgroundColor": "transparent",
"majorColor": "#9fa4af"
},
"dataSources": {
"primary": "data_ingestion_modal_data_time_label_end_ds"
}
},
"data_ingestion_modal_data_volume_viz": {
"type": "splunk.line",
"options": {
"xAxisVisibility": "hide",
"seriesColors": ["#A870EF"],
"yAxisTitleText": "Volume (bytes)",
"xAxisTitleText": "Time"
},
"title": "Data volume",
"dataSources": {
"primary": "data_ingestion_modal_data_volume_ds"
}
},
"data_ingestion_modal_events_count_viz": {
"type": "splunk.line",
"options": {
"xAxisVisibility": "hide",
"xAxisTitleText": "Time",
"seriesColors": [
"#A870EF"
],
"yAxisTitleText": "Number of events"
},
"title": "Number of events",
"dataSources": {
"primary": "ds_search_1"
}
}
},
"dataSources": {
"data_ingestion_modal_data_time_label_start_ds": {
"type": "ds.search",
"options": {
"query": "| makeresults | addinfo | eval StartDate = strftime(info_min_time, \"%e %b %Y %I:%M%p\") | table StartDate",
"queryParameters": {
"earliest": "$data_ingestion_modal_time.earliest$",
"latest": "$data_ingestion_modal_time.latest$"
}
}
},
"data_ingestion_modal_data_time_label_end_ds": {
"type": "ds.search",
"options": {
"query": "| makeresults | addinfo | eval EndDate = strftime(info_max_time, \"%e %b %Y %I:%M%p\") | table EndDate",
"queryParameters": {
"earliest": "$data_ingestion_modal_time.earliest$",
"latest": "$data_ingestion_modal_time.latest$"
}
}
},
"data_ingestion_modal_data_volume_ds": {
"type": "ds.search",
"options": {
"query": "{{data_ingestion}}",
"queryParameters": {
"earliest": "$data_ingestion_modal_time.earliest$",
"latest": "$data_ingestion_modal_time.latest$"
}
}
},
"ds_search_1": {
"type": "ds.search",
"options": {
"query": "{{events_count}}",
"queryParameters": {
"earliest": "$data_ingestion_modal_time.earliest$",
"latest": "$data_ingestion_modal_time.latest$"
}
},
"name": "Security Score vs Spend"
}
},
"defaults": {},
"inputs": {
"data_ingestion_modal_time_window": {
"options": {
"defaultValue": "-24h,now",
"token": "data_ingestion_modal_time"
},
"title": "Time Window",
"type": "input.timerange"
}
},
"layout": {
"type": "grid",
"globalInputs": ["data_ingestion_modal_time_window"],
"structure": [
{
"item": "data_ingestion_modal_timerange_label_start_viz",
"position": {
"x": 0,
"y": 50,
"w": 100,
"h": 20
}
},
{
"item": "data_ingestion_modal_timerange_label_end_viz",
"position": {
"x": 100,
"y": 50,
"w": 100,
"h": 20
}
},
{
"item": "data_ingestion_modal_data_volume_viz",
"position": {
"x": 0,
"y": 80,
"w": 300,
"h": 400
}
},
{
"item": "data_ingestion_modal_events_count_viz",
"position": {
"x": 0,
"y": 500,
"w": 300,
"h": 400
}
}
]
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,12 @@
}
},
"count": 10
}
},
"eventHandlers": [
{
"type": "table.click.handler"
}
]
}
},
"dataSources": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
"appserver/static/js/build/globalConfig.json created\u001b[0m": "INFO",
"appserver/static/openapi.json created\u001b[0m": "INFO",
"metadata/default.meta created\u001b[0m": "INFO",
"appserver/static/js/build/custom/data_ingestion_modal_definition.json created\u001b[0m": "INFO",
"appserver/static/js/build/custom/data_ingestion_tab_definition.json created\u001b[0m": "INFO",
"appserver/static/js/build/custom/errors_tab_definition.json created\u001b[0m": "INFO",
"appserver/static/js/build/custom/overview_definition.json created\u001b[0m": "INFO",
Expand Down
150 changes: 150 additions & 0 deletions tests/unit/expected_results/data_ingestion_modal_definition.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,150 @@
{
"visualizations": {
"data_ingestion_modal_timerange_label_start_viz": {
"type": "splunk.singlevalue",
"options": {
"majorFontSize": 12,
"backgroundColor": "transparent",
"majorColor": "#9fa4af"
},
"dataSources": {
"primary": "data_ingestion_modal_data_time_label_start_ds"
}
},
"data_ingestion_modal_timerange_label_end_viz": {
"type": "splunk.singlevalue",
"options": {
"majorFontSize": 12,
"backgroundColor": "transparent",
"majorColor": "#9fa4af"
},
"dataSources": {
"primary": "data_ingestion_modal_data_time_label_end_ds"
}
},
"data_ingestion_modal_data_volume_viz": {
"type": "splunk.line",
"options": {
"xAxisVisibility": "hide",
"seriesColors": ["#A870EF"],
"yAxisTitleText": "Volume (bytes)",
"xAxisTitleText": "Time"
},
"title": "Data volume",
"dataSources": {
"primary": "data_ingestion_modal_data_volume_ds"
}
},
"data_ingestion_modal_events_count_viz": {
"type": "splunk.line",
"options": {
"xAxisVisibility": "hide",
"xAxisTitleText": "Time",
"seriesColors": [
"#A870EF"
],
"yAxisTitleText": "Number of events"
},
"title": "Number of events",
"dataSources": {
"primary": "ds_search_1"
}
}
},
"dataSources": {
"data_ingestion_modal_data_time_label_start_ds": {
"type": "ds.search",
"options": {
"query": "| makeresults | addinfo | eval StartDate = strftime(info_min_time, \"%e %b %Y %I:%M%p\") | table StartDate",
"queryParameters": {
"earliest": "$data_ingestion_modal_time.earliest$",
"latest": "$data_ingestion_modal_time.latest$"
}
}
},
"data_ingestion_modal_data_time_label_end_ds": {
"type": "ds.search",
"options": {
"query": "| makeresults | addinfo | eval EndDate = strftime(info_max_time, \"%e %b %Y %I:%M%p\") | table EndDate",
"queryParameters": {
"earliest": "$data_ingestion_modal_time.earliest$",
"latest": "$data_ingestion_modal_time.latest$"
}
}
},
"data_ingestion_modal_data_volume_ds": {
"type": "ds.search",
"options": {
"query": "{{data_ingestion}}",
"queryParameters": {
"earliest": "$data_ingestion_modal_time.earliest$",
"latest": "$data_ingestion_modal_time.latest$"
}
}
},
"ds_search_1": {
"type": "ds.search",
"options": {
"query": "{{events_count}}",
"queryParameters": {
"earliest": "$data_ingestion_modal_time.earliest$",
"latest": "$data_ingestion_modal_time.latest$"
}
},
"name": "Security Score vs Spend"
}
},
"defaults": {},
"inputs": {
"data_ingestion_modal_time_window": {
"options": {
"defaultValue": "-24h,now",
"token": "data_ingestion_modal_time"
},
"title": "Time Window",
"type": "input.timerange"
}
},
"layout": {
"type": "grid",
"globalInputs": ["data_ingestion_modal_time_window"],
"structure": [
{
"item": "data_ingestion_modal_timerange_label_start_viz",
"position": {
"x": 0,
"y": 50,
"w": 100,
"h": 20
}
},
{
"item": "data_ingestion_modal_timerange_label_end_viz",
"position": {
"x": 100,
"y": 50,
"w": 100,
"h": 20
}
},
{
"item": "data_ingestion_modal_data_volume_viz",
"position": {
"x": 0,
"y": 80,
"w": 300,
"h": 400
}
},
{
"item": "data_ingestion_modal_events_count_viz",
"position": {
"x": 0,
"y": 500,
"w": 300,
"h": 400
}
}
]
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,12 @@
}
},
"count": 10
}
},
"eventHandlers": [
{
"type": "table.click.handler"
}
]
}
},
"dataSources": {
Expand Down
Loading
Loading