public inbox for [email protected]help / color / mirror / Atom feed
[pgAdmin][RM3782] Debugger title should show connection and object details 6+ messages / 3 participants [nested] [flat]
* [pgAdmin][RM3782] Debugger title should show connection and object details @ 2019-06-12 06:02 Aditya Toshniwal <[email protected]> 0 siblings, 1 reply; 6+ messages in thread From: Aditya Toshniwal @ 2019-06-12 06:02 UTC (permalink / raw) To: pgadmin-hackers Hi Hackers, Attached is the patch to add more information on connection details to debugger panel title and content title similar to Query Tool and View/Edit data. Adding the object name with arguments is not a good idea for the panel title, so I have kept to connection details similar to query tool. The content title will have all the details. Kindly review. -- Thanks and Regards, Aditya Toshniwal Software Engineer | EnterpriseDB India | Pune "Don't Complain about Heat, Plant a TREE" Attachments: [application/octet-stream] RM3782.patch (18.1K, 3-RM3782.patch) download | inline diff: diff --git a/web/pgadmin/static/js/sqleditor_utils.js b/web/pgadmin/static/js/sqleditor_utils.js index 9d14ac46..51026f65 100644 --- a/web/pgadmin/static/js/sqleditor_utils.js +++ b/web/pgadmin/static/js/sqleditor_utils.js @@ -195,22 +195,6 @@ define(['jquery', 'sources/gettext', 'sources/url_for'], } return '1em'; }, - - removeSlashInTheString: (value) => { - let locationList = []; - let idx = 0; - while (value && value.indexOf('/') !== -1) { - locationList.push(value.indexOf('/') + idx); - value = value.replace('/', ''); - // No of slashes already removed, so we need to increment the - // index accordingly when adding into location list - idx++; - } - return { - 'slashLocations': locationList.join(','), - 'title': encodeURIComponent(value), - }; - }, }; return sqlEditorUtils; }); diff --git a/web/pgadmin/static/js/utils.js b/web/pgadmin/static/js/utils.js index 1c58a9eb..627e4bbb 100644 --- a/web/pgadmin/static/js/utils.js +++ b/web/pgadmin/static/js/utils.js @@ -83,3 +83,19 @@ export function getGCD(inp_arr) { export function getMod(no, divisor) { return ((no % divisor) + divisor) % divisor; } + +export function removeSlashInTheString(value) { + let locationList = []; + let idx = 0; + while (value && value.indexOf('/') !== -1) { + locationList.push(value.indexOf('/') + idx); + value = value.replace('/', ''); + // No of slashes already removed, so we need to increment the + // index accordingly when adding into location list + idx++; + } + return { + 'slashLocations': locationList.join(','), + 'title': encodeURIComponent(value), + }; +} diff --git a/web/pgadmin/static/scss/_webcabin.pgadmin.scss b/web/pgadmin/static/scss/_webcabin.pgadmin.scss index 543336d2..786f4a37 100644 --- a/web/pgadmin/static/scss/_webcabin.pgadmin.scss +++ b/web/pgadmin/static/scss/_webcabin.pgadmin.scss @@ -22,6 +22,12 @@ background-color: $color-bg-theme; } +.wcFrameTitle { + text-overflow: ellipsis; + overflow: hidden; + white-space: nowrap; +} + .wcFrameTitleBar { height: $title-height; background-color: $color-bg-theme; diff --git a/web/pgadmin/tools/datagrid/__init__.py b/web/pgadmin/tools/datagrid/__init__.py index c0f61e9f..ece8325f 100644 --- a/web/pgadmin/tools/datagrid/__init__.py +++ b/web/pgadmin/tools/datagrid/__init__.py @@ -30,6 +30,7 @@ from pgadmin.utils.driver import get_driver from pgadmin.utils.exception import ConnectionLost, SSHTunnelConnectionLost from pgadmin.utils.preferences import Preferences from pgadmin.settings import get_setting +from pgadmin.utils.paths import add_fslash_string query_tool_close_session_lock = Lock() @@ -234,13 +235,8 @@ def panel(trans_id, is_query_tool, editor_title): # If title has slash(es) in it then replace it if request.args and request.args['fslashes'] != '': - try: - fslashesList = request.args['fslashes'].split(',') - for idx in fslashesList: - idx = int(idx) - editor_title = editor_title[:idx] + '/' + editor_title[idx:] - except IndexError as e: - app.logger.exception(e) + editor_title = add_fslash_string( + editor_title, request.args['fslashes']) # We need client OS information to render correct Keyboard shortcuts user_agent = UserAgent(request.headers.get('User-Agent')) diff --git a/web/pgadmin/tools/datagrid/static/js/datagrid.js b/web/pgadmin/tools/datagrid/static/js/datagrid.js index 5910fc43..6f352b87 100644 --- a/web/pgadmin/tools/datagrid/static/js/datagrid.js +++ b/web/pgadmin/tools/datagrid/static/js/datagrid.js @@ -13,10 +13,10 @@ define('pgadmin.datagrid', [ 'sources/sqleditor_utils', 'backbone', 'tools/datagrid/static/js/show_data', 'tools/datagrid/static/js/show_query_tool', 'pgadmin.browser.toolbar', - 'wcdocker', + 'sources/utils', 'wcdocker', ], function( gettext, url_for, $, _, alertify, pgAdmin, codemirror, sqlEditorUtils, - Backbone, showData, showQueryTool, toolBar + Backbone, showData, showQueryTool, toolBar, pgadminUtils ) { // Some scripts do export their object in the window only. // Generally the one, which do no have AMD support. @@ -280,7 +280,7 @@ define('pgadmin.datagrid', [ } // Open the panel if frame is initialized - let titileForURLObj = sqlEditorUtils.removeSlashInTheString(grid_title); + let titileForURLObj = pgadminUtils.removeSlashInTheString(grid_title); var url_params = { 'trans_id': trans_obj.gridTransId, 'is_query_tool': trans_obj.is_query_tool, diff --git a/web/pgadmin/tools/debugger/__init__.py b/web/pgadmin/tools/debugger/__init__.py index babd1efa..805d9dc8 100644 --- a/web/pgadmin/tools/debugger/__init__.py +++ b/web/pgadmin/tools/debugger/__init__.py @@ -33,6 +33,8 @@ from pgadmin.settings import get_setting from config import PG_DEFAULT_DRIVER from pgadmin.model import db, DebuggerFunctionArguments from pgadmin.tools.debugger.utils.debugger_instance import DebuggerInstance +from pgadmin.utils.paths import add_fslash_string + # Constants ASYNC_OK = 1 @@ -528,9 +530,10 @@ def init_function(node_type, sid, did, scid, fid, trid=None): ) [email protected]('/direct/<int:trans_id>', methods=['GET'], endpoint='direct') [email protected]('/direct/<int:trans_id>/<string:panel_title>', + methods=['GET'], endpoint='direct') @login_required -def direct_new(trans_id): +def direct_new(trans_id, panel_title): de_inst = DebuggerInstance(trans_id) # Return from the function if transaction id not found @@ -567,8 +570,12 @@ def direct_new(trans_id): # We need client OS information to render correct Keyboard shortcuts user_agent = UserAgent(request.headers.get('User-Agent')) + if request.args and request.args['fslashes'] != '': + panel_title = add_fslash_string( + panel_title, request.args['fslashes']) + function_arguments = '(' - if 'functionData' in session: + if de_inst.function_data is not None: if 'args_name' in de_inst.function_data and \ de_inst.function_data['args_name'] is not None and \ de_inst.function_data['args_name'] != '': @@ -589,7 +596,8 @@ def direct_new(trans_id): layout = get_setting('Debugger/Layout') function_name_with_arguments = \ - de_inst.debugger_data['function_name'] + function_arguments + de_inst.debugger_data['function_name'] + function_arguments \ + + '/' + panel_title return render_template( "debugger/direct.html", diff --git a/web/pgadmin/tools/debugger/static/js/debugger.js b/web/pgadmin/tools/debugger/static/js/debugger.js index a2149bf1..b05a0479 100644 --- a/web/pgadmin/tools/debugger/static/js/debugger.js +++ b/web/pgadmin/tools/debugger/static/js/debugger.js @@ -11,11 +11,11 @@ define([ 'sources/gettext', 'sources/url_for', 'jquery', 'underscore', 'underscore.string', 'alertify', 'sources/pgadmin', 'pgadmin.browser', 'backbone', 'pgadmin.backgrid', 'codemirror', 'pgadmin.backform', - 'pgadmin.tools.debugger.ui', 'pgadmin.tools.debugger.utils', - 'wcdocker', 'pgadmin.browser.frame', + 'pgadmin.tools.debugger.ui', 'pgadmin.tools.debugger.utils', 'tools/datagrid/static/js/get_panel_title', + 'sources/utils', 'wcdocker', 'pgadmin.browser.frame', ], function( gettext, url_for, $, _, S, Alertify, pgAdmin, pgBrowser, Backbone, Backgrid, - CodeMirror, Backform, get_function_arguments, debuggerUtils + CodeMirror, Backform, get_function_arguments, debuggerUtils, panelTitle, pgadminUtils ) { var pgTools = pgAdmin.Tools = pgAdmin.Tools || {}, wcDocker = window.wcDocker; @@ -340,6 +340,9 @@ define([ if (!d) return; + var panel_title = panelTitle.getPanelTitle(pgBrowser, item), + panel_title_for_url = pgadminUtils.removeSlashInTheString(panel_title); + var treeInfo = node.getTreeNodeHierarchy.apply(node, [i]), baseUrl; @@ -409,8 +412,11 @@ define([ .done(function(res) { var url = url_for('debugger.direct', { 'trans_id': res.data.debuggerTransId, + 'panel_title': panel_title_for_url.title, }); + url += '?fslashes=' + panel_title_for_url.slashLocations; + if (self.preferences.debugger_new_browser_tab) { window.open(url, '_blank'); } else { @@ -428,6 +434,7 @@ define([ 'frm_debugger', wcDocker.DOCK.STACKED, dashboardPanel[0] ); + panel.title('<span title="Debugger - '+panel_title+'">'+panel_title+'</span>'); panel.focus(); // Panel Closed event @@ -466,6 +473,10 @@ define([ self = this, is_edb_proc = d._type == 'edbproc'; + + var panel_title = panelTitle.getPanelTitle(pgBrowser, item), + panel_title_for_url = pgadminUtils.removeSlashInTheString(panel_title); + if (!d) return; @@ -482,7 +493,7 @@ define([ trans_id = res.data.trans_id; // Open Alertify the dialog to take the input arguments from user if function having input arguments if (debug_info[0]['require_input']) { - get_function_arguments(debug_info[0], 0, is_edb_proc, trans_id); + get_function_arguments(debug_info[0], 0, is_edb_proc, trans_id, panel_title); } else { // Initialize the target and create asynchronous connection and unique transaction ID // If there is no arguments to the functions then we should not ask for for function arguments and @@ -530,8 +541,11 @@ define([ var url = url_for('debugger.direct', { 'trans_id': trans_id, + 'panel_title': panel_title_for_url.title, }); + url += '?fslashes=' + panel_title_for_url.slashLocations; + if (self.preferences.debugger_new_browser_tab) { window.open(url, '_blank'); } else { @@ -549,6 +563,7 @@ define([ 'frm_debugger', wcDocker.DOCK.STACKED, dashboardPanel[0] ); + panel.title('<span title="Debugger - '+panel_title+'">'+panel_title+'</span>'); panel.focus(); // Register Panel Closed event diff --git a/web/pgadmin/tools/debugger/static/js/debugger_ui.js b/web/pgadmin/tools/debugger/static/js/debugger_ui.js index f05a22dc..371b787e 100644 --- a/web/pgadmin/tools/debugger/static/js/debugger_ui.js +++ b/web/pgadmin/tools/debugger/static/js/debugger_ui.js @@ -10,9 +10,9 @@ define([ 'sources/gettext', 'sources/url_for', 'jquery', 'underscore', 'backbone', 'pgadmin.alertifyjs', 'sources/pgadmin', 'pgadmin.browser', - 'pgadmin.backgrid', 'wcdocker', + 'pgadmin.backgrid', 'sources/utils', 'wcdocker', ], function( - gettext, url_for, $, _, Backbone, Alertify, pgAdmin, pgBrowser, Backgrid + gettext, url_for, $, _, Backbone, Alertify, pgAdmin, pgBrowser, Backgrid, pgadminUtils ) { var wcDocker = window.wcDocker; @@ -163,11 +163,11 @@ define([ } }; - var res = function(debug_info, restart_debug, is_edb_proc, trans_id) { + var res = function(debug_info, restart_debug, is_edb_proc, trans_id, panel_title) { if (!Alertify.debuggerInputArgsDialog) { Alertify.dialog('debuggerInputArgsDialog', function factory() { return { - main: function(title, debug_info, restart_debug, is_edb_proc, trans_id) { + main: function(title, debug_info, restart_debug, is_edb_proc, trans_id, panel_title) { this.preferences = window.top.pgAdmin.Browser.get_preferences_for_module('debugger'); this.set('title', title); @@ -176,6 +176,7 @@ define([ this.set('debug_info', debug_info); this.set('restart_debug', restart_debug); this.set('trans_id', trans_id); + this.set('panel_title', panel_title); // Variables to store the data sent from sqlite database var func_args_data = this.func_args_data = []; @@ -581,6 +582,7 @@ define([ debug_info: undefined, restart_debug: undefined, trans_id: undefined, + panel_title: undefined, }, setup: function() { return { @@ -752,12 +754,16 @@ define([ }) .done(function(res) { + var panel_title_for_url = pgadminUtils.removeSlashInTheString(panel_title); var url = url_for( 'debugger.direct', { 'trans_id': res.data.debuggerTransId, + 'panel_title': panel_title_for_url.title, } ); + url += '?fslashes=' + panel_title_for_url.slashLocations; + if (self.preferences.debugger_new_browser_tab) { window.open(url, '_blank'); } else { @@ -773,6 +779,7 @@ define([ 'frm_debugger', wcDocker.DOCK.STACKED, dashboardPanel[0] ); + panel.title('<span title="Debugger - '+ self.setting('panel_title')+'">'+self.setting('panel_title')+'</span>'); panel.focus(); // Panel Closed event @@ -970,7 +977,7 @@ define([ } Alertify.debuggerInputArgsDialog( - gettext('Debugger'), debug_info, restart_debug, is_edb_proc, trans_id + gettext('Debugger'), debug_info, restart_debug, is_edb_proc, trans_id, panel_title ).resizeTo(pgBrowser.stdW.md,pgBrowser.stdH.md); }; diff --git a/web/pgadmin/utils/paths.py b/web/pgadmin/utils/paths.py index 8f188474..84c08cc5 100644 --- a/web/pgadmin/utils/paths.py +++ b/web/pgadmin/utils/paths.py @@ -102,3 +102,13 @@ def get_cookie_path(): '/browser/', '' ) return cookie_root_path + + +def add_fslash_string(_text=None, _fslashes=''): + try: + for idx in map(int, _fslashes.split(',')): + _text = _text[:idx] + '/' + _text[idx:] + except IndexError as e: + current_app.logger.exception(e) + + return _text diff --git a/web/regression/javascript/pgadmin_utils_spec.js b/web/regression/javascript/pgadmin_utils_spec.js index 02bd5478..e7181069 100644 --- a/web/regression/javascript/pgadmin_utils_spec.js +++ b/web/regression/javascript/pgadmin_utils_spec.js @@ -7,7 +7,7 @@ // ////////////////////////////////////////////////////////////// -import { getEpoch, getGCD, getMod } from 'sources/utils'; +import { getEpoch, getGCD, getMod, removeSlashInTheString} from 'sources/utils'; describe('getEpoch', function () { it('should return non zero', function () { @@ -51,3 +51,59 @@ describe('getMod', function () { expect(getMod(-7,5)).toEqual(3); }); }); + +describe('Remove the slashes', function () { + it('it will remove the slashes', function () { + expect( + removeSlashInTheString('/') + ).toEqual({ + 'slashLocations': '0', + 'title': '', + }); + }); + + it('it will remove if slashes are present', function () { + expect( + removeSlashInTheString('my/test') + ).toEqual({ + 'slashLocations': '2', + 'title': 'mytest', + }); + }); + + it('it will remove all the slashes are present', function () { + expect( + removeSlashInTheString('my/test/value') + ).toEqual({ + 'slashLocations': '2,7', + 'title': 'mytestvalue', + }); + }); + + it('it will remove all the slashes are present', function () { + expect( + removeSlashInTheString('a/bb/ccc/dddd/eeeee') + ).toEqual({ + 'slashLocations': '1,4,8,13', + 'title': 'abbcccddddeeeee', + }); + }); + + it('it will not remove if slash is not present', function () { + expect( + removeSlashInTheString('mytest') + ).toEqual({ + 'slashLocations': '', + 'title': 'mytest', + }); + }); + + it('it will not remove if value is not present', function () { + expect( + removeSlashInTheString('') + ).toEqual({ + 'slashLocations': '', + 'title': '', + }); + }); +}); diff --git a/web/regression/javascript/sqleditor_utils_spec.js b/web/regression/javascript/sqleditor_utils_spec.js index 789f370c..614caeb5 100644 --- a/web/regression/javascript/sqleditor_utils_spec.js +++ b/web/regression/javascript/sqleditor_utils_spec.js @@ -36,61 +36,5 @@ define(['sources/sqleditor_utils'], expect(SqlEditorUtils.calcFontSize(2)).toEqual('2em'); }); }); - - describe('Remove the slashes', function () { - it('it will remove the slashes', function () { - expect( - SqlEditorUtils.removeSlashInTheString('/') - ).toEqual({ - 'slashLocations': '0', - 'title': '', - }); - }); - - it('it will remove if slashes are present', function () { - expect( - SqlEditorUtils.removeSlashInTheString('my/test') - ).toEqual({ - 'slashLocations': '2', - 'title': 'mytest', - }); - }); - - it('it will remove all the slashes are present', function () { - expect( - SqlEditorUtils.removeSlashInTheString('my/test/value') - ).toEqual({ - 'slashLocations': '2,7', - 'title': 'mytestvalue', - }); - }); - - it('it will remove all the slashes are present', function () { - expect( - SqlEditorUtils.removeSlashInTheString('a/bb/ccc/dddd/eeeee') - ).toEqual({ - 'slashLocations': '1,4,8,13', - 'title': 'abbcccddddeeeee', - }); - }); - - it('it will not remove if slash is not present', function () { - expect( - SqlEditorUtils.removeSlashInTheString('mytest') - ).toEqual({ - 'slashLocations': '', - 'title': 'mytest', - }); - }); - - it('it will not remove if value is not present', function () { - expect( - SqlEditorUtils.removeSlashInTheString('') - ).toEqual({ - 'slashLocations': '', - 'title': '', - }); - }); - }); }); }); ^ permalink raw reply [nested|flat] 6+ messages in thread
* Re: [pgAdmin][RM3782] Debugger title should show connection and object details @ 2019-06-12 08:23 Dave Page <[email protected]> parent: Aditya Toshniwal <[email protected]> 0 siblings, 1 reply; 6+ messages in thread From: Dave Page @ 2019-06-12 08:23 UTC (permalink / raw) To: Aditya Toshniwal <[email protected]>; +Cc: pgadmin-hackers Hi On Wed, Jun 12, 2019 at 7:03 AM Aditya Toshniwal < [email protected]> wrote: > Hi Hackers, > > Attached is the patch to add more information on connection details to > debugger panel title and content title similar to Query Tool and View/Edit > data. > Adding the object name with arguments is not a good idea for the panel > title, so I have kept to connection details similar to query tool. The > content title will have all the details. > > Kindly review. > I think not having the function name in there is a big limitation. With all this hacking going on, I think what we need to do is stop and make this configurable as has been both requested by users and suggested by us. I propose adding 2 preference options for each tab type. Each of these would be a string with placeholders, one for the tab title, and one for the tab tooltip. For example: - Query Tool * Placeholders: %DATABASE%, %SERVER%, %USERNAME%, %PORT%, %HOST% * Tab title default: %DATABASE% on %SERVER% * Tooltip title default: Query Tool: %DATABASE% on %USERNAME%@%SERVER% - View Data * Placeholders: %TABLE%, %SCHEMA%, %DATABASE%, %SERVER%, %USERNAME%, %PORT%, %HOST% * Tab title default: %SCHEMA%.%TABLE% in %DATABASE% on %SERVER% * Tooltip title default: View/Edit Data: %SCHEMA%.%TABLE% in %DATABASE% on %USERNAME%@%SERVER% - Script * Placeholders: %ACTION%, %OBJECT%, %SCHEMA%, %DATABASE%, %SERVER%, %USERNAME%, %PORT%, %HOST% * Tab title default: %ACTION% %SCHEMA%.%OBJECT% in %DATABASE% on %SERVER% * Tooltip title default: %ACTION% Script: %SCHEMA%.%OBJECT% in %DATABASE% on %USERNAME%@%SERVER% - Debugger * Placeholders: %FUNCTION_ARGS%, %FUNCTION_NOARGS%, %SCHEMA%, %DATABASE%, %SERVER%, %USERNAME%, %PORT%, %HOST% * Tab title default: %FUNCTION_NOARGS%.%OBJECT% in %DATABASE% on %SERVER% * Tooltip title default: Debugger: %SCHEMA%.%FUNCTION_ARGS% in %DATABASE% on %USERNAME%@%SERVER% Or something like that. Thoughts? -- Dave Page Blog: http://pgsnake.blogspot.com Twitter: @pgsnake EnterpriseDB UK: http://www.enterprisedb.com The Enterprise PostgreSQL Company ^ permalink raw reply [nested|flat] 6+ messages in thread
* Re: [pgAdmin][RM3782] Debugger title should show connection and object details @ 2019-06-12 09:02 Aditya Toshniwal <[email protected]> parent: Dave Page <[email protected]> 0 siblings, 1 reply; 6+ messages in thread From: Aditya Toshniwal @ 2019-06-12 09:02 UTC (permalink / raw) To: Dave Page <[email protected]>; +Cc: pgadmin-hackers Hi, On Wed, Jun 12, 2019 at 1:54 PM Dave Page <[email protected]> wrote: > Hi > > On Wed, Jun 12, 2019 at 7:03 AM Aditya Toshniwal < > [email protected]> wrote: > >> Hi Hackers, >> >> Attached is the patch to add more information on connection details to >> debugger panel title and content title similar to Query Tool and View/Edit >> data. >> Adding the object name with arguments is not a good idea for the panel >> title, so I have kept to connection details similar to query tool. The >> content title will have all the details. >> >> Kindly review. >> > > I think not having the function name in there is a big limitation. > > With all this hacking going on, I think what we need to do is stop and > make this configurable as has been both requested by users and suggested by > us. > > I propose adding 2 preference options for each tab type. Each of these > would be a string with placeholders, one for the tab title, and one for the > tab tooltip. For example: > > - Query Tool > * Placeholders: %DATABASE%, %SERVER%, %USERNAME%, %PORT%, %HOST% > * Tab title default: %DATABASE% on %SERVER% > * Tooltip title default: Query Tool: %DATABASE% on %USERNAME%@%SERVER% > > - View Data > * Placeholders: %TABLE%, %SCHEMA%, %DATABASE%, %SERVER%, %USERNAME%, > %PORT%, %HOST% > * Tab title default: %SCHEMA%.%TABLE% in %DATABASE% on %SERVER% > * Tooltip title default: View/Edit Data: %SCHEMA%.%TABLE% in %DATABASE% > on %USERNAME%@%SERVER% > > - Script > * Placeholders: %ACTION%, %OBJECT%, %SCHEMA%, %DATABASE%, %SERVER%, > %USERNAME%, %PORT%, %HOST% > * Tab title default: %ACTION% %SCHEMA%.%OBJECT% in %DATABASE% on %SERVER% > * Tooltip title default: %ACTION% Script: %SCHEMA%.%OBJECT% > in %DATABASE% on %USERNAME%@%SERVER% > > - Debugger > * Placeholders: %FUNCTION_ARGS%, %FUNCTION_NOARGS%, %SCHEMA%, > %DATABASE%, %SERVER%, %USERNAME%, %PORT%, %HOST% > * Tab title default: %FUNCTION_NOARGS%.%OBJECT% in %DATABASE% on %SERVER% > * Tooltip title default: Debugger: %SCHEMA%.%FUNCTION_ARGS% > in %DATABASE% on %USERNAME%@%SERVER% > > Or something like that. Thoughts? > Yes, this could be a nice feature. I think tooltip title customisation is not needed, we can just set it as prefix + tab title. Some users asked for in-place rename of tab title. I'm not sure if it is feasible to implement, but should we consider it also ? > > -- > Dave Page > Blog: http://pgsnake.blogspot.com > Twitter: @pgsnake > > EnterpriseDB UK: http://www.enterprisedb.com > The Enterprise PostgreSQL Company > -- Thanks and Regards, Aditya Toshniwal Software Engineer | EnterpriseDB India | Pune "Don't Complain about Heat, Plant a TREE" ^ permalink raw reply [nested|flat] 6+ messages in thread
* Re: [pgAdmin][RM3782] Debugger title should show connection and object details @ 2019-06-12 09:44 Dave Page <[email protected]> parent: Aditya Toshniwal <[email protected]> 0 siblings, 1 reply; 6+ messages in thread From: Dave Page @ 2019-06-12 09:44 UTC (permalink / raw) To: Aditya Toshniwal <[email protected]>; +Cc: pgadmin-hackers Hi On Wed, Jun 12, 2019 at 10:02 AM Aditya Toshniwal < [email protected]> wrote: > Hi, > > On Wed, Jun 12, 2019 at 1:54 PM Dave Page <[email protected]> wrote: > >> Hi >> >> On Wed, Jun 12, 2019 at 7:03 AM Aditya Toshniwal < >> [email protected]> wrote: >> >>> Hi Hackers, >>> >>> Attached is the patch to add more information on connection details to >>> debugger panel title and content title similar to Query Tool and View/Edit >>> data. >>> Adding the object name with arguments is not a good idea for the panel >>> title, so I have kept to connection details similar to query tool. The >>> content title will have all the details. >>> >>> Kindly review. >>> >> >> I think not having the function name in there is a big limitation. >> >> With all this hacking going on, I think what we need to do is stop and >> make this configurable as has been both requested by users and suggested by >> us. >> >> I propose adding 2 preference options for each tab type. Each of these >> would be a string with placeholders, one for the tab title, and one for the >> tab tooltip. For example: >> >> - Query Tool >> * Placeholders: %DATABASE%, %SERVER%, %USERNAME%, %PORT%, %HOST% >> * Tab title default: %DATABASE% on %SERVER% >> * Tooltip title default: Query Tool: %DATABASE% on %USERNAME%@%SERVER% >> >> - View Data >> * Placeholders: %TABLE%, %SCHEMA%, %DATABASE%, %SERVER%, %USERNAME%, >> %PORT%, %HOST% >> * Tab title default: %SCHEMA%.%TABLE% in %DATABASE% on %SERVER% >> * Tooltip title default: View/Edit Data: %SCHEMA%.%TABLE% in %DATABASE% >> on %USERNAME%@%SERVER% >> >> - Script >> * Placeholders: %ACTION%, %OBJECT%, %SCHEMA%, %DATABASE%, %SERVER%, >> %USERNAME%, %PORT%, %HOST% >> * Tab title default: %ACTION% %SCHEMA%.%OBJECT% in %DATABASE% on >> %SERVER% >> * Tooltip title default: %ACTION% Script: %SCHEMA%.%OBJECT% >> in %DATABASE% on %USERNAME%@%SERVER% >> >> - Debugger >> * Placeholders: %FUNCTION_ARGS%, %FUNCTION_NOARGS%, %SCHEMA%, >> %DATABASE%, %SERVER%, %USERNAME%, %PORT%, %HOST% >> * Tab title default: %FUNCTION_NOARGS%.%OBJECT% in %DATABASE% on >> %SERVER% >> * Tooltip title default: Debugger: %SCHEMA%.%FUNCTION_ARGS% >> in %DATABASE% on %USERNAME%@%SERVER% >> >> Or something like that. Thoughts? >> > Yes, this could be a nice feature. I think tooltip title customisation is > not needed, we can just set it as prefix + tab title. > I think having it be separate is useful - you can include full information there, but keep the tab minimal so as not to create huge tabs. For example, the debugger tab could just be set to %FUNCTION_NOARGS%, whilst the tooltip has the full string. > Some users asked for in-place rename of tab title. I'm not sure if it is > feasible to implement, but should we consider it also ? > No - I've only seen one request for that, and it seems like a lot of work for little gain. -- Dave Page Blog: http://pgsnake.blogspot.com Twitter: @pgsnake EnterpriseDB UK: http://www.enterprisedb.com The Enterprise PostgreSQL Company ^ permalink raw reply [nested|flat] 6+ messages in thread
* Re: [pgAdmin][RM3782] Debugger title should show connection and object details @ 2019-06-12 15:26 Strauch, Sheldon <[email protected]> parent: Dave Page <[email protected]> 0 siblings, 1 reply; 6+ messages in thread From: Strauch, Sheldon @ 2019-06-12 15:26 UTC (permalink / raw) To: Dave Page <[email protected]>; +Cc: Aditya Toshniwal <[email protected]>; pgadmin-hackers FWIW: - +1 for INDEPENDENTLY configurable tab title AND tooltip - I agree that in-place edit of tabs cost/benefit isn't there, unless someone wants a personal free-time project On Wed, Jun 12, 2019 at 4:44 AM Dave Page <[email protected]> wrote: > Hi > > On Wed, Jun 12, 2019 at 10:02 AM Aditya Toshniwal < > [email protected]> wrote: > >> Hi, >> >> On Wed, Jun 12, 2019 at 1:54 PM Dave Page <[email protected]> wrote: >> >>> Hi >>> >>> On Wed, Jun 12, 2019 at 7:03 AM Aditya Toshniwal < >>> [email protected]> wrote: >>> >>>> Hi Hackers, >>>> >>>> Attached is the patch to add more information on connection details to >>>> debugger panel title and content title similar to Query Tool and View/Edit >>>> data. >>>> Adding the object name with arguments is not a good idea for the panel >>>> title, so I have kept to connection details similar to query tool. The >>>> content title will have all the details. >>>> >>>> Kindly review. >>>> >>> >>> I think not having the function name in there is a big limitation. >>> >>> With all this hacking going on, I think what we need to do is stop and >>> make this configurable as has been both requested by users and suggested by >>> us. >>> >>> I propose adding 2 preference options for each tab type. Each of these >>> would be a string with placeholders, one for the tab title, and one for the >>> tab tooltip. For example: >>> >>> - Query Tool >>> * Placeholders: %DATABASE%, %SERVER%, %USERNAME%, %PORT%, %HOST% >>> * Tab title default: %DATABASE% on %SERVER% >>> * Tooltip title default: Query Tool: %DATABASE% on %USERNAME%@%SERVER% >>> >>> - View Data >>> * Placeholders: %TABLE%, %SCHEMA%, %DATABASE%, %SERVER%, %USERNAME%, >>> %PORT%, %HOST% >>> * Tab title default: %SCHEMA%.%TABLE% in %DATABASE% on %SERVER% >>> * Tooltip title default: View/Edit Data: %SCHEMA%.%TABLE% >>> in %DATABASE% on %USERNAME%@%SERVER% >>> >>> - Script >>> * Placeholders: %ACTION%, %OBJECT%, %SCHEMA%, %DATABASE%, %SERVER%, >>> %USERNAME%, %PORT%, %HOST% >>> * Tab title default: %ACTION% %SCHEMA%.%OBJECT% in %DATABASE% on >>> %SERVER% >>> * Tooltip title default: %ACTION% Script: %SCHEMA%.%OBJECT% >>> in %DATABASE% on %USERNAME%@%SERVER% >>> >>> - Debugger >>> * Placeholders: %FUNCTION_ARGS%, %FUNCTION_NOARGS%, %SCHEMA%, >>> %DATABASE%, %SERVER%, %USERNAME%, %PORT%, %HOST% >>> * Tab title default: %FUNCTION_NOARGS%.%OBJECT% in %DATABASE% on >>> %SERVER% >>> * Tooltip title default: Debugger: %SCHEMA%.%FUNCTION_ARGS% >>> in %DATABASE% on %USERNAME%@%SERVER% >>> >>> Or something like that. Thoughts? >>> >> Yes, this could be a nice feature. I think tooltip title customisation is >> not needed, we can just set it as prefix + tab title. >> > > I think having it be separate is useful - you can include full information > there, but keep the tab minimal so as not to create huge tabs. For example, > the debugger tab could just be set to %FUNCTION_NOARGS%, whilst the tooltip > has the full string. > > >> Some users asked for in-place rename of tab title. I'm not sure if it is >> feasible to implement, but should we consider it also ? >> > > No - I've only seen one request for that, and it seems like a lot of work > for little gain. > > -- > Dave Page > Blog: http://pgsnake.blogspot.com > <https://urldefense.proofpoint.com/v2/url?u=http-3A__pgsnake.blogspot.com&d=DwMFaQ&c=lEzKI_JJ...; > Twitter: @pgsnake > > EnterpriseDB UK: http://www.enterprisedb.com > <https://urldefense.proofpoint.com/v2/url?u=http-3A__www.enterprisedb.com&d=DwMFaQ&c=lEzKI_JJ...; > The Enterprise PostgreSQL Company > -- Look after your data, and your database will look after you. -- Simon Riggs Sheldon E. Strauch *Data Architect, Data Services * *O* 312-676-1556 *M* 224-723-3878 *Enova International, Inc.* *This transmission is confidential and may be privileged or proprietary. If you are not the intended recipient, you are not authorized to use the information in this transmission in any way. Please inform the sender immediately if you have received this transmission in error and permanently delete and destroy the original and any copies of the information.* ^ permalink raw reply [nested|flat] 6+ messages in thread
* Re: [pgAdmin][RM3782] Debugger title should show connection and object details @ 2019-06-13 05:06 Aditya Toshniwal <[email protected]> parent: Strauch, Sheldon <[email protected]> 0 siblings, 0 replies; 6+ messages in thread From: Aditya Toshniwal @ 2019-06-13 05:06 UTC (permalink / raw) To: Strauch, Sheldon <[email protected]>; +Cc: Dave Page <[email protected]>; pgadmin-hackers I have closed this RM (RM3782 <https://redmine.postgresql.org/issues/3782;) and have added the proposed solution to RM4232 <https://redmine.postgresql.org/issues/4232;. On Wed, Jun 12, 2019 at 8:56 PM Strauch, Sheldon <[email protected]> wrote: > FWIW: > > - +1 for INDEPENDENTLY configurable tab title AND tooltip > - I agree that in-place edit of tabs cost/benefit isn't there, unless > someone wants a personal free-time project > > > On Wed, Jun 12, 2019 at 4:44 AM Dave Page <[email protected]> wrote: > >> Hi >> >> On Wed, Jun 12, 2019 at 10:02 AM Aditya Toshniwal < >> [email protected]> wrote: >> >>> Hi, >>> >>> On Wed, Jun 12, 2019 at 1:54 PM Dave Page <[email protected]> wrote: >>> >>>> Hi >>>> >>>> On Wed, Jun 12, 2019 at 7:03 AM Aditya Toshniwal < >>>> [email protected]> wrote: >>>> >>>>> Hi Hackers, >>>>> >>>>> Attached is the patch to add more information on connection details to >>>>> debugger panel title and content title similar to Query Tool and View/Edit >>>>> data. >>>>> Adding the object name with arguments is not a good idea for the panel >>>>> title, so I have kept to connection details similar to query tool. The >>>>> content title will have all the details. >>>>> >>>>> Kindly review. >>>>> >>>> >>>> I think not having the function name in there is a big limitation. >>>> >>>> With all this hacking going on, I think what we need to do is stop and >>>> make this configurable as has been both requested by users and suggested by >>>> us. >>>> >>>> I propose adding 2 preference options for each tab type. Each of these >>>> would be a string with placeholders, one for the tab title, and one for the >>>> tab tooltip. For example: >>>> >>>> - Query Tool >>>> * Placeholders: %DATABASE%, %SERVER%, %USERNAME%, %PORT%, %HOST% >>>> * Tab title default: %DATABASE% on %SERVER% >>>> * Tooltip title default: Query Tool: %DATABASE% on %USERNAME%@ >>>> %SERVER% >>>> >>>> - View Data >>>> * Placeholders: %TABLE%, %SCHEMA%, %DATABASE%, %SERVER%, %USERNAME%, >>>> %PORT%, %HOST% >>>> * Tab title default: %SCHEMA%.%TABLE% in %DATABASE% on %SERVER% >>>> * Tooltip title default: View/Edit Data: %SCHEMA%.%TABLE% >>>> in %DATABASE% on %USERNAME%@%SERVER% >>>> >>>> - Script >>>> * Placeholders: %ACTION%, %OBJECT%, %SCHEMA%, %DATABASE%, %SERVER%, >>>> %USERNAME%, %PORT%, %HOST% >>>> * Tab title default: %ACTION% %SCHEMA%.%OBJECT% in %DATABASE% on >>>> %SERVER% >>>> * Tooltip title default: %ACTION% Script: %SCHEMA%.%OBJECT% >>>> in %DATABASE% on %USERNAME%@%SERVER% >>>> >>>> - Debugger >>>> * Placeholders: %FUNCTION_ARGS%, %FUNCTION_NOARGS%, %SCHEMA%, >>>> %DATABASE%, %SERVER%, %USERNAME%, %PORT%, %HOST% >>>> * Tab title default: %FUNCTION_NOARGS%.%OBJECT% in %DATABASE% on >>>> %SERVER% >>>> * Tooltip title default: Debugger: %SCHEMA%.%FUNCTION_ARGS% >>>> in %DATABASE% on %USERNAME%@%SERVER% >>>> >>>> Or something like that. Thoughts? >>>> >>> Yes, this could be a nice feature. I think tooltip title customisation >>> is not needed, we can just set it as prefix + tab title. >>> >> >> I think having it be separate is useful - you can include full >> information there, but keep the tab minimal so as not to create huge tabs. >> For example, the debugger tab could just be set to %FUNCTION_NOARGS%, >> whilst the tooltip has the full string. >> >> >>> Some users asked for in-place rename of tab title. I'm not sure if it is >>> feasible to implement, but should we consider it also ? >>> >> >> No - I've only seen one request for that, and it seems like a lot of work >> for little gain. >> >> -- >> Dave Page >> Blog: http://pgsnake.blogspot.com >> <https://urldefense.proofpoint.com/v2/url?u=http-3A__pgsnake.blogspot.com&d=DwMFaQ&c=lEzKI_JJ...; >> Twitter: @pgsnake >> >> EnterpriseDB UK: http://www.enterprisedb.com >> <https://urldefense.proofpoint.com/v2/url?u=http-3A__www.enterprisedb.com&d=DwMFaQ&c=lEzKI_JJ...; >> The Enterprise PostgreSQL Company >> > > > -- > > Look after your data, and your database will look after you. -- Simon Riggs > > Sheldon E. Strauch > *Data Architect, Data Services * > *O* 312-676-1556 > *M* 224-723-3878 > > *Enova International, Inc.* > *This transmission is confidential and may be privileged or proprietary. > If you are not the intended recipient, you are not authorized to use the > information in this transmission in any way. Please inform the sender > immediately if you have received this transmission in error and permanently > delete and destroy the original and any copies of the information.* > -- Thanks and Regards, Aditya Toshniwal Software Engineer | EnterpriseDB India | Pune "Don't Complain about Heat, Plant a TREE" ^ permalink raw reply [nested|flat] 6+ messages in thread
end of thread, other threads:[~2019-06-13 05:06 UTC | newest] Thread overview: 6+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2019-06-12 06:02 [pgAdmin][RM3782] Debugger title should show connection and object details Aditya Toshniwal <[email protected]> 2019-06-12 08:23 ` Dave Page <[email protected]> 2019-06-12 09:02 ` Aditya Toshniwal <[email protected]> 2019-06-12 09:44 ` Dave Page <[email protected]> 2019-06-12 15:26 ` Strauch, Sheldon <[email protected]> 2019-06-13 05:06 ` Aditya Toshniwal <[email protected]>
This inbox is served by agora; see mirroring instructions for how to clone and mirror all data and code used for this inbox