Skip to content

Commit

Permalink
chore: add custom endpoints to UI
Browse files Browse the repository at this point in the history
  • Loading branch information
karenc-bq committed Jan 10, 2025
1 parent 6a33b42 commit 1dbd66a
Show file tree
Hide file tree
Showing 6 changed files with 89 additions and 30 deletions.
2 changes: 1 addition & 1 deletion driver/custom_endpoint_monitor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ void CUSTOM_ENDPOINT_MONITOR::stop() {
this->thread_pool.resize(0);
custom_endpoint_cache.remove(this->custom_endpoint_host_info->get_host());
--SDK_HELPER;
MYLOG_TRACE(this->logger, 0, "Stopped custom endpoint monitor for '%s'", this->custom_endpoint_host_info->get_host());
MYLOG_TRACE(this->logger, 0, "Stopped custom endpoint monitor for '%s'", this->custom_endpoint_host_info->get_host().c_str());
}

void CUSTOM_ENDPOINT_MONITOR::clear_cache() { custom_endpoint_cache.clear(); }
57 changes: 43 additions & 14 deletions setupgui/callbacks.cc
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,15 @@ void syncTabsData(HWND hwnd, DataSource *params)
GET_UNSIGNED_TAB(FED_AUTH_TAB, CLIENT_SOCKET_TIMEOUT);
GET_BOOL_TAB(FED_AUTH_TAB, ENABLE_SSL);

/* 5 - Failover */
/* 5 - Custom Endpoint */
GET_BOOL_TAB(CUSTOM_ENDPOINT_TAB, ENABLE_CUSTOM_ENDPOINT_MONITORING);
GET_BOOL_TAB(CUSTOM_ENDPOINT_TAB, WAIT_FOR_CUSTOM_ENDPOINT_INFO);
GET_UNSIGNED_TAB(CUSTOM_ENDPOINT_TAB, CUSTOM_ENDPOINT_MONITOR_EXPIRATION_MS);
GET_UNSIGNED_TAB(CUSTOM_ENDPOINT_TAB, CUSTOM_ENDPOINT_INFO_REFRESH_RATE_MS);
GET_UNSIGNED_TAB(CUSTOM_ENDPOINT_TAB, WAIT_FOR_CUSTOM_ENDPOINT_INFO_TIMEOUT_MS);
GET_STRING_TAB(CUSTOM_ENDPOINT_TAB, CUSTOM_ENDPOINT_REGION);

/* 6 - Failover */
GET_BOOL_TAB(FAILOVER_TAB, ENABLE_CLUSTER_FAILOVER);
GET_COMBO_TAB(FAILOVER_TAB, FAILOVER_MODE);
GET_BOOL_TAB(FAILOVER_TAB, GATHER_PERF_METRICS);
Expand All @@ -365,7 +373,7 @@ void syncTabsData(HWND hwnd, DataSource *params)
GET_UNSIGNED_TAB(FAILOVER_TAB, CONNECT_TIMEOUT);
GET_UNSIGNED_TAB(FAILOVER_TAB, NETWORK_TIMEOUT);

/* 6 - Monitoring */
/* 7 - Monitoring */
GET_BOOL_TAB(MONITORING_TAB, ENABLE_FAILURE_DETECTION);
if (READ_BOOL_TAB(MONITORING_TAB, ENABLE_FAILURE_DETECTION))
{
Expand All @@ -376,15 +384,15 @@ void syncTabsData(HWND hwnd, DataSource *params)
GET_UNSIGNED_TAB(MONITORING_TAB, MONITOR_DISPOSAL_TIME);
}

/* 7 - Metadata*/
/* 8 - Metadata*/
GET_BOOL_TAB(METADATA_TAB, NO_BIGINT);
GET_BOOL_TAB(METADATA_TAB, NO_BINARY_RESULT);
GET_BOOL_TAB(METADATA_TAB, FULL_COLUMN_NAMES);
GET_BOOL_TAB(METADATA_TAB, NO_CATALOG);
GET_BOOL_TAB(METADATA_TAB, NO_SCHEMA);
GET_BOOL_TAB(METADATA_TAB, COLUMN_SIZE_S32);

/* 8 - Cursors/Results */
/* 9 - Cursors/Results */
GET_BOOL_TAB(CURSORS_TAB, FOUND_ROWS);
GET_BOOL_TAB(CURSORS_TAB, AUTO_IS_NULL);
GET_BOOL_TAB(CURSORS_TAB, DYNAMIC_CURSOR);
Expand All @@ -402,10 +410,10 @@ void syncTabsData(HWND hwnd, DataSource *params)
{
params->opt_PREFETCH = 0;
}
/* 9 - debug*/
/* 10 - debug*/
GET_BOOL_TAB(DEBUG_TAB,LOG_QUERY);

