diff --git a/project/ui/qprof-ui.ipynb b/project/ui/qprof-ui.ipynb index 1630f5b7..8f6263ca 100644 --- a/project/ui/qprof-ui.ipynb +++ b/project/ui/qprof-ui.ipynb @@ -2,25 +2,10 @@ "cells": [ { "cell_type": "code", - "execution_count": 1, + "execution_count": null, "id": "c7fde2aa-9a00-43b2-8e83-dc89087fa142", "metadata": {}, - "outputs": [ - { - "data": { - "application/vnd.jupyter.widget-view+json": { - "model_id": "02d833789e9d402d8b05bfcf10d8c179", - "version_major": 2, - "version_minor": 0 - }, - "text/plain": [ - "HBox(children=(HTML(value=\"\n", + " Caution: These settings will reflect in your entire environment.\n", + "\n", + "\"\"\"\n", + "\n", + "warning_message = widgets.HTML(value=warning_text)\n", + "advanced_display_settings = widgets.VBox([\n", + " warning_message,\n", + " footer_widget,\n", + " count_widget,\n", + " comma_widget,\n", + " percent_bar_widget,\n", + " max_cell_width_widget,\n", + " max_columns_widget,\n", + " max_rows_widget,\n", + " ],\n", + ")\n", + "\n", + "\n", + "\n", + "update_advanced_display_options = widgets.Button(description=\"Update preferences\")\n", + "output_advanced_display_options = widgets.Output()\n", + "\n", + "def on_button_clicked_update_display_options(b):\n", + " output_advanced_display_options.clear_output(wait=True)\n", + " \n", + " # Capture widget values\n", + " with output_initial:\n", + " global count_widget_val, footer_widget_val, comma_widget_val, percent_bar_widget_val, max_cell_width_widget_val, max_columns_widget_val, max_rows_widget_val\n", + " count_widget_val = count_widget.value\n", + " footer_widget_val = footer_widget.value\n", + " comma_widget_val = comma_widget.value\n", + " percent_bar_widget_val = percent_bar_widget.value\n", + " max_cell_width_widget_val = max_cell_width_widget.value\n", + " max_columns_widget_val = max_columns_widget.value\n", + " max_rows_widget_val = max_rows_widget.value\n", + "\n", + " # Store the variables\n", + " with output_advanced_display_options:\n", + " %store count_widget_val footer_widget_val comma_widget_val percent_bar_widget_val max_cell_width_widget_val max_columns_widget_val max_rows_widget_val\n", + " alert_text = \"\"\"\n", + "
\n", + " Alert: Changes have been updated. Please refresh the page to see them.\n", + "
\n", + " \"\"\"\n", + " display(widgets.HTML(value=alert_text))\n", + "\n", + "update_advanced_display_options.on_click(on_button_clicked_update_display_options)\n", + "advanced_display_settings_widget = widgets.VBox([advanced_display_settings, update_advanced_display_options, output_advanced_display_options])" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "a8232375-7334-48eb-b691-c43312964439", "metadata": {}, "outputs": [], "source": [ - "accordion = widgets.Accordion(children=[manual_query, output_initial], titles=('Manual Queries','Execution/Error Details',))\n", + "accordion = widgets.Accordion(children=[manual_query, output_initial, advanced_display_settings_widget], titles=('Manual Queries','Execution/Error Details','Advanced Output Settings'))\n", "logging.info(f'[Query Profile Tree Page] Trying to display the error log at the bottom of the page')\n", "accordion\n" ] @@ -483,7 +606,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3e6fadfb-e275-4944-8926-cb8a33a9c866", + "id": "48efab63-e87b-4fac-8891-67d28ed0b013", "metadata": {}, "outputs": [], "source": []