From 769c8fe850876ee1d9a03f673945962302419b14 Mon Sep 17 00:00:00 2001 From: Umar Farooq Ghumman Date: Fri, 23 Aug 2024 14:53:20 -0500 Subject: [PATCH] Connection Details Update Added information about Sandbox if the connection is via sandbox --- project/ui/conn.ipynb | 6 +++++- project/ui/qprof_main.ipynb | 10 ++++++++-- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/project/ui/conn.ipynb b/project/ui/conn.ipynb index c8221a9e..562a683d 100644 --- a/project/ui/conn.ipynb +++ b/project/ui/conn.ipynb @@ -262,6 +262,7 @@ "left_section = widgets.VBox([left_heading, connection_and_accordian_vbox, button, output])\n", "\n", "def on_button_clicked(b):\n", + " button.disabled = True\n", " output.clear_output(wait=True) # Clear the output\n", " global ssl_context\n", " if dropdown.value ==\"TLS\" and (tls_params==\"Verify-Full\" or tls_params==\"Verify-CA\"):\n", @@ -284,6 +285,7 @@ " auto = True,\n", " overwrite = True,)\n", " print(\"Successfully connected to the database:\", vp.current_connection().options['database'])\n", + " button.disabled = False\n", "button.on_click(on_button_clicked)" ] }, @@ -310,12 +312,14 @@ "right_section = widgets.VBox([right_heading, selectionvbox,button_select, output_2])\n", "\n", "def on_button_clicked_select(b):\n", + " button_select.disabled = True\n", " output_2.clear_output(wait=True) # Clear the output\n", " with output_2:\n", " vp.connect(selection.value)\n", " change_auto_connection(selection.value)\n", " logging.info(f\"\"\"[Connection Page] Trying to connect to the following connection: {selection.value},\"\"\")\n", " print(\"Successfully connected to the database:\", vp.current_connection().options['database'])\n", + " button_select.disabled = False\n", "button_select.on_click(on_button_clicked_select)" ] }, @@ -449,7 +453,7 @@ "\n", "\n", "
\n", - " Page version update date: 5/30/2024\n", + " Page version update date: 8/23/2024\n", "
\n", "\n", "\n" diff --git a/project/ui/qprof_main.ipynb b/project/ui/qprof_main.ipynb index 6d8a6fb8..52e4a37a 100644 --- a/project/ui/qprof_main.ipynb +++ b/project/ui/qprof_main.ipynb @@ -196,7 +196,13 @@ "conn_output = widgets.Output(layout={\"margin\" :\"0px 50px 0px 50px\"})\n", "with conn_output:\n", " try:\n", - " print(\"\\033[1mDatabase\\033[0m:\", vp.current_connection().options['database'], \" \\033[1mUsername\\033[0m:\", vp.current_connection().options['user'])\n", + " vdf_test_sandbox = vp.vDataFrame(\"select distinct sandbox from nodes where node_state='UP' and sandbox is not NULL;\")\n", + " if vdf_test_sandbox[0] is None or vdf_test_sandbox[0][0] =='':\n", + " print(\"\\033[1mDatabase\\033[0m:\", vp.current_connection().options['database'], \" \\033[1mUsername\\033[0m:\", vp.current_connection().options['user'])\n", + " else:\n", + " print(\"\\033[1mDatabase\\033[0m:\", vp.current_connection().options['database'],\n", + " \" \\033[1mUsername\\033[0m:\", vp.current_connection().options['user'],\n", + " \" \\033[1mSandbox\\033[0m:\", vdf_test_sandbox[0][0])\n", " except ConnectionError:\n", " print(\"\\033[91m\\033[1m WARNING: No database connection found. Please connect with a database to use this tool. \\033[0m\\033[0m\")\n", "display(conn_output)\n", @@ -788,7 +794,7 @@ "\n", "\n", "
\n", - " Page version update date: 8/9/2024\n", + " Page version update date: 8/23/2024\n", "
\n", "\n", ""