mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-25 18:55:31 -06:00
submodules inherited from the PgAdminModule instead of regular Blueprint. This allows us to load the module automatically from the under the pgadmin directory, and will work to extend the pgAdmin extension module. PgAdminModule is inherited from the Blueprint, and bring several methods: - get_own_stylesheets, which returns the stylesheets used by the module (excluding its submodules stylesheets) - get_own_javascripts - menu_items, which returns a dictionray mapping the old hook names (context_items etc) to a list of MenuItem instances For more specialized modules (as for now, any module that should be part of the browser tree construction), one can define an abstract base class defining additional methods. For example, the BrowserPluginModule abstract base class defines the following methods: - jssnippets - csssnipeets - node_type - get_nodes
26 lines
878 B
Python
26 lines
878 B
Python
##########################################################################
|
|
#
|
|
# pgAdmin 4 - PostgreSQL Tools
|
|
#
|
|
# Copyright (C) 2013 - 2015, The pgAdmin Development Team
|
|
# This software is released under the PostgreSQL Licence
|
|
#
|
|
##########################################################################
|
|
|
|
"""A blueprint module providing utility functions for the application."""
|
|
MODULE_NAME = 'misc'
|
|
|
|
from pgadmin.utils import PgAdminModule
|
|
|
|
# Initialise the module
|
|
blueprint = PgAdminModule(MODULE_NAME, __name__,
|
|
url_prefix='')
|
|
|
|
##########################################################################
|
|
# A special URL used to "ping" the server
|
|
##########################################################################
|
|
@blueprint.route("/ping")
|
|
def ping():
|
|
"""Generate a "PING" response to indicate that the server is alive."""
|
|
return "PING"
|