mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-25 18:55:31 -06:00
Optimize Webpack to improve overall performance.
Changes include: 1) Remove underscore-string and sprintf-js packages as we were using only %s. Instead, added a function to do the same. Also changed gettext to behave like sprintf directly. 2) backgrid.sizeable.columns was not used anywhere, removed. @babel/polyfill is deprecated, replaced it with core-js. 3) Moved few css to make sure they get minified and bundled. 4) Added Flask-Compress to send static files as compressed gzip. This will reduce network traffic and improve initial load time for pgAdmin. 5) Split few JS files to make code reusable. 6) Lazy load few modules like leaflet, wkx is required only if geometry viewer is opened. snapsvg loaded only when explain plan is executed. This will improve sqleditor initial opening time. Reviewed By: Khushboo Vashi Fixes #4701
This commit is contained in:
committed by
Akshay Joshi
parent
e5638b520d
commit
f16498a8a7
@@ -9,9 +9,9 @@
|
||||
|
||||
define('pgadmin.node.cast', [
|
||||
'sources/gettext', 'sources/url_for', 'jquery', 'underscore',
|
||||
'underscore.string', 'sources/pgadmin', 'pgadmin.browser',
|
||||
'sources/pgadmin', 'pgadmin.browser',
|
||||
'pgadmin.alertifyjs', 'pgadmin.backform', 'pgadmin.browser.collection',
|
||||
], function(gettext, url_for, $, _, S, pgAdmin, pgBrowser, alertify, Backform) {
|
||||
], function(gettext, url_for, $, _, pgAdmin, pgBrowser, alertify, Backform) {
|
||||
// Extend the collection class for cast
|
||||
if (!pgBrowser.Nodes['coll-cast']) {
|
||||
pgAdmin.Browser.Nodes['coll-cast'] =
|
||||
|
||||
@@ -9,9 +9,9 @@
|
||||
|
||||
define('pgadmin.node.event_trigger', [
|
||||
'sources/gettext', 'sources/url_for', 'jquery', 'underscore',
|
||||
'underscore.string', 'sources/pgadmin', 'pgadmin.browser',
|
||||
'sources/pgadmin', 'pgadmin.browser',
|
||||
'pgadmin.backform', 'pgadmin.browser.collection',
|
||||
], function(gettext, url_for, $, _, S, pgAdmin, pgBrowser, Backform) {
|
||||
], function(gettext, url_for, $, _, pgAdmin, pgBrowser, Backform) {
|
||||
|
||||
// Extend the browser's collection class for event trigger collection
|
||||
if (!pgBrowser.Nodes['coll-event_trigger']) {
|
||||
|
||||
@@ -9,9 +9,9 @@
|
||||
|
||||
define('pgadmin.node.extension', [
|
||||
'sources/gettext', 'sources/url_for', 'jquery', 'underscore',
|
||||
'underscore.string', 'sources/pgadmin', 'pgadmin.browser',
|
||||
'sources/pgadmin', 'pgadmin.browser',
|
||||
'pgadmin.backform', 'pgadmin.browser.collection',
|
||||
], function(gettext, url_for, $, _, S, pgAdmin, pgBrowser, Backform) {
|
||||
], function(gettext, url_for, $, _, pgAdmin, pgBrowser, Backform) {
|
||||
|
||||
/*
|
||||
* Create and Add an Extension Collection into nodes
|
||||
|
||||
@@ -8,10 +8,10 @@
|
||||
//////////////////////////////////////////////////////////////
|
||||
|
||||
define('pgadmin.node.foreign_server', [
|
||||
'sources/gettext', 'jquery', 'underscore', 'underscore.string', 'sources/pgadmin',
|
||||
'sources/gettext', 'jquery', 'underscore', 'sources/pgadmin',
|
||||
'pgadmin.browser', 'pgadmin.backform', 'pgadmin.browser.collection',
|
||||
'pgadmin.browser.server.privilege',
|
||||
], function(gettext, $, _, S, pgAdmin, pgBrowser, Backform) {
|
||||
], function(gettext, $, _, pgAdmin, pgBrowser, Backform) {
|
||||
|
||||
// Extend the browser's node model class to create a Options model
|
||||
var OptionsModel = pgAdmin.Browser.Node.Model.extend({
|
||||
|
||||
@@ -9,9 +9,9 @@
|
||||
|
||||
define('pgadmin.node.user_mapping', [
|
||||
'sources/gettext', 'sources/url_for', 'jquery', 'underscore',
|
||||
'underscore.string', 'sources/pgadmin', 'pgadmin.browser',
|
||||
'sources/pgadmin', 'pgadmin.browser',
|
||||
'pgadmin.backform', 'pgadmin.browser.collection',
|
||||
], function(gettext, url_for, $, _, S, pgAdmin, pgBrowser, Backform) {
|
||||
], function(gettext, url_for, $, _, pgAdmin, pgBrowser, Backform) {
|
||||
|
||||
// Extend the browser's node model class to create a Options model
|
||||
var OptionsModel = pgAdmin.Browser.Node.Model.extend({
|
||||
|
||||
@@ -9,9 +9,9 @@
|
||||
|
||||
define('pgadmin.node.foreign_data_wrapper', [
|
||||
'sources/gettext', 'sources/url_for', 'jquery', 'underscore',
|
||||
'underscore.string', 'sources/pgadmin', 'pgadmin.browser', 'pgadmin.backform',
|
||||
'sources/pgadmin', 'pgadmin.browser', 'pgadmin.backform',
|
||||
'pgadmin.browser.collection', 'pgadmin.browser.server.privilege',
|
||||
], function(gettext, url_for, $, _, S, pgAdmin, pgBrowser, Backform) {
|
||||
], function(gettext, url_for, $, _, pgAdmin, pgBrowser, Backform) {
|
||||
|
||||
// Extend the browser's node model class to create a Options model
|
||||
var OptionsModel = pgBrowser.Node.Model.extend({
|
||||
|
||||
@@ -9,9 +9,9 @@
|
||||
|
||||
define('pgadmin.node.language', [
|
||||
'sources/gettext', 'sources/url_for', 'jquery', 'underscore',
|
||||
'underscore.string', 'sources/pgadmin', 'pgadmin.browser', 'pgadmin.backform',
|
||||
'sources/pgadmin', 'pgadmin.browser', 'pgadmin.backform',
|
||||
'pgadmin.browser.collection', 'pgadmin.browser.server.privilege',
|
||||
], function(gettext, url_for, $, _, S, pgAdmin, pgBrowser, Backform) {
|
||||
], function(gettext, url_for, $, _, pgAdmin, pgBrowser, Backform) {
|
||||
|
||||
// Extend the browser's collection class for languages collection
|
||||
if (!pgBrowser.Nodes['coll-language']) {
|
||||
|
||||
@@ -8,9 +8,9 @@
|
||||
//////////////////////////////////////////////////////////////
|
||||
|
||||
define('pgadmin.node.catalog_object_column', [
|
||||
'sources/gettext', 'jquery', 'underscore', 'underscore.string', 'sources/pgadmin',
|
||||
'sources/gettext', 'jquery', 'underscore', 'sources/pgadmin',
|
||||
'pgadmin.browser', 'pgadmin.browser.collection',
|
||||
], function(gettext, $, _, S, pgAdmin, pgBrowser) {
|
||||
], function(gettext, $, _, pgAdmin, pgBrowser) {
|
||||
|
||||
if (!pgBrowser.Nodes['coll-catalog_object_column']) {
|
||||
pgAdmin.Browser.Nodes['coll-catalog_object_column'] =
|
||||
|
||||
@@ -8,9 +8,9 @@
|
||||
//////////////////////////////////////////////////////////////
|
||||
|
||||
define('pgadmin.node.catalog_object', [
|
||||
'sources/gettext', 'jquery', 'underscore', 'underscore.string', 'sources/pgadmin',
|
||||
'sources/gettext', 'jquery', 'underscore', 'sources/pgadmin',
|
||||
'pgadmin.browser', 'pgadmin.browser.collection',
|
||||
], function(gettext, $, _, S, pgAdmin, pgBrowser) {
|
||||
], function(gettext, $, _, pgAdmin, pgBrowser) {
|
||||
|
||||
if (!pgBrowser.Nodes['coll-catalog_object']) {
|
||||
pgAdmin.Browser.Nodes['coll-catalog_object'] =
|
||||
|
||||
@@ -9,10 +9,10 @@
|
||||
|
||||
define('pgadmin.node.collation', [
|
||||
'sources/gettext', 'sources/url_for', 'jquery', 'underscore',
|
||||
'underscore.string', 'sources/pgadmin', 'pgadmin.browser',
|
||||
'sources/pgadmin', 'pgadmin.browser',
|
||||
'pgadmin.node.schema.dir/child', 'pgadmin.node.schema.dir/schema_child_tree_node',
|
||||
'pgadmin.browser.collection',
|
||||
], function(gettext, url_for, $, _, S, pgAdmin, pgBrowser, schemaChild,
|
||||
], function(gettext, url_for, $, _, pgAdmin, pgBrowser, schemaChild,
|
||||
schemaChildTreeNode) {
|
||||
|
||||
if (!pgBrowser.Nodes['coll-collation']) {
|
||||
|
||||
@@ -10,9 +10,9 @@
|
||||
// Domain Constraint Module: Collection and Node
|
||||
define('pgadmin.node.domain_constraints', [
|
||||
'sources/gettext', 'sources/url_for', 'jquery', 'underscore',
|
||||
'underscore.string', 'sources/pgadmin', 'pgadmin.browser',
|
||||
'sources/pgadmin', 'pgadmin.browser',
|
||||
'pgadmin.node.schema.dir/schema_child_tree_node', 'pgadmin.browser.collection',
|
||||
], function(gettext, url_for, $, _, S, pgAdmin, pgBrowser, schemaChildTreeNode) {
|
||||
], function(gettext, url_for, $, _, pgAdmin, pgBrowser, schemaChildTreeNode) {
|
||||
|
||||
// Define Domain Constraint Collection Node
|
||||
if (!pgBrowser.Nodes['coll-domain_constraints']) {
|
||||
|
||||
@@ -9,11 +9,11 @@
|
||||
|
||||
define('pgadmin.node.fts_dictionary', [
|
||||
'sources/gettext', 'sources/url_for', 'jquery', 'underscore',
|
||||
'underscore.string', 'sources/pgadmin', 'pgadmin.browser', 'pgadmin.backform',
|
||||
'sources/pgadmin', 'pgadmin.browser', 'pgadmin.backform',
|
||||
'pgadmin.node.schema.dir/child', 'pgadmin.node.schema.dir/schema_child_tree_node',
|
||||
'pgadmin.browser.collection',
|
||||
], function(
|
||||
gettext, url_for, $, _, S, pgAdmin, pgBrowser, Backform, schemaChild,
|
||||
gettext, url_for, $, _, pgAdmin, pgBrowser, Backform, schemaChild,
|
||||
schemaChildTreeNode
|
||||
) {
|
||||
|
||||
|
||||
@@ -10,11 +10,11 @@
|
||||
/* Create and Register Procedure Collection and Node. */
|
||||
define('pgadmin.node.procedure', [
|
||||
'sources/gettext', 'sources/url_for', 'jquery', 'underscore',
|
||||
'underscore.string', 'sources/pgadmin', 'pgadmin.browser', 'alertify',
|
||||
'sources/pgadmin', 'pgadmin.browser', 'alertify',
|
||||
'pgadmin.node.function', 'pgadmin.node.schema.dir/child',
|
||||
'pgadmin.node.schema.dir/schema_child_tree_node',
|
||||
'pgadmin.browser.collection', 'pgadmin.browser.server.privilege',
|
||||
], function(gettext, url_for, $, _, S, pgAdmin, pgBrowser, alertify, Function,
|
||||
], function(gettext, url_for, $, _, pgAdmin, pgBrowser, alertify, Function,
|
||||
schemaChild, schemaChildTreeNode) {
|
||||
|
||||
if (!pgBrowser.Nodes['coll-procedure']) {
|
||||
|
||||
@@ -9,11 +9,11 @@
|
||||
|
||||
define('pgadmin.node.sequence', [
|
||||
'sources/gettext', 'sources/url_for', 'jquery', 'underscore',
|
||||
'underscore.string', 'sources/pgadmin', 'pgadmin.browser', 'pgadmin.backform',
|
||||
'sources/pgadmin', 'pgadmin.browser', 'pgadmin.backform',
|
||||
'pgadmin.node.schema.dir/child', 'pgadmin.node.schema.dir/schema_child_tree_node',
|
||||
'pgadmin.browser.collection',
|
||||
], function(
|
||||
gettext, url_for, $, _, S, pgAdmin, pgBrowser, Backform, schemaChild,
|
||||
gettext, url_for, $, _, pgAdmin, pgBrowser, Backform, schemaChild,
|
||||
schemaChildTreeNode
|
||||
) {
|
||||
|
||||
|
||||
@@ -9,10 +9,10 @@
|
||||
|
||||
define('pgadmin.node.synonym', [
|
||||
'sources/gettext', 'sources/url_for', 'jquery', 'underscore',
|
||||
'underscore.string', 'sources/pgadmin', 'pgadmin.browser', 'pgadmin.alertifyjs',
|
||||
'sources/pgadmin', 'pgadmin.browser', 'pgadmin.alertifyjs',
|
||||
'pgadmin.node.schema.dir/child', 'pgadmin.node.schema.dir/schema_child_tree_node',
|
||||
'pgadmin.browser.collection',
|
||||
], function(gettext, url_for, $, _, S, pgAdmin, pgBrowser, alertify,
|
||||
], function(gettext, url_for, $, _, pgAdmin, pgBrowser, alertify,
|
||||
schemaChild, schemaChildTreeNode) {
|
||||
|
||||
if (!pgBrowser.Nodes['coll-synonym']) {
|
||||
|
||||
@@ -9,12 +9,12 @@
|
||||
|
||||
define('pgadmin.node.compound_trigger', [
|
||||
'sources/gettext', 'sources/url_for', 'jquery', 'underscore',
|
||||
'underscore.string', 'sources/pgadmin', 'pgadmin.browser',
|
||||
'sources/pgadmin', 'pgadmin.browser',
|
||||
'pgadmin.backform', 'pgadmin.alertifyjs',
|
||||
'pgadmin.node.schema.dir/schema_child_tree_node',
|
||||
'pgadmin.browser.collection',
|
||||
], function(
|
||||
gettext, url_for, $, _, S, pgAdmin, pgBrowser, Backform, alertify,
|
||||
gettext, url_for, $, _, pgAdmin, pgBrowser, Backform, alertify,
|
||||
SchemaChildTreeNode
|
||||
) {
|
||||
|
||||
|
||||
@@ -10,9 +10,9 @@
|
||||
// Check Constraint Module: Node
|
||||
define('pgadmin.node.check_constraint', [
|
||||
'sources/gettext', 'sources/url_for', 'jquery', 'underscore',
|
||||
'underscore.string', 'sources/pgadmin', 'pgadmin.browser', 'pgadmin.alertifyjs',
|
||||
'sources/pgadmin', 'pgadmin.browser', 'pgadmin.alertifyjs',
|
||||
'pgadmin.node.schema.dir/schema_child_tree_node', 'pgadmin.browser.collection',
|
||||
], function(gettext, url_for, $, _, S, pgAdmin, pgBrowser, alertify, schemaChildTreeNode) {
|
||||
], function(gettext, url_for, $, _, pgAdmin, pgBrowser, alertify, schemaChildTreeNode) {
|
||||
|
||||
// Check Constraint Node
|
||||
if (!pgBrowser.Nodes['check_constraint']) {
|
||||
|
||||
@@ -640,7 +640,7 @@ define('pgadmin.node.primary_key', [
|
||||
|
||||
if ((_.isUndefined(index) || String(index).replace(/^\s+|\s+$/g, '') == '') &&
|
||||
(_.isUndefined(columns) || _.isNull(columns) || columns.length < 1)) {
|
||||
var msg = gettext('Please specify columns for %(node)s', {node: gettext('Primary key')});
|
||||
var msg = gettext('Please specify columns for %s', gettext('Primary key'));
|
||||
this.errorModel.set('columns', msg);
|
||||
return msg;
|
||||
}
|
||||
|
||||
@@ -629,7 +629,7 @@ define('pgadmin.node.unique_constraint', [
|
||||
|
||||
if ((_.isUndefined(index) || String(index).replace(/^\s+|\s+$/g, '') == '') &&
|
||||
(_.isUndefined(columns) || _.isNull(columns) || columns.length < 1)) {
|
||||
var msg = gettext('Please specify columns for %(node)s', {node: gettext('Unique constraint')});
|
||||
var msg = gettext('Please specify columns for %s', gettext('Unique constraint'));
|
||||
this.errorModel.set('columns', msg);
|
||||
return msg;
|
||||
}
|
||||
|
||||
@@ -9,14 +9,14 @@
|
||||
|
||||
define([
|
||||
'sources/gettext', 'sources/url_for', 'jquery', 'underscore',
|
||||
'underscore.string', 'sources/pgadmin', 'pgadmin.browser',
|
||||
'sources/pgadmin', 'pgadmin.browser',
|
||||
'pgadmin.alertifyjs', 'pgadmin.backform', 'pgadmin.backgrid',
|
||||
'pgadmin.node.schema.dir/schema_child_tree_node',
|
||||
'pgadmin.node.schema.dir/schema_child_tree_node', 'sources/utils',
|
||||
'pgadmin.browser.collection', 'pgadmin.browser.table.partition.utils',
|
||||
],
|
||||
function(
|
||||
gettext, url_for, $, _, S, pgAdmin, pgBrowser, Alertify, Backform, Backgrid,
|
||||
SchemaChildTreeNode
|
||||
gettext, url_for, $, _, pgAdmin, pgBrowser, Alertify, Backform, Backgrid,
|
||||
SchemaChildTreeNode, pgadminUtils
|
||||
) {
|
||||
|
||||
if (!pgBrowser.Nodes['coll-partition']) {
|
||||
@@ -107,13 +107,13 @@ function(
|
||||
info = (_.isUndefined(item) || _.isNull(item)) ?
|
||||
info || {} : this.getTreeNodeHierarchy(item);
|
||||
|
||||
return S('table/%s/%s/%s/%s/%s/%s').sprintf(
|
||||
return pgadminUtils.sprintf('table/%s/%s/%s/%s/%s/%s',
|
||||
encodeURIComponent(type), encodeURIComponent(info['server_group']._id),
|
||||
encodeURIComponent(info['server']._id),
|
||||
encodeURIComponent(info['database']._id),
|
||||
encodeURIComponent(info['partition'].schema_id),
|
||||
encodeURIComponent(info['partition']._id)
|
||||
).value();
|
||||
);
|
||||
},
|
||||
canDrop: SchemaChildTreeNode.isTreeItemOfChildOfSchema,
|
||||
canDropCascade: SchemaChildTreeNode.isTreeItemOfChildOfSchema,
|
||||
@@ -184,7 +184,7 @@ function(
|
||||
|
||||
Alertify.confirm(
|
||||
gettext('Truncate Table'),
|
||||
S(gettext('Are you sure you want to truncate table %s?')).sprintf(d.label).value(),
|
||||
gettext('Are you sure you want to truncate table %s?', d.label),
|
||||
function (e) {
|
||||
if (e) {
|
||||
var data = d;
|
||||
@@ -229,7 +229,7 @@ function(
|
||||
|
||||
Alertify.confirm(
|
||||
gettext('Reset statistics'),
|
||||
S(gettext('Are you sure you want to reset the statistics for table "%s"?')).sprintf(d._label).value(),
|
||||
gettext('Are you sure you want to reset the statistics for table "%s"?', d._label),
|
||||
function (e) {
|
||||
if (e) {
|
||||
var data = d;
|
||||
@@ -273,7 +273,7 @@ function(
|
||||
|
||||
Alertify.confirm(
|
||||
gettext('Detach Partition'),
|
||||
S(gettext('Are you sure you want to detach the partition %s?')).sprintf(d._label).value(),
|
||||
gettext('Are you sure you want to detach the partition %s?', d._label),
|
||||
function (e) {
|
||||
if (e) {
|
||||
$.ajax({
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
define('pgadmin.node.table', [
|
||||
'pgadmin.tables.js/enable_disable_triggers',
|
||||
'sources/gettext', 'sources/url_for', 'jquery', 'underscore',
|
||||
'underscore.string', 'sources/pgadmin', 'pgadmin.browser',
|
||||
'sources/pgadmin', 'pgadmin.browser',
|
||||
'pgadmin.alertifyjs', 'pgadmin.backform', 'pgadmin.backgrid',
|
||||
'pgadmin.tables.js/show_advanced_tab',
|
||||
'pgadmin.node.schema.dir/child','pgadmin.node.schema.dir/schema_child_tree_node',
|
||||
@@ -18,7 +18,7 @@ define('pgadmin.node.table', [
|
||||
'pgadmin.node.constraints', 'pgadmin.browser.table.partition.utils',
|
||||
], function(
|
||||
tableFunctions,
|
||||
gettext, url_for, $, _, S, pgAdmin, pgBrowser, Alertify, Backform, Backgrid,
|
||||
gettext, url_for, $, _, pgAdmin, pgBrowser, Alertify, Backform, Backgrid,
|
||||
ShowAdvancedTab, SchemaChild, SchemaChildTreeNode
|
||||
) {
|
||||
|
||||
@@ -165,7 +165,7 @@ define('pgadmin.node.table', [
|
||||
|
||||
Alertify.confirm(
|
||||
gettext('Truncate Table'),
|
||||
S(gettext('Are you sure you want to truncate table %s?')).sprintf(d.label).value(),
|
||||
gettext('Are you sure you want to truncate table %s?', d.label),
|
||||
function (e) {
|
||||
if (e) {
|
||||
var data = d;
|
||||
@@ -210,7 +210,7 @@ define('pgadmin.node.table', [
|
||||
|
||||
Alertify.confirm(
|
||||
gettext('Reset statistics'),
|
||||
S(gettext('Are you sure you want to reset the statistics for table "%s"?')).sprintf(d._label).value(),
|
||||
gettext('Are you sure you want to reset the statistics for table "%s"?', d._label),
|
||||
function (e) {
|
||||
if (e) {
|
||||
var data = d;
|
||||
|
||||
@@ -9,12 +9,12 @@
|
||||
|
||||
define('pgadmin.node.trigger', [
|
||||
'sources/gettext', 'sources/url_for', 'jquery', 'underscore',
|
||||
'underscore.string', 'sources/pgadmin', 'pgadmin.browser',
|
||||
'sources/pgadmin', 'pgadmin.browser',
|
||||
'pgadmin.backform', 'pgadmin.alertifyjs',
|
||||
'pgadmin.node.schema.dir/schema_child_tree_node',
|
||||
'pgadmin.browser.collection',
|
||||
], function(
|
||||
gettext, url_for, $, _, S, pgAdmin, pgBrowser, Backform, alertify,
|
||||
gettext, url_for, $, _, pgAdmin, pgBrowser, Backform, alertify,
|
||||
SchemaChildTreeNode
|
||||
) {
|
||||
|
||||
|
||||
@@ -218,9 +218,9 @@ define('pgadmin.node.type', [
|
||||
else if (this.get('is_tlength')
|
||||
&& !_.isUndefined(this.get('tlength'))) {
|
||||
if (this.get('tlength') < this.get('min_val'))
|
||||
errmsg = gettext('Length/precision should not be less than %(value)s', {value: this.get('min_val')});
|
||||
errmsg = gettext('Length/precision should not be less than %s', this.get('min_val'));
|
||||
if (this.get('tlength') > this.get('max_val') )
|
||||
errmsg = gettext('Length/precision should not be greater than %(value)s', {value: this.get('max_val')});
|
||||
errmsg = gettext('Length/precision should not be greater than %s', this.get('max_val'));
|
||||
// If we have any error set then throw it to user
|
||||
if(errmsg) {
|
||||
this.errorModel.set('tlength', errmsg);
|
||||
@@ -231,9 +231,9 @@ define('pgadmin.node.type', [
|
||||
else if (this.get('is_precision')
|
||||
&& !_.isUndefined(this.get('precision'))) {
|
||||
if (this.get('precision') < this.get('min_val'))
|
||||
errmsg = gettext('Scale should not be less than %(value)s', {value: this.get('min_val')});
|
||||
errmsg = gettext('Scale should not be less than %s', this.get('min_val'));
|
||||
if (this.get('precision') > this.get('max_val'))
|
||||
errmsg = gettext('Scale should not be greater than %(value)s', {value: this.get('max_val')});
|
||||
errmsg = gettext('Scale should not be greater than %s', this.get('max_val'));
|
||||
// If we have any error set then throw it to user
|
||||
if(errmsg) {
|
||||
this.errorModel.set('precision', errmsg);
|
||||
|
||||
@@ -9,10 +9,10 @@
|
||||
|
||||
define('pgadmin.node.database', [
|
||||
'sources/gettext', 'sources/url_for', 'jquery', 'underscore',
|
||||
'underscore.string', 'sources/pgadmin', 'pgadmin.browser.utils',
|
||||
'sources/utils', 'sources/pgadmin', 'pgadmin.browser.utils',
|
||||
'pgadmin.alertifyjs', 'pgadmin.backform', 'pgadmin.browser.collection',
|
||||
'pgadmin.browser.server.privilege', 'pgadmin.browser.server.variable',
|
||||
], function(gettext, url_for, $, _, S, pgAdmin, pgBrowser, Alertify, Backform) {
|
||||
], function(gettext, url_for, $, _, pgadminUtils, pgAdmin, pgBrowser, Alertify, Backform) {
|
||||
|
||||
if (!pgBrowser.Nodes['coll-database']) {
|
||||
pgBrowser.Nodes['coll-database'] =
|
||||
@@ -190,7 +190,7 @@ define('pgadmin.node.database', [
|
||||
|
||||
Alertify.confirm(
|
||||
gettext('Disconnect the database'),
|
||||
S(gettext('Are you sure you want to disconnect the database - %s?')).sprintf(d.label).value(),
|
||||
pgadminUtils.sprintf(gettext('Are you sure you want to disconnect the database - %s?'), d.label),
|
||||
function() {
|
||||
var data = d;
|
||||
$.ajax({
|
||||
|
||||
@@ -9,10 +9,10 @@
|
||||
|
||||
define('pgadmin.node.pga_schedule', [
|
||||
'sources/gettext', 'sources/url_for', 'jquery', 'underscore',
|
||||
'underscore.string', 'sources/pgadmin', 'moment', 'pgadmin.browser', 'alertify',
|
||||
'sources/pgadmin', 'moment', 'pgadmin.browser', 'alertify',
|
||||
'pgadmin.backform', 'pgadmin.backgrid',
|
||||
], function(
|
||||
gettext, url_for, $, _, S, pgAdmin, moment, pgBrowser, Alertify, Backform,
|
||||
gettext, url_for, $, _, pgAdmin, moment, pgBrowser, Alertify, Backform,
|
||||
Backgrid
|
||||
) {
|
||||
|
||||
|
||||
@@ -9,9 +9,9 @@
|
||||
|
||||
define('pgadmin.node.pga_job', [
|
||||
'sources/gettext', 'sources/url_for', 'jquery', 'underscore',
|
||||
'underscore.string', 'sources/pgadmin', 'pgadmin.browser', 'pgadmin.alertifyjs',
|
||||
'sources/pgadmin', 'pgadmin.browser', 'pgadmin.alertifyjs',
|
||||
'pgadmin.node.pga_jobstep', 'pgadmin.node.pga_schedule',
|
||||
], function(gettext, url_for, $, _, S, pgAdmin, pgBrowser, alertify) {
|
||||
], function(gettext, url_for, $, _, pgAdmin, pgBrowser, alertify) {
|
||||
|
||||
if (!pgBrowser.Nodes['coll-pga_job']) {
|
||||
pgBrowser.Nodes['coll-pga_job'] =
|
||||
|
||||
@@ -9,9 +9,9 @@
|
||||
|
||||
define('pgadmin.node.pga_jobstep', [
|
||||
'sources/gettext', 'sources/url_for', 'jquery', 'underscore',
|
||||
'underscore.string', 'sources/pgadmin', 'pgadmin.browser', 'alertify', 'backform',
|
||||
'sources/pgadmin', 'pgadmin.browser', 'alertify', 'backform',
|
||||
'backgrid', 'pgadmin.backform', 'pgadmin.backgrid',
|
||||
], function(gettext, url_for, $, _, S, pgAdmin, pgBrowser, Alertify, Backform, Backgrid) {
|
||||
], function(gettext, url_for, $, _, pgAdmin, pgBrowser, Alertify, Backform, Backgrid) {
|
||||
|
||||
if (!pgBrowser.Nodes['coll-pga_jobstep']) {
|
||||
pgBrowser.Nodes['coll-pga_jobstep'] =
|
||||
@@ -190,11 +190,9 @@ define('pgadmin.node.pga_jobstep', [
|
||||
id: 'jstconnstr', label: gettext('Connection string'), type: 'text',
|
||||
deps: ['jstkind', 'jstconntype'], disabled: function(m) {
|
||||
return !m.get('jstkind') || m.get('jstconntype');
|
||||
}, helpMessage: S(
|
||||
gettext('Please specify the connection string for the remote database server. Each parameter setting is in the form keyword = value. Spaces around the equal sign are optional. To write an empty value, or a value containing spaces, surround it with single quotes, e.g., keyword = \'a value\'. Single quotes and backslashes within the value must be escaped with a backslash, i.e., \' and \\.<br>For more information, please see the documentation on %s')
|
||||
).sprintf(
|
||||
}, helpMessage: gettext('Please specify the connection string for the remote database server. Each parameter setting is in the form keyword = value. Spaces around the equal sign are optional. To write an empty value, or a value containing spaces, surround it with single quotes, e.g., keyword = \'a value\'. Single quotes and backslashes within the value must be escaped with a backslash, i.e., \' and \\.<br>For more information, please see the documentation on %s',
|
||||
'<a href="https://www.postgresql.org/docs/current/libpq-connect.html#LIBPQ-CONNSTRING" target="_blank">libpq connection strings</a>'
|
||||
).value(), mode: ['create', 'edit'],
|
||||
), mode: ['create', 'edit'],
|
||||
},{
|
||||
id: 'jstonerror', label: gettext('On error'), cell: 'select2',
|
||||
control: 'select2', options: [
|
||||
@@ -273,9 +271,7 @@ define('pgadmin.node.pga_jobstep', [
|
||||
break;
|
||||
}
|
||||
|
||||
msg = S(
|
||||
gettext('Invalid parameter in the connection string - %s.')
|
||||
).sprintf(m[1]).value();
|
||||
msg = gettext('Invalid parameter in the connection string - %s.', m[1]);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,10 +9,10 @@
|
||||
|
||||
define('pgadmin.node.role', [
|
||||
'sources/gettext', 'sources/url_for', 'jquery', 'underscore',
|
||||
'underscore.string', 'sources/pgadmin', 'pgadmin.browser', 'alertify',
|
||||
'sources/pgadmin', 'pgadmin.browser', 'alertify',
|
||||
'pgadmin.backform', 'select2', 'pgadmin.browser.collection',
|
||||
'pgadmin.browser.node.ui', 'pgadmin.browser.server.variable',
|
||||
], function(gettext, url_for, $, _, S, pgAdmin, pgBrowser, alertify, Backform) {
|
||||
], function(gettext, url_for, $, _, pgAdmin, pgBrowser, alertify, Backform) {
|
||||
|
||||
if (!pgBrowser.Nodes['coll-role']) {
|
||||
pgAdmin.Browser.Nodes['coll-role'] =
|
||||
|
||||
@@ -9,13 +9,13 @@
|
||||
|
||||
define('pgadmin.node.server', [
|
||||
'sources/gettext', 'sources/url_for', 'jquery', 'underscore', 'backbone',
|
||||
'underscore.string', 'sources/pgadmin', 'pgadmin.browser',
|
||||
'sources/pgadmin', 'pgadmin.browser',
|
||||
'pgadmin.server.supported_servers', 'pgadmin.user_management.current_user',
|
||||
'pgadmin.alertifyjs', 'pgadmin.backform',
|
||||
'sources/browser/server_groups/servers/model_validation',
|
||||
'pgadmin.browser.server.privilege',
|
||||
], function(
|
||||
gettext, url_for, $, _, Backbone, S, pgAdmin, pgBrowser,
|
||||
gettext, url_for, $, _, Backbone, pgAdmin, pgBrowser,
|
||||
supported_servers, current_user, Alertify, Backform,
|
||||
modelValidation
|
||||
) {
|
||||
@@ -260,10 +260,7 @@ define('pgadmin.node.server', [
|
||||
if (notify) {
|
||||
Alertify.confirm(
|
||||
gettext('Disconnect server'),
|
||||
gettext(
|
||||
'Are you sure you want to disconnect the server %(server)s?',
|
||||
{server: d.label}
|
||||
),
|
||||
gettext('Are you sure you want to disconnect the server %s?', d.label),
|
||||
function() { disconnect(); },
|
||||
function() { return true;}
|
||||
);
|
||||
@@ -310,9 +307,7 @@ define('pgadmin.node.server', [
|
||||
|
||||
Alertify.confirm(
|
||||
gettext('Reload server configuration'),
|
||||
S(
|
||||
gettext('Are you sure you want to reload the server configuration on %s?')
|
||||
).sprintf(d.label).value(),
|
||||
gettext('Are you sure you want to reload the server configuration on %s?', d.label),
|
||||
function() {
|
||||
$.ajax({
|
||||
url: obj.generate_url(i, 'reload', d, true),
|
||||
@@ -643,9 +638,7 @@ define('pgadmin.node.server', [
|
||||
|
||||
Alertify.confirm(
|
||||
gettext('Clear saved password'),
|
||||
S(
|
||||
gettext('Are you sure you want to clear the saved password for server %s?')
|
||||
).sprintf(d.label).value(),
|
||||
gettext('Are you sure you want to clear the saved password for server %s?', d.label),
|
||||
function() {
|
||||
$.ajax({
|
||||
url: obj.generate_url(i, 'clear_saved_password', d, true),
|
||||
@@ -683,9 +676,7 @@ define('pgadmin.node.server', [
|
||||
|
||||
Alertify.confirm(
|
||||
gettext('Clear SSH Tunnel password'),
|
||||
S(
|
||||
gettext('Are you sure you want to clear the saved password of SSH Tunnel for server %s?')
|
||||
).sprintf(d.label).value(),
|
||||
gettext('Are you sure you want to clear the saved password of SSH Tunnel for server %s?', d.label),
|
||||
function() {
|
||||
$.ajax({
|
||||
url: obj.generate_url(i, 'clear_sshtunnel_password', d, true),
|
||||
|
||||
@@ -281,8 +281,8 @@ define('pgadmin.node.tablespace', [
|
||||
Alertify.confirm(
|
||||
gettext('Move objects...'),
|
||||
gettext(
|
||||
'Are you sure you wish to move the objects from %(old_tablespace)s to %(new_tablespace)s?',
|
||||
{old_tablespace: args.old_tblspc, new_tablespace: args.tblspc}
|
||||
'Are you sure you wish to move the objects from %s to %s?',
|
||||
args.old_tblspc, args.tblspc
|
||||
),
|
||||
function() {
|
||||
$.ajax({
|
||||
|
||||
Reference in New Issue
Block a user