()
| 75 | } |
| 76 | |
| 77 | init() { |
| 78 | if (this.initialized) |
| 79 | return; |
| 80 | this.initialized = true; |
| 81 | csrfToken.setPGCSRFToken(pgAdmin.csrf_token_header, pgAdmin.csrf_token); |
| 82 | // Define the nodes on which the menus to be appear |
| 83 | |
| 84 | let menus = [{ |
| 85 | name: 'psql', |
| 86 | module: this, |
| 87 | applies: ['tools'], |
| 88 | callback: 'openPsqlTool', |
| 89 | enable: this.psqlToolEnabled, |
| 90 | priority: 1, |
| 91 | label: gettext('PSQL Tool'), |
| 92 | data:{ |
| 93 | applies: 'tools', |
| 94 | data_disabled: gettext('Please select a database from the object explorer to access the PSQL Tool.'), |
| 95 | }, |
| 96 | permission: AllPermissionTypes.TOOLS_PSQL_TOOL, |
| 97 | }]; |
| 98 | |
| 99 | |
| 100 | this.enable_psql_tool = pgAdmin['enable_psql']; |
| 101 | if(pgAdmin['enable_psql']) { |
| 102 | pgBrowser.add_menus(menus); |
| 103 | } |
| 104 | } |
| 105 | |
| 106 | openPsqlTool(_data, treeIdentifier, connectionInfo=null) { |
| 107 | let parentData = null; |
no test coverage detected