mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-25 18:55:31 -06:00
Webpack all the things! Fixes #2135
This significantly speeds up loading of the application; in an average of 3 tests, v1.6 loaded in 11.5s in the runtime on a Mac, whilst the webpacked version of the code loaded in 5.53s.
This commit is contained in:
committed by
Dave Page
parent
d04ac7656a
commit
4a91bcde30
@@ -47,6 +47,8 @@ class AboutModule(PgAdminModule):
|
||||
'when': None
|
||||
}]
|
||||
|
||||
def get_exposed_url_endpoints(self):
|
||||
return ['about.index']
|
||||
|
||||
blueprint = AboutModule(MODULE_NAME, __name__,
|
||||
static_url_path='')
|
||||
@@ -55,7 +57,7 @@ blueprint = AboutModule(MODULE_NAME, __name__,
|
||||
##########################################################################
|
||||
# A test page
|
||||
##########################################################################
|
||||
@blueprint.route("/")
|
||||
@blueprint.route("/", endpoint='index')
|
||||
@login_required
|
||||
def index():
|
||||
"""Render the about box."""
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
define(
|
||||
['jquery', 'alertify', 'pgadmin', 'sources/gettext'],
|
||||
function($, alertify, pgAdmin, gettext) {
|
||||
['jquery', 'alertify', 'pgadmin', 'underscore.string', 'sources/gettext',
|
||||
'sources/url_for'
|
||||
],
|
||||
function($, alertify, pgAdmin, S, gettext, url_for) {
|
||||
pgAdmin = pgAdmin || window.pgAdmin || {};
|
||||
|
||||
/* Return back, this has been called more than once */
|
||||
@@ -39,9 +41,11 @@ define(
|
||||
}
|
||||
|
||||
var content = '';
|
||||
$.get("{{ url_for('about.index') }}",
|
||||
$.get(url_for('about.index'),
|
||||
function(data) {
|
||||
alertify.aboutDialog(gettext("About %(appname)s", {appname: "{{ config.APP_NAME }}"}), data).resizeTo(800, 450);
|
||||
alertify.aboutDialog(
|
||||
S(gettext("About %s")).sprintf(pgAdmin.Browser.utils.app_name).value(), data
|
||||
).resizeTo(800, 450);
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user