/* 10 - ssl related */
/* 11 - ssl related */
GET_STRING_TAB(SSL_TAB, SSL_KEY);
GET_STRING_TAB(SSL_TAB, SSL_CERT);
GET_STRING_TAB(SSL_TAB, SSL_CA);
Expand All @@ -420,7 +428,7 @@ void syncTabsData(HWND hwnd, DataSource *params)
GET_STRING_TAB(SSL_TAB, SSL_CRL);
GET_STRING_TAB(SSL_TAB, SSL_CRLPATH);

/* 11 - Misc*/
/* 12 - Misc*/
GET_BOOL_TAB(MISC_TAB, SAFE);
GET_BOOL_TAB(MISC_TAB, NO_LOCALE);
GET_BOOL_TAB(MISC_TAB, IGNORE_SPACE);
Expand Down Expand Up @@ -501,7 +509,28 @@ void syncTabs(HWND hwnd, DataSource *params)
SET_UNSIGNED_TAB(FED_AUTH_TAB, CLIENT_SOCKET_TIMEOUT);
SET_BOOL_TAB(FED_AUTH_TAB, ENABLE_SSL);

/* 5 - Failover */
/* 5 - Custom Endpoint */
SET_BOOL_TAB(CUSTOM_ENDPOINT_TAB, ENABLE_CUSTOM_ENDPOINT_MONITORING);
SET_BOOL_TAB(CUSTOM_ENDPOINT_TAB, WAIT_FOR_CUSTOM_ENDPOINT_INFO);

if (params->opt_CUSTOM_ENDPOINT_INFO_REFRESH_RATE_MS > 0)
{
SET_UNSIGNED_TAB(CUSTOM_ENDPOINT_TAB, CUSTOM_ENDPOINT_INFO_REFRESH_RATE_MS);
}

if (params->opt_CUSTOM_ENDPOINT_MONITOR_EXPIRATION_MS > 0)
{
SET_UNSIGNED_TAB(CUSTOM_ENDPOINT_TAB, CUSTOM_ENDPOINT_MONITOR_EXPIRATION_MS);
}

if (params->opt_WAIT_FOR_CUSTOM_ENDPOINT_INFO_TIMEOUT_MS > 0)
{
SET_UNSIGNED_TAB(CUSTOM_ENDPOINT_TAB, WAIT_FOR_CUSTOM_ENDPOINT_INFO_TIMEOUT_MS);
}

SET_STRING_TAB(CUSTOM_ENDPOINT_TAB, CUSTOM_ENDPOINT_REGION);

/* 6 - Failover */
SET_BOOL_TAB(FAILOVER_TAB, ENABLE_CLUSTER_FAILOVER);
SET_COMBO_TAB(FAILOVER_TAB, FAILOVER_MODE);
SET_BOOL_TAB(FAILOVER_TAB, GATHER_PERF_METRICS);
Expand Down Expand Up @@ -552,7 +581,7 @@ void syncTabs(HWND hwnd, DataSource *params)
SET_UNSIGNED_TAB(FAILOVER_TAB, NETWORK_TIMEOUT);
}

/* 6 - Monitoring */
/* 7 - Monitoring */
SET_BOOL_TAB(MONITORING_TAB, ENABLE_FAILURE_DETECTION);
if (READ_BOOL_TAB(MONITORING_TAB, ENABLE_FAILURE_DETECTION)) {
#ifdef _WIN32
Expand All @@ -569,15 +598,15 @@ void syncTabs(HWND hwnd, DataSource *params)
SET_UNSIGNED_TAB(MONITORING_TAB, FAILURE_DETECTION_TIMEOUT);
}

/* 7 - Metadata */
/* 8 - Metadata */
SET_BOOL_TAB(METADATA_TAB, NO_BIGINT);
SET_BOOL_TAB(METADATA_TAB, NO_BINARY_RESULT);
SET_BOOL_TAB(METADATA_TAB, FULL_COLUMN_NAMES);
SET_BOOL_TAB(METADATA_TAB, NO_CATALOG);
SET_BOOL_TAB(METADATA_TAB, NO_SCHEMA);
SET_BOOL_TAB(METADATA_TAB, COLUMN_SIZE_S32);

