mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-25 18:55:31 -06:00
Miscellaneous fixes and cleanups.
This commit is contained in:
@@ -9,9 +9,8 @@
|
||||
|
||||
"""Browser integration functions for settings."""
|
||||
|
||||
from flask import render_template
|
||||
from flask import url_for
|
||||
|
||||
def get_javascript_code():
|
||||
"""Render from the template and return any Javascript code snippets required
|
||||
in the browser"""
|
||||
return render_template("settings/browser.js")
|
||||
def get_scripts():
|
||||
"""Return a list of script URLs to include in the rendered page header"""
|
||||
return [ url_for('settings.script') ]
|
||||
@@ -11,7 +11,7 @@
|
||||
MODULE_NAME = 'settings'
|
||||
|
||||
import config
|
||||
from flask import Blueprint, Response, abort, request
|
||||
from flask import Blueprint, Response, abort, request, render_template
|
||||
from flask.ext.security import login_required
|
||||
|
||||
from . import get_setting, store_setting
|
||||
@@ -19,6 +19,14 @@ from . import get_setting, store_setting
|
||||
# Initialise the module
|
||||
blueprint = Blueprint(MODULE_NAME, __name__, template_folder='templates', url_prefix='/' + MODULE_NAME)
|
||||
|
||||
@blueprint.route("/settings.js")
|
||||
@login_required
|
||||
def script():
|
||||
"""Render the required Javascript"""
|
||||
return Response(response=render_template("settings/settings.js"),
|
||||
status=200,
|
||||
mimetype="application/javascript")
|
||||
|
||||
@blueprint.route("/store", methods=['POST'])
|
||||
@blueprint.route("/store/<setting>/<value>", methods=['GET'])
|
||||
@login_required
|
||||
|
||||
Reference in New Issue
Block a user