mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-25 18:55:31 -06:00
Adding the module.js route for each in the NodeView class.
This commit is contained in:
@@ -78,14 +78,6 @@ class ServerGroupPluginModule(BrowserPluginModule):
|
||||
|
||||
blueprint = ServerGroupModule( __name__, static_url_path='')
|
||||
|
||||
@blueprint.route('/module.js')
|
||||
@login_required
|
||||
def module():
|
||||
return make_response(
|
||||
render_template("server_groups/server_groups.js"),
|
||||
200, {'Content-Type': 'application/x-javascript'})
|
||||
|
||||
|
||||
# Initialise the module
|
||||
from pgadmin.browser.utils import NodeView
|
||||
|
||||
@@ -234,5 +226,15 @@ class ServerGroupView(NodeView):
|
||||
def dependents(self, gid):
|
||||
return make_json_response(status=422)
|
||||
|
||||
def module_js(self, **kwargs):
|
||||
"""
|
||||
This property defines (if javascript) exists for this node.
|
||||
Override this property for your own logic.
|
||||
"""
|
||||
return make_response(
|
||||
render_template("server_groups/server_groups.js"),
|
||||
200, {'Content-Type': 'application/x-javascript'}
|
||||
)
|
||||
|
||||
|
||||
ServerGroupView.register_node_view(blueprint)
|
||||
|
||||
Reference in New Issue
Block a user