/* 8 - Cursors/Results */
/* 9 - Cursors/Results */
SET_BOOL_TAB(CURSORS_TAB, FOUND_ROWS);
SET_BOOL_TAB(CURSORS_TAB, AUTO_IS_NULL);
SET_BOOL_TAB(CURSORS_TAB, DYNAMIC_CURSOR);
Expand All @@ -596,10 +625,10 @@ void syncTabs(HWND hwnd, DataSource *params)
SET_UNSIGNED_TAB(CURSORS_TAB, PREFETCH);
}

/* 9 - debug*/
/* 10 - debug*/
SET_BOOL_TAB(DEBUG_TAB,LOG_QUERY);

/* 10 - ssl related */
/* 11 - ssl related */
#ifdef _WIN32
if ( getTabCtrlTabPages(SSL_TAB-1) )
#endif
Expand Down Expand Up @@ -637,7 +666,7 @@ void syncTabs(HWND hwnd, DataSource *params)
SET_STRING_TAB(SSL_TAB, TLS_VERSIONS);
}

/* 11 - Misc*/
/* 12 - Misc*/
SET_BOOL_TAB(MISC_TAB, SAFE);
SET_BOOL_TAB(MISC_TAB, NO_LOCALE);
SET_BOOL_TAB(MISC_TAB, IGNORE_SPACE);
Expand Down
15 changes: 8 additions & 7 deletions setupgui/setupgui.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,14 @@
#define AUTH_TAB 2
#define AWS_AUTH_TAB 3
#define FED_AUTH_TAB 4
#define FAILOVER_TAB 5
#define MONITORING_TAB 6
#define METADATA_TAB 7
#define CURSORS_TAB 8
#define DEBUG_TAB 9
#define SSL_TAB 10
#define MISC_TAB 11
#define CUSTOM_ENDPOINT_TAB 5
#define FAILOVER_TAB 6
#define MONITORING_TAB 7
#define METADATA_TAB 8
#define CURSORS_TAB 9
#define DEBUG_TAB 10
#define SSL_TAB 11
#define MISC_TAB 12

#else
# include <gtk/gtk.h>
Expand Down
2 changes: 2 additions & 0 deletions setupgui/windows/odbcdialogparams.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -376,6 +376,7 @@ void btnDetails_Click (HWND hwnd)
L"Authentication",
L"AWS Authentication",
L"Federated Authentication",
L"Custom Endpoint Monitoring",
L"Cluster Failover",
L"Monitoring",
L"Metadata",
Expand All @@ -396,6 +397,7 @@ void btnDetails_Click (HWND hwnd)
MAKEINTRESOURCE(IDD_TAB9),
MAKEINTRESOURCE(IDD_TAB10),
MAKEINTRESOURCE(IDD_TAB11),
MAKEINTRESOURCE(IDD_TAB12),
0};

