mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2026-10-12 16:11:59 -05:00
Link online help to dialogs
This commit is contained in:
1 parent
2c7a45814c
commit
1606f1d8e8
21 files changed
+123
-23
No files matched your search
+61
-13
@@ -36,8 +36,25 @@ This module defines a set of methods, properties and attributes, that every modu
|
|||||||
kwargs.setdefault('template_folder', 'templates')
|
kwargs.setdefault('template_folder', 'templates')
|
||||||
kwargs.setdefault('static_folder', 'static')
|
kwargs.setdefault('static_folder', 'static')
|
||||||
self.submodules = []
|
self.submodules = []
|
||||||
|
|
||||||
super(PgAdminModule, self).__init__(name, import_name, **kwargs)
|
super(PgAdminModule, self).__init__(name, import_name, **kwargs)
|
||||||
|
|
||||||
|
def create_module_preference():
|
||||||
|
# Create preference for each module by default
|
||||||
|
if hasattr(self, 'LABEL'):
|
||||||
|
self.preference = Preferences(self.name, self.LABEL)
|
||||||
|
else:
|
||||||
|
self.preference = Preferences(self.name, None)
|
||||||
|
|
||||||
|
self.register_preferences()
|
||||||
|
|
||||||
|
# Create and register the module preference object and preferences for
|
||||||
|
# it just before the first request
|
||||||
|
self.before_app_first_request(create_module_preference)
|
||||||
|
|
||||||
|
def register_preferences(self):
|
||||||
|
pass
|
||||||
|
|
||||||
def register(self, app, options, first_registration=False):
|
def register(self, app, options, first_registration=False):
|
||||||
"""
|
"""
|
||||||
Override the default register function to automagically register
|
Override the default register function to automagically register
|
||||||
@@ -45,7 +62,9 @@ This module defines a set of methods, properties and attributes, that every modu
|
|||||||
"""
|
"""
|
||||||
if first_registration:
|
if first_registration:
|
||||||
self.submodules = list(app.find_submodules(self.import_name))
|
self.submodules = list(app.find_submodules(self.import_name))
|
||||||
|
|
||||||
super(PgAdminModule, self).register(app, options, first_registration)
|
super(PgAdminModule, self).register(app, options, first_registration)
|
||||||
|
|
||||||
for module in self.submodules:
|
for module in self.submodules:
|
||||||
app.register_blueprint(module)
|
app.register_blueprint(module)
|
||||||
|
|
||||||
@@ -57,6 +76,14 @@ This module defines a set of methods, properties and attributes, that every modu
|
|||||||
"""
|
"""
|
||||||
return []
|
return []
|
||||||
|
|
||||||
|
def get_own_messages(self):
|
||||||
|
"""
|
||||||
|
Returns:
|
||||||
|
dict: the i18n messages used by this module, not including any
|
||||||
|
messages needed by the submodules.
|
||||||
|
"""
|
||||||
|
return dict()
|
||||||
|
|
||||||
def get_own_javascripts(self):
|
def get_own_javascripts(self):
|
||||||
"""
|
"""
|
||||||
Returns:
|
Returns:
|
||||||
@@ -87,6 +114,14 @@ This module defines a set of methods, properties and attributes, that every modu
|
|||||||
stylesheets.extend(module.stylesheets)
|
stylesheets.extend(module.stylesheets)
|
||||||
return stylesheets
|
return stylesheets
|
||||||
|
|
||||||
|
@property
|
||||||
|
def messages(self):
|
||||||
|
res = self.get_own_messages()
|
||||||
|
|
||||||
|
for module in self.submodules:
|
||||||
|
res.update(module.messages)
|
||||||
|
return res
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def javascripts(self):
|
def javascripts(self):
|
||||||
javascripts = self.get_own_javascripts()
|
javascripts = self.get_own_javascripts()
|
||||||
@@ -244,7 +279,7 @@ pgAdmin Browser. The basic idea has been taken from the `Flask's MethodView
|
|||||||
meth = 'get'
|
meth = 'get'
|
||||||
|
|
||||||
assert self.cmd in self.operations, \
|
assert self.cmd in self.operations, \
|
||||||
"Unimplemented Command ({0}) for {1}".format(
|
"Unimplemented command ({0}) for {1}".format(
|
||||||
self.cmd,
|
self.cmd,
|
||||||
str(self.__class__.__name__)
|
str(self.__class__.__name__)
|
||||||
)
|
)
|
||||||
@@ -413,21 +448,21 @@ BaseConnection
|
|||||||
- Define this method to connect the server using that particular driver
|
- Define this method to connect the server using that particular driver
|
||||||
implementation.
|
implementation.
|
||||||
|
|
||||||
* execute_scalar(query, params)
|
* execute_scalar(query, params, formatted_exception_msg)
|
||||||
- Implement this method to execute the given query and returns single
|
- Implement this method to execute the given query and returns single
|
||||||
datum result.
|
datum result.
|
||||||
|
|
||||||
* execute_async(query, params)
|
* execute_async(query, params, formatted_exception_msg)
|
||||||
- Implement this method to execute the given query asynchronously and returns result.
|
- Implement this method to execute the given query asynchronously and returns result.
|
||||||
|
|
||||||
* execute_void(query, params)
|
* execute_void(query, params, formatted_exception_msg)
|
||||||
- Implement this method to execute the given query with no result.
|
- Implement this method to execute the given query with no result.
|
||||||
|
|
||||||
* execute_2darray(query, params)
|
* execute_2darray(query, params, formatted_exception_msg)
|
||||||
- Implement this method to execute the given query and returns the result
|
- Implement this method to execute the given query and returns the result
|
||||||
as a 2 dimensional array.
|
as a 2 dimensional array.
|
||||||
|
|
||||||
* execute_dict(query, params)
|
* execute_dict(query, params, formatted_exception_msg)
|
||||||
- Implement this method to execute the given query and returns the result
|
- Implement this method to execute the given query and returns the result
|
||||||
as an array of dict (column name -> value) format.
|
as an array of dict (column name -> value) format.
|
||||||
|
|
||||||
@@ -463,7 +498,7 @@ BaseConnection
|
|||||||
- Implement this method to wait for asynchronous connection with timeout.
|
- Implement this method to wait for asynchronous connection with timeout.
|
||||||
This must be a non blocking call.
|
This must be a non blocking call.
|
||||||
|
|
||||||
* poll()
|
* poll(formatted_exception_msg)
|
||||||
- Implement this method to poll the data of query running on asynchronous
|
- Implement this method to poll the data of query running on asynchronous
|
||||||
connection.
|
connection.
|
||||||
|
|
||||||
@@ -473,35 +508,40 @@ BaseConnection
|
|||||||
* messages()
|
* messages()
|
||||||
- Implement this method to return the list of the messages/notices from
|
- Implement this method to return the list of the messages/notices from
|
||||||
the database server.
|
the database server.
|
||||||
|
|
||||||
|
* rows_affected()
|
||||||
|
- Implement this method to get the rows affected by the last command
|
||||||
|
executed on the server.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
ASYNC_OK = 1
|
ASYNC_OK = 1
|
||||||
ASYNC_READ_TIMEOUT = 2
|
ASYNC_READ_TIMEOUT = 2
|
||||||
ASYNC_WRITE_TIMEOUT = 3
|
ASYNC_WRITE_TIMEOUT = 3
|
||||||
ASYNC_NOT_CONNECTED = 4
|
ASYNC_NOT_CONNECTED = 4
|
||||||
|
ASYNC_EXECUTION_ABORTED = 5
|
||||||
|
|
||||||
@abstractmethod
|
@abstractmethod
|
||||||
def connect(self, **kwargs):
|
def connect(self, **kwargs):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
@abstractmethod
|
@abstractmethod
|
||||||
def execute_scalar(self, query, params=None):
|
def execute_scalar(self, query, params=None, formatted_exception_msg=False):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
@abstractmethod
|
@abstractmethod
|
||||||
def execute_async(self, query, params=None):
|
def execute_async(self, query, params=None, formatted_exception_msg=True):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
@abstractmethod
|
@abstractmethod
|
||||||
def execute_void(self, query, params=None):
|
def execute_void(self, query, params=None, formatted_exception_msg=False):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
@abstractmethod
|
@abstractmethod
|
||||||
def execute_2darray(self, query, params=None):
|
def execute_2darray(self, query, params=None, formatted_exception_msg=False):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
@abstractmethod
|
@abstractmethod
|
||||||
def execute_dict(self, query, params=None):
|
def execute_dict(self, query, params=None, formatted_exception_msg=False):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
@abstractmethod
|
@abstractmethod
|
||||||
@@ -533,7 +573,15 @@ BaseConnection
|
|||||||
pass
|
pass
|
||||||
|
|
||||||
@abstractmethod
|
@abstractmethod
|
||||||
def poll(self):
|
def poll(self, formatted_exception_msg=True):
|
||||||
|
pass
|
||||||
|
|
||||||
|
@abstractmethod
|
||||||
|
def status_message(self):
|
||||||
|
pass
|
||||||
|
|
||||||
|
@abstractmethod
|
||||||
|
def rows_affected(self):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
@abstractmethod
|
@abstractmethod
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ function($, _, S, pgAdmin, pgBrowser, alertify) {
|
|||||||
type: 'cast',
|
type: 'cast',
|
||||||
sqlAlterHelp: 'sql-altercast.html',
|
sqlAlterHelp: 'sql-altercast.html',
|
||||||
sqlCreateHelp: 'sql-createcast.html',
|
sqlCreateHelp: 'sql-createcast.html',
|
||||||
|
dialogHelp: '{{ url_for('help.static', filename='create_cast.html') }}',
|
||||||
canDrop: true,
|
canDrop: true,
|
||||||
canDropCascade: true,
|
canDropCascade: true,
|
||||||
label: '{{ _('Cast') }}',
|
label: '{{ _('Cast') }}',
|
||||||
|
|||||||
+1
@@ -49,6 +49,7 @@ function($, _, S, pgAdmin, pgBrowser, alertify) {
|
|||||||
type: 'event_trigger',
|
type: 'event_trigger',
|
||||||
sqlAlterHelp: 'sql-altereventtrigger.html',
|
sqlAlterHelp: 'sql-altereventtrigger.html',
|
||||||
sqlCreateHelp: 'sql-createeventtrigger.html',
|
sqlCreateHelp: 'sql-createeventtrigger.html',
|
||||||
|
dialogHelp: '{{ url_for('help.static', filename='create_event_trigger.html') }}',
|
||||||
label: '{{ _('Event Trigger') }}',
|
label: '{{ _('Event Trigger') }}',
|
||||||
hasSQL: true,
|
hasSQL: true,
|
||||||
hasDepends: true,
|
hasDepends: true,
|
||||||
|
|||||||
+1
@@ -40,6 +40,7 @@ function($, _, S, pgAdmin, pgBrowser) {
|
|||||||
type: 'extension',
|
type: 'extension',
|
||||||
sqlAlterHelp: 'sql-alterextension.html',
|
sqlAlterHelp: 'sql-alterextension.html',
|
||||||
sqlCreateHelp: 'sql-createextension.html',
|
sqlCreateHelp: 'sql-createextension.html',
|
||||||
|
dialogHelp: '{{ url_for('help.static', filename='create_extension.html') }}',
|
||||||
hasSQL: true,
|
hasSQL: true,
|
||||||
hasDepends: true,
|
hasDepends: true,
|
||||||
canDrop: true,
|
canDrop: true,
|
||||||
|
|||||||
+1
@@ -54,6 +54,7 @@ function($, _, S, pgAdmin, pgBrowser, alertify) {
|
|||||||
type: 'foreign_data_wrapper',
|
type: 'foreign_data_wrapper',
|
||||||
sqlAlterHelp: 'sql-alterforeigndatawrapper.html',
|
sqlAlterHelp: 'sql-alterforeigndatawrapper.html',
|
||||||
sqlCreateHelp: 'sql-createforeigndatawrapper.html',
|
sqlCreateHelp: 'sql-createforeigndatawrapper.html',
|
||||||
|
dialogHelp: '{{ url_for('help.static', filename='create_fdw.html') }}',
|
||||||
label: '{{ _('Foreign Data Wrapper') }}',
|
label: '{{ _('Foreign Data Wrapper') }}',
|
||||||
hasSQL: true,
|
hasSQL: true,
|
||||||
hasDepends: true,
|
hasDepends: true,
|
||||||
|
|||||||
+1
@@ -17,6 +17,7 @@ function($, _, S, pgAdmin, pgBrowser, alertify) {
|
|||||||
type: 'collation',
|
type: 'collation',
|
||||||
sqlAlterHelp: 'sql-altercollation.html',
|
sqlAlterHelp: 'sql-altercollation.html',
|
||||||
sqlCreateHelp: 'sql-createcollation.html',
|
sqlCreateHelp: 'sql-createcollation.html',
|
||||||
|
dialogHelp: '{{ url_for('help.static', filename='create_collation.html') }}',
|
||||||
label: '{{ _('Collation') }}',
|
label: '{{ _('Collation') }}',
|
||||||
collection_type: 'coll-collation',
|
collection_type: 'coll-collation',
|
||||||
hasSQL: true,
|
hasSQL: true,
|
||||||
|
|||||||
+1
@@ -20,6 +20,7 @@ function($, _, S, pgAdmin, pgBrowser, alertify) {
|
|||||||
type: 'domain-constraints',
|
type: 'domain-constraints',
|
||||||
sqlAlterHelp: 'sql-alterdomain.html',
|
sqlAlterHelp: 'sql-alterdomain.html',
|
||||||
sqlCreateHelp: 'sql-alterdomain.html',
|
sqlCreateHelp: 'sql-alterdomain.html',
|
||||||
|
dialogHelp: '{{ url_for('help.static', filename='create_domain_constraint.html') }}',
|
||||||
label: '{{ _('Domain Constraints') }}',
|
label: '{{ _('Domain Constraints') }}',
|
||||||
collection_type: 'coll-domain-constraints',
|
collection_type: 'coll-domain-constraints',
|
||||||
hasSQL: true,
|
hasSQL: true,
|
||||||
|
|||||||
+1
@@ -21,6 +21,7 @@ function($, _, S, pgAdmin, pgBrowser, alertify) {
|
|||||||
type: 'fts_parser',
|
type: 'fts_parser',
|
||||||
sqlAlterHelp: 'sql-altertsparser.html',
|
sqlAlterHelp: 'sql-altertsparser.html',
|
||||||
sqlCreateHelp: 'sql-createtsparser.html',
|
sqlCreateHelp: 'sql-createtsparser.html',
|
||||||
|
dialogHelp: '{{ url_for('help.static', filename='create_fts_parser.html') }}',
|
||||||
canDrop: true,
|
canDrop: true,
|
||||||
canDropCascade: true,
|
canDropCascade: true,
|
||||||
label: '{{ _('FTS Parser') }}',
|
label: '{{ _('FTS Parser') }}',
|
||||||
|
|||||||
+1
@@ -20,6 +20,7 @@ function($, _, S, pgAdmin, pgBrowser, alertify) {
|
|||||||
type: 'fts_template',
|
type: 'fts_template',
|
||||||
sqlAlterHelp: 'sql-altertstemplate.html',
|
sqlAlterHelp: 'sql-altertstemplate.html',
|
||||||
sqlCreateHelp: 'sql-createtstemplate.html',
|
sqlCreateHelp: 'sql-createtstemplate.html',
|
||||||
|
dialogHelp: '{{ url_for('help.static', filename='create_fts_template.html') }}',
|
||||||
canDrop: true,
|
canDrop: true,
|
||||||
canDropCascade: true,
|
canDropCascade: true,
|
||||||
label: '{{ _('FTS Template') }}',
|
label: '{{ _('FTS Template') }}',
|
||||||
|
|||||||
+1
@@ -104,6 +104,7 @@ function($, _, S, pgAdmin, pgBrowser, alertify) {
|
|||||||
type: 'function',
|
type: 'function',
|
||||||
sqlAlterHelp: 'sql-alterfunction.html',
|
sqlAlterHelp: 'sql-alterfunction.html',
|
||||||
sqlCreateHelp: 'sql-createfunction.html',
|
sqlCreateHelp: 'sql-createfunction.html',
|
||||||
|
dialogHelp: '{{ url_for('help.static', filename='create_function.html') }}',
|
||||||
label: '{{ _('Function') }}',
|
label: '{{ _('Function') }}',
|
||||||
collection_type: 'coll-function',
|
collection_type: 'coll-function',
|
||||||
hasSQL: true,
|
hasSQL: true,
|
||||||
|
|||||||
+1
@@ -24,6 +24,7 @@ function($, _, S, pgAdmin, pgBrowser, alertify, Function) {
|
|||||||
type: 'procedure',
|
type: 'procedure',
|
||||||
sqlAlterHelp: 'sql-alterprocedure.html',
|
sqlAlterHelp: 'sql-alterprocedure.html',
|
||||||
sqlCreateHelp: 'sql-createprocedure.html',
|
sqlCreateHelp: 'sql-createprocedure.html',
|
||||||
|
dialogHelp: '{{ url_for('help.static', filename='create_procedure.html') }}',
|
||||||
label: '{{ _('Procedure') }}',
|
label: '{{ _('Procedure') }}',
|
||||||
collection_type: 'coll-procedure',
|
collection_type: 'coll-procedure',
|
||||||
hasSQL: true,
|
hasSQL: true,
|
||||||
|
|||||||
+1
@@ -53,6 +53,7 @@ function($, _, S, pgAdmin, pgBrowser, alertify) {
|
|||||||
type: 'sequence',
|
type: 'sequence',
|
||||||
sqlAlterHelp: 'sql-altersequence.html',
|
sqlAlterHelp: 'sql-altersequence.html',
|
||||||
sqlCreateHelp: 'sql-createsequence.html',
|
sqlCreateHelp: 'sql-createsequence.html',
|
||||||
|
dialogHelp: '{{ url_for('help.static', filename='create_sequence.html') }}',
|
||||||
label: '{{ _('Sequence') }}',
|
label: '{{ _('Sequence') }}',
|
||||||
collection_type: 'coll-sequence',
|
collection_type: 'coll-sequence',
|
||||||
hasSQL: true,
|
hasSQL: true,
|
||||||
|
|||||||
+1
@@ -53,6 +53,7 @@ function($, _, S, pgAdmin, pgBrowser, Backform, alertify) {
|
|||||||
type: 'schema',
|
type: 'schema',
|
||||||
sqlAlterHelp: 'sql-alterschema.html',
|
sqlAlterHelp: 'sql-alterschema.html',
|
||||||
sqlCreateHelp: 'sql-createschema.html',
|
sqlCreateHelp: 'sql-createschema.html',
|
||||||
|
dialogHelp: '{{ url_for('help.static', filename='create_schema.html') }}',
|
||||||
label: '{{ _('Schema') }}',
|
label: '{{ _('Schema') }}',
|
||||||
hasSQL: true,
|
hasSQL: true,
|
||||||
canDrop: true,
|
canDrop: true,
|
||||||
|
|||||||
+1
@@ -50,6 +50,7 @@ function($, _, S, pgAdmin, pgBrowser, Alertify) {
|
|||||||
type: 'database',
|
type: 'database',
|
||||||
sqlAlterHelp: 'sql-alterdatabase.html',
|
sqlAlterHelp: 'sql-alterdatabase.html',
|
||||||
sqlCreateHelp: 'sql-createdatabase.html',
|
sqlCreateHelp: 'sql-createdatabase.html',
|
||||||
|
dialogHelp: '{{ url_for('help.static', filename='create_database.html') }}',
|
||||||
hasSQL: true,
|
hasSQL: true,
|
||||||
hasDepends: true,
|
hasDepends: true,
|
||||||
hasStatistics: true,
|
hasStatistics: true,
|
||||||
|
|||||||
+1
@@ -18,6 +18,7 @@ define(
|
|||||||
pgAdmin.Browser.Nodes['resource_group'] = pgAdmin.Browser.Node.extend({
|
pgAdmin.Browser.Nodes['resource_group'] = pgAdmin.Browser.Node.extend({
|
||||||
parent_type: 'server',
|
parent_type: 'server',
|
||||||
type: 'resource_group',
|
type: 'resource_group',
|
||||||
|
dialogHelp: '{{ url_for('help.static', filename='create_resource_group.html') }}',
|
||||||
label: '{{ _('Resource Group') }}',
|
label: '{{ _('Resource Group') }}',
|
||||||
hasSQL: true,
|
hasSQL: true,
|
||||||
canDrop: true,
|
canDrop: true,
|
||||||
|
|||||||
@@ -294,6 +294,7 @@ function($, _, S, pgAdmin, pgBrowser, alertify, Backform) {
|
|||||||
type: 'role',
|
type: 'role',
|
||||||
sqlAlterHelp: 'sql-alterrole.html',
|
sqlAlterHelp: 'sql-alterrole.html',
|
||||||
sqlCreateHelp: 'sql-createrole.html',
|
sqlCreateHelp: 'sql-createrole.html',
|
||||||
|
dialogHelp: '{{ url_for('help.static', filename='create_role.html') }}',
|
||||||
label: '{{ _('Login/Group Role') }}',
|
label: '{{ _('Login/Group Role') }}',
|
||||||
hasSQL: true,
|
hasSQL: true,
|
||||||
canDrop: true,
|
canDrop: true,
|
||||||
|
|||||||
+1
@@ -49,6 +49,7 @@ function($, _, S, pgAdmin, pgBrowser, alertify) {
|
|||||||
type: 'tablespace',
|
type: 'tablespace',
|
||||||
sqlAlterHelp: 'sql-altertablespace.html',
|
sqlAlterHelp: 'sql-altertablespace.html',
|
||||||
sqlCreateHelp: 'sql-createtablespace.html',
|
sqlCreateHelp: 'sql-createtablespace.html',
|
||||||
|
dialogHelp: '{{ url_for('help.static', filename='create_tablespace.html') }}',
|
||||||
label: '{{ _('Tablespace') }}',
|
label: '{{ _('Tablespace') }}',
|
||||||
hasSQL: true,
|
hasSQL: true,
|
||||||
canDrop: true,
|
canDrop: true,
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ function($, _, S, pgAdmin, pgBrowser, alertify) {
|
|||||||
pgAdmin.Browser.Nodes['server'] = pgAdmin.Browser.Node.extend({
|
pgAdmin.Browser.Nodes['server'] = pgAdmin.Browser.Node.extend({
|
||||||
parent_type: 'server-group',
|
parent_type: 'server-group',
|
||||||
type: 'server',
|
type: 'server',
|
||||||
|
dialogHelp: '{{ url_for('help.static', filename='create_server.html') }}',
|
||||||
label: '{{ _('Server') }}',
|
label: '{{ _('Server') }}',
|
||||||
canDrop: true,
|
canDrop: true,
|
||||||
hasStatistics: true,
|
hasStatistics: true,
|
||||||
|
|||||||
@@ -6,9 +6,10 @@ function($, _, pgAdmin, Backbone) {
|
|||||||
pgAdmin.Browser.Nodes['server-group'] = pgAdmin.Browser.Node.extend({
|
pgAdmin.Browser.Nodes['server-group'] = pgAdmin.Browser.Node.extend({
|
||||||
parent_type: null,
|
parent_type: null,
|
||||||
type: 'server-group',
|
type: 'server-group',
|
||||||
|
dialogHelp: '{{ url_for('help.static', filename='create_server_group.html') }}',
|
||||||
label: '{{ _('Server Group') }}',
|
label: '{{ _('Server Group') }}',
|
||||||
Init: function() {
|
Init: function() {
|
||||||
/* Avoid mulitple registration of menus */
|
/* Avoid multiple registration of menus */
|
||||||
if (this.initialized)
|
if (this.initialized)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|||||||
@@ -50,9 +50,10 @@ function($, _, S, pgAdmin, Menu, Backbone, Alertify, pgBrowser, Backform) {
|
|||||||
type: undefined,
|
type: undefined,
|
||||||
// Label
|
// Label
|
||||||
label: '',
|
label: '',
|
||||||
// SQL help pages
|
// Help pages
|
||||||
sqlAlterHelp: '',
|
sqlAlterHelp: '',
|
||||||
sqlCreateHelp: '',
|
sqlCreateHelp: '',
|
||||||
|
dialogHelp: '',
|
||||||
|
|
||||||
title: function(d) {
|
title: function(d) {
|
||||||
return o.label + (d ? (' - ' + d.label) : '');
|
return o.label + (d ? (' - ' + d.label) : '');
|
||||||
@@ -791,7 +792,7 @@ function($, _, S, pgAdmin, Menu, Backbone, Alertify, pgBrowser, Backform) {
|
|||||||
buttons.push({
|
buttons.push({
|
||||||
label: '', type: 'help',
|
label: '', type: 'help',
|
||||||
tooltip: '{{ _("SQL help for this object type.") }}',
|
tooltip: '{{ _("SQL help for this object type.") }}',
|
||||||
extraClasses: ['btn-default'],
|
extraClasses: ['btn-default', 'pull-right'],
|
||||||
icon: 'fa fa-lg fa-info',
|
icon: 'fa fa-lg fa-info',
|
||||||
disabled: (that.sqlAlterHelp == '' && that.sqlCreateHelp == '') ? true : false,
|
disabled: (that.sqlAlterHelp == '' && that.sqlCreateHelp == '') ? true : false,
|
||||||
register: function(btn) {
|
register: function(btn) {
|
||||||
@@ -850,6 +851,25 @@ function($, _, S, pgAdmin, Menu, Backbone, Alertify, pgBrowser, Backform) {
|
|||||||
pnlSqlHelp.focus();
|
pnlSqlHelp.focus();
|
||||||
iframe.openURL(url);
|
iframe.openURL(url);
|
||||||
}.bind(panel),
|
}.bind(panel),
|
||||||
|
|
||||||
|
onDialogHelp = function() {
|
||||||
|
var panel = this;
|
||||||
|
// See if we can find an existing panel, if not, create one
|
||||||
|
pnlDialogHelp = pgBrowser.docker.findPanels('pnl_online_help')[0];
|
||||||
|
|
||||||
|
if (pnlDialogHelp == null) {
|
||||||
|
pnlProperties = pgBrowser.docker.findPanels('properties')[0];
|
||||||
|
pgBrowser.docker.addPanel('pnl_online_help', wcDocker.DOCK.STACKED, pnlProperties);
|
||||||
|
pnlDialogHelp = pgBrowser.docker.findPanels('pnl_online_help')[0];
|
||||||
|
}
|
||||||
|
|
||||||
|
// Update the panel
|
||||||
|
iframe = $(pnlDialogHelp).data('embeddedFrame');
|
||||||
|
|
||||||
|
pnlDialogHelp.focus();
|
||||||
|
iframe.openURL(that.dialogHelp);
|
||||||
|
}.bind(panel),
|
||||||
|
|
||||||
editFunc = function() {
|
editFunc = function() {
|
||||||
var panel = this;
|
var panel = this;
|
||||||
if (action && action == 'properties') {
|
if (action && action == 'properties') {
|
||||||
@@ -916,14 +936,25 @@ function($, _, S, pgAdmin, Menu, Backbone, Alertify, pgBrowser, Backform) {
|
|||||||
createButtons([{
|
createButtons([{
|
||||||
label: '', type: 'help',
|
label: '', type: 'help',
|
||||||
tooltip: '{{ _("SQL help for this object type.") }}',
|
tooltip: '{{ _("SQL help for this object type.") }}',
|
||||||
extraClasses: ['btn-default'],
|
extraClasses: ['btn-default', 'pull-left'],
|
||||||
icon: 'fa fa-lg fa-info',
|
icon: 'fa fa-lg fa-info',
|
||||||
disabled: that.sqlCreateHelp == '' ? true : false,
|
disabled: (that.sqlAlterHelp == '' && that.sqlCreateHelp == '') ? true : false,
|
||||||
register: function(btn) {
|
register: function(btn) {
|
||||||
btn.click(function() {
|
btn.click(function() {
|
||||||
onSqlHelp();
|
onSqlHelp();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
},{
|
||||||
|
label: '', type: 'help',
|
||||||
|
tooltip: '{{ _("Help for this dialog.") }}',
|
||||||
|
extraClasses: ['btn-default', 'pull-left'],
|
||||||
|
icon: 'fa fa-lg fa-question',
|
||||||
|
disabled: (that.dialogHelp == '') ? true : false,
|
||||||
|
register: function(btn) {
|
||||||
|
btn.click(function() {
|
||||||
|
onDialogHelp();
|
||||||
|
});
|
||||||
|
}
|
||||||
},{
|
},{
|
||||||
label: '{{ _("Save") }}', type: 'save',
|
label: '{{ _("Save") }}', type: 'save',
|
||||||
tooltip: '{{ _("Save this object.") }}',
|
tooltip: '{{ _("Save this object.") }}',
|
||||||
|
|||||||
@@ -50,23 +50,26 @@ class HelpModule(PgAdminModule):
|
|||||||
Panel(
|
Panel(
|
||||||
name='pnl_online_help',
|
name='pnl_online_help',
|
||||||
priority=100,
|
priority=100,
|
||||||
|
isPrivate=True,
|
||||||
title=gettext('Online Help'),
|
title=gettext('Online Help'),
|
||||||
icon='fa fa-question',
|
icon='fa fa-question'),
|
||||||
content=url_for('help.static', filename='index.html')),
|
|
||||||
|
|
||||||
Panel(name='pnl_pgadmin_website',
|
Panel(
|
||||||
|
name='pnl_pgadmin_website',
|
||||||
priority=200,
|
priority=200,
|
||||||
title=gettext('pgAdmin Website'),
|
title=gettext('pgAdmin Website'),
|
||||||
icon='fa fa-external-link',
|
icon='fa fa-external-link',
|
||||||
content='http://www.pgadmin.org/'),
|
content='http://www.pgadmin.org/'),
|
||||||
|
|
||||||
Panel(name='pnl_postgresql_website',
|
Panel(
|
||||||
|
name='pnl_postgresql_website',
|
||||||
priority=300,
|
priority=300,
|
||||||
title=gettext('PostgreSQL Website'),
|
title=gettext('PostgreSQL Website'),
|
||||||
icon='fa fa-external-link',
|
icon='fa fa-external-link',
|
||||||
content='http://www.postgresql.org/'),
|
content='http://www.postgresql.org/'),
|
||||||
|
|
||||||
Panel(name='pnl_sql_help',
|
Panel(
|
||||||
|
name='pnl_sql_help',
|
||||||
priority=400,
|
priority=400,
|
||||||
isPrivate=True,
|
isPrivate=True,
|
||||||
icon='fa fa-info',
|
icon='fa fa-info',
|
||||||
|
|||||||
Reference in new issue
Block a user