New_TabControl( &TabCtrl_1, // address of TabControl struct
Expand Down
34 changes: 26 additions & 8 deletions setupgui/windows/odbcdialogparams.rc
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,25 @@ BEGIN
CONTROL "&Enable SSL",IDC_CHECK_ENABLE_SSL,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,207,108,47,10
END

IDD_TAB5 DIALOGEX 0, 0, 209, 281
IDD_TAB5 DIALOGEX 0, 0, 209, 181
STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD
FONT 8, "MS Shell Dlg", 400, 0, 0x1
BEGIN
CONTROL "&Enable custom endpoint monitoring",IDC_CHECK_ENABLE_CUSTOM_ENDPOINT_MONITORING,
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,12,12,147,10
CONTROL "&Wait for custom endpoint info",IDC_CHECK_WAIT_FOR_CUSTOM_ENDPOINT_INFO,
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,12,27,147,10
RTEXT "Custom endpoint info refresh rate (ms):",IDC_STATIC,12,42,150,10
EDITTEXT IDC_EDIT_CUSTOM_ENDPOINT_INFO_REFRESH_RATE_MS,165,40,64,12,ES_AUTOHSCROLL | ES_NUMBER | WS_DISABLED
RTEXT "Wait for custom endpoint info timeout (ms):",IDC_STATIC,12,57,150,8
EDITTEXT IDC_EDIT_WAIT_FOR_CUSTOM_ENDPOINT_INFO_TIMEOUT_MS,165,55,64,12,ES_AUTOHSCROLL | ES_NUMBER | WS_DISABLED
RTEXT "Custom endpoint monitor expiration time (ms):",IDC_STATIC,12,72,150,8
EDITTEXT IDC_EDIT_CUSTOM_ENDPOINT_MONITOR_EXPIRATION_MS,165,70,64,12,ES_AUTOHSCROLL | ES_NUMBER | WS_DISABLED
RTEXT "Custom endpoint region:",IDC_STATIC,12,87,150,8
EDITTEXT IDC_EDIT_CUSTOM_ENDPOINT_REGION,165,85,64,12,ES_AUTOHSCROLL
END

IDD_TAB6 DIALOGEX 0, 0, 209, 281
STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD
FONT 8, "MS Shell Dlg", 400, 0, 0x1
BEGIN
Expand Down Expand Up @@ -284,7 +302,7 @@ BEGIN
"Button", BS_AUTOCHECKBOX | WS_TABSTOP | WS_DISABLED, 210, 96, 120, 10
END

IDD_TAB6 DIALOGEX 0, 0, 209, 181
IDD_TAB7 DIALOGEX 0, 0, 209, 181
STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD
FONT 8, "MS Shell Dlg", 400, 0, 0x1
BEGIN
Expand All @@ -302,7 +320,7 @@ BEGIN
EDITTEXT IDC_EDIT_MONITOR_DISPOSAL_TIME,132,85,64,12,ES_AUTOHSCROLL | ES_NUMBER| WS_DISABLED
END

IDD_TAB7 DIALOGEX 0, 0, 209, 181
IDD_TAB8 DIALOGEX 0, 0, 209, 181
STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD
FONT 8, "MS Shell Dlg", 400, 0, 0x1
BEGIN
Expand All @@ -320,7 +338,7 @@ BEGIN
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,12,87,141,10
END

IDD_TAB8 DIALOGEX 0, 0, 209, 181
IDD_TAB9 DIALOGEX 0, 0, 209, 181
STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD
FONT 8, "MS Shell Dlg", 400, 0, 0x1
BEGIN
Expand All @@ -345,15 +363,15 @@ BEGIN
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,12,125,138,10
END

IDD_TAB9 DIALOGEX 0, 0, 209, 181
IDD_TAB10 DIALOGEX 0, 0, 209, 181
STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD
FONT 8, "MS Shell Dlg", 400, 0, 0x1
BEGIN
CONTROL "&Log driver activity to %TEMP%\\myodbc.log",IDC_CHECK_LOG_QUERY,
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,12,12,148,10
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,12,12,1170,10
END

IDD_TAB10 DIALOGEX 0, 0, 509, 181
IDD_TAB11 DIALOGEX 0, 0, 509, 181
STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD
FONT 8, "MS Shell Dlg", 400, 0, 0x1
BEGIN
Expand Down Expand Up @@ -386,7 +404,7 @@ BEGIN
CONTROL "Disable TLS Version 1.&3",IDC_CHECK_NO_TLS_1_3,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,90,164,87,10
END

IDD_TAB11 DIALOGEX 0, 0, 209, 181
IDD_TAB12 DIALOGEX 0, 0, 209, 181
STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD
FONT 8, "MS Shell Dlg", 400, 0, 0x1
BEGIN
Expand Down
9 changes: 9 additions & 0 deletions setupgui/windows/resource.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@
#define IDD_TAB9 140
#define IDD_TAB10 141
#define IDD_TAB11 142
#define IDD_TAB12 143
#define IDC_LOGO 1000
#define IDC_EDIT 1010
#define IDC_EDIT_PASSWORD 1010
Expand Down Expand Up @@ -199,6 +200,14 @@
#define IDC_EDIT_FED_AUTH_HOST 11032
#define IDC_EDIT_FED_AUTH_PORT 11033
#define IDC_EDIT_FED_AUTH_EXPIRATION 11034
#define IDC_CHECK_ENABLE_CUSTOM_ENDPOINT_MONITORING 11040
#define IDC_CHECK_WAIT_FOR_CUSTOM_ENDPOINT_INFO 11041
#define IDC_EDIT_CUSTOM_ENDPOINT_INFO_REFRESH_RATE_MS 11042
#define IDC_EDIT_WAIT_FOR_CUSTOM_ENDPOINT_INFO_TIMEOUT_MS 11043
#define IDC_EDIT_CUSTOM_ENDPOINT_MONITOR_EXPIRATION_MS 11044
#define IDC_EDIT_CUSTOM_ENDPOINT_REGION 11045

#define IDC
#define MYSQL_ADMIN_PORT 33062
#define IDC_STATIC -1

Expand Down

0 comments on commit 1dbd66a

Please sign in to comment.