diff --git a/requirements.txt b/requirements.txt
index fe01bf9e..60f0bd66 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -4,32 +4,33 @@
# ignored when building a PIP Wheel.
##############################################################################
blinker==1.4
-Flask==0.12.4
+Flask==1.0.2
Flask-Gravatar==0.5.0
-Flask-Login==0.3.2
+Flask-Login==0.4.1
Flask-Mail==0.9.1
-Flask-Migrate==2.1.1
+Flask-Migrate==2.4.0
Flask-Principal==0.4.0
Flask-SQLAlchemy==2.3.2
Flask-WTF==0.14.2
passlib==1.7.1
-pytz==2018.3
-simplejson==3.13.2
-six>=1.11.0
+pytz==2018.9
+simplejson==3.16.0
+six>=1.12.0
speaklater==1.3
sqlparse==0.2.4
-WTForms==2.1
+WTForms==2.2.1
Flask-Paranoid==0.2.0
-psutil==5.4.7
-psycopg2>=2.7.4
-python-dateutil>=2.7.1
+psutil==5.5.1
+psycopg2>=2.7.7
+python-dateutil>=2.8.0
htmlmin==0.1.12
-Flask-HTMLmin==1.3.2
-SQLAlchemy>=1.2.5
+Flask-HTMLmin==1.5.0
+SQLAlchemy>=1.2.18
Flask-Security>=3.0.0
-sshtunnel>=0.1.3
+sshtunnel>=0.1.4
###############################################################
# Modules specifically required for Python2.7
###############################################################
-importlib==1.0.3; python_version <= '2.7'
+importlib==1.0.4; python_version <= '2.7'
+
diff --git a/web/.eslintrc.js b/web/.eslintrc.js
index 56ec061a..03b8dcab 100644
--- a/web/.eslintrc.js
+++ b/web/.eslintrc.js
@@ -14,14 +14,9 @@ module.exports = {
'amd': true,
'jasmine': true,
},
- 'extends': [
- 'eslint:recommended',
- ],
'parserOptions': {
- 'ecmaFeatures': {
- 'experimentalObjectRestSpread': true,
- },
- 'sourceType': 'module'
+ 'ecmaVersion': 2018,
+ 'sourceType': 'module',
},
'plugins': [
],
diff --git a/web/package.json b/web/package.json
index cde5e47d..c21edfd4 100644
--- a/web/package.json
+++ b/web/package.json
@@ -1,96 +1,98 @@
{
"license": "PostgreSQL",
"devDependencies": {
- "axios-mock-adapter": "^1.14.1",
- "babel-core": "~6.24.0",
- "babel-loader": "~7.1.2",
- "babel-plugin-transform-object-rest-spread": "^6.26.0",
- "babel-preset-es2015": "~6.24.0",
- "cross-env": "^5.0.1",
- "eclint": "^2.3.0",
- "eslint": "3.19.0",
- "extract-text-webpack-plugin": "^3.0.2",
- "file-loader": "^0.11.2",
- "image-webpack-loader": "^3.3.1",
+ "@babel/core": "~7.3.4",
+ "@babel/preset-env": "~7.3.4",
+ "axios-mock-adapter": "^1.16.0",
+ "babel-loader": "~8.0.5",
+ "babel-plugin-transform-object-rest-spread": "^7.0.0-beta.3",
+ "cross-env": "^5.2.0",
+ "eclint": "^2.8.1",
+ "eslint": "5.15.1",
+ "file-loader": "^3.0.1",
+ "image-webpack-loader": "^4.6.0",
"is-docker": "^1.1.0",
- "jasmine-core": "~2.99.0",
- "karma": "~2.0.0",
- "karma-babel-preprocessor": "^7.0.0",
- "karma-browserify": "~5.2.0",
+ "jasmine-core": "~3.3.0",
+ "karma": "^4.0.1",
+ "karma-babel-preprocessor": "^8.0.0",
+ "karma-browserify": "~6.0.0",
"karma-chrome-launcher": "^2.2.0",
- "karma-jasmine": "~1.1.1",
- "karma-jasmine-html-reporter": "^0.2.2",
+ "karma-jasmine": "~2.0.1",
+ "karma-jasmine-html-reporter": "^1.4.0",
"karma-requirejs": "~1.1.0",
- "karma-source-map-support": "^1.3.0",
+ "karma-source-map-support": "^1.4.0",
"karma-sourcemap-loader": "^0.3.7",
- "karma-webpack": "~2.0.13",
- "node-sass": "^4.5.3",
- "optimize-css-assets-webpack-plugin": "^2.0.0",
- "popper.js": "^1.14.4",
- "raw-loader": "^0.5.1",
+ "karma-webpack": "~4.0.0-rc.6",
+ "mini-css-extract-plugin": "^0.5.0",
+ "node-sass": "^4.11.0",
+ "optimize-css-assets-webpack-plugin": "^5.0.1",
+ "popper.js": "^1.14.7",
+ "raw-loader": "^1.0.0",
"sass-loader": "^7.1.0",
- "sass-resources-loader": "^1.3.3",
- "style-loader": "^0.18.2",
- "uglifyjs-webpack-plugin": "^0.4.6",
- "url-loader": "^0.5.9",
- "webpack": "^3.0.0"
+ "sass-resources-loader": "^2.0.0",
+ "style-loader": "^0.23.1",
+ "uglifyjs-webpack-plugin": "^2.1.2",
+ "url-loader": "^1.1.2",
+ "webpack": "^4.29.6",
+ "webpack-cli": "^3.2.3"
},
"dependencies": {
+ "@babel/polyfill": "^7.2.5",
"acitree": "git+https://github.com/imsurinder90/jquery-aciTree.git#rc.7",
"alertifyjs": "1.7.1",
"axios": "^0.18.0",
"babel-plugin-transform-es2015-modules-amd": "^6.24.1",
- "babel-polyfill": "^6.23.0",
"babel-preset-es2015-without-strict": "~0.0.4",
- "babelify": "~7.3.0",
- "backbone": "1.3.3",
+ "babelify": "~10.0.0",
+ "backbone": "1.4.0",
"backform": "^0.2.0",
"backgrid": "^0.3.8",
"backgrid-filter": "^0.3.7",
"backgrid-select-all": "^0.3.5",
"backgrid-sizeable-columns": "^0.1.1",
- "bignumber.js": "^6.0.0",
- "bootstrap": "^4.1.3",
- "bootstrap-datepicker": "^1.7.0",
+ "bignumber.js": "^8.1.1",
+ "bootstrap": "^4.3.1",
+ "bootstrap-datepicker": "^1.8.0",
"bootstrap4-toggle": "3.4.0",
- "bowser": "1.6.1",
- "browserify": "~14.1.0",
- "codemirror": "^5.43.0",
- "css-loader": "0.14.0",
- "cssnano": "^3.10.0",
- "dropzone": "^5.1.1",
- "exports-loader": "~0.6.4",
+ "bowser": "2.1.2",
+ "browserify": "~16.2.3",
+ "codemirror": "^5.44.0",
+ "css-loader": "2.1.0",
+ "cssnano": "^4.1.10",
+ "dropzone": "^5.5.1",
+ "exports-loader": "~0.7.0",
"flotr2": "git+https://github.com/EnterpriseDB/Flotr2.git",
"font-awesome": "^4.7.0",
- "hard-source-webpack-plugin": "0.12.0",
- "immutability-helper": "^2.2.0",
- "imports-loader": "^0.7.1",
+ "fsevents": "^1.2.7",
+ "hard-source-webpack-plugin": "0.13.1",
+ "immutability-helper": "^3.0.0",
+ "imports-loader": "^0.8.0",
"ip-address": "^5.8.9",
"jquery": "3.3.1",
- "jquery-contextmenu": "^2.6.4",
+ "jquery-contextmenu": "^2.8.0",
"jquery-ui": "^1.12.1",
"json-bignumber": "^1.0.1",
- "leaflet": "^1.3.3",
- "moment": "^2.20.1",
- "moment-timezone": "^0.5.21",
- "mousetrap": "^1.6.1",
- "prop-types": "^15.5.10",
- "requirejs": "~2.3.3",
+ "leaflet": "^1.4.0",
+ "moment": "^2.24.0",
+ "moment-timezone": "^0.5.23",
+ "mousetrap": "^1.6.3",
+ "prop-types": "^15.7.2",
+ "requirejs": "~2.3.6",
"select2": "^4.0.6-rc.1",
"shim-loader": "^1.0.1",
"slickgrid": "git+https://github.com/6pac/SlickGrid.git#2.3.16",
"snapsvg": "^0.5.1",
"spectrum-colorpicker": "^1.8.0",
"split.js": "^1.5.10",
- "sprintf-js": "^1.1.1",
- "tablesorter": "^2.30.6",
+ "sprintf-js": "^1.1.2",
+ "tablesorter": "^2.31.1",
"tempusdominus-bootstrap-4": "^5.1.2",
"tempusdominus-core": "^5.0.3",
- "underscore": "^1.8.3",
- "underscore.string": "^3.3.4",
- "watchify": "~3.9.0",
+ "underscore": "^1.9.1",
+ "underscore.string": "^3.3.5",
+ "watchify": "~3.11.1",
"webcabin-docker": "git+https://github.com/EnterpriseDB/wcDocker/#9cf81f03bb350b76b77a264f1db5d55391d5e424",
- "wkx": "^0.4.5"
+ "wkx": "^0.4.6"
},
"scripts": {
"linter": "yarn eslint --no-eslintrc -c .eslintrc.js --ext .js .",
diff --git a/web/pgadmin/about/static/js/about.js b/web/pgadmin/about/static/js/about.js
index e76dea61..64bc356d 100644
--- a/web/pgadmin/about/static/js/about.js
+++ b/web/pgadmin/about/static/js/about.js
@@ -51,11 +51,11 @@ define(
}
$.get(url_for('about.index'),
- function(data) {
- alertify.aboutDialog(
- S(gettext('About %s')).sprintf(pgAdmin.Browser.utils.app_name).value(), data
- ).resizeTo(pgAdmin.Browser.stdW.md, pgAdmin.Browser.stdH.md);
- });
+ function(data) {
+ alertify.aboutDialog(
+ S(gettext('About %s')).sprintf(pgAdmin.Browser.utils.app_name).value(), data
+ ).resizeTo(pgAdmin.Browser.stdW.md, pgAdmin.Browser.stdH.md);
+ });
},
};
diff --git a/web/pgadmin/browser/server_groups/servers/databases/casts/static/js/cast.js b/web/pgadmin/browser/server_groups/servers/databases/casts/static/js/cast.js
index 268cf970..c3b8e080 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/casts/static/js/cast.js
+++ b/web/pgadmin/browser/server_groups/servers/databases/casts/static/js/cast.js
@@ -12,7 +12,7 @@ define('pgadmin.node.cast', [
'underscore.string', 'sources/pgadmin', 'pgadmin.browser',
'pgadmin.alertifyjs', 'pgadmin.backform', 'pgadmin.browser.collection',
], function(gettext, url_for, $, _, S, pgAdmin, pgBrowser, alertify, Backform) {
- // Extend the collection class for cast
+ // Extend the collection class for cast
if (!pgBrowser.Nodes['coll-cast']) {
pgAdmin.Browser.Nodes['coll-cast'] =
pgAdmin.Browser.Collection.extend({
@@ -23,7 +23,7 @@ define('pgadmin.node.cast', [
});
}
- // Extend the node class for cast
+ // Extend the node class for cast
if (!pgBrowser.Nodes['cast']) {
pgAdmin.Browser.Nodes['cast'] = pgAdmin.Browser.Node.extend({
parent_type: 'database',
@@ -38,13 +38,13 @@ define('pgadmin.node.cast', [
hasDepends: true,
Init: function() {
- // Avoid multiple registration of menus
+ // Avoid multiple registration of menus
if (this.initialized)
return;
this.initialized = true;
- // Add context menus for cast
+ // Add context menus for cast
pgBrowser.add_menus([{
name: 'create_cast_on_database', node: 'database', module: this,
applies: ['object', 'context'], callback: 'show_obj_properties',
@@ -65,7 +65,7 @@ define('pgadmin.node.cast', [
},
- // Define the backform model for cast node
+ // Define the backform model for cast node
model: pgAdmin.Browser.Node.Model.extend({
idAttribute: 'oid',
defaults: {
@@ -79,7 +79,7 @@ define('pgadmin.node.cast', [
description: undefined, // Comment on the cast
},
- // Define the schema for cast
+ // Define the schema for cast
schema: [{
id: 'name', label: gettext('Name'), cell: 'string',
editable: false, type: 'text', disabled: true, cellHeaderClasses: 'width_percent_50',
@@ -99,7 +99,7 @@ define('pgadmin.node.cast', [
return rows;
},
- /*
+ /*
* Control is extended to create cast name from source type and destination type
* once their values are changed
*/
@@ -107,10 +107,10 @@ define('pgadmin.node.cast', [
onChange: function() {
Backform.NodeAjaxOptionsControl.prototype.onChange.apply(
- this, arguments
- );
+ this, arguments
+ );
- /*
+ /*
* On source type change, check if both source type and
* target type are set, if yes then fetch values from both
* controls and generate cast name
@@ -121,12 +121,12 @@ define('pgadmin.node.cast', [
trgtype != undefined && trgtype != '')
this.model.set('name', srctype+'->'+trgtype);
else
- this.model.unset('name');
+ this.model.unset('name');
},
}),
},
- /*
+ /*
* Text control for viewing source type in properties and
* edit mode only
*/
@@ -145,7 +145,7 @@ define('pgadmin.node.cast', [
return rows;
},
- /*
+ /*
* Control is extended to create cast name from source type and destination type
* once their values are changed
*/
@@ -153,10 +153,10 @@ define('pgadmin.node.cast', [
onChange: function() {
Backform.NodeAjaxOptionsControl.prototype.onChange.apply(
- this, arguments
- );
+ this, arguments
+ );
- /*
+ /*
* on target type change, check if both source type and
* target type are set, if yes then fetch values from both
* controls and generate cast name
@@ -167,11 +167,11 @@ define('pgadmin.node.cast', [
trgtype != undefined && trgtype != '')
this.model.set('name', srcType+'->'+trgtype);
else
- this.model.unset('name');
+ this.model.unset('name');
},
}),
},
- /*
+ /*
* Text control for viewing target type in properties and
* edit mode only
*/
@@ -180,7 +180,7 @@ define('pgadmin.node.cast', [
group: gettext('Definition'), disabled: true, mode:['properties','edit'],
},
- /*
+ /*
* Proname field is dependent on source type and target type.
* On source and target type changed event,
* associated functions will be fetch using ajax call
@@ -197,13 +197,13 @@ define('pgadmin.node.cast', [
if(srcTyp != undefined && srcTyp != '' &&
trgtyp != undefined && trgtyp != '')
- {
+ {
var node = control.field.get('schema_node'),
_url = node.generate_url.apply(
- node, [
- null, 'get_functions', control.field.get('node_data'), false,
- control.field.get('node_info'),
- ]);
+ node, [
+ null, 'get_functions', control.field.get('node_data'), false,
+ control.field.get('node_info'),
+ ]);
$.ajax({
type: 'POST',
timeout: 30000,
@@ -212,15 +212,15 @@ define('pgadmin.node.cast', [
async: false,
data: {'srctyp' : srcTyp, 'trgtyp' : trgtyp},
})
- // On success return function list from server
- .done(function(result) {
- res = result.data;
- return res;
- })
- // On failure show error appropriate error message to user
- .fail(function(xhr, status, error) {
- alertify.pgRespErrorNotify(xhr, error);
- });
+ // On success return function list from server
+ .done(function(result) {
+ res = result.data;
+ return res;
+ })
+ // On failure show error appropriate error message to user
+ .fail(function(xhr, status, error) {
+ alertify.pgRespErrorNotify(xhr, error);
+ });
}
return res;
},
diff --git a/web/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/foreign_servers/static/js/foreign_server.js b/web/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/foreign_servers/static/js/foreign_server.js
index 46d9e511..1c82513f 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/foreign_servers/static/js/foreign_server.js
+++ b/web/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/foreign_servers/static/js/foreign_server.js
@@ -21,18 +21,18 @@ define('pgadmin.node.foreign_server', [
fsrvvalue: undefined,
},
- // Defining schema for the Options model
+ // Defining schema for the Options model
schema: [
- {id: 'fsrvoption', label: gettext('Options'), type:'text', cellHeaderClasses:'width_percent_50', group: null, editable: true},
- {id: 'fsrvvalue', label: gettext('Value'), type: 'text', cellHeaderClasses:'width_percent_50', group:null, editable: true},
+ {id: 'fsrvoption', label: gettext('Options'), type:'text', cellHeaderClasses:'width_percent_50', group: null, editable: true},
+ {id: 'fsrvvalue', label: gettext('Value'), type: 'text', cellHeaderClasses:'width_percent_50', group:null, editable: true},
],
- /* validate function is used to validate the input given by
+ /* validate function is used to validate the input given by
* the user. In case of error, message will be displayed on
* the browser for the respective control.
*/
validate: function() {
- // Validation for the option name
+ // Validation for the option name
if (_.isUndefined(this.get('fsrvoption')) ||
_.isNull(this.get('fsrvoption')) ||
String(this.get('fsrvoption')).replace(/^\s+|\s+$/g, '') == '') {
diff --git a/web/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/foreign_servers/user_mapping/static/js/user_mapping.js b/web/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/foreign_servers/user_mapping/static/js/user_mapping.js
index 63080f68..3d75f673 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/foreign_servers/user_mapping/static/js/user_mapping.js
+++ b/web/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/foreign_servers/user_mapping/static/js/user_mapping.js
@@ -13,7 +13,7 @@ define('pgadmin.node.user_mapping', [
'pgadmin.backform', 'pgadmin.browser.collection',
], function(gettext, url_for, $, _, S, pgAdmin, pgBrowser, Backform) {
- // Extend the browser's node model class to create a Options model
+ // Extend the browser's node model class to create a Options model
var OptionsModel = pgAdmin.Browser.Node.Model.extend({
idAttribute: 'umoption',
defaults: {
@@ -21,7 +21,7 @@ define('pgadmin.node.user_mapping', [
umvalue: undefined,
},
- // Defining schema for the Options model
+ // Defining schema for the Options model
schema: [{
id: 'umoption', label: gettext('Options'), type:'text',
cellHeaderClasses:'width_percent_50', group: null, editable: true,
@@ -30,12 +30,12 @@ define('pgadmin.node.user_mapping', [
cellHeaderClasses:'width_percent_50', group:null, editable: true,
}],
- /* validate function is used to validate the input given by
+ /* validate function is used to validate the input given by
* the user. In case of error, message will be displayed on
* the browser for the respective control.
*/
validate: function() {
- // Validation for the option value
+ // Validation for the option value
if (_.isUndefined(this.get('umoption')) ||
_.isNull(this.get('umoption')) ||
String(this.get('umoption')).replace(/^\s+|\s+$/g, '') == '') {
diff --git a/web/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/static/js/foreign_data_wrapper.js b/web/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/static/js/foreign_data_wrapper.js
index 39726af4..c5ee0b3c 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/static/js/foreign_data_wrapper.js
+++ b/web/pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/static/js/foreign_data_wrapper.js
@@ -13,14 +13,14 @@ define('pgadmin.node.foreign_data_wrapper', [
'pgadmin.browser.collection', 'pgadmin.browser.server.privilege',
], function(gettext, url_for, $, _, S, pgAdmin, pgBrowser, Backform) {
- // Extend the browser's node model class to create a Options model
+ // Extend the browser's node model class to create a Options model
var OptionsModel = pgBrowser.Node.Model.extend({
idAttribute: 'fdwoption',
defaults: {
fdwoption: undefined,
fdwvalue: undefined,
},
- // Defining schema for the Options model
+ // Defining schema for the Options model
schema: [{
id: 'fdwoption', label: gettext('Option'), type:'text',
cellHeaderClasses:'width_percent_50', editable: true,
@@ -28,12 +28,12 @@ define('pgadmin.node.foreign_data_wrapper', [
id: 'fdwvalue', label: gettext('Value'), type: 'text',
cellHeaderClasses:'width_percent_50', group:null, editable: true,
}],
- /* validate function is used to validate the input given by
+ /* validate function is used to validate the input given by
* the user. In case of error, message will be displayed on
* the browser for the respective control.
*/
validate: function() {
- // Validation for the option name
+ // Validation for the option name
if (_.isUndefined(this.get('fdwoption')) ||
_.isNull(this.get('fdwoption')) ||
String(this.get('fdwoption')).replace(/^\s+|\s+$/g, '') == '') {
@@ -170,7 +170,7 @@ define('pgadmin.node.foreign_data_wrapper', [
id: 'acl', label: gettext('Privileges'), type: 'text',
group: gettext('Security'), mode: ['properties'], disabled: true,
}],
- /* validate function is used to validate the input given by
+ /* validate function is used to validate the input given by
* the user. In case of error, message will be displayed on
* the browser for the respective control.
*/
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/collations/static/js/collation.js b/web/pgadmin/browser/server_groups/servers/databases/schemas/collations/static/js/collation.js
index 1218131e..e3b60303 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/collations/static/js/collation.js
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/collations/static/js/collation.js
@@ -13,7 +13,7 @@ define('pgadmin.node.collation', [
'pgadmin.node.schema.dir/child', 'pgadmin.node.schema.dir/schema_child_tree_node',
'pgadmin.browser.collection',
], function(gettext, url_for, $, _, S, pgAdmin, pgBrowser, schemaChild,
- schemaChildTreeNode) {
+ schemaChildTreeNode) {
if (!pgBrowser.Nodes['coll-collation']) {
pgAdmin.Browser.Nodes['coll-collation'] =
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/domains/static/js/domain.js b/web/pgadmin/browser/server_groups/servers/databases/schemas/domains/static/js/domain.js
index ff0528cc..8fa1c36b 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/domains/static/js/domain.js
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/domains/static/js/domain.js
@@ -209,10 +209,10 @@ define('pgadmin.node.domain', [
_.each(m.type_options, function(o) {
// if type from selected from combobox matches in options
if ( of_type == o.value ) {
- // if length is allowed for selected type
+ // if length is allowed for selected type
if(o.length)
- {
- // set the values in model
+ {
+ // set the values in model
m.set('is_tlength', true, {silent: true});
m.set('min_val', o.min_val, {silent: true});
m.set('max_val', o.max_val, {silent: true});
@@ -236,10 +236,10 @@ define('pgadmin.node.domain', [
_.each(m.type_options, function(o) {
// if type from selected from combobox matches in options
if ( of_type == o.value ) {
- // if precession is allowed for selected type
+ // if precession is allowed for selected type
if(o.precision)
- {
- // set the values in model
+ {
+ // set the values in model
m.set('is_precision', true, {silent: true});
m.set('min_val', o.min_val, {silent: true});
m.set('max_val', o.max_val, {silent: true});
@@ -269,7 +269,7 @@ define('pgadmin.node.domain', [
model: ConstraintModel, canAdd: true, canDelete: true,
canEdit: false, columns: ['conname','consrc', 'convalidated'],
},
- pgBrowser.SecurityGroupSchema,
+ pgBrowser.SecurityGroupSchema,
{
id: 'seclabels', label: gettext('Security labels'),
model: pgBrowser.SecLabelModel, type: 'collection',
@@ -301,7 +301,7 @@ define('pgadmin.node.domain', [
if (!m.isNew()) {
var server = this.node_info.server;
if (server.version < 90200)
- {
+ {
return false;
}
}
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/static/js/foreign_table.js b/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/static/js/foreign_table.js
index aab263ba..d34fa838 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/static/js/foreign_table.js
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/static/js/foreign_table.js
@@ -96,7 +96,7 @@ define('pgadmin.node.foreign_table', [
type: 'int', deps: ['datatype'],
disabled: function(m) {
var val = m.get('typlen');
- // We will store type from selected from combobox
+ // We will store type from selected from combobox
if(!(_.isUndefined(m.get('inheritedid'))
|| _.isNull(m.get('inheritedid'))
|| _.isUndefined(m.get('inheritedfrom'))
@@ -115,14 +115,14 @@ define('pgadmin.node.foreign_table', [
if(m.type_options) {
m.set('is_tlength', false, {silent: true});
- // iterating over all the types
+ // iterating over all the types
_.each(m.type_options, function(o) {
- // if type from selected from combobox matches in options
+ // if type from selected from combobox matches in options
if ( of_type == o.value ) {
- // if length is allowed for selected type
+ // if length is allowed for selected type
if(o.length)
- {
- // set the values in model
+ {
+ // set the values in model
has_length = true;
m.set('is_tlength', true, {silent: true});
m.set('min_val', o.min_val, {silent: true});
@@ -171,15 +171,15 @@ define('pgadmin.node.foreign_table', [
if(m.type_options) {
m.set('is_precision', false, {silent: true});
- // iterating over all the types
+ // iterating over all the types
_.each(m.type_options, function(o) {
- // if type from selected from combobox matches in options
+ // if type from selected from combobox matches in options
if ( of_type == o.value ) {
- // if precession is allowed for selected type
+ // if precession is allowed for selected type
if(o.precision)
- {
+ {
has_precision = true;
- // set the values in model
+ // set the values in model
m.set('is_precision', true, {silent: true});
m.set('min_val', o.min_val, {silent: true});
m.set('max_val', o.max_val, {silent: true});
@@ -263,7 +263,7 @@ define('pgadmin.node.foreign_table', [
}
if (_.isUndefined(this.get('datatype')) || String(this.get('datatype'))
- .replace(/^\s+|\s+$/g, '') == '') {
+ .replace(/^\s+|\s+$/g, '') == '') {
errmsg = gettext('Column Datatype cannot be empty.');
this.errorModel.set('datatype', errmsg);
} else {
@@ -345,10 +345,10 @@ define('pgadmin.node.foreign_table', [
var node = this.field.get('schema_node'),
node_info = this.field.get('node_info'),
full_url = node.generate_url.apply(
- node, [
- null, url, this.field.get('node_data'),
- this.field.get('url_with_id') || false, node_info,
- ]),
+ node, [
+ null, url, this.field.get('node_data'),
+ this.field.get('url_with_id') || false, node_info,
+ ]),
cache_level = this.field.get('cache_level') || node.type,
cache_node = this.field.get('cache_node');
@@ -363,17 +363,17 @@ define('pgadmin.node.foreign_table', [
url: full_url,
data: data,
})
- .done(function(res) {
+ .done(function(res) {
/*
* We will cache this data for short period of time for avoiding
* same calls.
*/
- data = cache_node.cache(url, node_info, cache_level, res.data);
+ data = cache_node.cache(url, node_info, cache_level, res.data);
- })
- .fail(function() {
- m.trigger('pgadmin:view:fetch:error', m, self.field);
- });
+ })
+ .fail(function() {
+ m.trigger('pgadmin:view:fetch:error', m, self.field);
+ });
m.trigger('pgadmin:view:fetched', m, self.field);
// To fetch only options from cache, we do not need time from 'at'
@@ -444,7 +444,7 @@ define('pgadmin.node.foreign_table', [
}
if (_.isUndefined(this.get('consrc')) || String(this.get('consrc'))
- .replace(/^\s+|\s+$/g, '') == '') {
+ .replace(/^\s+|\s+$/g, '') == '') {
err['consrc'] = gettext('Constraint Check cannot be empty.');
errmsg = errmsg || err['consrc'];
}
@@ -631,8 +631,8 @@ define('pgadmin.node.foreign_table', [
mode: ['properties'], min_version: 90200,
}, pgBrowser.SecurityGroupSchema, {
id: 'acl', label: gettext('Privileges'), model: pgAdmin
- .Browser.Node.PrivilegeRoleModel.extend(
- {privileges: ['a','r','w','x']}), uniqueCol : ['grantee', 'grantor'],
+ .Browser.Node.PrivilegeRoleModel.extend(
+ {privileges: ['a','r','w','x']}), uniqueCol : ['grantee', 'grantor'],
editable: false, type: 'collection', group: 'security',
mode: ['edit', 'create'],
canAdd: true, canDelete: true, control: 'unique-col-collection',
@@ -657,7 +657,7 @@ define('pgadmin.node.foreign_table', [
}
if (_.isUndefined(this.get('basensp')) || String(this.get('basensp'))
- .replace(/^\s+|\s+$/g, '') == '') {
+ .replace(/^\s+|\s+$/g, '') == '') {
err['basensp'] = gettext('Schema cannot be empty.');
errmsg = errmsg || err['basensp'];
}
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/fts_configurations/static/js/fts_configuration.js b/web/pgadmin/browser/server_groups/servers/databases/schemas/fts_configurations/static/js/fts_configuration.js
index 8c7c2e0a..5b526903 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/fts_configurations/static/js/fts_configuration.js
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/fts_configurations/static/js/fts_configuration.js
@@ -24,7 +24,7 @@ define('pgadmin.node.fts_configuration', [
dictname: undefined,
},
keys: ['token'],
- // Define the schema for the token/dictionary list
+ // Define the schema for the token/dictionary list
schema: [{
id: 'token', label: gettext('Token'), type:'text', group: null,
cellHeaderClasses:'width_percent_50',
@@ -34,9 +34,9 @@ define('pgadmin.node.fts_configuration', [
cellHeaderClasses:'width_percent_50', editable: true,
cell:Backgrid.Extension.MultiSelectAjaxCell, url: 'dictionaries',
}],
- // Validation for token and dictionary list
+ // Validation for token and dictionary list
validate: function() {
- // Clear any existing errors.
+ // Clear any existing errors.
var msg;
this.errorModel.clear();
var token = this.get('token');
@@ -61,14 +61,14 @@ define('pgadmin.node.fts_configuration', [
},
});
-// Customized control for token control
+ // Customized control for token control
var TokenControl = Backform.TokenControl =
Backform.UniqueColCollectionControl.extend({
initialize: function() {
Backform.UniqueColCollectionControl.prototype.initialize.apply(
- this, arguments
- );
+ this, arguments
+ );
var self = this,
headerSchema = [{
@@ -82,7 +82,7 @@ define('pgadmin.node.fts_configuration', [
Backform.NodeAjaxOptionsControl.prototype.initialize.apply(
this,
arguments
- );
+ );
var self = this,
url = self.field.get('url') || self.defaults.url,
m = self.model.top || self.model;
@@ -122,20 +122,20 @@ define('pgadmin.node.fts_configuration', [
async: false,
url: full_url,
})
- .done(function(res) {
- /*
+ .done(function(res) {
+ /*
* We will cache this data for short period of time for
* avoiding same calls.
*/
- data = cache_node.cache(url,
- node_info,
- cache_level,
- res.data
- );
- })
- .fail(function() {
- m.trigger('pgadmin:view:fetch:error', m, self.field);
- });
+ data = cache_node.cache(url,
+ node_info,
+ cache_level,
+ res.data
+ );
+ })
+ .fail(function() {
+ m.trigger('pgadmin:view:fetch:error', m, self.field);
+ });
m.trigger('pgadmin:view:fetched', m, self.field);
}
@@ -169,16 +169,16 @@ define('pgadmin.node.fts_configuration', [
// Grid columns backgrid
gridCols = ['token', 'dictname'];
- // Creating model for header control which is used to add new tokens
+ // Creating model for header control which is used to add new tokens
self.headerData = new (Backbone.Model.extend({
defaults: headerDefaults,
schema: headerSchema,
}))({});
- // Creating view from header schema in tokens control
+ // Creating view from header schema in tokens control
var headerGroups = Backform.generateViewSchema(
- self.field.get('node_info'), self.headerData, 'create',
- self.field.get('schema_node'), self.field.get('node_data')
+ self.field.get('node_info'), self.headerData, 'create',
+ self.field.get('schema_node'), self.field.get('node_data')
),
fields = [];
@@ -187,13 +187,13 @@ define('pgadmin.node.fts_configuration', [
});
self.headerFields = new Backform.Fields(fields);
- // creating grid using grid columns
+ // creating grid using grid columns
self.gridSchema = Backform.generateGridColumnsFromModel(
self.field.get('node_info'), self.field.get('model'),
'edit', gridCols, self.field.get('schema_node')
- );
+ );
- // Providing behaviour control functions to header and grid control
+ // Providing behaviour control functions to header and grid control
self.controls = [];
self.listenTo(self.headerData, 'change', self.headerDataChanged);
self.listenTo(self.headerData, 'select2', self.headerDataChanged);
@@ -201,7 +201,7 @@ define('pgadmin.node.fts_configuration', [
self.listenTo(self.collection, 'remove', self.onAddorRemoveTokens);
},
- // Template for creating header view
+ // Template for creating header view
generateHeader: function(data) {
var header = [
'
'].join('\n')),
gridBody = $('
').append(
- gridHeader(attributes)
- );
+ gridHeader(attributes)
+ );
- // Initialize a new Grid instance
+ // Initialize a new Grid instance
var grid = self.grid = new Backgrid.Grid({
columns: self.grid_columns,
collection: self.model.get(self.field.get('name')),
className: 'backgrid table-bordered table-noouter-border table-hover',
});
- // render grid
+ // render grid
self.$el.append($(gridBody).append(grid.render().$el));
return self;
@@ -127,7 +127,7 @@ define('pgadmin.node.schema', [
},
});
- // Extend the browser's collection class for VacuumSettingsModel
+ // Extend the browser's collection class for VacuumSettingsModel
Backform.VacuumSettingsSchema = [{
id: 'spacer_ctrl', group: gettext('Table'), mode: ['edit', 'create'], type: 'spacer',
},{
@@ -373,7 +373,7 @@ define('pgadmin.node.schema', [
},{
id: 'nspacl', label: gettext('Privileges'),
model: pgBrowser.Node.PrivilegeRoleModel.extend(
- {privileges: ['C', 'U']}), uniqueCol : ['grantee', 'grantor'],
+ {privileges: ['C', 'U']}), uniqueCol : ['grantee', 'grantor'],
editable: false, type: 'collection', group: gettext('Security'),
mode: ['edit', 'create'],
canAdd: true, canDelete: true, control: 'unique-col-collection',
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/synonyms/static/js/synonym.js b/web/pgadmin/browser/server_groups/servers/databases/schemas/synonyms/static/js/synonym.js
index 39722d2e..e42eca4c 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/synonyms/static/js/synonym.js
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/synonyms/static/js/synonym.js
@@ -13,7 +13,7 @@ define('pgadmin.node.synonym', [
'pgadmin.node.schema.dir/child', 'pgadmin.node.schema.dir/schema_child_tree_node',
'pgadmin.browser.collection',
], function(gettext, url_for, $, _, S, pgAdmin, pgBrowser, alertify,
- schemaChild, schemaChildTreeNode) {
+ schemaChild, schemaChildTreeNode) {
if (!pgBrowser.Nodes['coll-synonym']) {
pgAdmin.Browser.Nodes['coll-synonym'] =
@@ -110,13 +110,13 @@ define('pgadmin.node.synonym', [
select2: { width: '50%', allowClear: false },
options: function() {
return [
- {label: gettext('Function'), value: 'f'},
- {label: gettext('Package'), value: 'P'},
- {label: gettext('Procedure'), value: 'p'},
- {label: gettext('Public Synonym'), value: 's'},
- {label: gettext('Sequence'), value: 'S'},
- {label: gettext('Table'), value: 'r'},
- {label: gettext('View'), value: 'v'},
+ {label: gettext('Function'), value: 'f'},
+ {label: gettext('Package'), value: 'P'},
+ {label: gettext('Procedure'), value: 'p'},
+ {label: gettext('Public Synonym'), value: 's'},
+ {label: gettext('Sequence'), value: 'S'},
+ {label: gettext('Table'), value: 'r'},
+ {label: gettext('View'), value: 'v'},
];
},
control: 'select2',
@@ -169,14 +169,14 @@ define('pgadmin.node.synonym', [
data: {'trgTyp' : trgTyp, 'trgSchema' : trgSchema},
})
// On success return function list from server
- .done(function(result) {
- res = result.data;
- return res;
- })
+ .done(function(result) {
+ res = result.data;
+ return res;
+ })
// On failure show error appropriate error message to user
- .fail(function(xhr, status, error) {
- alertify.pgRespErrorNotify(xhr, error);
- });
+ .fail(function(xhr, status, error) {
+ alertify.pgRespErrorNotify(xhr, error);
+ });
return res;
},
},{
@@ -228,7 +228,7 @@ define('pgadmin.node.synonym', [
},
}),
canCreate: function(itemData, item, data) {
- //If check is false then , we will allow create menu
+ //If check is false then , we will allow create menu
if (data && data.check == false)
return true;
@@ -238,11 +238,11 @@ define('pgadmin.node.synonym', [
if (server && server.server_type === 'pg')
return false;
- // If it is catalog then don't allow user to create synonyms
+ // If it is catalog then don't allow user to create synonyms
if (treeData['catalog'] != undefined)
return false;
- // by default we do not want to allow create menu
+ // by default we do not want to allow create menu
return true;
},
});
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/column/static/js/column.js b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/column/static/js/column.js
index fc23b075..c4f19184 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/column/static/js/column.js
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/column/static/js/column.js
@@ -28,7 +28,7 @@ define('pgadmin.node.column', [
});
}
- // This Node model will be used for variable control for column
+ // This Node model will be used for variable control for column
var VariablesModel = Backform.VariablesModel = pgBrowser.Node.Model.extend({
idAttribute: 'name',
defaults: {
@@ -39,7 +39,7 @@ define('pgadmin.node.column', [
id: 'name', label: gettext('Name'), cell: 'select2',
type: 'text', disabled: false, node: 'column',
options: [['n_distinct', 'n_distinct'],
- ['n_distinct_inherited','n_distinct_inherited']],
+ ['n_distinct_inherited','n_distinct_inherited']],
select2: {placeholder: 'Select variable'},
cellHeaderClasses:'width_percent_50',
},{
@@ -338,7 +338,7 @@ define('pgadmin.node.column', [
_.each(m.datatypes, function(o) {
if ( of_type == o.value ) {
if(o.length)
- {
+ {
m.set('min_val', o.min_val, {silent: true});
m.set('max_val', o.max_val, {silent: true});
flag = false;
@@ -355,7 +355,7 @@ define('pgadmin.node.column', [
return flag;
},
editable: function(m) {
- // inheritedfrom has value then we should disable it
+ // inheritedfrom has value then we should disable it
if(!_.isUndefined(m.get('inheritedfrom'))) {
return false;
}
@@ -409,7 +409,7 @@ define('pgadmin.node.column', [
return flag;
},
editable: function(m) {
- // inheritedfrom has value then we should disable it
+ // inheritedfrom has value then we should disable it
if(!_.isUndefined(m.get('inheritedfrom'))) {
return false;
}
@@ -449,7 +449,7 @@ define('pgadmin.node.column', [
_.each(m.datatypes, function(o) {
if ( of_type == o.value ) {
if(o.is_collatable)
- {
+ {
flag = false;
}
}
@@ -661,25 +661,25 @@ define('pgadmin.node.column', [
editable_check_for_table: function(arg) {
if (arg instanceof Backbone.Collection) {
return !arg.model.prototype.inSchemaWithColumnCheck.apply(
- this, [arg.top]
- );
+ this, [arg.top]
+ );
} else {
return !arg.inSchemaWithColumnCheck.apply(
- this, [arg]
- );
+ this, [arg]
+ );
}
},
}),
// Below function will enable right click menu for creating column
canCreate: function(itemData, item, data) {
- // If check is false then , we will allow create menu
+ // If check is false then , we will allow create menu
if (data && data.check == false)
return true;
var t = pgBrowser.tree, i = item, d = itemData, parents = [];
- // To iterate over tree to check parent node
+ // To iterate over tree to check parent node
while (i) {
- // If it is schema then allow user to create table
+ // If it is schema then allow user to create table
if (_.indexOf(['schema'], d._type) > -1) {
return true;
}
@@ -693,7 +693,7 @@ define('pgadmin.node.column', [
i = t.hasParent(i) ? t.parent(i) : null;
d = i ? t.itemData(i) : null;
}
- // If node is under catalog then do not allow 'create' menu
+ // If node is under catalog then do not allow 'create' menu
if (_.indexOf(parents, 'catalog') > -1 ||
_.indexOf(parents, 'coll-view') > -1 ||
_.indexOf(parents, 'coll-mview') > -1 ||
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/check_constraint/static/js/check_constraint.js b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/check_constraint/static/js/check_constraint.js
index aa749d35..8258b3cb 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/check_constraint/static/js/check_constraint.js
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/check_constraint/static/js/check_constraint.js
@@ -71,21 +71,21 @@ define('pgadmin.node.check_constraint', [
url: obj.generate_url(i, 'validate', d, true),
type:'GET',
})
- .done(function(res) {
- if (res.success == 1) {
- alertify.success(res.info);
- t.removeIcon(i);
- data.valid = true;
- data.icon = 'icon-check_constraint';
- t.addIcon(i, {icon: data.icon});
- setTimeout(function() {t.deselect(i);}, 10);
- setTimeout(function() {t.select(i);}, 100);
- }
- })
- .fail(function(xhr, status, error) {
- alertify.pgRespErrorNotify(xhr, error);
- t.unload(i);
- });
+ .done(function(res) {
+ if (res.success == 1) {
+ alertify.success(res.info);
+ t.removeIcon(i);
+ data.valid = true;
+ data.icon = 'icon-check_constraint';
+ t.addIcon(i, {icon: data.icon});
+ setTimeout(function() {t.deselect(i);}, 10);
+ setTimeout(function() {t.select(i);}, 100);
+ }
+ })
+ .fail(function(xhr, status, error) {
+ alertify.pgRespErrorNotify(xhr, error);
+ t.unload(i);
+ });
return false;
},
@@ -127,10 +127,10 @@ define('pgadmin.node.check_constraint', [
id: 'consrc', label: gettext('Check'), type: 'multiline', cell:
'string', group: gettext('Definition'), mode: ['properties',
'create', 'edit'], disabled: function(m) {
- return ((_.has(m, 'handler') &&
+ return ((_.has(m, 'handler') &&
!_.isUndefined(m.handler) &&
!_.isUndefined(m.get('oid'))) || (_.isFunction(m.isNew) && !m.isNew()));
- }, editable: false,
+ }, editable: false,
},{
id: 'connoinherit', label: gettext('No inherit?'), type:
'switch', cell: 'boolean', group: gettext('Definition'), mode:
@@ -204,21 +204,21 @@ define('pgadmin.node.check_constraint', [
}),
// Below function will enable right click menu for creating check constraint.
canCreate: function(itemData, item, data) {
- // If check is false then , we will allow create menu
+ // If check is false then , we will allow create menu
if (data && data.check == false)
return true;
var t = pgBrowser.tree, i = item, d = itemData, parents = [];
- // To iterate over tree to check parent node
+ // To iterate over tree to check parent node
while (i) {
- // If it is schema then allow user to c reate table
+ // If it is schema then allow user to c reate table
if (_.indexOf(['schema'], d._type) > -1)
return true;
parents.push(d._type);
i = t.hasParent(i) ? t.parent(i) : null;
d = i ? t.itemData(i) : null;
}
- // If node is under catalog then do not allow 'create' menu
+ // If node is under catalog then do not allow 'create' menu
if (_.indexOf(parents, 'catalog') > -1) {
return false;
} else {
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/exclusion_constraint/static/js/exclusion_constraint.js b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/exclusion_constraint/static/js/exclusion_constraint.js
index 7ac17fb6..647b6352 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/exclusion_constraint/static/js/exclusion_constraint.js
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/exclusion_constraint/static/js/exclusion_constraint.js
@@ -48,7 +48,7 @@ define('pgadmin.node.exclusion_constraint', [
!_.isUndefined(m.collection.handler) &&
!_.isUndefined(m.collection.handler.get('amname')) &&
m.collection.handler.get('amname') != 'btree') {
- // Disable if access method is not btree
+ // Disable if access method is not btree
return false;
}
return true;
@@ -67,7 +67,7 @@ define('pgadmin.node.exclusion_constraint', [
if (url && (indextype == 'btree' || _.isUndefined(indextype) ||
_.isNull(indextype) || indextype == '')) {
- // Set sort_order and nulls to true if access method is btree
+ // Set sort_order and nulls to true if access method is btree
setTimeout(function() {
m.set('order', true);
m.set('nulls_order', true);
@@ -77,10 +77,10 @@ define('pgadmin.node.exclusion_constraint', [
eventHandler = m.top || m,
node_info = this.column.get('node_info'),
full_url = node.generate_url.apply(
- node, [
- null, url, this.column.get('node_data'),
- this.column.get('url_with_id') || false, node_info,
- ]),
+ node, [
+ null, url, this.column.get('node_data'),
+ this.column.get('url_with_id') || false, node_info,
+ ]),
data = [];
indextype = 'btree';
@@ -92,13 +92,13 @@ define('pgadmin.node.exclusion_constraint', [
data : {indextype:indextype},
url: full_url,
})
- .done(function(res) {
- data = res.data;
- self.column.set('options', data);
- })
- .fail(function() {
- eventHandler.trigger('pgadmin:view:fetch:error', m, self.column);
- });
+ .done(function(res) {
+ data = res.data;
+ self.column.set('options', data);
+ })
+ .fail(function() {
+ eventHandler.trigger('pgadmin:view:fetch:error', m, self.column);
+ });
eventHandler.trigger('pgadmin:view:fetched', m, self.column);
}
} else {
@@ -193,13 +193,13 @@ define('pgadmin.node.exclusion_constraint', [
data : {col_type:col_type},
url: full_url,
})
- .done(function(res) {
- data = res.data;
- self.column.set('options', data);
- })
- .fail(function() {
- eventHandler.trigger('pgadmin:view:fetch:error', m, self.column);
- });
+ .done(function(res) {
+ data = res.data;
+ self.column.set('options', data);
+ })
+ .fail(function() {
+ eventHandler.trigger('pgadmin:view:fetch:error', m, self.column);
+ });
eventHandler.trigger('pgadmin:view:fetched', m, self.column);
}
}
@@ -333,13 +333,13 @@ define('pgadmin.node.exclusion_constraint', [
_.each(rows, function(r) {
if (filter(r)) {
var l = (_.isFunction(node['node_label']) ?
- (node['node_label']).apply(node, [r, that.model, that]) :
+ (node['node_label']).apply(node, [r, that.model, that]) :
r.label),
image = (_.isFunction(node['node_image']) ?
(node['node_image']).apply(
node, [r, that.model, that]
) :
- (node['node_image'] || ('icon-' + node.type)));
+ (node['node_image'] || ('icon-' + node.type)));
res.push({
'value': r.label,
'image': image,
@@ -374,9 +374,9 @@ define('pgadmin.node.exclusion_constraint', [
}))({});
var headerGroups = Backform.generateViewSchema(
- self.field.get('node_info'), self.headerData, 'create',
- node, self.field.get('node_data')
- ),
+ self.field.get('node_info'), self.headerData, 'create',
+ node, self.field.get('node_data')
+ ),
fields = [];
_.each(headerGroups, function(o) {
@@ -981,8 +981,8 @@ define('pgadmin.node.exclusion_constraint', [
// If we are in table edit mode then
if (_.has(m, 'top') && !_.isUndefined(m.top)
&& !m.top.isNew()) {
- // If OID is undefined then user is trying to add
- // new constraint which should be allowed for Unique
+ // If OID is undefined then user is trying to add
+ // new constraint which should be allowed for Unique
return !_.isUndefined(m.get('oid'));
}
@@ -1024,16 +1024,16 @@ define('pgadmin.node.exclusion_constraint', [
}),
canCreate: function(itemData, item, data) {
- // If check is false then , we will allow create menu
+ // If check is false then , we will allow create menu
if (data && data.check == false)
return true;
var t = pgBrowser.tree, i = item, d = itemData, parents = [],
immediate_parent_table_found = false,
is_immediate_parent_table_partitioned = false;
- // To iterate over tree to check parent node
+ // To iterate over tree to check parent node
while (i) {
- // If table is partitioned table then return false
+ // If table is partitioned table then return false
if (!immediate_parent_table_found && (d._type == 'table' || d._type == 'partition')) {
immediate_parent_table_found = true;
if ('is_partitioned' in d && d.is_partitioned) {
@@ -1041,14 +1041,14 @@ define('pgadmin.node.exclusion_constraint', [
}
}
- // If it is schema then allow user to create table
+ // If it is schema then allow user to create table
if (_.indexOf(['schema'], d._type) > -1)
return !is_immediate_parent_table_partitioned;
parents.push(d._type);
i = t.hasParent(i) ? t.parent(i) : null;
d = i ? t.itemData(i) : null;
}
- // If node is under catalog then do not allow 'create' menu
+ // If node is under catalog then do not allow 'create' menu
if (_.indexOf(parents, 'catalog') > -1) {
return false;
} else {
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/foreign_key/static/js/foreign_key.js b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/foreign_key/static/js/foreign_key.js
index 7c194745..10bdb64a 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/foreign_key/static/js/foreign_key.js
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/foreign_key/static/js/foreign_key.js
@@ -27,8 +27,8 @@ define('pgadmin.node.foreign_key', [
return opt.text;
} else {
return $(
- ' ' + opt.text + ' '
- );
+ ' ' + opt.text + ' '
+ );
}
},
headerSelectControlTemplate = _.template([
@@ -224,15 +224,15 @@ define('pgadmin.node.foreign_key', [
data : {tid:tid},
url: full_url,
})
- .done(function(res) {
- data = res.data;
- })
- .fail(function() {
- m.trigger('pgadmin:view:fetch:error', m, self.field);
- });
+ .done(function(res) {
+ data = res.data;
+ })
+ .fail(function() {
+ m.trigger('pgadmin:view:fetch:error', m, self.field);
+ });
m.trigger('pgadmin:view:fetched', m, self.field);
}
- /*
+ /*
* Transform the data
*/
var transform = this.field.get('transform') || self.defaults.transform;
@@ -285,9 +285,9 @@ define('pgadmin.node.foreign_key', [
}))({});
var headerGroups = Backform.generateViewSchema(
- self.field.get('node_info'), self.headerData, 'create',
- node, self.field.get('node_data')
- ),
+ self.field.get('node_info'), self.headerData, 'create',
+ node, self.field.get('node_data')
+ ),
fields = [];
_.each(headerGroups, function(o) {
@@ -486,7 +486,7 @@ define('pgadmin.node.foreign_key', [
}
var m = new (self.field.get('model'))(
- self.headerData.toJSON()),
+ self.headerData.toJSON()),
coll = self.model.get(self.field.get('name'));
coll.add(m);
@@ -567,12 +567,12 @@ define('pgadmin.node.foreign_key', [
data : {cols:JSON.stringify(cols)},
url: full_url,
})
- .done(function(res) {
- coveringindex = res.data;
- })
- .fail(function() {
- m.trigger('pgadmin:view:fetch:error', m, self.field);
- });
+ .done(function(res) {
+ coveringindex = res.data;
+ })
+ .fail(function() {
+ m.trigger('pgadmin:view:fetch:error', m, self.field);
+ });
m.trigger('pgadmin:view:fetched', m, self.field);
}
}
@@ -662,21 +662,21 @@ define('pgadmin.node.foreign_key', [
url: obj.generate_url(i, 'validate', d, true),
type:'GET',
})
- .done(function(res) {
- if (res.success == 1) {
- Alertify.success(res.info);
- t.removeIcon(i);
- data.valid = true;
- data.icon = 'icon-foreign_key';
- t.addIcon(i, {icon: data.icon});
- setTimeout(function() {t.deselect(i);}, 10);
- setTimeout(function() {t.select(i);}, 100);
- }
- })
- .fail(function(xhr, status, error) {
- Alertify.pgRespErrorNotify(xhr, error);
- t.unload(i);
- });
+ .done(function(res) {
+ if (res.success == 1) {
+ Alertify.success(res.info);
+ t.removeIcon(i);
+ data.valid = true;
+ data.icon = 'icon-foreign_key';
+ t.addIcon(i, {icon: data.icon});
+ setTimeout(function() {t.deselect(i);}, 10);
+ setTimeout(function() {t.select(i);}, 100);
+ }
+ })
+ .fail(function(xhr, status, error) {
+ Alertify.pgRespErrorNotify(xhr, error);
+ t.unload(i);
+ });
return false;
},
@@ -981,19 +981,19 @@ define('pgadmin.node.foreign_key', [
},
}),
canAdd: function(m) {
- // We can't update columns of existing foreign key.
+ // We can't update columns of existing foreign key.
return m.isNew();
}, canDelete: true,
control: ForeignKeyColumnControl,
model: ForeignKeyColumnModel,
disabled: function(m) {
- // If we are in table edit mode then
+ // If we are in table edit mode then
if (_.has(m, 'handler') && !_.isUndefined(m.handler)) {
- // If OID is undefined then user is trying to add
- // new constraint which should allowed for Unique
+ // If OID is undefined then user is trying to add
+ // new constraint which should allowed for Unique
return !_.isUndefined(m.get('oid'));
}
- // We can't update columns of existing foreign key.
+ // We can't update columns of existing foreign key.
return !m.isNew();
},
},{
@@ -1001,19 +1001,19 @@ define('pgadmin.node.foreign_key', [
type:'select2', group: gettext('Action'), mode: ['edit','create'],
select2:{width:'50%', allowClear: false},
options: [
- {label: 'NO ACTION', value: 'a'},
- {label: 'RESTRICT', value: 'r'},
- {label: 'CASCADE', value: 'c'},
- {label: 'SET NULL', value: 'n'},
- {label: 'SET DEFAULT', value: 'd'},
+ {label: 'NO ACTION', value: 'a'},
+ {label: 'RESTRICT', value: 'r'},
+ {label: 'CASCADE', value: 'c'},
+ {label: 'SET NULL', value: 'n'},
+ {label: 'SET DEFAULT', value: 'd'},
],disabled: function(m) {
- // If we are in table edit mode then
+ // If we are in table edit mode then
if (_.has(m, 'handler') && !_.isUndefined(m.handler)) {
- // If OID is undefined then user is trying to add
- // new constraint which should allowed for Unique
+ // If OID is undefined then user is trying to add
+ // new constraint which should allowed for Unique
return !_.isUndefined(m.get('oid'));
}
- // We can't update confupdtype of existing foreign key.
+ // We can't update confupdtype of existing foreign key.
return !m.isNew();
},
},{
@@ -1021,19 +1021,19 @@ define('pgadmin.node.foreign_key', [
type:'select2', group: gettext('Action'), mode: ['edit','create'],
select2:{width:'50%', allowClear: false},
options: [
- {label: 'NO ACTION', value: 'a'},
- {label: 'RESTRICT', value: 'r'},
- {label: 'CASCADE', value: 'c'},
- {label: 'SET NULL', value: 'n'},
- {label: 'SET DEFAULT', value: 'd'},
+ {label: 'NO ACTION', value: 'a'},
+ {label: 'RESTRICT', value: 'r'},
+ {label: 'CASCADE', value: 'c'},
+ {label: 'SET NULL', value: 'n'},
+ {label: 'SET DEFAULT', value: 'd'},
],disabled: function(m) {
- // If we are in table edit mode then
+ // If we are in table edit mode then
if (_.has(m, 'handler') && !_.isUndefined(m.handler)) {
- // If OID is undefined then user is trying to add
- // new constraint which should allowed for Unique
+ // If OID is undefined then user is trying to add
+ // new constraint which should allowed for Unique
return !_.isUndefined(m.get('oid'));
}
- // We can't update confdeltype of existing foreign key.
+ // We can't update confdeltype of existing foreign key.
return !m.isNew();
},
},
@@ -1064,7 +1064,7 @@ define('pgadmin.node.foreign_key', [
}),
canCreate: function(itemData, item, data) {
- // If check is false then , we will allow create menu
+ // If check is false then , we will allow create menu
if (data && data.check == false)
return true;
@@ -1073,9 +1073,9 @@ define('pgadmin.node.foreign_key', [
is_immediate_parent_table_partitioned = false,
s_version = this.getTreeNodeHierarchy(i).server.version;
- // To iterate over tree to check parent node
+ // To iterate over tree to check parent node
while (i) {
- // If table is partitioned table then return false
+ // If table is partitioned table then return false
if (!immediate_parent_table_found && (d._type == 'table' || d._type == 'partition')) {
immediate_parent_table_found = true;
if ('is_partitioned' in d && d.is_partitioned && s_version < 110000) {
@@ -1083,14 +1083,14 @@ define('pgadmin.node.foreign_key', [
}
}
- // If it is schema then allow user to c reate table
+ // If it is schema then allow user to c reate table
if (_.indexOf(['schema'], d._type) > -1)
return !is_immediate_parent_table_partitioned;
parents.push(d._type);
i = t.hasParent(i) ? t.parent(i) : null;
d = i ? t.itemData(i) : null;
}
- // If node is under catalog then do not allow 'create' menu
+ // If node is under catalog then do not allow 'create' menu
if (_.indexOf(parents, 'catalog') > -1) {
return false;
} else {
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/index_constraint/static/js/primary_key.js b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/index_constraint/static/js/primary_key.js
index 93702224..7d363c20 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/index_constraint/static/js/primary_key.js
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/index_constraint/static/js/primary_key.js
@@ -314,7 +314,7 @@ define('pgadmin.node.primary_key', [
this.stopListening(this.model, 'change:' + name, this.render);
- /*
+ /*
* Iterate through all the values, and find out how many are already
* present in the collection.
*/
@@ -329,7 +329,7 @@ define('pgadmin.node.primary_key', [
}
});
- /*
+ /*
* Adding new values
*/
@@ -344,7 +344,7 @@ define('pgadmin.node.primary_key', [
collection.add(m);
});
- /*
+ /*
* Removing unwanted!
*/
_.each(removed, function(v) {
@@ -391,8 +391,8 @@ define('pgadmin.node.primary_key', [
// If we are in table edit mode then
if (_.has(m, 'top') && !_.isUndefined(m.top)
&& !m.top.isNew()) {
- // If OID is undefined then user is trying to add
- // new constraint which should be allowed for Unique
+ // If OID is undefined then user is trying to add
+ // new constraint which should be allowed for Unique
return !_.isUndefined(m.get('oid'));
}
@@ -488,8 +488,8 @@ define('pgadmin.node.primary_key', [
// If we are in table edit mode then
if (_.has(m, 'top') && !_.isUndefined(m.top)
&& !m.top.isNew()) {
- // If OID is undefined then user is trying to add
- // new constraint which should be allowed for Unique
+ // If OID is undefined then user is trying to add
+ // new constraint which should be allowed for Unique
return !_.isUndefined(m.get('oid'));
}
@@ -580,8 +580,8 @@ define('pgadmin.node.primary_key', [
// If we are in table edit mode then
if (_.has(m, 'top') && !_.isUndefined(m.top)
&& !m.top.isNew()) {
- // If OID is undefined then user is trying to add
- // new constraint which should allowed for Unique
+ // If OID is undefined then user is trying to add
+ // new constraint which should allowed for Unique
return !_.isUndefined(m.get('oid'));
}
@@ -609,8 +609,8 @@ define('pgadmin.node.primary_key', [
// If we are in table edit mode then
if (_.has(m, 'top') && !_.isUndefined(m.top)
&& !m.top.isNew()) {
- // If OID is undefined then user is trying to add
- // new constraint which should allowed for Unique
+ // If OID is undefined then user is trying to add
+ // new constraint which should allowed for Unique
return !_.isUndefined(m.get('oid'));
}
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/index_constraint/static/js/unique_constraint.js b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/index_constraint/static/js/unique_constraint.js
index 022d16d1..41a524b1 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/index_constraint/static/js/unique_constraint.js
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/index_constraint/static/js/unique_constraint.js
@@ -300,7 +300,7 @@ define('pgadmin.node.unique_constraint', [
this.stopListening(this.model, 'change:' + name, this.render);
- /*
+ /*
* Iterate through all the values, and find out how many are already
* present in the collection.
*/
@@ -315,7 +315,7 @@ define('pgadmin.node.unique_constraint', [
}
});
- /*
+ /*
* Adding new values
*/
@@ -330,7 +330,7 @@ define('pgadmin.node.unique_constraint', [
collection.add(m);
});
- /*
+ /*
* Removing unwanted!
*/
_.each(removed, function(v) {
@@ -377,8 +377,8 @@ define('pgadmin.node.unique_constraint', [
// If we are in table edit mode then
if (_.has(m, 'top') && !_.isUndefined(m.top)
&& !m.top.isNew()) {
- // If OID is undefined then user is trying to add
- // new constraint which should be allowed for Unique
+ // If OID is undefined then user is trying to add
+ // new constraint which should be allowed for Unique
return !_.isUndefined(m.get('oid'));
}
@@ -474,8 +474,8 @@ define('pgadmin.node.unique_constraint', [
// If we are in table edit mode then
if (_.has(m, 'top') && !_.isUndefined(m.top)
&& !m.top.isNew()) {
- // If OID is undefined then user is trying to add
- // new constraint which should be allowed for Unique
+ // If OID is undefined then user is trying to add
+ // new constraint which should be allowed for Unique
return !_.isUndefined(m.get('oid'));
}
@@ -566,8 +566,8 @@ define('pgadmin.node.unique_constraint', [
// If we are in table edit mode then
if (_.has(m, 'top') && !_.isUndefined(m.top)
&& !m.top.isNew()) {
- // If OID is undefined then user is trying to add
- // new constraint which should allowed for Unique
+ // If OID is undefined then user is trying to add
+ // new constraint which should allowed for Unique
return !_.isUndefined(m.get('oid'));
}
@@ -595,8 +595,8 @@ define('pgadmin.node.unique_constraint', [
// If we are in table edit mode then
if (_.has(m, 'top') && !_.isUndefined(m.top)
&& !m.top.isNew()) {
- // If OID is undefined then user is trying to add
- // new constraint which should allowed for Unique
+ // If OID is undefined then user is trying to add
+ // new constraint which should allowed for Unique
return !_.isUndefined(m.get('oid'));
}
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/indexes/static/js/index.js b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/indexes/static/js/index.js
index fd48d1fc..f075d5d9 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/indexes/static/js/index.js
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/indexes/static/js/index.js
@@ -205,8 +205,8 @@ define('pgadmin.node.index', [
_.isNull(parent_model.get('amname')) ||
String(parent_model.get('amname')).replace(/^\s+|\s+$/g, '') == '' ||
parent_model.get('amname') === 'btree') {
- // We need to set nulls to true if sort_order is set to desc
- // nulls first is default for desc
+ // We need to set nulls to true if sort_order is set to desc
+ // nulls first is default for desc
if(m.get('sort_order') == true && m.previous('sort_order') == false) {
setTimeout(function() { m.set('nulls', true); }, 10);
}
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/partitions/static/js/partition.js b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/partitions/static/js/partition.js
index 2bf5849c..493deae0 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/partitions/static/js/partition.js
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/partitions/static/js/partition.js
@@ -108,12 +108,12 @@ function(
info || {} : this.getTreeNodeHierarchy(item);
return S('table/%s/%s/%s/%s/%s/%s').sprintf(
- 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();
+ 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,
@@ -146,21 +146,21 @@ function(
data: params,
dataType: 'json',
})
- .done(function(res) {
- if (res.success == 1) {
- Alertify.success(res.info);
+ .done(function(res) {
+ if (res.success == 1) {
+ Alertify.success(res.info);
+ t.unload(i);
+ t.setInode(i);
+ t.deselect(i);
+ setTimeout(function() {
+ t.select(i);
+ }, 10);
+ }
+ })
+ .fail(function(xhr, status, error) {
+ Alertify.pgRespErrorNotify(xhr, error);
t.unload(i);
- t.setInode(i);
- t.deselect(i);
- setTimeout(function() {
- t.select(i);
- }, 10);
- }
- })
- .fail(function(xhr, status, error) {
- Alertify.pgRespErrorNotify(xhr, error);
- t.unload(i);
- });
+ });
},
/* Truncate table */
truncate_table: function(args) {
@@ -194,25 +194,25 @@ function(
data: params,
dataType: 'json',
})
- .done(function(res) {
- if (res.success == 1) {
- Alertify.success(res.info);
- t.removeIcon(i);
- data.icon = 'icon-partition';
- t.addIcon(i, {icon: data.icon});
+ .done(function(res) {
+ if (res.success == 1) {
+ Alertify.success(res.info);
+ t.removeIcon(i);
+ data.icon = 'icon-partition';
+ t.addIcon(i, {icon: data.icon});
+ t.unload(i);
+ t.setInode(i);
+ t.deselect(i);
+ // Fetch updated data from server
+ setTimeout(function() {
+ t.select(i);
+ }, 10);
+ }
+ })
+ .fail(function(xhr, status, error) {
+ Alertify.pgRespErrorNotify(xhr, error);
t.unload(i);
- t.setInode(i);
- t.deselect(i);
- // Fetch updated data from server
- setTimeout(function() {
- t.select(i);
- }, 10);
- }
- })
- .fail(function(xhr, status, error) {
- Alertify.pgRespErrorNotify(xhr, error);
- t.unload(i);
- });
+ });
}},
function() {}
);
@@ -237,25 +237,25 @@ function(
url: obj.generate_url(i, 'reset' , d, true),
type:'DELETE',
})
- .done(function(res) {
- if (res.success == 1) {
- Alertify.success(res.info);
- t.removeIcon(i);
- data.icon = 'icon-partition';
- t.addIcon(i, {icon: data.icon});
+ .done(function(res) {
+ if (res.success == 1) {
+ Alertify.success(res.info);
+ t.removeIcon(i);
+ data.icon = 'icon-partition';
+ t.addIcon(i, {icon: data.icon});
+ t.unload(i);
+ t.setInode(i);
+ t.deselect(i);
+ // Fetch updated data from server
+ setTimeout(function() {
+ t.select(i);
+ }, 10);
+ }
+ })
+ .fail(function(xhr, status, error) {
+ Alertify.pgRespErrorNotify(xhr, error);
t.unload(i);
- t.setInode(i);
- t.deselect(i);
- // Fetch updated data from server
- setTimeout(function() {
- t.select(i);
- }, 10);
- }
- })
- .fail(function(xhr, status, error) {
- Alertify.pgRespErrorNotify(xhr, error);
- t.unload(i);
- });
+ });
}
},
function() {}
@@ -280,26 +280,26 @@ function(
url: obj.generate_url(i, 'detach' , d, true),
type:'PUT',
})
- .done(function(res) {
- if (res.success == 1) {
- Alertify.success(res.info);
- var n = t.next(i);
- if (!n || !n.length) {
- n = t.prev(i);
+ .done(function(res) {
+ if (res.success == 1) {
+ Alertify.success(res.info);
+ var n = t.next(i);
if (!n || !n.length) {
- n = t.parent(i);
- t.setInode(n, true);
+ n = t.prev(i);
+ if (!n || !n.length) {
+ n = t.parent(i);
+ t.setInode(n, true);
+ }
+ }
+ t.remove(i);
+ if (n.length) {
+ t.select(n);
}
}
- t.remove(i);
- if (n.length) {
- t.select(n);
- }
- }
- })
- .fail(function(xhr, status, error) {
- Alertify.pgRespErrorNotify(xhr, error);
- });
+ })
+ .fail(function(xhr, status, error) {
+ Alertify.pgRespErrorNotify(xhr, error);
+ });
}
},
function() {}
@@ -343,8 +343,8 @@ function(
initialize: function(attrs, args) {
if (_.size(attrs) === 0) {
var userInfo = pgBrowser.serverInfo[
- args.node_info.server._id
- ].user,
+ args.node_info.server._id
+ ].user,
schemaInfo = args.node_info.schema;
this.set({
@@ -486,11 +486,11 @@ function(
if (primary_key_column_exist.length == 0) {
var primary_key_column = new (primary_key_column_coll.model)(
- {column: column_name}, { silent: true,
- top: self.model,
- collection: primary_key_coll,
- handler: primary_key_coll,
- });
+ {column: column_name}, { silent: true,
+ top: self.model,
+ collection: primary_key_coll,
+ handler: primary_key_coll,
+ });
primary_key_column_coll.add(primary_key_column);
}
@@ -574,7 +574,7 @@ function(
return true;
},
canAddRow: function(m) {
- // User can only add one primary key
+ // User can only add one primary key
var columns = m.get('columns');
return (m.get('primary_key') &&
@@ -602,7 +602,7 @@ function(
},
columns : ['name', 'columns'],
canAddRow: function(m) {
- // User can only add if there is at least one column with name.
+ // User can only add if there is at least one column with name.
var columns = m.get('columns');
return _.some(columns.pluck('name'));
},
@@ -637,7 +637,7 @@ function(
return true;
},
canAddRow: function(m) {
- // User can only add if there is at least one column with name.
+ // User can only add if there is at least one column with name.
var columns = m.get('columns');
return _.some(columns.pluck('name'));
},
@@ -662,7 +662,7 @@ function(
return true;
},
canAddRow: function(m) {
- // User can only add if there is at least one column with name.
+ // User can only add if there is at least one column with name.
var columns = m.get('columns');
return _.some(columns.pluck('name'));
},
@@ -679,7 +679,7 @@ function(
return data;
},
control: Backform.NodeAjaxOptionsControl.extend({
- // When of_types changes we need to clear columns collection
+ // When of_types changes we need to clear columns collection
onChange: function() {
Backform.NodeAjaxOptionsControl.prototype.onChange.apply(this, arguments);
var self = this,
@@ -693,7 +693,7 @@ function(
var msg = gettext('Changing of table type will clear columns collection.');
Alertify.confirm(msg, function (e) {
if (e) {
- // User clicks Ok, lets clear columns collection
+ // User clicks Ok, lets clear columns collection
column_collection.reset();
} else {
return this;
@@ -703,11 +703,11 @@ function(
column_collection.reset();
}
- // Run Ajax now to fetch columns
+ // Run Ajax now to fetch columns
if (!_.isUndefined(tbl_name) && tbl_name !== '') {
arg = { 'tname': tbl_name };
data = self.model.fetch_columns_ajax.apply(self, [arg]);
- // Add into column collection
+ // Add into column collection
column_collection.set(data, { merge:false,remove:false });
}
},
@@ -878,27 +878,27 @@ function(
// Make ajax call to get the tables to be attached
$.ajax({
url: node.generate_url.apply(
- node, [
- null, 'get_attach_tables', this.field.get('node_data'),
- true, node_info,
- ]),
+ node, [
+ null, 'get_attach_tables', this.field.get('node_data'),
+ true, node_info,
+ ]),
type: 'GET',
async: false,
})
- .done(function(res) {
- if (res.success == 1) {
- self.model.table_options = res.data;
- }
- else {
- Alertify.alert(
- gettext('Error fetching tables to be attached'), res.data.result
- );
- }
- })
- .fail(function(xhr, status, error) {
- Alertify.pgRespErrorNotify(xhr, error, gettext('Error fetching tables to be attached'));
- });
+ .done(function(res) {
+ if (res.success == 1) {
+ self.model.table_options = res.data;
+ }
+ else {
+ Alertify.alert(
+ gettext('Error fetching tables to be attached'), res.data.result
+ );
+ }
+ })
+ .fail(function(xhr, status, error) {
+ Alertify.pgRespErrorNotify(xhr, error, gettext('Error fetching tables to be attached'));
+ });
}
},
}
@@ -1143,11 +1143,11 @@ function(
node = this.field.get('schema_node'),
node_info = this.field.get('node_info'),
full_url = node.generate_url.apply(
- node, [
- null, url, this.field.get('node_data'),
- this.field.get('url_with_id') || false, node_info,
- ]
- ),
+ node, [
+ null, url, this.field.get('node_data'),
+ this.field.get('url_with_id') || false, node_info,
+ ]
+ ),
cache_level = this.field.get('cache_level') || node.type,
cache_node = this.field.get('cache_node');
@@ -1160,12 +1160,12 @@ function(
url: full_url,
data: arg,
})
- .done(function(res) {
- data = cache_node.cache(url, node_info, cache_level, res.data);
- })
- .fail(function() {
- m.trigger('pgadmin:view:fetch:error', m, self.field);
- });
+ .done(function(res) {
+ data = cache_node.cache(url, node_info, cache_level, res.data);
+ })
+ .fail(function() {
+ m.trigger('pgadmin:view:fetch:error', m, self.field);
+ });
m.trigger('pgadmin:view:fetched', m, self.field);
data = (data && data.data) || [];
return data;
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/static/js/partition.utils.js b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/static/js/partition.utils.js
index fc7a4db1..56855611 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/static/js/partition.utils.js
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/static/js/partition.utils.js
@@ -97,12 +97,12 @@ define('pgadmin.node.table_partition_utils', [
return _.isObject(res) && !_.isArray(res) ? null : res;
},
initialize: function() {
- // Here we will decide if we need to call URL
- // Or fetch the data from parent columns collection
+ // Here we will decide if we need to call URL
+ // Or fetch the data from parent columns collection
var self = this;
if(this.model.handler) {
Backgrid.Extension.Select2DepCell.prototype.initialize.apply(this, arguments);
- // Do not listen for any event(s) for existing constraint.
+ // Do not listen for any event(s) for existing constraint.
if (_.isUndefined(self.model.get('oid'))) {
var tableCols = self.model.top.get('columns');
self.listenTo(tableCols, 'remove' , self.resetColOptions);
@@ -121,7 +121,7 @@ define('pgadmin.node.table_partition_utils', [
}, 50);
},
custom_options: function() {
- // We will add all the columns entered by user in table model
+ // We will add all the columns entered by user in table model
var columns = this.model.top.get('columns'),
typename = this.model.top.get('typname'),
of_types_tables = this.model.top.of_types_tables,
@@ -132,26 +132,26 @@ define('pgadmin.node.table_partition_utils', [
var col = m.get('name');
if(!_.isUndefined(col) && !_.isNull(col)) {
added_columns_from_tables.push(
- {label: col, value: col, image:'icon-column'}
- );
+ {label: col, value: col, image:'icon-column'}
+ );
}
});
} else if (!_.isUndefined(typename) && !_.isNull(typename)
&& !_.isUndefined(of_types_tables) && of_types_tables.length > 0) {
- // Iterate through all the of_type tables
+ // Iterate through all the of_type tables
_.each(of_types_tables, function(type) {
if (type.label == typename) {
- // Iterate all the columns of selected "OF TYPE".
+ // Iterate all the columns of selected "OF TYPE".
_.each(type.oftype_columns, function(col) {
added_columns_from_tables.push(
- {label: col.name, value: col.name, image:'icon-column'}
- );
+ {label: col.name, value: col.name, image:'icon-column'}
+ );
});
}
});
}
- // Set the values in to options so that user can select
+ // Set the values in to options so that user can select
this.column.set('options', added_columns_from_tables);
},
remove: function() {
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/static/js/table.js b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/static/js/table.js
index 4b4c1142..6653edd4 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/static/js/table.js
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/static/js/table.js
@@ -175,25 +175,25 @@ define('pgadmin.node.table', [
data: params,
dataType: 'json',
})
- .done(function(res) {
- if (res.success == 1) {
- Alertify.success(res.info);
- t.removeIcon(i);
- data.icon = data.is_partitioned ? 'icon-partition': 'icon-table';
- t.addIcon(i, {icon: data.icon});
+ .done(function(res) {
+ if (res.success == 1) {
+ Alertify.success(res.info);
+ t.removeIcon(i);
+ data.icon = data.is_partitioned ? 'icon-partition': 'icon-table';
+ t.addIcon(i, {icon: data.icon});
+ t.unload(i);
+ t.setInode(i);
+ t.deselect(i);
+ // Fetch updated data from server
+ setTimeout(function() {
+ t.select(i);
+ }, 10);
+ }
+ })
+ .fail(function(xhr, status, error) {
+ Alertify.pgRespErrorNotify(xhr, error);
t.unload(i);
- t.setInode(i);
- t.deselect(i);
- // Fetch updated data from server
- setTimeout(function() {
- t.select(i);
- }, 10);
- }
- })
- .fail(function(xhr, status, error) {
- Alertify.pgRespErrorNotify(xhr, error);
- t.unload(i);
- });
+ });
}
}, function() {}
);
@@ -218,25 +218,25 @@ define('pgadmin.node.table', [
url: obj.generate_url(i, 'reset' , d, true),
type:'DELETE',
})
- .done(function(res) {
- if (res.success == 1) {
- Alertify.success(res.info);
- t.removeIcon(i);
- data.icon = data.is_partitioned ? 'icon-partition': 'icon-table';
- t.addIcon(i, {icon: data.icon});
+ .done(function(res) {
+ if (res.success == 1) {
+ Alertify.success(res.info);
+ t.removeIcon(i);
+ data.icon = data.is_partitioned ? 'icon-partition': 'icon-table';
+ t.addIcon(i, {icon: data.icon});
+ t.unload(i);
+ t.setInode(i);
+ t.deselect(i);
+ // Fetch updated data from server
+ setTimeout(function() {
+ t.select(i);
+ }, 10);
+ }
+ })
+ .fail(function(xhr, status, error) {
+ Alertify.pgRespErrorNotify(xhr, error);
t.unload(i);
- t.setInode(i);
- t.deselect(i);
- // Fetch updated data from server
- setTimeout(function() {
- t.select(i);
- }, 10);
- }
- })
- .fail(function(xhr, status, error) {
- Alertify.pgRespErrorNotify(xhr, error);
- t.unload(i);
- });
+ });
}
},
function() {}
@@ -256,20 +256,20 @@ define('pgadmin.node.table', [
url: obj.generate_url(i, 'count_rows' , d, true),
type:'GET',
})
- .done(function(res) {
- Alertify.success(res.info);
- d.rows_cnt = res.data.total_rows;
- t.unload(i);
- t.setInode(i);
- t.deselect(i);
- setTimeout(function() {
- t.select(i);
- }, 10);
- })
- .fail(function(xhr, status, error) {
- Alertify.pgRespErrorNotify(xhr, error);
- t.unload(i);
- });
+ .done(function(res) {
+ Alertify.success(res.info);
+ d.rows_cnt = res.data.total_rows;
+ t.unload(i);
+ t.setInode(i);
+ t.deselect(i);
+ setTimeout(function() {
+ t.select(i);
+ }, 10);
+ })
+ .fail(function(xhr, status, error) {
+ Alertify.pgRespErrorNotify(xhr, error);
+ t.unload(i);
+ });
},
},
model: pgBrowser.Node.Model.extend({
@@ -309,8 +309,8 @@ define('pgadmin.node.table', [
initialize: function(attrs, args) {
if (_.size(attrs) === 0) {
var userInfo = pgBrowser.serverInfo[
- args.node_info.server._id
- ].user,
+ args.node_info.server._id
+ ].user,
schemaInfo = args.node_info.schema;
this.set({
@@ -739,22 +739,22 @@ define('pgadmin.node.table', [
msg = gettext('Changing \'Of type\' will remove column definitions.');
Alertify.confirm(
- title, msg, function () {
- // User clicks Ok, lets clear columns collection
- column_collection.remove(
- column_collection.filter(function() { return true; })
- );
- },
- function() {
- setTimeout(function() {
- self.model.set('typname', null);
- }, 10);
- }
- );
+ title, msg, function () {
+ // User clicks Ok, lets clear columns collection
+ column_collection.remove(
+ column_collection.filter(function() { return true; })
+ );
+ },
+ function() {
+ setTimeout(function() {
+ self.model.set('typname', null);
+ }, 10);
+ }
+ );
} else if (!_.isUndefined(tbl_name) && tbl_name === '') {
column_collection.remove(
- column_collection.filter(function() { return true; })
- );
+ column_collection.filter(function() { return true; })
+ );
}
// Run Ajax now to fetch columns
@@ -903,7 +903,7 @@ define('pgadmin.node.table', [
if (m.get('partition_type') && m.get('partition_type') == 'list')
max_row_count = 1;
- /* If columns are not specified by the user then it may be
+ /* If columns are not specified by the user then it may be
* possible that he/she selected 'OF TYPE', so we should check
* for that as well.
*/
@@ -1011,19 +1011,19 @@ define('pgadmin.node.table', [
type: 'GET',
async: false,
})
- .done(function(res) {
- if (res.success == 1) {
- self.model.table_options = res.data;
- }
- else {
- Alertify.alert(
- gettext('Error fetching tables to be attached'), res.data.result
- );
- }
- })
- .fail(function(xhr, status, error) {
- Alertify.pgRespErrorNotify(xhr, error);
- });
+ .done(function(res) {
+ if (res.success == 1) {
+ self.model.table_options = res.data;
+ }
+ else {
+ Alertify.alert(
+ gettext('Error fetching tables to be attached'), res.data.result
+ );
+ }
+ })
+ .fail(function(xhr, status, error) {
+ Alertify.pgRespErrorNotify(xhr, error);
+ });
}
},
}
@@ -1291,12 +1291,12 @@ define('pgadmin.node.table', [
url: full_url,
data: arg,
})
- .done(function(res) {
- data = cache_node.cache(url, node_info, cache_level, res.data);
- })
- .fail(function() {
- m.trigger('pgadmin:view:fetch:error', m, self.field);
- });
+ .done(function(res) {
+ data = cache_node.cache(url, node_info, cache_level, res.data);
+ })
+ .fail(function() {
+ m.trigger('pgadmin:view:fetch:error', m, self.field);
+ });
m.trigger('pgadmin:view:fetched', m, self.field);
data = (data && data.data) || [];
return data;
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/static/js/trigger.js b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/static/js/trigger.js
index 531e3911..44d530a3 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/static/js/trigger.js
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/static/js/trigger.js
@@ -111,25 +111,25 @@ define('pgadmin.node.trigger', [
data: {'enable' : true},
dataType: 'json',
})
- .done(function(res) {
- if (res.success == 1) {
- alertify.success(res.info);
- t.removeIcon(i);
- data.icon = 'icon-trigger';
- t.addIcon(i, {icon: data.icon});
+ .done(function(res) {
+ if (res.success == 1) {
+ alertify.success(res.info);
+ t.removeIcon(i);
+ data.icon = 'icon-trigger';
+ t.addIcon(i, {icon: data.icon});
+ t.unload(i);
+ t.setInode(false);
+ t.deselect(i);
+ // Fetch updated data from server
+ setTimeout(function() {
+ t.select(i);
+ }, 10);
+ }
+ })
+ .fail(function(xhr, status, error) {
+ alertify.pgRespErrorNotify(xhr, error);
t.unload(i);
- t.setInode(false);
- t.deselect(i);
- // Fetch updated data from server
- setTimeout(function() {
- t.select(i);
- }, 10);
- }
- })
- .fail(function(xhr, status, error) {
- alertify.pgRespErrorNotify(xhr, error);
- t.unload(i);
- });
+ });
},
/* Disable trigger */
disable_trigger: function(args) {
@@ -149,25 +149,25 @@ define('pgadmin.node.trigger', [
data: {'enable' : false},
dataType: 'json',
})
- .done(function(res) {
- if (res.success == 1) {
- alertify.success(res.info);
- t.removeIcon(i);
- data.icon = 'icon-trigger-bad';
- t.addIcon(i, {icon: data.icon});
+ .done(function(res) {
+ if (res.success == 1) {
+ alertify.success(res.info);
+ t.removeIcon(i);
+ data.icon = 'icon-trigger-bad';
+ t.addIcon(i, {icon: data.icon});
+ t.unload(i);
+ t.setInode(false);
+ t.deselect(i);
+ // Fetch updated data from server
+ setTimeout(function() {
+ t.select(i);
+ }, 10);
+ }
+ })
+ .fail(function(xhr, status, error) {
+ alertify.pgRespErrorNotify(xhr, error, gettext('Disable trigger failed'));
t.unload(i);
- t.setInode(false);
- t.deselect(i);
- // Fetch updated data from server
- setTimeout(function() {
- t.select(i);
- }, 10);
- }
- })
- .fail(function(xhr, status, error) {
- alertify.pgRespErrorNotify(xhr, error, gettext('Disable trigger failed'));
- t.unload(i);
- });
+ });
},
},
canDrop: SchemaChildTreeNode.isTreeItemOfChildOfSchema,
@@ -199,7 +199,7 @@ define('pgadmin.node.trigger', [
if (_.has(m, 'node_info') && _.has(m.node_info, 'table') &&
_.has(m.node_info.table, 'is_partitioned') &&
m.node_info.table.is_partitioned && m.node_info.server.version < 110000
- )
+ )
{
setTimeout(function(){
m.set('is_row_trigger', false);
@@ -214,7 +214,7 @@ define('pgadmin.node.trigger', [
if(!m.inSchemaWithModelCheck.apply(this, [m])) {
if(!_.isUndefined(is_constraint_trigger) &&
is_constraint_trigger === true) {
- // change it's model value
+ // change it's model value
setTimeout(function() { m.set('is_row_trigger', true); }, 10);
return true;
} else {
@@ -263,7 +263,7 @@ define('pgadmin.node.trigger', [
is_constraint_trigger === true) {
return false;
} else {
- // If value is already set then reset it to false
+ // If value is already set then reset it to false
if(m.get('tgdeferrable')) {
setTimeout(function() { m.set('tgdeferrable', false); }, 10);
}
@@ -287,11 +287,11 @@ define('pgadmin.node.trigger', [
tgdeferrable) {
return false;
} else {
- // If value is already set then reset it to false
+ // If value is already set then reset it to false
if(m.get('tginitdeferred')) {
setTimeout(function() { m.set('tginitdeferred', false); }, 10);
}
- // If constraint trigger is set then do not disable
+ // If constraint trigger is set then do not disable
return m.get('is_constraint_trigger') ? false : true;
}
} else {
@@ -318,7 +318,7 @@ define('pgadmin.node.trigger', [
if(server_type === 'ppas' &&
!_.isUndefined(tfunction) &&
tfunction === 'Inline EDB-SPL') {
- // Disable and clear its value
+ // Disable and clear its value
m.set('tgargs', undefined);
return true;
} else {
@@ -334,8 +334,8 @@ define('pgadmin.node.trigger', [
mode: ['create','edit', 'properties'], group: gettext('Events'),
options: function(control) {
var table_options = [
- {label: 'BEFORE', value: 'BEFORE'},
- {label: 'AFTER', value: 'AFTER'}],
+ {label: 'BEFORE', value: 'BEFORE'},
+ {label: 'AFTER', value: 'AFTER'}],
view_options = [
{label: 'BEFORE', value: 'BEFORE'},
{label: 'AFTER', value: 'AFTER'},
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/types/static/js/type.js b/web/pgadmin/browser/server_groups/servers/databases/schemas/types/static/js/type.js
index 535296af..21ef722c 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/types/static/js/type.js
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/types/static/js/type.js
@@ -435,12 +435,12 @@ define('pgadmin.node.type', [
cache: false,
data: {'typname' : l_typname},
})
- .done(function(res) {
- result = res.data;
- })
- .fail(function() {
- self.model.trigger('pgadmin:view:fetch:error', self.model, self.field);
- });
+ .done(function(res) {
+ result = res.data;
+ })
+ .fail(function() {
+ self.model.trigger('pgadmin:view:fetch:error', self.model, self.field);
+ });
//
}
return result;
@@ -503,13 +503,13 @@ define('pgadmin.node.type', [
cache: false,
data: {'name' : name},
})
- .done(function(res) {
- result = res.data;
- })
- .fail(function() {
- self.model.trigger('pgadmin:view:fetch:error',
- self.model, self.field);
- });
+ .done(function(res) {
+ result = res.data;
+ })
+ .fail(function() {
+ self.model.trigger('pgadmin:view:fetch:error',
+ self.model, self.field);
+ });
}
return result;
},
@@ -528,24 +528,24 @@ define('pgadmin.node.type', [
!_.isUndefined(l_opcname) && l_opcname != '') {
var node = this.field.get('schema_node'),
_url = node.generate_url.apply(
- node, [
- null, 'get_stypediff',
- this.field.get('node_data'), false,
- this.field.get('node_info'),
- ]);
+ node, [
+ null, 'get_stypediff',
+ this.field.get('node_data'), false,
+ this.field.get('node_info'),
+ ]);
$.ajax({
async: false,
url: _url,
cache: false,
data: {'typname' : l_typname, 'opcname': l_opcname},
})
- .done(function(res) {
- result = res.data;
- })
- .fail(function() {
- self.model.trigger('pgadmin:view:fetch:error',
+ .done(function(res) {
+ result = res.data;
+ })
+ .fail(function() {
+ self.model.trigger('pgadmin:view:fetch:error',
self.model, self.field);
- });
+ });
}
return result;
},
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/static/js/mview.js b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/static/js/mview.js
index a9581277..1be5efc8 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/static/js/mview.js
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/static/js/mview.js
@@ -267,20 +267,20 @@ define('pgadmin.node.mview', [
data: {'concurrent': args.concurrent, 'with_data': args.with_data},
dataType: 'json',
})
- .done(function(res) {
- if (res.success == 1) {
- Alertify.success(gettext('View refreshed successfully'));
- }
- else {
- Alertify.alert(
- gettext('Error refreshing view'),
+ .done(function(res) {
+ if (res.success == 1) {
+ Alertify.success(gettext('View refreshed successfully'));
+ }
+ else {
+ Alertify.alert(
+ gettext('Error refreshing view'),
res.data.result
- );
- }
- })
- .fail(function(xhr, status, error) {
- Alertify.pgRespErrorNotify(xhr, error, gettext('Error refreshing view'));
- });
+ );
+ }
+ })
+ .fail(function(xhr, status, error) {
+ Alertify.pgRespErrorNotify(xhr, error, gettext('Error refreshing view'));
+ });
},
is_version_supported: function(data, item) {
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/static/js/view.js b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/static/js/view.js
index 8303ac66..2bce5567 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/static/js/view.js
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/static/js/view.js
@@ -62,7 +62,7 @@ define('pgadmin.node.view', [
this.initialized = true;
- /**
+ /**
Add "create view" menu option into context and object menu
for the following nodes:
coll-view, view and schema.
diff --git a/web/pgadmin/browser/server_groups/servers/databases/static/js/database.js b/web/pgadmin/browser/server_groups/servers/databases/static/js/database.js
index eea416e8..2f719de3 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/static/js/database.js
+++ b/web/pgadmin/browser/server_groups/servers/databases/static/js/database.js
@@ -197,33 +197,33 @@ define('pgadmin.node.database', [
url: obj.generate_url(i, 'connect', d, true),
type:'DELETE',
})
- .done(function(res) {
- if (res.success == 1) {
- var prv_i = t.parent(i);
- Alertify.success(res.info);
- t.removeIcon(i);
- data.connected = false;
- data.icon = 'icon-database-not-connected';
- t.addIcon(i, {icon: data.icon});
- t.unload(i);
- t.setInode(i);
- setTimeout(function() {
- t.select(prv_i);
- }, 10);
-
- } else {
- try {
- Alertify.error(res.errormsg);
- } catch (e) {
- console.warn(e.stack || e);
+ .done(function(res) {
+ if (res.success == 1) {
+ var prv_i = t.parent(i);
+ Alertify.success(res.info);
+ t.removeIcon(i);
+ data.connected = false;
+ data.icon = 'icon-database-not-connected';
+ t.addIcon(i, {icon: data.icon});
+ t.unload(i);
+ t.setInode(i);
+ setTimeout(function() {
+ t.select(prv_i);
+ }, 10);
+
+ } else {
+ try {
+ Alertify.error(res.errormsg);
+ } catch (e) {
+ console.warn(e.stack || e);
+ }
+ t.unload(i);
}
+ })
+ .fail(function(xhr, status, error) {
+ Alertify.pgRespErrorNotify(xhr, error);
t.unload(i);
- }
- })
- .fail(function(xhr, status, error) {
- Alertify.pgRespErrorNotify(xhr, error);
- t.unload(i);
- });
+ });
},
function() { return true; });
diff --git a/web/pgadmin/browser/server_groups/servers/pgagent/static/js/pga_job.js b/web/pgadmin/browser/server_groups/servers/pgagent/static/js/pga_job.js
index 98dfaf55..8cc7a91a 100644
--- a/web/pgadmin/browser/server_groups/servers/pgagent/static/js/pga_job.js
+++ b/web/pgadmin/browser/server_groups/servers/pgagent/static/js/pga_job.js
@@ -186,11 +186,11 @@ define('pgadmin.node.pga_job', [
})
// 'pgagent.pga_job' table updated with current time to run the job
// now.
- .done(function() { t.unload(i); })
- .fail(function(xhr, status, error) {
- alertify.pgRespErrorNotify(xhr, error);
- t.unload(i);
- });
+ .done(function() { t.unload(i); })
+ .fail(function(xhr, status, error) {
+ alertify.pgRespErrorNotify(xhr, error);
+ t.unload(i);
+ });
return false;
},
diff --git a/web/pgadmin/browser/server_groups/servers/roles/static/js/role.js b/web/pgadmin/browser/server_groups/servers/roles/static/js/role.js
index b62b625b..94aad6d1 100644
--- a/web/pgadmin/browser/server_groups/servers/roles/static/js/role.js
+++ b/web/pgadmin/browser/server_groups/servers/roles/static/js/role.js
@@ -209,11 +209,11 @@ define('pgadmin.node.role', [
return opt.text;
} else {
var d = _.extend(
- {}, data, {
- 'opttext': _.escape(opt.text),
- 'optimage': optimage,
- 'checkbox': true,
- }),
+ {}, data, {
+ 'opttext': _.escape(opt.text),
+ 'optimage': optimage,
+ 'checkbox': true,
+ }),
j = $(self.selectionTemplate(d));
// Update the checkbox lazy
@@ -255,7 +255,7 @@ define('pgadmin.node.role', [
this.stopListening(this.model, 'change:' + name, this.render);
- /*
+ /*
* Iterate through all the values, and find out how many are already
* present in the collection.
*/
@@ -270,14 +270,14 @@ define('pgadmin.node.role', [
}
});
- /*
+ /*
* Adding new values
*/
_.each(vals, function(v) {
collection.add({role: v});
});
- /*
+ /*
* Removing unwanted!
*/
_.each(removed, function(v) {
diff --git a/web/pgadmin/browser/server_groups/servers/static/js/privilege.js b/web/pgadmin/browser/server_groups/servers/static/js/privilege.js
index 5476cf8f..2726ef2d 100644
--- a/web/pgadmin/browser/server_groups/servers/static/js/privilege.js
+++ b/web/pgadmin/browser/server_groups/servers/static/js/privilege.js
@@ -133,8 +133,8 @@ define(['sources/gettext', 'underscore', 'jquery', 'backbone', 'backform',
// it is not loaded yet
node_info = (_.has(model.top, 'node_info')
&& !_.isUndefined(model.top.node_info)) ?
- model.top.node_info :
- model.handler.top.node_info,
+ model.top.node_info :
+ model.handler.top.node_info,
curr_user = node_info.server.user.name;
model.collection.each(function(m) {
@@ -282,11 +282,11 @@ define(['sources/gettext', 'underscore', 'jquery', 'backbone', 'backform',
this.attributes['privileges']) {
var anyPrivSelected = false;
this.attributes['privileges'].each(
- function(p) {
- if (p.get('privilege')) {
- anyPrivSelected = true;
- }
- });
+ function(p) {
+ if (p.get('privilege')) {
+ anyPrivSelected = true;
+ }
+ });
if (!anyPrivSelected) {
msg = gettext('At least one privilege should be selected.');
@@ -473,7 +473,7 @@ define(['sources/gettext', 'underscore', 'jquery', 'backbone', 'backform',
*/
$allPrivileges.prop('checked', false);
$elGrant.prop('checked', false),
- $allGrants.prop('checked', false);
+ $allGrants.prop('checked', false);
$elGrant.prop('disabled', true);
$allGrants.prop('disabled', true);
}
@@ -546,8 +546,8 @@ define(['sources/gettext', 'underscore', 'jquery', 'backbone', 'backform',
if (type == 'with_grant') {
$allGrants = $tbl.find(
- 'input[name=with_grant][privilege!=\'ALL\']:checked'
- );
+ 'input[name=with_grant][privilege!=\'ALL\']:checked'
+ );
if ($allGrants.length == collection.models.length) {
$allGrants.prop('disabled', false);
$allGrants.prop('checked', true);
@@ -616,7 +616,7 @@ define(['sources/gettext', 'underscore', 'jquery', 'backbone', 'backform',
coll = this.model.get(this.column.get('name'));
if (command.moveUp() || command.moveDown() || command.save()) {
- // backgrid vertical navigation (Up/Down arrow key)
+ // backgrid vertical navigation (Up/Down arrow key)
ev.preventDefault();
ev.stopPropagation();
model.trigger('backgrid:edited', model, column, command);
@@ -752,7 +752,7 @@ define(['sources/gettext', 'underscore', 'jquery', 'backbone', 'backform',
e.stopPropagation();
model.trigger('backgrid:edited', model, column, command);
}
- // esc
+ // esc
else if (command.cancel()) {
// undo
e.stopPropagation();
diff --git a/web/pgadmin/browser/server_groups/servers/static/js/server.js b/web/pgadmin/browser/server_groups/servers/static/js/server.js
index 3efc27a0..af4cf642 100644
--- a/web/pgadmin/browser/server_groups/servers/static/js/server.js
+++ b/web/pgadmin/browser/server_groups/servers/static/js/server.js
@@ -223,38 +223,38 @@ define('pgadmin.node.server', [
url: obj.generate_url(i, 'connect', d, true),
type:'DELETE',
})
- .done(function(res) {
- if (res.success == 1) {
- Alertify.success(res.info);
- d = t.itemData(i);
- t.removeIcon(i);
- d.connected = false;
- d.icon = 'icon-server-not-connected';
- t.addIcon(i, {icon: d.icon});
- obj.callbacks.refresh.apply(obj, [null, i]);
- if (pgBrowser.serverInfo && d._id in pgBrowser.serverInfo) {
- delete pgBrowser.serverInfo[d._id];
+ .done(function(res) {
+ if (res.success == 1) {
+ Alertify.success(res.info);
+ d = t.itemData(i);
+ t.removeIcon(i);
+ d.connected = false;
+ d.icon = 'icon-server-not-connected';
+ t.addIcon(i, {icon: d.icon});
+ obj.callbacks.refresh.apply(obj, [null, i]);
+ if (pgBrowser.serverInfo && d._id in pgBrowser.serverInfo) {
+ delete pgBrowser.serverInfo[d._id];
+ }
+ pgBrowser.enable_disable_menus(i);
+ // Trigger server disconnect event
+ pgBrowser.Events.trigger(
+ 'pgadmin:server:disconnect',
+ {item: i, data: d}, false
+ );
}
- pgBrowser.enable_disable_menus(i);
- // Trigger server disconnect event
- pgBrowser.Events.trigger(
- 'pgadmin:server:disconnect',
- {item: i, data: d}, false
- );
- }
- else {
- try {
- Alertify.error(res.errormsg);
- } catch (e) {
- console.warn(e.stack || e);
+ else {
+ try {
+ Alertify.error(res.errormsg);
+ } catch (e) {
+ console.warn(e.stack || e);
+ }
+ t.unload(i);
}
+ })
+ .fail(function(xhr, status, error) {
+ Alertify.pgRespErrorNotify(xhr, error);
t.unload(i);
- }
- })
- .fail(function(xhr, status, error) {
- Alertify.pgRespErrorNotify(xhr, error);
- t.unload(i);
- });
+ });
};
if (notify) {
@@ -318,18 +318,18 @@ define('pgadmin.node.server', [
url: obj.generate_url(i, 'reload', d, true),
method:'GET',
})
- .done(function(res) {
- if (res.data.status) {
- Alertify.success(res.data.result);
- }
- else {
- Alertify.error(res.data.result);
- }
- })
- .fail(function(xhr, status, error) {
- Alertify.pgRespErrorNotify(xhr, error);
- t.unload(i);
- });
+ .done(function(res) {
+ if (res.data.status) {
+ Alertify.success(res.data.result);
+ }
+ else {
+ Alertify.error(res.data.result);
+ }
+ })
+ .fail(function(xhr, status, error) {
+ Alertify.pgRespErrorNotify(xhr, error);
+ t.unload(i);
+ });
},
function() { return true; }
);
@@ -359,13 +359,13 @@ define('pgadmin.node.server', [
method:'POST',
data:{ 'value': JSON.stringify(value) },
})
- .done(function(res) {
- Alertify.success(res.data.result, 10);
- })
- .fail(function(xhr, status, error) {
- Alertify.pgRespErrorNotify(xhr, error);
- t.unload(i);
- });
+ .done(function(res) {
+ Alertify.success(res.data.result, 10);
+ })
+ .fail(function(xhr, status, error) {
+ Alertify.pgRespErrorNotify(xhr, error);
+ t.unload(i);
+ });
} else {
evt.cancel = true;
Alertify.error( gettext('Please enter a valid name.'), 10);
@@ -515,27 +515,27 @@ define('pgadmin.node.server', [
method:'POST',
data:{'data': JSON.stringify(args) },
})
- .done(function(res) {
- if (res.success) {
+ .done(function(res) {
+ if (res.success) {
// Notify user to update pgpass file
- if(is_pgpass_file_used) {
- Alertify.alert(
- gettext('Change Password'),
- gettext('Please make sure to disconnect the server'
+ if(is_pgpass_file_used) {
+ Alertify.alert(
+ gettext('Change Password'),
+ gettext('Please make sure to disconnect the server'
+ ' and update the new password in the pgpass file'
+ ' before performing any other operation')
- );
- }
+ );
+ }
- Alertify.success(res.info);
- self.close();
- } else {
- Alertify.error(res.errormsg);
- }
- })
- .fail(function(xhr, status, error) {
- Alertify.pgRespErrorNotify(xhr, error);
- });
+ Alertify.success(res.info);
+ self.close();
+ } else {
+ Alertify.error(res.errormsg);
+ }
+ })
+ .fail(function(xhr, status, error) {
+ Alertify.pgRespErrorNotify(xhr, error);
+ });
}
},
};
@@ -547,15 +547,15 @@ define('pgadmin.node.server', [
url: check_pgpass_url,
method:'GET',
})
- .done(function(res) {
- if (res.success && res.data.is_pgpass) {
- is_pgpass_file_used = true;
- }
- Alertify.changeServerPassword(d).resizeTo('40%','52%');
- })
- .fail(function(xhr, status, error) {
- Alertify.pgRespErrorNotify(xhr, error);
- });
+ .done(function(res) {
+ if (res.success && res.data.is_pgpass) {
+ is_pgpass_file_used = true;
+ }
+ Alertify.changeServerPassword(d).resizeTo('40%','52%');
+ })
+ .fail(function(xhr, status, error) {
+ Alertify.pgRespErrorNotify(xhr, error);
+ });
return false;
},
@@ -576,23 +576,23 @@ define('pgadmin.node.server', [
type:'DELETE',
dataType: 'json',
})
- .done(function(res) {
- if (res.success == 1) {
- Alertify.success(res.info);
- t.itemData(i).wal_pause=res.data.wal_pause;
+ .done(function(res) {
+ if (res.success == 1) {
+ Alertify.success(res.info);
+ t.itemData(i).wal_pause=res.data.wal_pause;
+ t.unload(i);
+ t.setInode(i);
+ t.deselect(i);
+ // Fetch updated data from server
+ setTimeout(function() {
+ t.select(i);
+ }, 10);
+ }
+ })
+ .fail(function(xhr, status, error) {
+ Alertify.pgRespErrorNotify(xhr, error);
t.unload(i);
- t.setInode(i);
- t.deselect(i);
- // Fetch updated data from server
- setTimeout(function() {
- t.select(i);
- }, 10);
- }
- })
- .fail(function(xhr, status, error) {
- Alertify.pgRespErrorNotify(xhr, error);
- t.unload(i);
- });
+ });
},
/* Resume WAL Replay */
@@ -611,23 +611,23 @@ define('pgadmin.node.server', [
type:'PUT',
dataType: 'json',
})
- .done(function(res) {
- if (res.success == 1) {
- Alertify.success(res.info);
- t.itemData(i).wal_pause=res.data.wal_pause;
+ .done(function(res) {
+ if (res.success == 1) {
+ Alertify.success(res.info);
+ t.itemData(i).wal_pause=res.data.wal_pause;
+ t.unload(i);
+ t.setInode(i);
+ t.deselect(i);
+ // Fetch updated data from server
+ setTimeout(function() {
+ t.select(i);
+ }, 10);
+ }
+ })
+ .fail(function(xhr, status, error) {
+ Alertify.pgRespErrorNotify(xhr, error);
t.unload(i);
- t.setInode(i);
- t.deselect(i);
- // Fetch updated data from server
- setTimeout(function() {
- t.select(i);
- }, 10);
- }
- })
- .fail(function(xhr, status, error) {
- Alertify.pgRespErrorNotify(xhr, error);
- t.unload(i);
- });
+ });
},
/* Cleat saved database server password */
@@ -651,18 +651,18 @@ define('pgadmin.node.server', [
url: obj.generate_url(i, 'clear_saved_password', d, true),
method:'PUT',
})
- .done(function(res) {
- if (res.success == 1) {
- Alertify.success(res.info);
- t.itemData(i).is_password_saved=res.data.is_password_saved;
- }
- else {
- Alertify.error(res.info);
- }
- })
- .fail(function(xhr, status, error) {
- Alertify.pgRespErrorNotify(xhr, error);
- });
+ .done(function(res) {
+ if (res.success == 1) {
+ Alertify.success(res.info);
+ t.itemData(i).is_password_saved=res.data.is_password_saved;
+ }
+ else {
+ Alertify.error(res.info);
+ }
+ })
+ .fail(function(xhr, status, error) {
+ Alertify.pgRespErrorNotify(xhr, error);
+ });
},
function() { return true; }
);
@@ -691,18 +691,18 @@ define('pgadmin.node.server', [
url: obj.generate_url(i, 'clear_sshtunnel_password', d, true),
method:'PUT',
})
- .done(function(res) {
- if (res.success == 1) {
- Alertify.success(res.info);
- t.itemData(i).is_tunnel_password_saved=res.data.is_tunnel_password_saved;
- }
- else {
- Alertify.error(res.info);
- }
- })
- .fail(function(xhr, status, error) {
- Alertify.pgRespErrorNotify(xhr, error);
- });
+ .done(function(res) {
+ if (res.success == 1) {
+ Alertify.success(res.info);
+ t.itemData(i).is_tunnel_password_saved=res.data.is_tunnel_password_saved;
+ }
+ else {
+ Alertify.error(res.info);
+ }
+ })
+ .fail(function(xhr, status, error) {
+ Alertify.pgRespErrorNotify(xhr, error);
+ });
},
function() { return true; }
);
@@ -1241,16 +1241,16 @@ define('pgadmin.node.server', [
url: _url,
data: $('#frmPassword').serialize(),
})
- .done(function(res) {
- return _onSuccess(
- res, _node, _data, _tree, _item, _status
- );
- })
- .fail(function(xhr, status, error) {
- return _onFailure(
- xhr, status, error, _node, _data, _tree, _item, _status
- );
- });
+ .done(function(res) {
+ return _onSuccess(
+ res, _node, _data, _tree, _item, _status
+ );
+ })
+ .fail(function(xhr, status, error) {
+ return _onFailure(
+ xhr, status, error, _node, _data, _tree, _item, _status
+ );
+ });
} else {
_onCancel && typeof(_onCancel) == 'function' &&
_onCancel(_tree, _item, _data, _status);
diff --git a/web/pgadmin/browser/server_groups/servers/static/js/variable.js b/web/pgadmin/browser/server_groups/servers/static/js/variable.js
index 4a831d6f..7c79fda9 100644
--- a/web/pgadmin/browser/server_groups/servers/static/js/variable.js
+++ b/web/pgadmin/browser/server_groups/servers/static/js/variable.js
@@ -11,214 +11,214 @@ define([
'sources/gettext', 'underscore', 'jquery', 'backbone', 'backform', 'backgrid', 'alertify',
'sources/pgadmin', 'pgadmin.browser.node', 'pgadmin.browser.node.ui',
],
- function(gettext, _, $, Backbone, Backform, Backgrid, Alertify, pgAdmin, pgNode) {
+function(gettext, _, $, Backbone, Backform, Backgrid, Alertify, pgAdmin, pgNode) {
- /*
+ /*
* cellFunction for variable control.
* This function returns cell class depending on vartype.
*/
- var cellFunction = function(model) {
- var self = this,
- name = model.get('name'),
- availVariables = {};
-
- self.collection.each(function(col) {
- if (col.get('name') == 'name') {
- availVariables = col.get('availVariables');
- }
- });
+ var cellFunction = function(model) {
+ var self = this,
+ name = model.get('name'),
+ availVariables = {};
+
+ self.collection.each(function(col) {
+ if (col.get('name') == 'name') {
+ availVariables = col.get('availVariables');
+ }
+ });
- var variable = name ? availVariables[name]: undefined,
- value = model.get('value');
+ var variable = name ? availVariables[name]: undefined,
+ value = model.get('value');
- switch(variable && variable.vartype) {
- case 'bool':
- /*
+ switch(variable && variable.vartype) {
+ case 'bool':
+ /*
* bool cell and variable cannot be stateless (i.e undefined).
* It should be either true or false.
*/
- model.set('value', !!model.get('value'), {silent: true});
-
- return Backgrid.Extension.SwitchCell;
- case 'enum':
- model.set({'value': value}, {silent:true});
- var options = [],
- enumVals = variable.enumvals;
-
- _.each(enumVals, function(enumVal) {
- options.push([enumVal, enumVal]);
- });
-
- return Backgrid.Extension.Select2Cell.extend({optionValues: options});
- case 'integer':
- if (!_.isNaN(parseInt(value))) {
- model.set({'value': parseInt(value)}, {silent:true});
- } else {
- model.set({'value': undefined}, {silent:true});
- }
- return Backgrid.IntegerCell;
- case 'real':
- if (!_.isNaN(parseFloat(value))) {
- model.set({'value': parseFloat(value)}, {silent:true});
- } else {
- model.set({'value': undefined}, {silent:true});
- }
- return Backgrid.NumberCell.extend({decimals: 0});
- case 'string':
- return Backgrid.StringCell;
- default:
+ model.set('value', !!model.get('value'), {silent: true});
+
+ return Backgrid.Extension.SwitchCell;
+ case 'enum':
+ model.set({'value': value}, {silent:true});
+ var options = [],
+ enumVals = variable.enumvals;
+
+ _.each(enumVals, function(enumVal) {
+ options.push([enumVal, enumVal]);
+ });
+
+ return Backgrid.Extension.Select2Cell.extend({optionValues: options});
+ case 'integer':
+ if (!_.isNaN(parseInt(value))) {
+ model.set({'value': parseInt(value)}, {silent:true});
+ } else {
model.set({'value': undefined}, {silent:true});
- return Backgrid.Cell;
}
- };
-
- /*
+ return Backgrid.IntegerCell;
+ case 'real':
+ if (!_.isNaN(parseFloat(value))) {
+ model.set({'value': parseFloat(value)}, {silent:true});
+ } else {
+ model.set({'value': undefined}, {silent:true});
+ }
+ return Backgrid.NumberCell.extend({decimals: 0});
+ case 'string':
+ return Backgrid.StringCell;
+ default:
+ model.set({'value': undefined}, {silent:true});
+ return Backgrid.Cell;
+ }
+ };
+
+ /*
* This row will define behaviour or value column cell depending upon
* variable name.
*/
- var VariableRow = Backgrid.Row.extend({
- modelDuplicateClass: 'bg-model-duplicate',
-
- initialize: function () {
- Backgrid.Row.prototype.initialize.apply(this, arguments);
- var self = this;
- self.model.on('change:name', function() {
- setTimeout(function() {
- self.columns.each(function(col) {
- if (col.get('name') == 'value') {
-
- var idx = self.columns.indexOf(col),
- cf = col.get('cellFunction'),
- cell = new (cf.apply(col, [self.model]))({
- column: col,
- model: self.model,
- }),
- oldCell = self.cells[idx];
- oldCell.remove();
- self.cells[idx] = cell;
- self.render();
- }
+ var VariableRow = Backgrid.Row.extend({
+ modelDuplicateClass: 'bg-model-duplicate',
+
+ initialize: function () {
+ Backgrid.Row.prototype.initialize.apply(this, arguments);
+ var self = this;
+ self.model.on('change:name', function() {
+ setTimeout(function() {
+ self.columns.each(function(col) {
+ if (col.get('name') == 'value') {
+
+ var idx = self.columns.indexOf(col),
+ cf = col.get('cellFunction'),
+ cell = new (cf.apply(col, [self.model]))({
+ column: col,
+ model: self.model,
+ }),
+ oldCell = self.cells[idx];
+ oldCell.remove();
+ self.cells[idx] = cell;
+ self.render();
+ }
- });
- }, 10);
- });
- self.listenTo(self.model, 'pgadmin-session:model:duplicate', self.modelDuplicate);
- self.listenTo(self.model, 'pgadmin-session:model:unique', self.modelUnique);
- },
- modelDuplicate: function() {
- $(this.el).removeClass('new');
- $(this.el).addClass(this.modelDuplicateClass);
- },
- modelUnique: function() {
- $(this.el).removeClass(this.modelDuplicateClass);
- },
+ });
+ }, 10);
+ });
+ self.listenTo(self.model, 'pgadmin-session:model:duplicate', self.modelDuplicate);
+ self.listenTo(self.model, 'pgadmin-session:model:unique', self.modelUnique);
+ },
+ modelDuplicate: function() {
+ $(this.el).removeClass('new');
+ $(this.el).addClass(this.modelDuplicateClass);
+ },
+ modelUnique: function() {
+ $(this.el).removeClass(this.modelDuplicateClass);
+ },
- });
- /**
+ });
+ /**
* VariableModel used to represent configuration parameters (variables tab)
* for database objects.
**/
- var VariableModel = pgNode.VariableModel = pgNode.Model.extend({
- keys: ['name'],
- defaults: {
- name: undefined,
- value: undefined,
- role: null,
- database: null,
- },
- schema: [
- {
- id: 'name', label: gettext('Name'), type:'text', cellHeaderClasses: 'width_percent_30',
- editable: function(m) {
- return (m instanceof Backbone.Collection) ? true : m.isNew();
- },
- cell: Backgrid.Extension.NodeAjaxOptionsCell.extend({
- initialize: function() {
- Backgrid.Extension.NodeAjaxOptionsCell.prototype.initialize.apply(this, arguments);
+ var VariableModel = pgNode.VariableModel = pgNode.Model.extend({
+ keys: ['name'],
+ defaults: {
+ name: undefined,
+ value: undefined,
+ role: null,
+ database: null,
+ },
+ schema: [
+ {
+ id: 'name', label: gettext('Name'), type:'text', cellHeaderClasses: 'width_percent_30',
+ editable: function(m) {
+ return (m instanceof Backbone.Collection) ? true : m.isNew();
+ },
+ cell: Backgrid.Extension.NodeAjaxOptionsCell.extend({
+ initialize: function() {
+ Backgrid.Extension.NodeAjaxOptionsCell.prototype.initialize.apply(this, arguments);
- // Immediately process options as we need them before render.
+ // Immediately process options as we need them before render.
- var opVals = _.clone(this.optionValues ||
+ var opVals = _.clone(this.optionValues ||
(_.isFunction(this.column.get('options')) ?
(this.column.get('options'))(this) :
- this.column.get('options')));
-
- this.column.set('options', opVals);
- },
- }),
- url: 'vopts',
- select2: { allowClear: false },
- transform: function(vars, cell) {
- var res = [],
- availVariables = {};
-
- _.each(vars, function(v) {
- res.push({
- 'value': v.name,
- 'image': undefined,
- 'label': v.name,
- });
- availVariables[v.name] = v;
- });
+ this.column.get('options')));
- cell.column.set('availVariables', availVariables);
- return res;
+ this.column.set('options', opVals);
},
+ }),
+ url: 'vopts',
+ select2: { allowClear: false },
+ transform: function(vars, cell) {
+ var res = [],
+ availVariables = {};
+
+ _.each(vars, function(v) {
+ res.push({
+ 'value': v.name,
+ 'image': undefined,
+ 'label': v.name,
+ });
+ availVariables[v.name] = v;
+ });
+
+ cell.column.set('availVariables', availVariables);
+ return res;
},
- {
- id: 'value', label: gettext('Value'), type: 'text', editable: true,
- cellFunction: cellFunction, cellHeaderClasses: 'width_percent_40',
- },
- {id: 'database', label: gettext('Database'), type: 'text', editable: true,
- node: 'database', cell: Backgrid.Extension.NodeListByNameCell,
- },
- {id: 'role', label: gettext('Role'), type: 'text', editable: true,
- node: 'role', cell: Backgrid.Extension.NodeListByNameCell},
- ],
- toJSON: function() {
- var d = Backbone.Model.prototype.toJSON.apply(this);
-
- // Remove not defined values from model values.
- // i.e.
- // role, database
- if (_.isUndefined(d.database) || _.isNull(d.database)) {
- delete d.database;
- }
-
- if (_.isUndefined(d.role) || _.isNull(d.role)) {
- delete d.role;
- }
-
- return d;
},
- validate: function() {
- var msg = null;
- if (_.isUndefined(this.get('name')) ||
+ {
+ id: 'value', label: gettext('Value'), type: 'text', editable: true,
+ cellFunction: cellFunction, cellHeaderClasses: 'width_percent_40',
+ },
+ {id: 'database', label: gettext('Database'), type: 'text', editable: true,
+ node: 'database', cell: Backgrid.Extension.NodeListByNameCell,
+ },
+ {id: 'role', label: gettext('Role'), type: 'text', editable: true,
+ node: 'role', cell: Backgrid.Extension.NodeListByNameCell},
+ ],
+ toJSON: function() {
+ var d = Backbone.Model.prototype.toJSON.apply(this);
+
+ // Remove not defined values from model values.
+ // i.e.
+ // role, database
+ if (_.isUndefined(d.database) || _.isNull(d.database)) {
+ delete d.database;
+ }
+
+ if (_.isUndefined(d.role) || _.isNull(d.role)) {
+ delete d.role;
+ }
+
+ return d;
+ },
+ validate: function() {
+ var msg = null;
+ if (_.isUndefined(this.get('name')) ||
_.isNull(this.get('name')) ||
String(this.get('name')).replace(/^\s+|\s+$/g, '') == '') {
- msg = gettext('Please select a parameter name.');
- this.errorModel.set('name', msg);
- } else if (_.isUndefined(this.get('value')) ||
+ msg = gettext('Please select a parameter name.');
+ this.errorModel.set('name', msg);
+ } else if (_.isUndefined(this.get('value')) ||
_.isNull(this.get('value')) ||
String(this.get('value')).replace(/^\s+|\s+$/g, '') == '') {
- msg = ('Please enter a value for the parameter.');
- this.errorModel.set('value', msg);
- this.errorModel.unset('name');
- } else {
- this.errorModel.unset('name');
- this.errorModel.unset('value');
- }
-
- return msg;
- },
- });
+ msg = ('Please enter a value for the parameter.');
+ this.errorModel.set('value', msg);
+ this.errorModel.unset('name');
+ } else {
+ this.errorModel.unset('name');
+ this.errorModel.unset('value');
+ }
+
+ return msg;
+ },
+ });
- /**
+ /**
* Variable Tab Control to set/update configuration values for database object.
*
**/
- Backform.VariableCollectionControl =
+ Backform.VariableCollectionControl =
Backform.UniqueColCollectionControl.extend({
hasDatabase: false,
@@ -228,7 +228,7 @@ define([
var self = this,
keys = ['name'];
- /*
+ /*
* Read from field schema whether user wants to use database and role
* fields in Variable control.
*/
@@ -247,9 +247,9 @@ define([
opts.field.set({
model: pgNode.VariableModel.extend({keys:keys}),
},
- {
- silent: true,
- });
+ {
+ silent: true,
+ });
} else {
opts.field.extend({
model: pgNode.VariableModel.extend({keys:keys}),
@@ -311,18 +311,18 @@ define([
async: false,
url: full_url,
})
- .done(function (res) {
- data = res.data;
- })
- .fail(function() {
- m.trigger('pgadmin-view:fetch:error', m, self.field);
- });
+ .done(function (res) {
+ data = res.data;
+ })
+ .fail(function() {
+ m.trigger('pgadmin-view:fetch:error', m, self.field);
+ });
m.trigger('pgadmin-view:fetched', m, self.field);
if (data && _.isArray(data)) {
self.collection.reset(data, {silent: true});
}
- /*
+ /*
* Make sure - new data will be taken care by the session management
*/
if (isTracking) {
@@ -483,5 +483,5 @@ define([
},
});
- return VariableModel;
- });
+ return VariableModel;
+});
diff --git a/web/pgadmin/browser/server_groups/servers/tablespaces/static/js/tablespace.js b/web/pgadmin/browser/server_groups/servers/tablespaces/static/js/tablespace.js
index 722256e4..5ff75bab 100644
--- a/web/pgadmin/browser/server_groups/servers/tablespaces/static/js/tablespace.js
+++ b/web/pgadmin/browser/server_groups/servers/tablespaces/static/js/tablespace.js
@@ -290,17 +290,17 @@ define('pgadmin.node.tablespace', [
method:'PUT',
data:{'data': JSON.stringify(args) },
})
- .done(function(res) {
- if (res.success) {
- Alertify.success(res.info);
- self.close();
- } else {
- Alertify.error(res.errormsg);
- }
- })
- .fail(function(xhr, status, error) {
- Alertify.pgRespErrorNotify(xhr, error);
- });
+ .done(function(res) {
+ if (res.success) {
+ Alertify.success(res.info);
+ self.close();
+ } else {
+ Alertify.error(res.errormsg);
+ }
+ })
+ .fail(function(xhr, status, error) {
+ Alertify.pgRespErrorNotify(xhr, error);
+ });
},
function() {
// Do nothing as user cancel the operation
diff --git a/web/pgadmin/browser/static/js/browser.js b/web/pgadmin/browser/static/js/browser.js
index e3d758fb..9e7dee07 100644
--- a/web/pgadmin/browser/static/js/browser.js
+++ b/web/pgadmin/browser/static/js/browser.js
@@ -45,7 +45,7 @@ define('pgadmin.browser', [
if (d && obj.Nodes[d._type].callbacks['selected'] &&
_.isFunction(obj.Nodes[d._type].callbacks['selected'])) {
return obj.Nodes[d._type].callbacks['selected'].apply(
- obj.Nodes[d._type], [i, d, obj]);
+ obj.Nodes[d._type], [i, d, obj]);
}
}
};
@@ -492,7 +492,7 @@ define('pgadmin.browser', [
if (d && obj.Nodes[d._type]) {
node = obj.Nodes[d._type];
- /* If the node specific callback returns false, we will also return
+ /* If the node specific callback returns false, we will also return
* false for further processing.
*/
if (_.isObject(node.callbacks) &&
@@ -535,8 +535,8 @@ define('pgadmin.browser', [
url: url_for('misc.cleanup'),
type:'POST',
})
- .done(function() {})
- .fail(function() {});
+ .done(function() {})
+ .fail(function() {});
}, 300000);
obj.Events.on('pgadmin:browser:tree:add', obj.onAddTreeNode, obj);
@@ -571,13 +571,13 @@ define('pgadmin.browser', [
'management', 'tools', 'help']) >= 0) {
var menus;
- // If current node is not visible in browser tree
- // then return from here
+ // If current node is not visible in browser tree
+ // then return from here
if(!checkNodeVisibility(self, m.node)) {
return;
} else if(_.has(m, 'module') && !_.isUndefined(m.module)) {
- // If module to which this menu applies is not visible in
- // browser tree then also we do not display menu
+ // If module to which this menu applies is not visible in
+ // browser tree then also we do not display menu
if(!checkNodeVisibility(self, m.module.type)) {
return;
}
@@ -601,16 +601,16 @@ define('pgadmin.browser', [
target: m.target, icon: m.icon,
enable: (m.enable == '' ? true : (_.isString(m.enable) &&
m.enable.toLowerCase() == 'false') ?
- false : m.enable),
+ false : m.enable),
node: m.node,
});
}
} else {
console.warn(
- 'Developer warning: Category \'' +
+ 'Developer warning: Category \'' +
a +
'\' is not supported!\nSupported categories are: context, file, edit, object, tools, management, help'
- );
+ );
}
});
});
@@ -628,17 +628,17 @@ define('pgadmin.browser', [
{menu: 'management', id: '#mnu_management'},
{menu: 'tools', id: '#mnu_tools'},
{menu: 'help', id:'#mnu_help'}],
- function(o) {
- var $mnu = navbar.children(o.id).first(),
- $dropdown = $mnu.children('.dropdown-menu').first();
- $dropdown.empty();
-
- if (pgAdmin.Browser.MenuCreator(
- $dropdown, obj.menus[o.menu], obj.menu_categories
- )) {
- $mnu.removeClass('d-none');
- }
- });
+ function(o) {
+ var $mnu = navbar.children(o.id).first(),
+ $dropdown = $mnu.children('.dropdown-menu').first();
+ $dropdown.empty();
+
+ if (pgAdmin.Browser.MenuCreator(
+ $dropdown, obj.menus[o.menu], obj.menu_categories
+ )) {
+ $mnu.removeClass('d-none');
+ }
+ });
navbar.children('#mnu_obj').removeClass('d-none');
obj.enable_disable_menus();
@@ -739,12 +739,12 @@ define('pgadmin.browser', [
hasId: true,
i: null, // current item
p: _.toArray(_hierarchy || {}).sort(
- function(a, b) {
- return (a.priority === b.priority) ? 0 : (
- a.priority < b.priority ? -1 : 1
- );
- }
- ), // path of the parent
+ function(a, b) {
+ return (a.priority === b.priority) ? 0 : (
+ a.priority < b.priority ? -1 : 1
+ );
+ }
+ ), // path of the parent
pathOfTreeItems: [], // path Item
t: this.tree, // Tree Api
o: _opts,
@@ -893,8 +893,8 @@ define('pgadmin.browser', [
if(
is_parent_loaded_before &&
_parent_data && _parent_data._type.search(
- _data._type
- ) > -1
+ _data._type
+ ) > -1
) {
ctx.t.openPath(i);
ctx.t.select(i);
@@ -988,12 +988,12 @@ define('pgadmin.browser', [
i: null, // current item
hasId: true,
p: _.toArray(_hierarchy || {}).sort(
- function(a, b) {
- return (a.priority === b.priority) ? 0 : (
- a.priority < b.priority ? -1 : 1
- );
- }
- ), // path of the old object
+ function(a, b) {
+ return (a.priority === b.priority) ? 0 : (
+ a.priority < b.priority ? -1 : 1
+ );
+ }
+ ), // path of the old object
pathOfTreeItems: [], // path items
t: this.tree, // Tree Api
o: _opts,
@@ -1035,9 +1035,9 @@ define('pgadmin.browser', [
&& this.t.hasParent(this.i)
&& this.t.parent(this.i)) || null,
_item_grand_parent = _item_parent ?
- (this.t.hasParent(_item_parent)
+ (this.t.hasParent(_item_parent)
&& this.t.parent(_item_parent))
- : null;
+ : null;
// Remove the current node first.
if (
@@ -1147,7 +1147,7 @@ define('pgadmin.browser', [
self.t.unload(_parent, {success: function() {
setTimeout(postRemove);
}}
- );
+ );
},
});
} else {
@@ -1541,73 +1541,73 @@ define('pgadmin.browser', [
cache: false,
dataType: 'json',
})
- .done(function(res) {
+ .done(function(res) {
// Node information can come as result/data
- var newData = res.result || res.data;
+ var newData = res.result || res.data;
- newData._label = newData.label;
- newData.label = _.escape(newData.label);
+ newData._label = newData.label;
+ newData.label = _.escape(newData.label);
- ctx.t.setLabel(ctx.i, {label: newData.label});
- ctx.t.addIcon(ctx.i, {icon: newData.icon});
- ctx.t.setId(ctx.i, {id: newData.id});
- if (newData.inode)
- ctx.t.setInode(ctx.i, {inode: true});
+ ctx.t.setLabel(ctx.i, {label: newData.label});
+ ctx.t.addIcon(ctx.i, {icon: newData.icon});
+ ctx.t.setId(ctx.i, {id: newData.id});
+ if (newData.inode)
+ ctx.t.setInode(ctx.i, {inode: true});
- // This will update the tree item data.
- var itemData = ctx.t.itemData(ctx.i);
- _.extend(itemData, newData);
+ // This will update the tree item data.
+ var itemData = ctx.t.itemData(ctx.i);
+ _.extend(itemData, newData);
- if (
- _n.can_expand && typeof(_n.can_expand) == 'function'
- ) {
- if (!_n.can_expand(itemData)) {
- ctx.t.unload(ctx.i);
- return;
+ if (
+ _n.can_expand && typeof(_n.can_expand) == 'function'
+ ) {
+ if (!_n.can_expand(itemData)) {
+ ctx.t.unload(ctx.i);
+ return;
+ }
}
- }
- ctx.b._refreshNode(ctx, ctx.branch);
- var success = (ctx.o && ctx.o.success) || ctx.success;
- if (success && typeof(success) == 'function') {
- success();
- }
- })
- .fail(function(xhr, error, status) {
- if (
- !Alertify.pgHandleItemError(
- xhr, error, status, {item: _i, info: info}
- )
- ) {
- var contentType = xhr.getResponseHeader('Content-Type'),
- jsonResp = (
- contentType &&
+ ctx.b._refreshNode(ctx, ctx.branch);
+ var success = (ctx.o && ctx.o.success) || ctx.success;
+ if (success && typeof(success) == 'function') {
+ success();
+ }
+ })
+ .fail(function(xhr, error, status) {
+ if (
+ !Alertify.pgHandleItemError(
+ xhr, error, status, {item: _i, info: info}
+ )
+ ) {
+ var contentType = xhr.getResponseHeader('Content-Type'),
+ jsonResp = (
+ contentType &&
contentType.indexOf('application/json') == 0 &&
JSON.parse(xhr.responseText)
- ) || {};
+ ) || {};
- if (xhr.status == 410 && jsonResp.success == 0) {
- var p = ctx.t.parent(ctx.i);
+ if (xhr.status == 410 && jsonResp.success == 0) {
+ var p = ctx.t.parent(ctx.i);
- ctx.t.remove(ctx.i, {
- success: function() {
- if (p) {
+ ctx.t.remove(ctx.i, {
+ success: function() {
+ if (p) {
// Try to refresh the parent on error
- try {
- pgBrowser.Events.trigger(
- 'pgadmin:browser:tree:refresh', p
- );
- } catch (e) { console.warn(e.stack || e); }
- }
- },
- });
- }
+ try {
+ pgBrowser.Events.trigger(
+ 'pgadmin:browser:tree:refresh', p
+ );
+ } catch (e) { console.warn(e.stack || e); }
+ }
+ },
+ });
+ }
- Alertify.pgNotifier(
- error, xhr, gettext('Error retrieving details for the node.'),
- function() { console.warn(arguments); }
- );
- }
- });
+ Alertify.pgNotifier(
+ error, xhr, gettext('Error retrieving details for the node.'),
+ function() { console.warn(arguments); }
+ );
+ }
+ });
}.bind(this);
if (n && n.collection_node) {
@@ -1792,16 +1792,16 @@ define('pgadmin.browser', [
url: childNodeUrl,
dataType: 'json',
})
- .done(function(res) {
- if (res.success) {
- arrayChildNodeData.push(res.data);
- }
- fetchNodeInfo(_callback);
- })
- .fail(function(xhr, status, error) {
- Alertify.pgRespErrorNotify(xhr, error);
- fetchNodeInfo(_callback);
- });
+ .done(function(res) {
+ if (res.success) {
+ arrayChildNodeData.push(res.data);
+ }
+ fetchNodeInfo(_callback);
+ })
+ .fail(function(xhr, status, error) {
+ Alertify.pgRespErrorNotify(xhr, error);
+ fetchNodeInfo(_callback);
+ });
};
@@ -1885,33 +1885,33 @@ define('pgadmin.browser', [
'Ctrl-Space': 'autocomplete',
'Cmd-Space': 'autocomplete',
- // Select All text
+ // Select All text
'Ctrl-A': 'selectAll',
'Cmd-A': 'selectAll',
- // Redo text
+ // Redo text
'Ctrl-Y': 'redo',
'Cmd-Y': 'redo',
- // Undo text
+ // Undo text
'Ctrl-Z': 'undo',
'Cmd-Z': 'undo',
- // Delete Line
+ // Delete Line
'Ctrl-D': 'deleteLine',
'Cmd-D': 'deleteLine',
- // Go to start/end of Line
+ // Go to start/end of Line
'Alt-Left': 'goLineStart',
'Alt-Right': 'goLineEnd',
- // Move word by word left/right
+ // Move word by word left/right
'Ctrl-Alt-Left': 'goGroupLeft',
'Cmd-Alt-Left': 'goGroupLeft',
'Ctrl-Alt-Right': 'goGroupRight',
'Cmd-Alt-Right': 'goGroupRight',
- // Allow user to delete Tab(s)
+ // Allow user to delete Tab(s)
'Shift-Tab': 'indentLess',
},
editor_options: {
@@ -1944,7 +1944,7 @@ define('pgadmin.browser', [
},
});
- /* Remove paste event mapping from CodeMirror's emacsy KeyMap binding
+ /* Remove paste event mapping from CodeMirror's emacsy KeyMap binding
* specific to Mac LineNumber:5797 - lib/Codemirror.js
* It is preventing default paste event(Cmd-V) from triggering
* in runtime.
diff --git a/web/pgadmin/browser/static/js/collection.js b/web/pgadmin/browser/static/js/collection.js
index 998ceb81..483f57b7 100644
--- a/web/pgadmin/browser/static/js/collection.js
+++ b/web/pgadmin/browser/static/js/collection.js
@@ -76,7 +76,7 @@ define([
j = panel.$container.find('.obj_properties').first(),
view = j.data('obj-view'),
content = $('
')
- .addClass('pg-prop-content col-12 has-pg-prop-btn-group'),
+ .addClass('pg-prop-content col-12 has-pg-prop-btn-group'),
node = pgBrowser.Nodes[that.node],
$msgContainer = '',
// This will be the URL, used for object manipulation.
@@ -136,9 +136,9 @@ define([
}))();
// Add the new column for the multi-select menus
if((_.isFunction(that.canDrop) ?
- that.canDrop.apply(that, [data, item]) : that.canDrop) ||
+ that.canDrop.apply(that, [data, item]) : that.canDrop) ||
(_.isFunction(that.canDropCascade) ?
- that.canDropCascade.apply(that, [data, item]) : that.canDropCascade)) {
+ that.canDropCascade.apply(that, [data, item]) : that.canDropCascade)) {
gridSchema.columns.unshift({
name: 'oid',
cell: Backgrid.Extension.SelectRowCell.extend({
@@ -178,7 +178,7 @@ define([
headerCell: Backgrid.Extension.SelectAllHeaderCell,
});
}
- // Initialize a new Grid instance
+ // Initialize a new Grid instance
that.grid = new Backgrid.Grid({
emptyText: 'No data found',
columns: gridSchema.columns,
@@ -224,10 +224,10 @@ define([
$msgContainer = $($msgContainer).appendTo(j);
that.header = $('
').addClass(
- 'pg-prop-header'
+ 'pg-prop-header'
);
- // Render the buttons
+ // Render the buttons
var buttons = [];
buttons.push({
@@ -282,51 +282,51 @@ define([
}, 1000);
},
})
- .done(function(res) {
- clearTimeout(timer);
+ .done(function(res) {
+ clearTimeout(timer);
- if (_.isUndefined(that.grid) || _.isNull(that.grid)) return;
+ if (_.isUndefined(that.grid) || _.isNull(that.grid)) return;
- that.data = res;
+ that.data = res;
- if (that.data.length > 0) {
+ if (that.data.length > 0) {
- if (!$msgContainer.hasClass('d-none')) {
- $msgContainer.addClass('d-none');
- }
- that.header.appendTo(j);
- j.append(content);
+ if (!$msgContainer.hasClass('d-none')) {
+ $msgContainer.addClass('d-none');
+ }
+ that.header.appendTo(j);
+ j.append(content);
- // Listen scroll event to load more rows
- $('.pg-prop-content').on('scroll', that.__loadMoreRows.bind(that));
+ // Listen scroll event to load more rows
+ $('.pg-prop-content').on('scroll', that.__loadMoreRows.bind(that));
- that.collection.reset(that.data.splice(0, 50));
- } else {
+ that.collection.reset(that.data.splice(0, 50));
+ } else {
// Do not listen the scroll event
- $('.pg-prop-content').off('scroll', that.__loadMoreRows);
+ $('.pg-prop-content').off('scroll', that.__loadMoreRows);
- $msgContainer.text(gettext('No properties are available for the selected object.'));
+ $msgContainer.text(gettext('No properties are available for the selected object.'));
- }
- })
- .fail(function(xhr, error) {
- pgBrowser.Events.trigger(
- 'pgadmin:node:retrieval:error', 'properties', xhr, error.message, item, that
- );
- if (!Alertify.pgHandleItemError(xhr, error.message, {
- item: item,
- info: info,
- })) {
- Alertify.pgNotifier(
- error, xhr,
- S(gettext('Error retrieving properties - %s')).sprintf(
- error.message || that.label).value(), function() {
- console.warn(arguments);
- });
- }
- // show failed message.
- $msgContainer.text(gettext('Failed to retrieve data from the server.'));
- });
+ }
+ })
+ .fail(function(xhr, error) {
+ pgBrowser.Events.trigger(
+ 'pgadmin:node:retrieval:error', 'properties', xhr, error.message, item, that
+ );
+ if (!Alertify.pgHandleItemError(xhr, error.message, {
+ item: item,
+ info: info,
+ })) {
+ Alertify.pgNotifier(
+ error, xhr,
+ S(gettext('Error retrieving properties - %s')).sprintf(
+ error.message || that.label).value(), function() {
+ console.warn(arguments);
+ });
+ }
+ // show failed message.
+ $msgContainer.text(gettext('Failed to retrieve data from the server.'));
+ });
var onDrop = function(type) {
let sel_row_models = this.grid.getSelectedModels(),
@@ -366,45 +366,45 @@ define([
data: JSON.stringify({'ids': sel_rows}),
contentType: 'application/json; charset=utf-8',
})
- .done(function(res) {
- if (res.success == 0) {
- pgBrowser.report_error(res.errormsg, res.info);
- } else {
- $(pgBrowser.panels['properties'].panel).removeData('node-prop');
- pgBrowser.Events.trigger(
- 'pgadmin:browser:tree:refresh', item || pgBrowser.tree.selected(), {
- success: function() {
- node.callbacks.selected.apply(node, [item]);
- },
- });
- }
- return true;
- })
- .fail(function(jqx) {
- var msg = jqx.responseText;
- /* Error from the server */
- if (jqx.status == 417 || jqx.status == 410 || jqx.status == 500) {
- try {
- var data = JSON.parse(jqx.responseText);
- msg = data.errormsg;
- } catch (e) {
- console.warn(e.stack || e);
+ .done(function(res) {
+ if (res.success == 0) {
+ pgBrowser.report_error(res.errormsg, res.info);
+ } else {
+ $(pgBrowser.panels['properties'].panel).removeData('node-prop');
+ pgBrowser.Events.trigger(
+ 'pgadmin:browser:tree:refresh', item || pgBrowser.tree.selected(), {
+ success: function() {
+ node.callbacks.selected.apply(node, [item]);
+ },
+ });
}
- }
- pgBrowser.report_error(
- S(gettext('Error dropping %s'))
- .sprintf(d._label.toLowerCase())
- .value(), msg);
-
- $(pgBrowser.panels['properties'].panel).removeData('node-prop');
- pgBrowser.Events.trigger(
- 'pgadmin:browser:tree:refresh', item || pgBrowser.tree.selected(), {
- success: function() {
- node.callbacks.selected.apply(node, [item]);
- },
+ return true;
+ })
+ .fail(function(jqx) {
+ var msg = jqx.responseText;
+ /* Error from the server */
+ if (jqx.status == 417 || jqx.status == 410 || jqx.status == 500) {
+ try {
+ var data = JSON.parse(jqx.responseText);
+ msg = data.errormsg;
+ } catch (e) {
+ console.warn(e.stack || e);
+ }
}
- );
- });
+ pgBrowser.report_error(
+ S(gettext('Error dropping %s'))
+ .sprintf(d._label.toLowerCase())
+ .value(), msg);
+
+ $(pgBrowser.panels['properties'].panel).removeData('node-prop');
+ pgBrowser.Events.trigger(
+ 'pgadmin:browser:tree:refresh', item || pgBrowser.tree.selected(), {
+ success: function() {
+ node.callbacks.selected.apply(node, [item]);
+ },
+ }
+ );
+ });
},
null).show();
return;
diff --git a/web/pgadmin/browser/static/js/datamodel.js b/web/pgadmin/browser/static/js/datamodel.js
index 79ef530f..ac4f84ae 100644
--- a/web/pgadmin/browser/static/js/datamodel.js
+++ b/web/pgadmin/browser/static/js/datamodel.js
@@ -36,7 +36,7 @@ define([
obj = new(pgBrowser.Node.Collection)(val, {
model: ((_.isString(s.model) &&
s.model in pgBrowser.Nodes) ?
- pgBrowser.Nodes[s.model].model : s.model),
+ pgBrowser.Nodes[s.model].model : s.model),
top: self.top || self,
handler: self,
parse: true,
@@ -44,7 +44,7 @@ define([
attrName: s.id,
});
- /*
+ /*
* Nested collection models may or may not have idAttribute.
* So to decide whether model is new or not set 'on_server'
* flag on such models.
@@ -56,7 +56,7 @@ define([
on_server: true,
});
} else {
- /*
+ /*
* Nested collection models may or may not have idAttribute.
* So to decide whether model is new or not set 'on_server'
* flag on such models.
@@ -83,13 +83,13 @@ define([
if (_.isString(s.model) &&
s.model in pgBrowser.Nodes[s.model]) {
obj = new(pgBrowser.Nodes[s.model].Model)(
- obj, {
- silent: true,
- top: self.top || self,
- handler: self,
- attrName: s.id,
- }
- );
+ obj, {
+ silent: true,
+ top: self.top || self,
+ handler: self,
+ attrName: s.id,
+ }
+ );
} else {
obj = new(s.model)(obj, {
silent: true,
@@ -163,7 +163,7 @@ define([
self.objects = [];
self.arrays = [];
self.attrName = options.attrName,
- self.top = (options.top || self.collection && self.collection.top || self.collection || self);
+ self.top = (options.top || self.collection && self.collection.top || self.collection || self);
self.handler = options.handler ||
(self.collection && self.collection.handler);
self.trackChanges = false;
@@ -234,19 +234,19 @@ define([
if (_.isString(s.model) &&
s.model in pgBrowser.Nodes[s.model]) {
obj = new(pgBrowser.Nodes[s.model].Model)(
- obj, {
- top: self.top || self,
- handler: self,
- attrName: s.id,
- }
- );
+ obj, {
+ top: self.top || self,
+ handler: self,
+ attrName: s.id,
+ }
+ );
} else {
obj = new(s.model)(
- obj, {
- top: self.top || self,
- handler: self,
- attrName: s.id,
- });
+ obj, {
+ top: self.top || self,
+ handler: self,
+ attrName: s.id,
+ });
}
}
@@ -549,26 +549,26 @@ define([
typeof(obj.primary_key) === 'function';
var key = hasPrimaryKey ? obj.primary_key() : obj.cid,
comparator = hasPrimaryKey ?
- function(k) {
- var o = self.get('k');
+ function(k) {
+ var o = self.get('k');
- if (o && o.primary_key() === key) {
- objName = k;
- return true;
- }
+ if (o && o.primary_key() === key) {
+ objName = k;
+ return true;
+ }
- return false;
- } :
- function(k) {
- var o = self.get(k);
+ return false;
+ } :
+ function(k) {
+ var o = self.get(k);
- if (o.cid === key) {
- objName = k;
- return true;
- }
+ if (o.cid === key) {
+ objName = k;
+ return true;
+ }
- return false;
- };
+ return false;
+ };
_.findIndex(self.objects, comparator);
}
@@ -599,26 +599,26 @@ define([
(typeof(obj.primary_key) === 'function'));
var key = hasPrimaryKey ? obj.primary_key() : obj.cid,
comparator = hasPrimaryKey ?
- function(k) {
- var o = self.get('k');
+ function(k) {
+ var o = self.get('k');
- if (o && o.primary_key() === key) {
- objName = k;
- return true;
- }
+ if (o && o.primary_key() === key) {
+ objName = k;
+ return true;
+ }
- return false;
- } :
- function(k) {
- var o = self.get('k');
+ return false;
+ } :
+ function(k) {
+ var o = self.get('k');
- if (o && o.cid === key) {
- objName = k;
- return true;
- }
+ if (o && o.cid === key) {
+ objName = k;
+ return true;
+ }
- return false;
- };
+ return false;
+ };
_.findIndex(self.objects, comparator);
}
diff --git a/web/pgadmin/browser/static/js/error.js b/web/pgadmin/browser/static/js/error.js
index e486f25d..81e9ab04 100644
--- a/web/pgadmin/browser/static/js/error.js
+++ b/web/pgadmin/browser/static/js/error.js
@@ -8,16 +8,16 @@
//////////////////////////////////////////////////////////////
define(
- ['sources/gettext', 'underscore', 'alertify', 'sources/pgadmin'],
-function(gettext, _, alertify, pgAdmin) {
- pgAdmin.Browser = pgAdmin.Browser || {};
+ ['sources/gettext', 'underscore', 'alertify', 'sources/pgadmin'],
+ function(gettext, _, alertify, pgAdmin) {
+ pgAdmin.Browser = pgAdmin.Browser || {};
- _.extend(pgAdmin.Browser, {
- report_error: function(title, message, info) {
- title = _.escape(title);
- message = _.escape(message);
- info = _.escape(info);
- let text = '\
+ _.extend(pgAdmin.Browser, {
+ report_error: function(title, message, info) {
+ title = _.escape(title);
+ message = _.escape(message);
+ info = _.escape(info);
+ let text = '
\
\
\
\
@@ -30,8 +30,8 @@ function(gettext, _, alertify, pgAdmin) {
\
';
- if (info != null && info != '') {
- text += '
\
+ if (info != null && info != '') {
+ text += '
\
';
- }
+ }
- text += '
';
- alertify.alert(
- title,
- text
- ).set('closable', true);
- },
- });
+ text += '
';
+ alertify.alert(
+ title,
+ text
+ ).set('closable', true);
+ },
+ });
- return pgAdmin.Browser.report_error;
-});
+ return pgAdmin.Browser.report_error;
+ });
diff --git a/web/pgadmin/browser/static/js/menu.js b/web/pgadmin/browser/static/js/menu.js
index 1de333bb..f8c018dc 100644
--- a/web/pgadmin/browser/static/js/menu.js
+++ b/web/pgadmin/browser/static/js/menu.js
@@ -113,8 +113,8 @@ define([
cb;
if (o.module['callbacks'] && (
- o.callback in o.module['callbacks']
- )) {
+ o.callback in o.module['callbacks']
+ )) {
cb = o.module['callbacks'][o.callback];
} else if (o.callback in o.module) {
cb = o.module[o.callback];
@@ -141,8 +141,8 @@ define([
return true;
}
if (_.isArray(this.node) ? (
- _.indexOf(this.node, node) == -1
- ) : (this.node != node._type)) {
+ _.indexOf(this.node, node) == -1
+ ) : (this.node != node._type)) {
return true;
}
}
diff --git a/web/pgadmin/browser/static/js/node.js b/web/pgadmin/browser/static/js/node.js
index 1b03fc25..319f39c2 100644
--- a/web/pgadmin/browser/static/js/node.js
+++ b/web/pgadmin/browser/static/js/node.js
@@ -423,11 +423,11 @@ define('pgadmin.browser.node', [
xhr, error, message, item
);
if (!Alertify.pgHandleItemError(
- xhr, error, message, {
- item: item,
- info: info,
- }
- )) {
+ xhr, error, message, {
+ item: item,
+ info: info,
+ }
+ )) {
Alertify.pgNotifier(
error, xhr,
S(
@@ -738,10 +738,10 @@ define('pgadmin.browser.node', [
title = S(gettext('DROP CASCADE %s?')).sprintf(obj.label).value();
if (!(_.isFunction(obj.canDropCascade) ?
- obj.canDropCascade.apply(obj, [d, i]) : obj.canDropCascade)) {
+ obj.canDropCascade.apply(obj, [d, i]) : obj.canDropCascade)) {
Alertify.error(
S(gettext('The %s "%s" cannot be dropped.'))
- .sprintf(obj.label, d.label).value(),
+ .sprintf(obj.label, d.label).value(),
10
);
return;
@@ -752,10 +752,10 @@ define('pgadmin.browser.node', [
title = S(gettext('DROP %s?')).sprintf(obj.label).value();
if (!(_.isFunction(obj.canDrop) ?
- obj.canDrop.apply(obj, [d, i]) : obj.canDrop)) {
+ obj.canDrop.apply(obj, [d, i]) : obj.canDrop)) {
Alertify.error(
S(gettext('The %s "%s" cannot be dropped.'))
- .sprintf(obj.label, d.label).value(),
+ .sprintf(obj.label, d.label).value(),
10
);
return;
@@ -767,30 +767,30 @@ define('pgadmin.browser.node', [
url: obj.generate_url(i, input.url, d, true),
type: 'DELETE',
})
- .done(function(res) {
- if (res.success == 0) {
- pgBrowser.report_error(res.errormsg, res.info);
- } else {
- pgBrowser.removeTreeNode(i, true);
- }
- return true;
- })
- .fail(function(jqx) {
- var msg = jqx.responseText;
- /* Error from the server */
- if (jqx.status == 417 || jqx.status == 410 || jqx.status == 500) {
- try {
- var data = JSON.parse(jqx.responseText);
- msg = data.errormsg;
- } catch (e) {
- console.warn(e.stack || e);
+ .done(function(res) {
+ if (res.success == 0) {
+ pgBrowser.report_error(res.errormsg, res.info);
+ } else {
+ pgBrowser.removeTreeNode(i, true);
}
- }
- pgBrowser.report_error(
- S(gettext('Error dropping %s: "%s"'))
- .sprintf(obj.label, objName)
- .value(), msg);
- });
+ return true;
+ })
+ .fail(function(jqx) {
+ var msg = jqx.responseText;
+ /* Error from the server */
+ if (jqx.status == 417 || jqx.status == 410 || jqx.status == 500) {
+ try {
+ var data = JSON.parse(jqx.responseText);
+ msg = data.errormsg;
+ } catch (e) {
+ console.warn(e.stack || e);
+ }
+ }
+ pgBrowser.report_error(
+ S(gettext('Error dropping %s: "%s"'))
+ .sprintf(obj.label, objName)
+ .value(), msg);
+ });
},
null).show();
},
@@ -913,7 +913,7 @@ define('pgadmin.browser.node', [
}
pgBrowser.Events.trigger('pgadmin:browser:tree:expand-from-previous-tree-state',
- item);
+ item);
pgBrowser.Node.callbacks.change_server_background(item, data);
},
// Callback called - when a node is selected in browser tree.
@@ -944,7 +944,7 @@ define('pgadmin.browser.node', [
}
pgBrowser.Events.trigger('pgadmin:browser:tree:update-tree-state',
- item);
+ item);
return true;
},
removed: function(item) {
@@ -1003,7 +1003,7 @@ define('pgadmin.browser.node', [
auto_expand = pgBrowser.get_preference('browser', 'auto_expand_sole_children');
pgBrowser.Events.trigger('pgadmin:browser:tree:update-tree-state',
- item);
+ item);
if (auto_expand && auto_expand.value == true && tree.children(item).length == 1) {
// Automatically expand the child node, if a treeview node has only a single child.
@@ -1013,7 +1013,7 @@ define('pgadmin.browser.node', [
},
closed: function(item) {
pgBrowser.Events.trigger('pgadmin:browser:tree:remove-from-tree-state',
- item);
+ item);
},
},
/**********************************************************************
@@ -1029,7 +1029,7 @@ define('pgadmin.browser.node', [
j = panel.$container.find('.obj_properties').first(),
view = j.data('obj-view'),
content = $('
')
- .addClass('pg-prop-content col-12');
+ .addClass('pg-prop-content col-12');
// Handle key press events for Cancel, save and help button
var handleKeyDown = function(event, context) {
@@ -1041,12 +1041,12 @@ define('pgadmin.browser.node', [
closePanel();
break;
case keyCode.ENTER:
- // Return if event is fired from child element
+ // Return if event is fired from child element
if (event.target !== context) return;
if (view && view.model && view.model.sessChanged()) {
var btn = $(event.target).closest('.obj_properties')
- .find('.pg-prop-btn-group')
- .find('button.btn-primary');
+ .find('.pg-prop-btn-group')
+ .find('button.btn-primary');
onSave.call(this, view, btn);
}
break;
@@ -1364,8 +1364,8 @@ define('pgadmin.browser.node', [
panel.icon(
_.isFunction(that['node_image']) ?
- (that['node_image']).apply(that, [data, view.model]) :
- (that['node_image'] || ('icon-' + that.type))
+ (that['node_image']).apply(that, [data, view.model]) :
+ (that['node_image'] || ('icon-' + that.type))
);
// Create proper buttons
diff --git a/web/pgadmin/browser/static/js/node.ui.js b/web/pgadmin/browser/static/js/node.ui.js
index 181296d3..3417b3aa 100644
--- a/web/pgadmin/browser/static/js/node.ui.js
+++ b/web/pgadmin/browser/static/js/node.ui.js
@@ -165,16 +165,16 @@ define([
async: false,
url: full_url,
})
- .done(function(res) {
+ .done(function(res) {
/*
* We will cache this data for short period of time for avoiding
* same calls.
*/
- data = cache_node.cache(node.type + '#' + url, node_info, cache_level, res.data);
- })
- .fail(function() {
- m.trigger('pgadmin:view:fetch:error', m, self.field);
- });
+ data = cache_node.cache(node.type + '#' + url, node_info, cache_level, res.data);
+ })
+ .fail(function() {
+ m.trigger('pgadmin:view:fetch:error', m, self.field);
+ });
m.trigger('pgadmin:view:fetched', m, self.field);
}
// To fetch only options from cache, we do not need time from 'at'
@@ -406,16 +406,16 @@ define([
async: false,
url: full_url,
})
- .done(function(res) {
+ .done(function(res) {
/*
* We will cache this data for short period of time for avoiding
* same calls.
*/
- data = cache_node.cache(node.type + '#' + url, node_info, cache_level, res.data);
- })
- .fail(function() {
- eventHandler.trigger('pgadmin:view:fetch:error', m, column);
- });
+ data = cache_node.cache(node.type + '#' + url, node_info, cache_level, res.data);
+ })
+ .fail(function() {
+ eventHandler.trigger('pgadmin:view:fetch:error', m, column);
+ });
eventHandler.trigger('pgadmin:view:fetched', m, column);
}
// To fetch only options from cache, we do not need time from 'at'
diff --git a/web/pgadmin/browser/static/js/preferences.js b/web/pgadmin/browser/static/js/preferences.js
index d7956e88..96330aff 100644
--- a/web/pgadmin/browser/static/js/preferences.js
+++ b/web/pgadmin/browser/static/js/preferences.js
@@ -9,10 +9,10 @@
import pgAdmin from 'sources/pgadmin';
import url_for from 'sources/url_for';
-import * as modifyAnimation from 'sources/modify_animation';
import $ from 'jquery';
import * as Alertify from 'pgadmin.alertifyjs';
import * as SqlEditorUtils from 'sources/sqleditor_utils';
+var modifyAnimation = require('sources/modify_animation');
const pgBrowser = pgAdmin.Browser = pgAdmin.Browser || {};
@@ -51,8 +51,8 @@ _.extend(pgBrowser, {
if(self.preferences_cache.length > 0) {
clearInterval(preferenceTimeout);
return _.findWhere(
- self.preferences_cache, {'module': module, 'name': preference}
- );
+ self.preferences_cache, {'module': module, 'name': preference}
+ );
}
},
preferenceTimeout = setInterval(check_preference, 1000);
@@ -93,35 +93,35 @@ _.extend(pgBrowser, {
$.ajax({
url: url_for('preferences.get_all'),
})
- .done(function(res) {
- self.preferences_cache = res;
- self.preference_version(self.generate_preference_version());
-
- pgBrowser.keyboardNavigation.init();
- if(pgBrowser.tree) {
- modifyAnimation.modifyAcitreeAnimation(self);
- modifyAnimation.modifyAlertifyAnimation(self);
- }
+ .done(function(res) {
+ self.preferences_cache = res;
+ self.preference_version(self.generate_preference_version());
+
+ pgBrowser.keyboardNavigation.init();
+ if(pgBrowser.tree) {
+ modifyAnimation.modifyAcitreeAnimation(self);
+ modifyAnimation.modifyAlertifyAnimation(self);
+ }
- // Initialize Tree saving/reloading
- pgBrowser.browserTreeState.init();
+ // Initialize Tree saving/reloading
+ pgBrowser.browserTreeState.init();
- /* Once the cache is loaded after changing the preferences,
+ /* Once the cache is loaded after changing the preferences,
* notify the modules of the change
*/
- if(modulesChanged) {
- if(typeof modulesChanged === 'string'){
- $.event.trigger('prefchange:'+modulesChanged);
- } else {
- _.each(modulesChanged, (val, key)=> {
- $.event.trigger('prefchange:'+key);
- });
+ if(modulesChanged) {
+ if(typeof modulesChanged === 'string'){
+ $.event.trigger('prefchange:'+modulesChanged);
+ } else {
+ _.each(modulesChanged, (val, key)=> {
+ $.event.trigger('prefchange:'+key);
+ });
+ }
}
- }
- })
- .fail(function(xhr, status, error) {
- Alertify.pgRespErrorNotify(xhr, error);
- });
+ })
+ .fail(function(xhr, status, error) {
+ Alertify.pgRespErrorNotify(xhr, error);
+ });
}, 500);
},
diff --git a/web/pgadmin/dashboard/static/js/dashboard.js b/web/pgadmin/dashboard/static/js/dashboard.js
index 7085b4ec..a45ec7c2 100644
--- a/web/pgadmin/dashboard/static/js/dashboard.js
+++ b/web/pgadmin/dashboard/static/js/dashboard.js
@@ -95,17 +95,17 @@ define('pgadmin.dashboard', [
url: action_url,
type: 'DELETE',
})
- .done(function(res) {
- if (res == gettext('Success')) {
- Alertify.success(txtSuccess);
- refresh_grid();
- } else {
- Alertify.error(txtError);
- }
- })
- .fail(function(xhr, status, error) {
- Alertify.pgRespErrorNotify(xhr, error);
- });
+ .done(function(res) {
+ if (res == gettext('Success')) {
+ Alertify.success(txtSuccess);
+ refresh_grid();
+ } else {
+ Alertify.error(txtError);
+ }
+ })
+ .fail(function(xhr, status, error) {
+ Alertify.pgRespErrorNotify(xhr, error);
+ });
},
function() {
return true;
@@ -228,14 +228,14 @@ define('pgadmin.dashboard', [
type: 'GET',
dataType: 'html',
})
- .done(function(data) {
- $(div).html(data);
- })
- .fail(function() {
- $(div).html(
- '' + gettext('An error occurred whilst loading the dashboard.') + '
'
- );
- });
+ .done(function(data) {
+ $(div).html(data);
+ })
+ .fail(function() {
+ $(div).html(
+ '' + gettext('An error occurred whilst loading the dashboard.') + '
'
+ );
+ });
// Cache the current IDs for next time
$(dashboardPanel).data('sid', -1);
@@ -342,15 +342,15 @@ define('pgadmin.dashboard', [
type: 'GET',
dataType: 'html',
})
- .done(function(data) {
- $(div).html(data);
- self.init_dashboard();
- })
- .fail(function() {
- $(div).html(
- '' + gettext('An error occurred whilst loading the dashboard.') + '
'
- );
- });
+ .done(function(data) {
+ $(div).html(data);
+ self.init_dashboard();
+ })
+ .fail(function() {
+ $(div).html(
+ '' + gettext('An error occurred whilst loading the dashboard.') + '
'
+ );
+ });
$(dashboardPanel).data('server_status', true);
}
} else {
@@ -536,45 +536,45 @@ define('pgadmin.dashboard', [
url: path,
type: 'GET',
})
- .done(function(resp) {
- last_poll_wait_counter = 0;
- for(let chart_name in resp) {
- let chart_obj = chart_store[chart_name].chart_obj;
- $(chart_obj.getContainer()).removeClass('graph-error');
- self.updateChart(chart_obj, resp[chart_name]);
- }
- })
- .fail(function(xhr) {
- last_poll_wait_counter = 0;
- let err = '';
- let msg = '';
- let cls = 'info';
-
- if (xhr.readyState === 0) {
- msg = gettext('Not connected to the server or the connection to the server has been closed.');
- } else {
- err = JSON.parse(xhr.responseText);
- msg = err.errormsg;
-
- // If we get a 428, it means the server isn't connected
- if (xhr.status === 428) {
- if (_.isUndefined(msg) || _.isNull(msg)) {
- msg = gettext('Please connect to the selected server to view the graph.');
- }
+ .done(function(resp) {
+ last_poll_wait_counter = 0;
+ for(let chart_name in resp) {
+ let chart_obj = chart_store[chart_name].chart_obj;
+ $(chart_obj.getContainer()).removeClass('graph-error');
+ self.updateChart(chart_obj, resp[chart_name]);
+ }
+ })
+ .fail(function(xhr) {
+ last_poll_wait_counter = 0;
+ let err = '';
+ let msg = '';
+ let cls = 'info';
+
+ if (xhr.readyState === 0) {
+ msg = gettext('Not connected to the server or the connection to the server has been closed.');
} else {
- msg = gettext('An error occurred whilst rendering the graph.');
- cls = 'danger';
+ err = JSON.parse(xhr.responseText);
+ msg = err.errormsg;
+
+ // If we get a 428, it means the server isn't connected
+ if (xhr.status === 428) {
+ if (_.isUndefined(msg) || _.isNull(msg)) {
+ msg = gettext('Please connect to the selected server to view the graph.');
+ }
+ } else {
+ msg = gettext('An error occurred whilst rendering the graph.');
+ cls = 'danger';
+ }
}
- }
- for(let chart_name in chart_store) {
- let chart_obj = chart_store[chart_name].chart_obj;
- $(chart_obj.getContainer()).addClass('graph-error');
- $(chart_obj.getContainer()).html(
- '' + msg + '
'
- );
- }
- });
+ for(let chart_name in chart_store) {
+ let chart_obj = chart_store[chart_name].chart_obj;
+ $(chart_obj.getContainer()).addClass('graph-error');
+ $(chart_obj.getContainer()).html(
+ '' + msg + '
'
+ );
+ }
+ });
last_poll_wait_counter = WAIT_COUNTER;
};
/* Execute once for the first time as setInterval will not do */
@@ -586,8 +586,8 @@ define('pgadmin.dashboard', [
add_new_server: function() {
if (pgBrowser && pgBrowser.tree) {
var i = pgBrowser.tree.selected().length != 0 ?
- pgBrowser.tree.selected() :
- pgBrowser.tree.first(null, false),
+ pgBrowser.tree.selected() :
+ pgBrowser.tree.first(null, false),
serverModule = require('pgadmin.node.server'),
itemData = pgBrowser.tree.itemData(i);
diff --git a/web/pgadmin/misc/bgprocess/static/js/bgprocess.js b/web/pgadmin/misc/bgprocess/static/js/bgprocess.js
index 7a37035e..fa69d978 100644
--- a/web/pgadmin/misc/bgprocess/static/js/bgprocess.js
+++ b/web/pgadmin/misc/bgprocess/static/js/bgprocess.js
@@ -112,12 +112,12 @@ define('misc.bgprocess', [
case 'status':
if (this.details && this.out != -1 && this.err != -1) {
return url_for(
- 'bgprocess.detailed_status', {
- 'pid': this.id,
- 'out': this.out,
- 'err': this.err,
- }
- );
+ 'bgprocess.detailed_status', {
+ 'pid': this.id,
+ 'out': this.out,
+ 'err': this.err,
+ }
+ );
}
return url_for('bgprocess.status', {
'pid': this.id,
@@ -270,18 +270,18 @@ define('misc.bgprocess', [
async: true,
contentType: 'application/json',
})
- .done(function(res) {
- setTimeout(function() {
- self.update(res);
- }, 10);
- })
- .fail(function(res) {
- // Try after some time only if job id present
- if (res.status != 410)
+ .done(function(res) {
setTimeout(function() {
self.update(res);
- }, 10000);
- });
+ }, 10);
+ })
+ .fail(function(res) {
+ // Try after some time only if job id present
+ if (res.status != 410)
+ setTimeout(function() {
+ self.update(res);
+ }, 10000);
+ });
},
show: function() {
@@ -477,12 +477,12 @@ define('misc.bgprocess', [
async: true,
contentType: 'application/json',
})
- .done(function() {
- return;
- })
- .fail(function() {
- console.warn(arguments);
- });
+ .done(function() {
+ return;
+ })
+ .fail(function() {
+ console.warn(arguments);
+ });
},
stop_process: function() {
@@ -497,12 +497,12 @@ define('misc.bgprocess', [
async: true,
contentType: 'application/json',
})
- .done(function() {
- return;
- })
- .fail(function() {
- console.warn(arguments);
- });
+ .done(function() {
+ return;
+ })
+ .fail(function() {
+ console.warn(arguments);
+ });
},
});
@@ -547,31 +547,31 @@ define('misc.bgprocess', [
async: true,
contentType: 'application/json',
})
- .done(function(res) {
- if (!res || !_.isArray(res)) {
- return;
- }
- for (var idx in res) {
- var process = res[idx];
- if ('id' in process) {
- if (!(process.id in observer.bgprocesses)) {
- observer.bgprocesses[process.id] = new BGProcess(process);
+ .done(function(res) {
+ if (!res || !_.isArray(res)) {
+ return;
+ }
+ for (var idx in res) {
+ var process = res[idx];
+ if ('id' in process) {
+ if (!(process.id in observer.bgprocesses)) {
+ observer.bgprocesses[process.id] = new BGProcess(process);
+ }
}
}
- }
- if (recheck && res.length == 0) {
+ if (recheck && res.length == 0) {
// Recheck after some more time
- setTimeout(
- function() {
- observer.update_process_list(false);
- }, 3000
- );
- }
- })
- .fail(function() {
+ setTimeout(
+ function() {
+ observer.update_process_list(false);
+ }, 3000
+ );
+ }
+ })
+ .fail(function() {
// FIXME:: What to do now?
- console.warn(arguments);
- });
+ console.warn(arguments);
+ });
},
create_panel: function() {
diff --git a/web/pgadmin/misc/dependencies/static/js/dependencies.js b/web/pgadmin/misc/dependencies/static/js/dependencies.js
index 664a27fe..18fb37b3 100644
--- a/web/pgadmin/misc/dependencies/static/js/dependencies.js
+++ b/web/pgadmin/misc/dependencies/static/js/dependencies.js
@@ -47,8 +47,8 @@ define('misc.dependencies', [
parse: function(res) {
var node = pgBrowser.Nodes[res.type];
res.icon = node ? (_.isFunction(node['node_image']) ?
- (node['node_image']).apply(node, [null, null]) :
- (node['node_image'] || ('icon-' + res.type))) :
+ (node['node_image']).apply(node, [null, null]) :
+ (node['node_image'] || ('icon-' + res.type))) :
('icon-' + res.type);
res.type = S.titleize(res.type.replace(/_/g, ' '), true);
return res;
@@ -76,7 +76,7 @@ define('misc.dependencies', [
columns: [{
name: 'type',
label: gettext('Type'),
- // Extend it to render the icon as per the type.
+ // Extend it to render the icon as per the type.
cell: Backgrid.Cell.extend({
render: function() {
Backgrid.Cell.prototype.render.apply(this, arguments);
@@ -162,65 +162,65 @@ define('misc.dependencies', [
}, 1000);
},
})
- .done(function(res) {
- clearTimeout(timer);
+ .done(function(res) {
+ clearTimeout(timer);
- if (res.length > 0) {
+ if (res.length > 0) {
- if (!$msgContainer.hasClass('d-none')) {
- $msgContainer.addClass('d-none');
- }
- $gridContainer.removeClass('d-none');
+ if (!$msgContainer.hasClass('d-none')) {
+ $msgContainer.addClass('d-none');
+ }
+ $gridContainer.removeClass('d-none');
- self.dependenciesData = res;
+ self.dependenciesData = res;
- // Load only 100 rows
- self.dependenciesCollection.reset(self.dependenciesData.splice(0, 100), {parse: true});
+ // Load only 100 rows
+ self.dependenciesCollection.reset(self.dependenciesData.splice(0, 100), {parse: true});
- // Load more rows on scroll down
- pgBrowser.Events.on(
- 'pgadmin-browser:panel-dependencies:' +
+ // Load more rows on scroll down
+ pgBrowser.Events.on(
+ 'pgadmin-browser:panel-dependencies:' +
wcDocker.EVENT.SCROLLED,
- self.__loadMoreRows
- );
+ self.__loadMoreRows
+ );
- } else {
+ } else {
// Do not listen the scroll event
- pgBrowser.Events.off(
- 'pgadmin-browser:panel-dependencies:' +
+ pgBrowser.Events.off(
+ 'pgadmin-browser:panel-dependencies:' +
wcDocker.EVENT.SCROLLED
- );
+ );
- self.dependenciesCollection.reset({silent: true});
- $msgContainer.text(msg);
- $msgContainer.removeClass('d-none');
+ self.dependenciesCollection.reset({silent: true});
+ $msgContainer.text(msg);
+ $msgContainer.removeClass('d-none');
- if (!$gridContainer.hasClass('d-none')) {
- $gridContainer.addClass('d-none');
+ if (!$gridContainer.hasClass('d-none')) {
+ $gridContainer.addClass('d-none');
+ }
}
- }
- })
- .fail(function(xhr, error, message) {
- var _label = treeHierarchy[n_type].label;
- pgBrowser.Events.trigger(
- 'pgadmin:node:retrieval:error', 'depends', xhr, error, message
- );
- if (!Alertify.pgHandleItemError(xhr, error, message, {
- item: item,
- info: treeHierarchy,
- })) {
- Alertify.pgNotifier(
- error, xhr,
- S(gettext('Error retrieving data from the server: %s')).sprintf(
- message || _label).value(), function() {
- console.warn(arguments);
- });
- }
- // show failed message.
- $msgContainer.text(gettext('Failed to retrieve data from the server.'));
- });
+ })
+ .fail(function(xhr, error, message) {
+ var _label = treeHierarchy[n_type].label;
+ pgBrowser.Events.trigger(
+ 'pgadmin:node:retrieval:error', 'depends', xhr, error, message
+ );
+ if (!Alertify.pgHandleItemError(xhr, error, message, {
+ item: item,
+ info: treeHierarchy,
+ })) {
+ Alertify.pgNotifier(
+ error, xhr,
+ S(gettext('Error retrieving data from the server: %s')).sprintf(
+ message || _label).value(), function() {
+ console.warn(arguments);
+ });
+ }
+ // show failed message.
+ $msgContainer.text(gettext('Failed to retrieve data from the server.'));
+ });
}
} if (msg != '') {
$msgContainer.text(msg);
diff --git a/web/pgadmin/misc/dependents/static/js/dependents.js b/web/pgadmin/misc/dependents/static/js/dependents.js
index cf2820da..1c3db62f 100644
--- a/web/pgadmin/misc/dependents/static/js/dependents.js
+++ b/web/pgadmin/misc/dependents/static/js/dependents.js
@@ -47,8 +47,8 @@ define('misc.dependents', [
parse: function(res) {
var node = pgBrowser.Nodes[res.type];
res.icon = node ? (_.isFunction(node['node_image']) ?
- (node['node_image']).apply(node, [null, null]) :
- (node['node_image'] || ('icon-' + res.type))) :
+ (node['node_image']).apply(node, [null, null]) :
+ (node['node_image'] || ('icon-' + res.type))) :
('icon-' + res.type);
res.type = S.titleize(res.type.replace(/_/g, ' '), true);
return res;
@@ -77,7 +77,7 @@ define('misc.dependents', [
columns: [{
name: 'type',
label: gettext('Type'),
- // Extend it to render the icon as per the type.
+ // Extend it to render the icon as per the type.
cell: Backgrid.Cell.extend({
render: function() {
Backgrid.Cell.prototype.render.apply(this, arguments);
@@ -168,65 +168,65 @@ define('misc.dependents', [
}, 1000);
},
})
- .done(function(res) {
- clearTimeout(timer);
+ .done(function(res) {
+ clearTimeout(timer);
- if (res.length > 0) {
+ if (res.length > 0) {
- if (!$msgContainer.hasClass('d-none')) {
- $msgContainer.addClass('d-none');
- }
- $gridContainer.removeClass('d-none');
+ if (!$msgContainer.hasClass('d-none')) {
+ $msgContainer.addClass('d-none');
+ }
+ $gridContainer.removeClass('d-none');
- self.dependentData = res;
+ self.dependentData = res;
- // Load only 100 rows
- self.dependentCollection.reset(self.dependentData.splice(0, 100), {parse: true});
+ // Load only 100 rows
+ self.dependentCollection.reset(self.dependentData.splice(0, 100), {parse: true});
- // Load more rows on scroll down
- pgBrowser.Events.on(
- 'pgadmin-browser:panel-dependents:' +
+ // Load more rows on scroll down
+ pgBrowser.Events.on(
+ 'pgadmin-browser:panel-dependents:' +
wcDocker.EVENT.SCROLLED,
- self.__loadMoreRows
- );
+ self.__loadMoreRows
+ );
- } else {
+ } else {
// Do not listen the scroll event
- pgBrowser.Events.off(
- 'pgadmin-browser:panel-dependents:' +
+ pgBrowser.Events.off(
+ 'pgadmin-browser:panel-dependents:' +
wcDocker.EVENT.SCROLLED
- );
+ );
- self.dependentCollection.reset({silent: true});
- $msgContainer.text(msg);
- $msgContainer.removeClass('d-none');
+ self.dependentCollection.reset({silent: true});
+ $msgContainer.text(msg);
+ $msgContainer.removeClass('d-none');
- if (!$gridContainer.hasClass('d-none')) {
- $gridContainer.addClass('d-none');
+ if (!$gridContainer.hasClass('d-none')) {
+ $gridContainer.addClass('d-none');
+ }
}
- }
- })
- .fail(function(xhr, error, message) {
- var _label = treeHierarchy[n_type].label;
- pgBrowser.Events.trigger(
- 'pgadmin:node:retrieval:error', 'depends', xhr, error, message
- );
- if (!Alertify.pgHandleItemError(xhr, error, message, {
- item: item,
- info: treeHierarchy,
- })) {
- Alertify.pgNotifier(
- error, xhr,
- S(gettext('Error retrieving data from the server: %s')).sprintf(
- message || _label).value(), function() {
- console.warn(arguments);
- });
- }
- // show failed message.
- $msgContainer.text(gettext('Failed to retrieve data from the server.'));
- });
+ })
+ .fail(function(xhr, error, message) {
+ var _label = treeHierarchy[n_type].label;
+ pgBrowser.Events.trigger(
+ 'pgadmin:node:retrieval:error', 'depends', xhr, error, message
+ );
+ if (!Alertify.pgHandleItemError(xhr, error, message, {
+ item: item,
+ info: treeHierarchy,
+ })) {
+ Alertify.pgNotifier(
+ error, xhr,
+ S(gettext('Error retrieving data from the server: %s')).sprintf(
+ message || _label).value(), function() {
+ console.warn(arguments);
+ });
+ }
+ // show failed message.
+ $msgContainer.text(gettext('Failed to retrieve data from the server.'));
+ });
}
} if (msg != '') {
$msgContainer.text(msg);
diff --git a/web/pgadmin/misc/file_manager/static/js/create_dialogue.js b/web/pgadmin/misc/file_manager/static/js/create_dialogue.js
index ec2a474e..4a77906e 100644
--- a/web/pgadmin/misc/file_manager/static/js/create_dialogue.js
+++ b/web/pgadmin/misc/file_manager/static/js/create_dialogue.js
@@ -98,14 +98,14 @@ module.exports = Alertify.dialog('createModeDlg', function() {
contentType: 'application/x-download; charset=utf-8',
async: false,
})
- .done(function(resp) {
- var data = resp.data.result;
- if (data['Code'] === 1) {
- is_exist = true;
- } else {
- is_exist = false;
- }
- });
+ .done(function(resp) {
+ var data = resp.data.result;
+ if (data['Code'] === 1) {
+ is_exist = true;
+ } else {
+ is_exist = false;
+ }
+ });
return is_exist;
},
check_permission: function(path) {
@@ -125,19 +125,19 @@ module.exports = Alertify.dialog('createModeDlg', function() {
contentType: 'application/json; charset=utf-8',
async: false,
})
- .done(function(resp) {
- var data = resp.data.result;
- if (data.Code === 1) {
- permission = true;
- } else {
+ .done(function(resp) {
+ var data = resp.data.result;
+ if (data.Code === 1) {
+ permission = true;
+ } else {
+ $('.file_manager_ok').addClass('disabled');
+ Alertify.error(data.Error);
+ }
+ })
+ .fail(function() {
$('.file_manager_ok').addClass('disabled');
- Alertify.error(data.Error);
- }
- })
- .fail(function() {
- $('.file_manager_ok').addClass('disabled');
- Alertify.error(gettext('Error occurred while checking access permission.'));
- });
+ Alertify.error(gettext('Error occurred while checking access permission.'));
+ });
return permission;
},
callback: function(closeEvent) {
diff --git a/web/pgadmin/misc/file_manager/static/js/select_dialogue.js b/web/pgadmin/misc/file_manager/static/js/select_dialogue.js
index 04d56fa6..e6ec14d1 100644
--- a/web/pgadmin/misc/file_manager/static/js/select_dialogue.js
+++ b/web/pgadmin/misc/file_manager/static/js/select_dialogue.js
@@ -141,7 +141,7 @@ module.exports = Alertify.dialog('fileSelectionDlg', function() {
},
hooks: {
onshow: function() {
-// $(this.elements.body).addClass('pgadmin-storage-body');
+ // $(this.elements.body).addClass('pgadmin-storage-body');
},
},
};
diff --git a/web/pgadmin/misc/file_manager/static/js/utility.js b/web/pgadmin/misc/file_manager/static/js/utility.js
index 93891fc7..2730eef6 100644
--- a/web/pgadmin/misc/file_manager/static/js/utility.js
+++ b/web/pgadmin/misc/file_manager/static/js/utility.js
@@ -252,40 +252,40 @@ define([
contentType: 'application/json; charset=utf-8',
async: false,
})
- .done(function(resp) {
- var result = resp.data.result;
- if (result.Code === 1) {
- var newPath = result['New Path'],
- newName = result['New Name'],
- title = $('#preview h1').attr('title');
-
- if (typeof title != 'undefined' && title == oldPath) {
- $('#preview h1').text(newName);
- }
+ .done(function(resp) {
+ var result = resp.data.result;
+ if (result.Code === 1) {
+ var newPath = result['New Path'],
+ newName = result['New Name'],
+ title = $('#preview h1').attr('title');
+
+ if (typeof title != 'undefined' && title == oldPath) {
+ $('#preview h1').text(newName);
+ }
- if ($('.fileinfo').data('view') == 'grid') {
- $('.fileinfo span[data-alt="' + oldPath + '"]').parent().next('div span').text(newName);
- $('.fileinfo span[data-alt="' + oldPath + '"]').attr('data-alt', newPath);
- } else {
- $('.fileinfo td[title="' + oldPath + '"]').text(newName);
- $('.fileinfo td[title="' + oldPath + '"]').attr('title', newPath);
- }
- $('#preview h1').html(newName);
+ if ($('.fileinfo').data('view') == 'grid') {
+ $('.fileinfo span[data-alt="' + oldPath + '"]').parent().next('div span').text(newName);
+ $('.fileinfo span[data-alt="' + oldPath + '"]').attr('data-alt', newPath);
+ } else {
+ $('.fileinfo td[title="' + oldPath + '"]').text(newName);
+ $('.fileinfo td[title="' + oldPath + '"]').attr('title', newPath);
+ }
+ $('#preview h1').html(newName);
- // actualized data for binding
- data.Path = newPath;
- data.Filename = newName;
+ // actualized data for binding
+ data.Path = newPath;
+ data.Filename = newName;
- // UnBind toolbar functions.
- $('.fileinfo').find('button.rename, button.delete, button.download').off();
+ // UnBind toolbar functions.
+ $('.fileinfo').find('button.rename, button.delete, button.download').off();
- Alertify.success(lg.successful_rename);
- } else {
- Alertify.error(result.Error);
- }
+ Alertify.success(lg.successful_rename);
+ } else {
+ Alertify.error(result.Error);
+ }
- finalName = result['New Name'];
- });
+ finalName = result['New Name'];
+ });
}
};
@@ -315,21 +315,21 @@ define([
contentType: 'application/json; charset=utf-8',
async: false,
})
- .done(function(resp) {
- var result = resp.data.result;
- if (result.Code === 1) {
- isDeleted = true;
- if (isDeleted) {
- Alertify.success(lg.successful_delete);
- var rootpath = result.Path.substring(0, result.Path.length - 1); // removing the last slash
- rootpath = rootpath.substr(0, rootpath.lastIndexOf('/') + 1);
- getFolderInfo(rootpath);
+ .done(function(resp) {
+ var result = resp.data.result;
+ if (result.Code === 1) {
+ isDeleted = true;
+ if (isDeleted) {
+ Alertify.success(lg.successful_delete);
+ var rootpath = result.Path.substring(0, result.Path.length - 1); // removing the last slash
+ rootpath = rootpath.substr(0, rootpath.lastIndexOf('/') + 1);
+ getFolderInfo(rootpath);
+ }
+ } else {
+ isDeleted = false;
+ Alertify.error(result.Error);
}
- } else {
- isDeleted = false;
- Alertify.error(result.Error);
- }
- });
+ });
return isDeleted;
};
@@ -366,34 +366,34 @@ define([
contentType: 'application/json; charset=utf-8',
async: false,
})
- .done(function(resp) {
- var data = resp.data.result;
- if (data.Code === 1) {
- $('.file_manager_ok').removeClass('disabled');
- $('.file_manager_ok').attr('disabled', false);
- data.Capabilities = capabilities;
- bindToolbar(data);
- if (data.FileType == 'Directory') {
+ .done(function(resp) {
+ var data = resp.data.result;
+ if (data.Code === 1) {
+ $('.file_manager_ok').removeClass('disabled');
+ $('.file_manager_ok').attr('disabled', false);
+ data.Capabilities = capabilities;
+ bindToolbar(data);
+ if (data.FileType == 'Directory') {
// Enable/Disable level up button
- enab_dis_level_up();
- $('.file_manager_ok').addClass('disabled');
- $('.file_manager_ok').attr('disabled', true);
- $('.file_manager button.delete, .file_manager button.rename').attr('disabled', 'disabled');
- $('.file_manager button.download').attr('disabled', 'disabled');
+ enab_dis_level_up();
+ $('.file_manager_ok').addClass('disabled');
+ $('.file_manager_ok').attr('disabled', true);
+ $('.file_manager button.delete, .file_manager button.rename').attr('disabled', 'disabled');
+ $('.file_manager button.download').attr('disabled', 'disabled');
- if (file.charAt(file.length - 1) != '/' && file.charAt(file.length - 1) != '\\') {
- file += '/';
+ if (file.charAt(file.length - 1) != '/' && file.charAt(file.length - 1) != '\\') {
+ file += '/';
+ }
+ getFolderInfo(file);
+ } else {
+ is_file_valid = true;
}
- getFolderInfo(file);
} else {
- is_file_valid = true;
+ $('.file_manager_ok').addClass('disabled');
+ $('.file_manager_ok').attr('disabled', true);
+ Alertify.error(data.Error);
}
- } else {
- $('.file_manager_ok').addClass('disabled');
- $('.file_manager_ok').attr('disabled', true);
- Alertify.error(data.Error);
- }
- });
+ });
return is_file_valid;
};
@@ -412,23 +412,23 @@ define([
contentType: 'application/json; charset=utf-8',
async: false,
})
- .done(function(resp) {
- var data = resp.data.result;
- if (data.Code === 1) {
- permission = true;
- } else {
+ .done(function(resp) {
+ var data = resp.data.result;
+ if (data.Code === 1) {
+ permission = true;
+ } else {
+ $('.file_manager_ok').addClass('disabled');
+ $('.file_manager_ok').attr('disabled', true);
+ Alertify.error(data.Error);
+ }
+ })
+ .fail(function() {
$('.file_manager_ok').addClass('disabled');
$('.file_manager_ok').attr('disabled', true);
- Alertify.error(data.Error);
- }
- })
- .fail(function() {
- $('.file_manager_ok').addClass('disabled');
- $('.file_manager_ok').attr('disabled', true);
- Alertify.error(
- gettext('Error occurred while checking access permission.')
- );
- });
+ Alertify.error(
+ gettext('Error occurred while checking access permission.')
+ );
+ });
return permission;
};
@@ -498,527 +498,527 @@ define([
contentType: 'application/json; charset=utf-8',
async: false,
})
- .done(function(resp) {
- $('.storage_dialog #uploader .input-path').prop('disabled', false);
- var result = '',
- data = resp.data.result;
-
- // hide activity indicator
- $('.fileinfo').find('span.activity').hide();
- if (data.Code === 0) {
- Alertify.error(data.Error);
- return;
- }
-
- var $this, orig_value, newvalue;
+ .done(function(resp) {
+ $('.storage_dialog #uploader .input-path').prop('disabled', false);
+ var result = '',
+ data = resp.data.result;
+
+ // hide activity indicator
+ $('.fileinfo').find('span.activity').hide();
+ if (data.Code === 0) {
+ Alertify.error(data.Error);
+ return;
+ }
- // generate HTML for files/folder and render into container
- if (!_.isEmpty(data)) {
- if ($('.fileinfo').data('view') == 'grid') {
- result += '';
- Object.keys(data).sort(function keyOrder(x, y) {
- return pgAdmin.natural_sort(x.toLowerCase(), y.toLowerCase());
- }).forEach(function(key) {
- var props = (data[key]).Properties,
- cap_classes = '';
-
- Object.keys(capabilities).forEach(function(cap) {
- if (has_capability(data[key], capabilities[cap])) {
- cap_classes += 'cap_' + capabilities[cap];
- }
- });
+ var $this, orig_value, newvalue;
+
+ // generate HTML for files/folder and render into container
+ if (!_.isEmpty(data)) {
+ if ($('.fileinfo').data('view') == 'grid') {
+ result += '';
- } else {
- result += '';
- result += '';
- result += '' + lg.name + ' ';
- result += '' + lg.size + ' ';
- result += '' + lg.modified + ' ';
- result += '';
-
- Object.keys(data).sort(function keyOrder(x, y) {
- return pgAdmin.natural_sort(x.toLowerCase(), y.toLowerCase());
- }).forEach(function(key) {
- var path = _.escape((data[key]).Path),
- props = (data[key]).Properties,
- cap_classes = '',
- cap, class_type, icon_type;
-
- for (cap in capabilities) {
- if (has_capability(data[key], capabilities[cap])) {
- cap_classes += ' cap_' + capabilities[cap];
+ result += '';
+ } else {
+ result += '';
+ result += '';
+ result += '' + lg.name + ' ';
+ result += '' + lg.size + ' ';
+ result += '' + lg.modified + ' ';
+ result += '';
+
+ Object.keys(data).sort(function keyOrder(x, y) {
+ return pgAdmin.natural_sort(x.toLowerCase(), y.toLowerCase());
+ }).forEach(function(key) {
+ var path = _.escape((data[key]).Path),
+ props = (data[key]).Properties,
+ cap_classes = '',
+ cap, class_type, icon_type;
+
+ for (cap in capabilities) {
+ if (has_capability(data[key], capabilities[cap])) {
+ cap_classes += ' cap_' + capabilities[cap];
+ }
}
- }
- (data[key]).Capabilities = capabilities;
- bindToolbar(data[key]);
+ (data[key]).Capabilities = capabilities;
+ bindToolbar(data[key]);
- if ((data[key]).file_type == 'dir') {
- class_type = 'tbl_folder';
- icon_type = 'fa fa-folder-open fm_folder_list';
- } else if ((data[key]).file_type == 'drive') {
- class_type = 'tbl_drive';
- icon_type = 'fa fa-hdd-o';
- } else {
- class_type = 'tbl_file';
- icon_type = 'fa fa-file-text-o';
- }
+ if ((data[key]).file_type == 'dir') {
+ class_type = 'tbl_folder';
+ icon_type = 'fa fa-folder-open fm_folder_list';
+ } else if ((data[key]).file_type == 'drive') {
+ class_type = 'tbl_drive';
+ icon_type = 'fa fa-hdd-o';
+ } else {
+ class_type = 'tbl_file';
+ icon_type = 'fa fa-file-text-o';
+ }
- result += '';
+ result += ' ';
- var fm_filename = (data[key]).Filename;
- if (fm_filename.length > 48) {
- fm_filename = (data[key]).Filename.substr(0, 48) + '...';
- }
- fm_filename = _.escape(fm_filename);
+ var fm_filename = (data[key]).Filename;
+ if (fm_filename.length > 48) {
+ fm_filename = (data[key]).Filename.substr(0, 48) + '...';
+ }
+ fm_filename = _.escape(fm_filename);
- result += '';
+ result += ' ';
- let data_protected = '';
- if ((data[key]).Protected == 1) {
- data_protected = ' ';
- }
- if (!has_capability(data[key], 'rename')) {
- result += data_protected;
- result += '' +
+ let data_protected = '';
+ if ((data[key]).Protected == 1) {
+ data_protected = ' ';
+ }
+ if (!has_capability(data[key], 'rename')) {
+ result += data_protected;
+ result += '' +
fm_filename + ' ';
- } else {
- result += ''+
+ } else {
+ result += '
'+
'
' +
' ' +
data_protected +
'' + fm_filename + ' ' +
'
' +
'
';
- }
- if (props.Size && props.Size != '') {
- result += '
' +
+ }
+ if (props.Size && props.Size != '') {
+ result += ' ' +
props.Size + ' ';
- } else {
- result += '
';
- }
+ } else {
+ result += '
';
+ }
- if (props['Date Modified'] && props['Date Modified'] != '') {
- result += '
' + props['Date Modified'] + ' ';
- } else {
- result += '
';
- }
+ if (props['Date Modified'] && props['Date Modified'] != '') {
+ result += '
' + props['Date Modified'] + ' ';
+ } else {
+ result += '
';
+ }
- result += '
';
- });
+ result += '';
+ });
- result += ' ';
- result += '
';
- }
- } else {
- if ($('.fileinfo').data('view') == 'grid') {
- result += '';
+ result += ' ';
+ result += '
';
+ }
} else {
+ if ($('.fileinfo').data('view') == 'grid') {
+ result += '';
+ } else {
/* file_listing_table class makes height 100%, because of which No folder message is not displayed
* file_listing_table_no_data will be removed when new folder is created
*/
- result += '';
- result += '' + lg.name + ' ' +
+ result += '';
+ result += '' + lg.name + ' ' +
'' + lg.size + ' ' +
'' + lg.modified + ' ' +
' ' +
' ';
- result += '
';
- }
- result += '' + lg.could_not_retrieve_folder + '
';
- var cap_no_folders = ['upload', 'create'];
+ result += '
';
+ }
+ result += '' + lg.could_not_retrieve_folder + '
';
+ var cap_no_folders = ['upload', 'create'];
- data.Capabilities = cap_no_folders;
- bindToolbar(data);
- }
+ data.Capabilities = cap_no_folders;
+ bindToolbar(data);
+ }
- // Add the new markup to the DOM.
- $('.fileinfo .file_listing').html(result);
- $('.fileinfo .file_listing #contents').tablesorter({
- headers: {
- 2: {
- sorter: 'shortDate',
+ // Add the new markup to the DOM.
+ $('.fileinfo .file_listing').html(result);
+ $('.fileinfo .file_listing #contents').tablesorter({
+ headers: {
+ 2: {
+ sorter: 'shortDate',
+ },
},
- },
- });
-
- // rename file/folder
- $('.file_manager button.rename').off().on('click', function(e) {
-
- if ($('.fileinfo').data('view') == 'grid') {
- e.stopPropagation();
- $this = $('.file_manager').find('#contents li.selected div');
- orig_value = decodeURI($this.find('span.less_text').attr('title'));
- newvalue = orig_value.substring(0, orig_value.indexOf('.'));
+ });
- if (newvalue === '') {
- newvalue = decodeURI(orig_value);
- }
+ // rename file/folder
+ $('.file_manager button.rename').off().on('click', function(e) {
- $this.find('input').toggle().val(newvalue).trigger('focus');
- $this.find('span').toggle();
+ if ($('.fileinfo').data('view') == 'grid') {
+ e.stopPropagation();
+ $this = $('.file_manager').find('#contents li.selected div');
+ orig_value = decodeURI($this.find('span.less_text').attr('title'));
+ newvalue = orig_value.substring(0, orig_value.indexOf('.'));
- // Rename folder/file on pressing enter key
- $('.file_manager').off().on('keyup', function(e) {
- if (e.keyCode == 13) {
- e.stopPropagation();
- $('.fileinfo #contents li.selected div').find(
- 'input'
- ).trigger('blur');
+ if (newvalue === '') {
+ newvalue = decodeURI(orig_value);
}
- });
- } else if ($('.fileinfo').data('view') == 'list') {
- e.stopPropagation();
- $this = $('.fileinfo').find(
- 'table#contents tbody tr.selected td:first-child div'
- );
- orig_value = decodeURI($this.find('span.less_text').html()),
- newvalue = orig_value.substring(0, orig_value.lastIndexOf('.'));
- if (orig_value.lastIndexOf('/') == orig_value.length - 1 || newvalue === '') {
- newvalue = decodeURI(orig_value);
- }
-
- $this.find('input').toggle().val(newvalue).trigger('focus');
- $this.find('span').toggle();
-
- // Rename folder/file on pressing enter key
- $('.file_manager').off().on('keyup', function(e) {
- if (e.keyCode == 13) {
- e.stopPropagation();
- $('.fileinfo table#contents tr.selected td div').find(
- 'input'
- ).trigger('blur');
- }
- });
- }
- });
+ $this.find('input').toggle().val(newvalue).trigger('focus');
+ $this.find('span').toggle();
- // Rename UI handling
- $('.fileinfo #contents li div').on('blur dblclick', 'input', function(e) {
- e.stopPropagation();
-
- var old_name = decodeURI($(this).siblings('span').attr('title'));
- newvalue = old_name.substring(0, old_name.indexOf('.'));
- var last = getFileExtension(old_name),
- data, new_name, path, full_name;
-
- if (old_name.indexOf('.') == 0) {
- last = '';
- }
-
- if (newvalue == '') {
- newvalue = decodeURI(old_name);
- }
-
- if (e.type == 'keydown') {
- if (e.which == 13) {
- full_name = decodeURI($(this).val()) + (
- last !== '' ? '.' + last : ''
+ // Rename folder/file on pressing enter key
+ $('.file_manager').off().on('keyup', function(e) {
+ if (e.keyCode == 13) {
+ e.stopPropagation();
+ $('.fileinfo #contents li.selected div').find(
+ 'input'
+ ).trigger('blur');
+ }
+ });
+ } else if ($('.fileinfo').data('view') == 'list') {
+ e.stopPropagation();
+ $this = $('.fileinfo').find(
+ 'table#contents tbody tr.selected td:first-child div'
);
+ orig_value = decodeURI($this.find('span.less_text').html()),
+ newvalue = orig_value.substring(0, orig_value.lastIndexOf('.'));
- $(this).toggle();
- $(this).siblings('span').toggle().html(full_name);
-
- new_name = decodeURI($(this).val());
- path = decodeURI($(this).parent().parent().find(
- 'span'
- ).attr('data-alt'));
- data = {
- 'Filename': old_name,
- 'Path': path,
- 'NewFilename': new_name,
- };
-
- if (newvalue !== new_name) {
- renameItem(data);
- var parent = $('.currentpath').val();
- getFolderInfo(parent);
+ if (orig_value.lastIndexOf('/') == orig_value.length - 1 || newvalue === '') {
+ newvalue = decodeURI(orig_value);
}
- e.stopPropagation();
- }
- if (
- e.which == 38 || e.which == 40 || e.which == 37 ||
- e.which == 39 || e.keyCode == 32
- ) {
- e.stopPropagation();
- }
- } else if (e.type == 'focusout') {
- if ($(this).css('display') == 'inline-block' || $(this).css('display') == 'inline') {
- full_name = decodeURI(
- $(this).val()
- ) + (last !== '' ? '.' + last : '');
-
- $(this).toggle();
- $(this).siblings('span').toggle().html(full_name);
-
- new_name = decodeURI($(this).val());
- path = decodeURI($(this).parent().parent().find(
- 'span'
- ).attr('data-alt'));
- data = {
- 'Filename': old_name,
- 'Path': path,
- 'NewFilename': new_name,
- };
+ $this.find('input').toggle().val(newvalue).trigger('focus');
+ $this.find('span').toggle();
- if (newvalue !== new_name) {
- renameItem(data);
- getFolderInfo($('.currentpath').val());
- }
+ // Rename folder/file on pressing enter key
+ $('.file_manager').off().on('keyup', function(e) {
+ if (e.keyCode == 13) {
+ e.stopPropagation();
+ $('.fileinfo table#contents tr.selected td div').find(
+ 'input'
+ ).trigger('blur');
+ }
+ });
}
- } else {
+ });
+
+ // Rename UI handling
+ $('.fileinfo #contents li div').on('blur dblclick', 'input', function(e) {
e.stopPropagation();
- }
- });
- $('.fileinfo table#contents tr td div').on(
- 'blur dblclick', 'input',
- function(e) {
- var old_name = decodeURI($(this).siblings('span').attr('title')),
- newvalue = old_name.substring(0, old_name.indexOf('.')),
- last = getFileExtension(old_name);
+ var old_name = decodeURI($(this).siblings('span').attr('title'));
+ newvalue = old_name.substring(0, old_name.indexOf('.'));
+ var last = getFileExtension(old_name),
+ data, new_name, path, full_name;
+
if (old_name.indexOf('.') == 0) {
last = '';
}
if (newvalue == '') {
- newvalue = old_name;
+ newvalue = decodeURI(old_name);
}
- if (e.type == 'focusout') {
- if ($(this).css('display') == 'inline-block' || $(this).css('display') == 'inline') {
- var full_name = decodeURI($(this).val()) + (
+ if (e.type == 'keydown') {
+ if (e.which == 13) {
+ full_name = decodeURI($(this).val()) + (
last !== '' ? '.' + last : ''
);
+
$(this).toggle();
$(this).siblings('span').toggle().html(full_name);
- var new_name = decodeURI($(this).val()),
- path = decodeURI($(this).parent().parent().attr('title')),
- data = {
- 'Filename': old_name,
- 'Path': path,
- 'NewFilename': new_name,
- };
+ new_name = decodeURI($(this).val());
+ path = decodeURI($(this).parent().parent().find(
+ 'span'
+ ).attr('data-alt'));
+ data = {
+ 'Filename': old_name,
+ 'Path': path,
+ 'NewFilename': new_name,
+ };
if (newvalue !== new_name) {
renameItem(data);
- var parent = path.split('/').reverse().slice(2).reverse().join('/') + '/';
+ var parent = $('.currentpath').val();
getFolderInfo(parent);
}
+ e.stopPropagation();
+ }
+
+ if (
+ e.which == 38 || e.which == 40 || e.which == 37 ||
+ e.which == 39 || e.keyCode == 32
+ ) {
+ e.stopPropagation();
+ }
+ } else if (e.type == 'focusout') {
+ if ($(this).css('display') == 'inline-block' || $(this).css('display') == 'inline') {
+ full_name = decodeURI(
+ $(this).val()
+ ) + (last !== '' ? '.' + last : '');
+
+ $(this).toggle();
+ $(this).siblings('span').toggle().html(full_name);
+
+ new_name = decodeURI($(this).val());
+ path = decodeURI($(this).parent().parent().find(
+ 'span'
+ ).attr('data-alt'));
+ data = {
+ 'Filename': old_name,
+ 'Path': path,
+ 'NewFilename': new_name,
+ };
+
+ if (newvalue !== new_name) {
+ renameItem(data);
+ getFolderInfo($('.currentpath').val());
+ }
}
} else {
e.stopPropagation();
}
});
- var data_cap = {};
- data_cap.Capabilities = capabilities;
- /*
+ $('.fileinfo table#contents tr td div').on(
+ 'blur dblclick', 'input',
+ function(e) {
+ var old_name = decodeURI($(this).siblings('span').attr('title')),
+ newvalue = old_name.substring(0, old_name.indexOf('.')),
+ last = getFileExtension(old_name);
+ if (old_name.indexOf('.') == 0) {
+ last = '';
+ }
+
+ if (newvalue == '') {
+ newvalue = old_name;
+ }
+
+ if (e.type == 'focusout') {
+ if ($(this).css('display') == 'inline-block' || $(this).css('display') == 'inline') {
+ var full_name = decodeURI($(this).val()) + (
+ last !== '' ? '.' + last : ''
+ );
+ $(this).toggle();
+ $(this).siblings('span').toggle().html(full_name);
+
+ var new_name = decodeURI($(this).val()),
+ path = decodeURI($(this).parent().parent().attr('title')),
+ data = {
+ 'Filename': old_name,
+ 'Path': path,
+ 'NewFilename': new_name,
+ };
+
+ if (newvalue !== new_name) {
+ renameItem(data);
+ var parent = path.split('/').reverse().slice(2).reverse().join('/') + '/';
+ getFolderInfo(parent);
+ }
+ }
+ } else {
+ e.stopPropagation();
+ }
+ });
+
+ var data_cap = {};
+ data_cap.Capabilities = capabilities;
+ /*
* Bind click events
* Select items - afolder dblclick
*/
- if ($('.fileinfo').data('view') == 'grid') {
+ if ($('.fileinfo').data('view') == 'grid') {
// Get into folder on dblclick
- $('.fileinfo').find('#contents li').dblclick(function(e) {
- e.stopPropagation();
- // Enable/Disable level up button
- enab_dis_level_up();
+ $('.fileinfo').find('#contents li').dblclick(function(e) {
+ e.stopPropagation();
+ // Enable/Disable level up button
+ enab_dis_level_up();
- var path = decodeURI($(this).find('span').attr('data-alt'));
+ var path = decodeURI($(this).find('span').attr('data-alt'));
- if (path.lastIndexOf('/') == path.length - 1 || path.lastIndexOf('\\') == path.length - 1) {
- $('.file_manager_ok').addClass('disabled');
- $('.file_manager_ok').attr('disabled', true);
- $('.file_manager button.delete, .file_manager button.rename').attr('disabled', 'disabled');
- $('.file_manager button.download').attr('disabled', 'disabled');
+ if (path.lastIndexOf('/') == path.length - 1 || path.lastIndexOf('\\') == path.length - 1) {
+ $('.file_manager_ok').addClass('disabled');
+ $('.file_manager_ok').attr('disabled', true);
+ $('.file_manager button.delete, .file_manager button.rename').attr('disabled', 'disabled');
+ $('.file_manager button.download').attr('disabled', 'disabled');
- getFolderInfo(path);
+ getFolderInfo(path);
- } else {
- var is_valid_file = getFileInfo(path);
- if (is_valid_file && check_file_capability(e, data_cap, 'grid')) {
- $('.file_manager_ok').trigger('click');
+ } else {
+ var is_valid_file = getFileInfo(path);
+ if (is_valid_file && check_file_capability(e, data_cap, 'grid')) {
+ $('.file_manager_ok').trigger('click');
+ }
}
- }
- });
-
- $('.fileinfo').find('#contents li').on('click', function(e) {
- e.stopPropagation();
- var path = decodeURI($(this).find('.clip span').attr('data-alt')),
- is_protected = $(this).find(
- '.clip span.fm_lock_icon'
- ).attr('data-protected');
+ });
- if (path.lastIndexOf('/') == path.length - 1 || path.lastIndexOf('\\') == path.length - 1) {
- if (
- has_capability(data_cap, 'select_folder') &&
+ $('.fileinfo').find('#contents li').on('click', function(e) {
+ e.stopPropagation();
+ var path = decodeURI($(this).find('.clip span').attr('data-alt')),
+ is_protected = $(this).find(
+ '.clip span.fm_lock_icon'
+ ).attr('data-protected');
+
+ if (path.lastIndexOf('/') == path.length - 1 || path.lastIndexOf('\\') == path.length - 1) {
+ if (
+ has_capability(data_cap, 'select_folder') &&
is_protected == undefined
- ) {
- $(this).parent().find('li.selected').removeClass('selected');
- $(this).addClass('selected');
-
- $('.file_manager_ok').removeClass('disabled');
- $('.file_manager_ok').attr('disabled', false);
- $('.file_manager button.delete, .file_manager button.rename').removeAttr(
- 'disabled', 'disabled'
- );
- $('.file_manager button.download').attr(
- 'disabled', 'disabled'
- );
- // set selected folder name in breadcrums
- $('.file_manager #uploader .input-path').hide();
- $('.file_manager #uploader .show_selected_file').remove();
- $('' + path + ' ').appendTo(
- '.file_manager #uploader .filemanager-path-group'
- );
- }
- pgAdmin.FileUtils.setUploader(path);
- } else {
- if (
- has_capability(data_cap, 'select_file') &&
+ ) {
+ $(this).parent().find('li.selected').removeClass('selected');
+ $(this).addClass('selected');
+
+ $('.file_manager_ok').removeClass('disabled');
+ $('.file_manager_ok').attr('disabled', false);
+ $('.file_manager button.delete, .file_manager button.rename').removeAttr(
+ 'disabled', 'disabled'
+ );
+ $('.file_manager button.download').attr(
+ 'disabled', 'disabled'
+ );
+ // set selected folder name in breadcrums
+ $('.file_manager #uploader .input-path').hide();
+ $('.file_manager #uploader .show_selected_file').remove();
+ $('' + path + ' ').appendTo(
+ '.file_manager #uploader .filemanager-path-group'
+ );
+ }
+ pgAdmin.FileUtils.setUploader(path);
+ } else {
+ if (
+ has_capability(data_cap, 'select_file') &&
is_protected == undefined
- ) {
- $(this).parent().find('li.selected').removeClass('selected');
- $(this).addClass('selected');
- $('.file_manager_ok').removeClass('disabled');
- $('.file_manager_ok').attr('disabled', false);
- $('.file_manager button.delete, .file_manager button.download, .file_manager button.rename').removeAttr(
- 'disabled'
- );
- // set selected folder name in breadcrums
- $('.file_manager #uploader .show_selected_file').remove();
- }
-
- getFileInfo(path);
- }
- });
- } else {
- $('.fileinfo table#contents tbody tr').on('click', function(e) {
- e.stopPropagation();
- var path = decodeURI($('td:first-child', this).attr('title')),
- is_protected = $('td:first-child', this).find(
- 'i.tbl_lock_icon'
- ).attr('data-protected');
-
- if (path.lastIndexOf('/') == path.length - 1 || path.lastIndexOf('\\') == path.length - 1) {
- if (has_capability(data_cap, 'select_folder') && is_protected == undefined) {
- $(this).parent().find('tr.selected').removeClass('selected');
- $('td:first-child', this).parent().addClass('selected');
- $('.file_manager_ok').removeClass('disabled');
- $('.file_manager_ok').attr('disabled', false);
- $('.file_manager button.download').attr('disabled', 'disabled');
- $('.file_manager button.delete, .file_manager button.rename').removeAttr('disabled');
+ ) {
+ $(this).parent().find('li.selected').removeClass('selected');
+ $(this).addClass('selected');
+ $('.file_manager_ok').removeClass('disabled');
+ $('.file_manager_ok').attr('disabled', false);
+ $('.file_manager button.delete, .file_manager button.download, .file_manager button.rename').removeAttr(
+ 'disabled'
+ );
+ // set selected folder name in breadcrums
+ $('.file_manager #uploader .show_selected_file').remove();
+ }
- // set selected folder name in breadcrums
- $('.file_manager #uploader .input-path').hide();
- $('.file_manager #uploader .show_selected_file').remove();
- $('' + path + ' ').appendTo(
- '.file_manager #uploader .filemanager-path-group'
- );
- }
- pgAdmin.FileUtils.setUploader(path);
- } else {
- if (has_capability(data_cap, 'select_file') && is_protected == undefined) {
- $(this).parent().find('tr.selected').removeClass('selected');
- $('td:first-child', this).parent().addClass('selected');
- $('.file_manager button.delete, .file_manager button.download, .file_manager button.rename').removeAttr(
- 'disabled'
- );
- // set selected folder name in breadcrums
- $('.file_manager #uploader .show_selected_file').remove();
+ getFileInfo(path);
}
+ });
+ } else {
+ $('.fileinfo table#contents tbody tr').on('click', function(e) {
+ e.stopPropagation();
+ var path = decodeURI($('td:first-child', this).attr('title')),
+ is_protected = $('td:first-child', this).find(
+ 'i.tbl_lock_icon'
+ ).attr('data-protected');
+
+ if (path.lastIndexOf('/') == path.length - 1 || path.lastIndexOf('\\') == path.length - 1) {
+ if (has_capability(data_cap, 'select_folder') && is_protected == undefined) {
+ $(this).parent().find('tr.selected').removeClass('selected');
+ $('td:first-child', this).parent().addClass('selected');
+ $('.file_manager_ok').removeClass('disabled');
+ $('.file_manager_ok').attr('disabled', false);
+ $('.file_manager button.download').attr('disabled', 'disabled');
+ $('.file_manager button.delete, .file_manager button.rename').removeAttr('disabled');
+
+ // set selected folder name in breadcrums
+ $('.file_manager #uploader .input-path').hide();
+ $('.file_manager #uploader .show_selected_file').remove();
+ $('' + path + ' ').appendTo(
+ '.file_manager #uploader .filemanager-path-group'
+ );
+ }
+ pgAdmin.FileUtils.setUploader(path);
+ } else {
+ if (has_capability(data_cap, 'select_file') && is_protected == undefined) {
+ $(this).parent().find('tr.selected').removeClass('selected');
+ $('td:first-child', this).parent().addClass('selected');
+ $('.file_manager button.delete, .file_manager button.download, .file_manager button.rename').removeAttr(
+ 'disabled'
+ );
+ // set selected folder name in breadcrums
+ $('.file_manager #uploader .show_selected_file').remove();
+ }
- getFileInfo(path);
- }
- });
+ getFileInfo(path);
+ }
+ });
- $('.fileinfo table#contents tbody tr').on('dblclick', function(e) {
- e.stopPropagation();
- // Enable/Disable level up button
- enab_dis_level_up();
- var path = $('td:first-child', this).attr('title');
+ $('.fileinfo table#contents tbody tr').on('dblclick', function(e) {
+ e.stopPropagation();
+ // Enable/Disable level up button
+ enab_dis_level_up();
+ var path = $('td:first-child', this).attr('title');
- if (path.lastIndexOf('/') == path.length - 1 || path.lastIndexOf('\\') == path.length - 1) {
- $('.file_manager_ok').addClass('disabled');
- $('.file_manager_ok').attr('disabled', true);
- $('.file_manager button.download').attr('disabled', 'disabled');
- $('.file_manager button.delete, .file_manager button.rename').attr('disabled', 'disabled');
- getFolderInfo(path);
- } else {
- var is_valid_file = getFileInfo(path);
- if (
- is_valid_file && check_file_capability(e, data_cap, 'table')
- ) {
- $('.file_manager_ok').trigger('click');
+ if (path.lastIndexOf('/') == path.length - 1 || path.lastIndexOf('\\') == path.length - 1) {
+ $('.file_manager_ok').addClass('disabled');
+ $('.file_manager_ok').attr('disabled', true);
+ $('.file_manager button.download').attr('disabled', 'disabled');
+ $('.file_manager button.delete, .file_manager button.rename').attr('disabled', 'disabled');
+ getFolderInfo(path);
+ } else {
+ var is_valid_file = getFileInfo(path);
+ if (
+ is_valid_file && check_file_capability(e, data_cap, 'table')
+ ) {
+ $('.file_manager_ok').trigger('click');
+ }
}
- }
- });
+ });
- }
+ }
//input_object.set_cap(data_cap);
- })
- .fail(function() {
- $('.storage_dialog #uploader .input-path').prop('disabled', false);
- });
+ })
+ .fail(function() {
+ $('.storage_dialog #uploader .input-path').prop('disabled', false);
+ });
};
// Enable/Disable level up button
diff --git a/web/pgadmin/misc/sql/static/js/sql.js b/web/pgadmin/misc/sql/static/js/sql.js
index 1b5d8d97..20f0af1e 100644
--- a/web/pgadmin/misc/sql/static/js/sql.js
+++ b/web/pgadmin/misc/sql/static/js/sql.js
@@ -134,30 +134,30 @@ define('misc.sql', [
}, 1000);
},
})
- .done(function(res) {
- if (pgAdmin.Browser.editor.getValue() != res) {
- pgAdmin.Browser.editor.setValue(res);
- }
- clearTimeout(timer);
- })
- .fail(function(xhr, error, message) {
- var _label = treeHierarchy[n_type].label;
- pgBrowser.Events.trigger(
- 'pgadmin:node:retrieval:error', 'sql', xhr, error, message, item
- );
- if (!Alertify.pgHandleItemError(xhr, error, message, {
- item: item,
- info: treeHierarchy,
- })) {
- Alertify.pgNotifier(
- error, xhr,
- S(gettext('Error retrieving the information - %s')).sprintf(
- message || _label
- ).value(),
- function() {}
+ .done(function(res) {
+ if (pgAdmin.Browser.editor.getValue() != res) {
+ pgAdmin.Browser.editor.setValue(res);
+ }
+ clearTimeout(timer);
+ })
+ .fail(function(xhr, error, message) {
+ var _label = treeHierarchy[n_type].label;
+ pgBrowser.Events.trigger(
+ 'pgadmin:node:retrieval:error', 'sql', xhr, error, message, item
);
- }
- });
+ if (!Alertify.pgHandleItemError(xhr, error, message, {
+ item: item,
+ info: treeHierarchy,
+ })) {
+ Alertify.pgNotifier(
+ error, xhr,
+ S(gettext('Error retrieving the information - %s')).sprintf(
+ message || _label
+ ).value(),
+ function() {}
+ );
+ }
+ });
}
}
diff --git a/web/pgadmin/misc/static/explain/js/explain.js b/web/pgadmin/misc/static/explain/js/explain.js
index c3af7560..af50bdd8 100644
--- a/web/pgadmin/misc/static/explain/js/explain.js
+++ b/web/pgadmin/misc/static/explain/js/explain.js
@@ -436,9 +436,9 @@ define('pgadmin.misc.explain', [
var mappedImage = (_.isFunction(imageMapper[node_type]) &&
imageMapper[node_type].apply(undefined, [data])) ||
imageMapper[node_type] || {
- 'image': 'ex_unknown.svg',
- 'image_text': node_type,
- };
+ 'image': 'ex_unknown.svg',
+ 'image_text': node_type,
+ };
data['image'] = mappedImage['image'];
data['image_text'] = mappedImage['image_text'];
diff --git a/web/pgadmin/misc/statistics/static/js/statistics.js b/web/pgadmin/misc/statistics/static/js/statistics.js
index 7cc1f633..77edc18b 100644
--- a/web/pgadmin/misc/statistics/static/js/statistics.js
+++ b/web/pgadmin/misc/statistics/static/js/statistics.js
@@ -86,10 +86,10 @@ define('misc.statistics', [
}),
// timestamptz
1184: 'string'
- /* Backgrid.DatetimeCell.extend({
+ /* Backgrid.DatetimeCell.extend({
includeDate: true, includeTime: true, includeMilli: true
}) */
- ,
+ ,
1266: 'string',
/* Backgrid.DatetimeCell.extend({
includeDate: false, includeTime: true, includeMilli: true
@@ -248,78 +248,78 @@ define('misc.statistics', [
}, 1000);
},
})
- .done(function(res) {
+ .done(function(res) {
// clear timer and reset message.
- clearTimeout(timer);
- $msgContainer.text('');
- if (res.data) {
- var data = self.data = res.data;
- if (node.hasCollectiveStatistics || data['rows'].length > 1) {
+ clearTimeout(timer);
+ $msgContainer.text('');
+ if (res.data) {
+ var data = self.data = res.data;
+ if (node.hasCollectiveStatistics || data['rows'].length > 1) {
// Listen scroll event to load more rows
- pgBrowser.Events.on(
- 'pgadmin-browser:panel-statistics:' +
+ pgBrowser.Events.on(
+ 'pgadmin-browser:panel-statistics:' +
wcDocker.EVENT.SCROLLED,
- self.__loadMoreRows
- );
- self.__createMultiLineStatistics.call(self, data, node.statsPrettifyFields);
- } else {
+ self.__loadMoreRows
+ );
+ self.__createMultiLineStatistics.call(self, data, node.statsPrettifyFields);
+ } else {
// Do not listen the scroll event
- pgBrowser.Events.off(
- 'pgadmin-browser:panel-statistics:' +
+ pgBrowser.Events.off(
+ 'pgadmin-browser:panel-statistics:' +
wcDocker.EVENT.SCROLLED,
- self.__loadMoreRows
- );
- self.__createSingleLineStatistics.call(self, data, node.statsPrettifyFields);
- }
+ self.__loadMoreRows
+ );
+ self.__createSingleLineStatistics.call(self, data, node.statsPrettifyFields);
+ }
- if (self.grid) {
- delete self.grid;
- self.grid = null;
- }
+ if (self.grid) {
+ delete self.grid;
+ self.grid = null;
+ }
- self.grid = new Backgrid.Grid({
- emptyText: 'No data found',
- columns: self.columns,
- collection: self.collection,
- className: GRID_CLASSES,
- });
- self.grid.render();
- $gridContainer.empty();
- $gridContainer.append(self.grid.$el);
-
- if (!$msgContainer.hasClass('d-none')) {
- $msgContainer.addClass('d-none');
- }
- $gridContainer.removeClass('d-none');
+ self.grid = new Backgrid.Grid({
+ emptyText: 'No data found',
+ columns: self.columns,
+ collection: self.collection,
+ className: GRID_CLASSES,
+ });
+ self.grid.render();
+ $gridContainer.empty();
+ $gridContainer.append(self.grid.$el);
+
+ if (!$msgContainer.hasClass('d-none')) {
+ $msgContainer.addClass('d-none');
+ }
+ $gridContainer.removeClass('d-none');
- } else if (res.info) {
- if (!$gridContainer.hasClass('d-none')) {
- $gridContainer.addClass('d-none');
+ } else if (res.info) {
+ if (!$gridContainer.hasClass('d-none')) {
+ $gridContainer.addClass('d-none');
+ }
+ $msgContainer.text(res.info);
+ $msgContainer.removeClass('d-none');
}
- $msgContainer.text(res.info);
- $msgContainer.removeClass('d-none');
- }
- })
- .fail(function(xhr, error, message) {
- var _label = treeHierarchy[n_type].label;
- pgBrowser.Events.trigger(
- 'pgadmin:node:retrieval:error', 'statistics', xhr, error, message, item
- );
- if (!Alertify.pgHandleItemError(xhr, error, message, {
- item: item,
- info: treeHierarchy,
- })) {
- Alertify.pgNotifier(
- error, xhr,
- S(gettext('Error retrieving the information - %s')).sprintf(
- message || _label
- ).value(),
- function() {}
+ })
+ .fail(function(xhr, error, message) {
+ var _label = treeHierarchy[n_type].label;
+ pgBrowser.Events.trigger(
+ 'pgadmin:node:retrieval:error', 'statistics', xhr, error, message, item
);
- }
- // show failed message.
- $msgContainer.text(gettext('Failed to retrieve data from the server.'));
- });
+ if (!Alertify.pgHandleItemError(xhr, error, message, {
+ item: item,
+ info: treeHierarchy,
+ })) {
+ Alertify.pgNotifier(
+ error, xhr,
+ S(gettext('Error retrieving the information - %s')).sprintf(
+ message || _label
+ ).value(),
+ function() {}
+ );
+ }
+ // show failed message.
+ $msgContainer.text(gettext('Failed to retrieve data from the server.'));
+ });
}
}
if (msg != '') {
diff --git a/web/pgadmin/preferences/static/js/preferences.js b/web/pgadmin/preferences/static/js/preferences.js
index 15d9e088..513e3381 100644
--- a/web/pgadmin/preferences/static/js/preferences.js
+++ b/web/pgadmin/preferences/static/js/preferences.js
@@ -273,10 +273,10 @@ define('pgadmin.preferences', [
return 'keyboardShortcut';
default:
if (console && console.warn) {
- // Warning for developer only.
+ // Warning for developer only.
console.warn(
- 'Hmm.. We don\'t know how to render this type - \'\'' + p.type + '\' of control.'
- );
+ 'Hmm.. We don\'t know how to render this type - \'\'' + p.type + '\' of control.'
+ );
}
return 'input';
}
@@ -314,7 +314,7 @@ define('pgadmin.preferences', [
return true;
if (d.preferences) {
- /*
+ /*
* Clear the existing html in the preferences content
*/
$container.find('.preferences_content');
@@ -341,7 +341,7 @@ define('pgadmin.preferences', [
'mid': d.mid,
'name': p.name,
});
- /*
+ /*
* We don't know until now, how to render the control for
* this preference.
*/
@@ -356,13 +356,13 @@ define('pgadmin.preferences', [
d.sortable = false;
break;
case 'loaded':
- // Let's select the first category from the prefrences.
- // We need to wait for sometime before all item gets loaded
- // properly.
+ // Let's select the first category from the prefrences.
+ // We need to wait for sometime before all item gets loaded
+ // properly.
setTimeout(
- function() {
- selectFirstCategory(api, null);
- }, 300);
+ function() {
+ selectFirstCategory(api, null);
+ }, 300);
break;
}
return true;
diff --git a/web/pgadmin/settings/static/js/settings.js b/web/pgadmin/settings/static/js/settings.js
index 4566f149..a79471a6 100644
--- a/web/pgadmin/settings/static/js/settings.js
+++ b/web/pgadmin/settings/static/js/settings.js
@@ -43,18 +43,18 @@ define('pgadmin.settings', [
type: 'DELETE',
async: false,
})
- .done(function() {
+ .done(function() {
// Prevent saving layout on server for next page reload.
- $(window).off('unload');
- window.onbeforeunload = null;
- // Now reload page
- location.reload(true);
- })
- .fail(function() {
- console.warn(
- 'Something went wrong on server while resetting layout.'
- );
- });
+ $(window).off('unload');
+ window.onbeforeunload = null;
+ // Now reload page
+ location.reload(true);
+ })
+ .fail(function() {
+ console.warn(
+ 'Something went wrong on server while resetting layout.'
+ );
+ });
},
function() {
diff --git a/web/pgadmin/static/bundle/app.js b/web/pgadmin/static/bundle/app.js
index 85fb1ebe..68f8a3b1 100644
--- a/web/pgadmin/static/bundle/app.js
+++ b/web/pgadmin/static/bundle/app.js
@@ -22,11 +22,11 @@ define('app', [
}
};
- // Initialize modules registered to pgAdmin, pgAdmin.Browser and Tools object.
+ // Initialize modules registered to pgAdmin, pgAdmin.Browser and Tools object.
initializeModules(pgAdmin);
initializeModules(pgAdmin.Browser);
initializeModules(pgAdmin.Tools);
- // create menus after all modules are initialized.
+ // create menus after all modules are initialized.
pgAdmin.Browser.create_menus();
});
diff --git a/web/pgadmin/static/js/alertify.pgadmin.defaults.js b/web/pgadmin/static/js/alertify.pgadmin.defaults.js
index b93d49fb..93b4e358 100644
--- a/web/pgadmin/static/js/alertify.pgadmin.defaults.js
+++ b/web/pgadmin/static/js/alertify.pgadmin.defaults.js
@@ -355,25 +355,25 @@ define([
),
dataType: 'json',
})
- .done(function(res) {
- if (res.success && 'connected' in res.data) {
- if (res.data.connected) {
+ .done(function(res) {
+ if (res.success && 'connected' in res.data) {
+ if (res.data.connected) {
// Server is connected, but - the connection with the
// particular database has been lost.
- pgBrowser.Events.trigger(
- 'pgadmin:database:connection:lost', args.item, jsonResp
- );
- return;
+ pgBrowser.Events.trigger(
+ 'pgadmin:database:connection:lost', args.item, jsonResp
+ );
+ return;
+ }
}
- }
- // Serever was not connected, we should first try to connect
- // the server.
- reconnectServer();
- })
- .fail(function() {
- reconnectServer();
- });
+ // Serever was not connected, we should first try to connect
+ // the server.
+ reconnectServer();
+ })
+ .fail(function() {
+ reconnectServer();
+ });
return true;
}
return false;
diff --git a/web/pgadmin/static/js/alertify/dialog.js b/web/pgadmin/static/js/alertify/dialog.js
index 82c8f5fb..fa1100b1 100644
--- a/web/pgadmin/static/js/alertify/dialog.js
+++ b/web/pgadmin/static/js/alertify/dialog.js
@@ -22,9 +22,9 @@ import {getTreeNodeHierarchyFromIdentifier} from '../tree/pgadmin_tree_node';
*/
export class Dialog {
constructor(errorAlertTitle,
- dialogContainerSelector,
- pgBrowser, $, alertify, DialogModel,
- backform = Backform) {
+ dialogContainerSelector,
+ pgBrowser, $, alertify, DialogModel,
+ backform = Backform) {
this.errorAlertTitle = errorAlertTitle;
this.alertify = alertify;
this.pgBrowser = pgBrowser;
diff --git a/web/pgadmin/static/js/alertify/dialog_factory.js b/web/pgadmin/static/js/alertify/dialog_factory.js
index bb3eef8d..683fa756 100644
--- a/web/pgadmin/static/js/alertify/dialog_factory.js
+++ b/web/pgadmin/static/js/alertify/dialog_factory.js
@@ -12,8 +12,8 @@ import {RestoreDialogWrapper} from '../../../tools/restore/static/js/restore_dia
export class DialogFactory {
constructor(pgBrowser, $,
- alertify, DialogModel,
- backform, dialogContainerSelector) {
+ alertify, DialogModel,
+ backform, dialogContainerSelector) {
this.pgBrowser = pgBrowser;
this.jquery = $;
this.alertify = alertify;
diff --git a/web/pgadmin/static/js/backform.pgadmin.js b/web/pgadmin/static/js/backform.pgadmin.js
index 1d8f495c..0342be3a 100644
--- a/web/pgadmin/static/js/backform.pgadmin.js
+++ b/web/pgadmin/static/js/backform.pgadmin.js
@@ -511,7 +511,7 @@ define([
data.options = _.defaults({
disabled: evalF(field.disabled, field, this.model),
}, this.field.get('options'), this.defaults.options,
- $.fn.bootstrapToggle.defaults);
+ $.fn.bootstrapToggle.defaults);
this.$el.html(this.template(data)).addClass(field.name);
@@ -573,8 +573,8 @@ define([
this.cleanup();
var c = this.$el
- .children().first().children('.active')
- .first().attr('id'),
+ .children().first().children('.active')
+ .first().attr('id'),
m = this.model,
controls = this.controls,
tmpls = this.template,
@@ -625,15 +625,15 @@ define([
function() {
self.hidden_tab = $(this).data('tabIndex');
}).on('shown.bs.tab', function() {
- var self = this;
- self.shown_tab = $(self).data('tabIndex');
- m.trigger('pg-property-tab-changed', {
- 'model': m,
- 'shown': self.shown_tab,
- 'hidden': self.hidden_tab,
- 'tab': self,
- });
+ var self = this;
+ self.shown_tab = $(self).data('tabIndex');
+ m.trigger('pg-property-tab-changed', {
+ 'model': m,
+ 'shown': self.shown_tab,
+ 'hidden': self.hidden_tab,
+ 'tab': self,
});
+ });
});
var makeActive = tabHead.find('[id="' + c + '"]').first();
@@ -1748,7 +1748,7 @@ define([
var visible = true;
ver_in_limit = (_.isUndefined(server_info) ? true :
((_.isUndefined(s.server_type) ? true :
- (server_info.type in s.server_type)) &&
+ (server_info.type in s.server_type)) &&
(_.isUndefined(s.min_version) ? true :
(server_info.version >= s.min_version)) &&
(_.isUndefined(s.max_version) ? true :
@@ -1783,7 +1783,7 @@ define([
groups[group] = (groups[group] || []);
ver_in_limit = (_.isUndefined(server_info) ? true :
((_.isUndefined(s.server_type) ? true :
- (server_info.type in s.server_type)) &&
+ (server_info.type in s.server_type)) &&
(_.isUndefined(s.min_version) ? true :
(server_info.version >= s.min_version)) &&
(_.isUndefined(s.max_version) ? true :
@@ -2242,7 +2242,7 @@ define([
* SQL Editor can be in different tab
*/
let browser = window.opener ?
- window.opener.pgAdmin.Browser : window.top.pgAdmin.Browser;
+ window.opener.pgAdmin.Browser : window.top.pgAdmin.Browser;
let sqlEditPreferences = browser.get_preferences_for_module('sqleditor');
@@ -2916,12 +2916,12 @@ define([
_.each(innerFields, function(fld) {
var f = new Backform.Field(
- _.extend({}, {
- id: fld['name'],
- name: fld['name'],
- control: fld['type'] == 'checkbox' ? 'checkboxWithBox' : fld['type'],
- label: fld['label'],
- })
+ _.extend({}, {
+ id: fld['name'],
+ name: fld['name'],
+ control: fld['type'] == 'checkbox' ? 'checkboxWithBox' : fld['type'],
+ label: fld['label'],
+ })
),
cntr = new (f.get('control')) ({
field: f,
diff --git a/web/pgadmin/static/js/backgrid.pgadmin.js b/web/pgadmin/static/js/backgrid.pgadmin.js
index ca91dfcb..b717230c 100644
--- a/web/pgadmin/static/js/backgrid.pgadmin.js
+++ b/web/pgadmin/static/js/backgrid.pgadmin.js
@@ -68,10 +68,10 @@ define([
var col_type = column.get('cell').prototype.className || 'string-cell',
comparator = this.makeComparator(column.get('name'), order,
order ?
- column.sortValue() :
- function(model) {
- return model.cid.replace('c', '') * 1;
- }, col_type);
+ column.sortValue() :
+ function(model) {
+ return model.cid.replace('c', '') * 1;
+ }, col_type);
if (Backbone.PageableCollection &&
collection instanceof Backbone.PageableCollection) {
@@ -527,9 +527,9 @@ define([
tabIndex: -1,
type: 'checkbox',
}).prop('checked', rawValue).prop('disabled', !editable).attr('data-toggle', 'toggle')
- .attr('data-size', options.size).attr('data-on', options.onText).attr('data-off', options.offText)
- .attr('data-width', options.width).attr('data-height', options.height)
- .attr('data-onstyle', options.onColor).attr('data-offstyle', options.offColor));
+ .attr('data-size', options.size).attr('data-on', options.onText).attr('data-off', options.offText)
+ .attr('data-width', options.width).attr('data-height', options.height)
+ .attr('data-onstyle', options.onColor).attr('data-offstyle', options.offColor));
this.$input = this.$el.find('input[type=checkbox]').first();
@@ -633,9 +633,9 @@ define([
'<%= selected ? \'selected="selected"\' : "" %>>',
'<%- label %>',
].join(''),
- null, {
- variable: null,
- }),
+ null, {
+ variable: null,
+ }),
initialize: function() {
Backgrid.SelectCell.prototype.initialize.apply(this, arguments);
@@ -683,7 +683,7 @@ define([
openOnEnter: false,
multiple: false,
}, self.defaults.select2,
- (col.select2 || {})
+ (col.select2 || {})
),
selectTpl = _.template('> ');
@@ -1409,9 +1409,9 @@ define([
var m = this.modelInUnixOffset ? moment(rawData) :
this.modelInUnixTimestamp ? moment.unix(rawData) :
- this.modelInUTC ?
- moment.utc(rawData, this.modelFormat, this.modelLang) :
- moment(rawData, this.modelFormat, this.modelLang);
+ this.modelInUTC ?
+ moment.utc(rawData, this.modelFormat, this.modelLang) :
+ moment(rawData, this.modelFormat, this.modelLang);
if (this.displayInUnixOffset) return +m;
@@ -1439,9 +1439,9 @@ define([
var m = this.displayInUnixOffset ? moment(+formattedData) :
this.displayInUnixTimestamp ? moment.unix(+formattedData) :
- this.displayInUTC ?
- moment.utc(formattedData, this.displayFormat, this.displayLang) :
- moment(formattedData, this.displayFormat, this.displayLang);
+ this.displayInUTC ?
+ moment.utc(formattedData, this.displayFormat, this.displayLang) :
+ moment(formattedData, this.displayFormat, this.displayLang);
if (!m || !m.isValid()) return (this.allowEmpty && formattedData === '') ? null : undefined;
@@ -1636,7 +1636,7 @@ define([
if (
_.isFunction(editable) ? !!editable.apply(column, [model]) :
- !!editable
+ !!editable
) {
this.$el.addClass('editable');
} else {
diff --git a/web/pgadmin/static/js/keyboard_shortcuts.js b/web/pgadmin/static/js/keyboard_shortcuts.js
index 70aab912..017529b7 100644
--- a/web/pgadmin/static/js/keyboard_shortcuts.js
+++ b/web/pgadmin/static/js/keyboard_shortcuts.js
@@ -212,21 +212,21 @@ function keyboardShortcutsQueryTool(
queryToolActions.executeRollback(sqlEditorController);
}
} else if ((
- (this.isMac() && event.metaKey) ||
+ (this.isMac() && event.metaKey) ||
(!this.isMac() && event.ctrlKey)
- ) && !event.altKey && event.shiftKey && keyCode === FWD_SLASH_KEY) {
+ ) && !event.altKey && event.shiftKey && keyCode === FWD_SLASH_KEY) {
this._stopEventPropagation(event);
queryToolActions.commentBlockCode(sqlEditorController);
} else if ((
- (this.isMac() && !this.isKeyCtrlAltShift(event) && event.metaKey) ||
+ (this.isMac() && !this.isKeyCtrlAltShift(event) && event.metaKey) ||
(!this.isMac() && !this.isKeyAltShift(event) && event.ctrlKey)
- ) && keyCode === FWD_SLASH_KEY) {
+ ) && keyCode === FWD_SLASH_KEY) {
this._stopEventPropagation(event);
queryToolActions.commentLineCode(sqlEditorController);
} else if ((
- (this.isMac() && !this.isKeyCtrlAltShift(event) && event.metaKey) ||
+ (this.isMac() && !this.isKeyCtrlAltShift(event) && event.metaKey) ||
(!this.isMac() && !this.isKeyAltShift(event) && event.ctrlKey)
- ) && keyCode === PERIOD_KEY) {
+ ) && keyCode === PERIOD_KEY) {
this._stopEventPropagation(event);
queryToolActions.uncommentLineCode(sqlEditorController);
} else if (keyCode == ESC_KEY) {
@@ -296,22 +296,11 @@ function keyboardShortcutsQueryTool(
return panel_id;
}
-module.exports = {
- processEventDebugger: keyboardShortcutsDebugger,
- processEventQueryTool: keyboardShortcutsQueryTool,
- getInnerPanel: getInnerPanel,
- validateShortcutKeys: validateShortcutKeys,
- // misc functions
- _stopEventPropagation: _stopEventPropagation,
- isMac: isMac,
- isKeyCtrlAlt: isKeyCtrlAlt,
- isKeyAltShift: isKeyAltShift,
- isKeyCtrlShift: isKeyCtrlShift,
- isKeyCtrlAltShift: isKeyCtrlAltShift,
- isAltShiftBoth: isAltShiftBoth,
- isCtrlShiftBoth: isCtrlShiftBoth,
- isCtrlAltBoth: isCtrlAltBoth,
- shortcut_key : shortcut_key,
- shortcut_title : shortcut_title,
- shortcut_accesskey_title : shortcut_accesskey_title,
+export {
+ keyboardShortcutsDebugger as processEventDebugger,
+ keyboardShortcutsQueryTool as processEventQueryTool,
+ getInnerPanel, validateShortcutKeys,
+ _stopEventPropagation, isMac, isKeyCtrlAlt, isKeyAltShift, isKeyCtrlShift,
+ isKeyCtrlAltShift, isAltShiftBoth, isCtrlShiftBoth, isCtrlAltBoth,
+ shortcut_key, shortcut_title, shortcut_accesskey_title,
};
diff --git a/web/pgadmin/static/js/modify_animation.js b/web/pgadmin/static/js/modify_animation.js
index 1e1e4cb0..420c9433 100644
--- a/web/pgadmin/static/js/modify_animation.js
+++ b/web/pgadmin/static/js/modify_animation.js
@@ -57,17 +57,17 @@ function modifyAlertifyAnimation(pgBrowser) {
if(enableAcitreeAnimation) {
$(document).find('link#alertify-no-animation')
- .attr('disabled', 'disabled');
+ .attr('disabled', 'disabled');
_.each(document.getElementsByTagName('iframe'), function(frame) {
$(frame.contentDocument).find('link#alertify-no-animation')
- .attr('disabled', 'disabled');
+ .attr('disabled', 'disabled');
});
} else {
$(document).find('link#alertify-no-animation')
- .removeAttr('disabled', 'disabled');
+ .removeAttr('disabled', 'disabled');
_.each(document.getElementsByTagName('iframe'), function(frame) {
$(frame.contentDocument).find('link#alertify-no-animation')
- .removeAttr('disabled', 'disabled');
+ .removeAttr('disabled', 'disabled');
});
}
}
diff --git a/web/pgadmin/static/js/slickgrid/editors.js b/web/pgadmin/static/js/slickgrid/editors.js
index 749fe6e0..e0fbd76b 100644
--- a/web/pgadmin/static/js/slickgrid/editors.js
+++ b/web/pgadmin/static/js/slickgrid/editors.js
@@ -53,7 +53,7 @@ import JSONBigNumber from 'json-bignumber';
$('' +
' '+ label +
' ')
- .appendTo($buttons);
+ .appendTo($buttons);
if (editable) {
$(''+
diff --git a/web/pgadmin/static/js/sqleditor/execute_query.js b/web/pgadmin/static/js/sqleditor/execute_query.js
index 8e2a1c4e..c3c9dc2a 100644
--- a/web/pgadmin/static/js/sqleditor/execute_query.js
+++ b/web/pgadmin/static/js/sqleditor/execute_query.js
@@ -97,7 +97,7 @@ class ExecuteQuery {
}).catch(function (error) {
self.onExecuteHTTPError(error);
}
- );
+ );
}
generateURLReconnectionFlag(shouldReconnect) {
diff --git a/web/pgadmin/static/js/sqleditor/filter_dialog.js b/web/pgadmin/static/js/sqleditor/filter_dialog.js
index ac7e2a22..f5662ea5 100644
--- a/web/pgadmin/static/js/sqleditor/filter_dialog.js
+++ b/web/pgadmin/static/js/sqleditor/filter_dialog.js
@@ -14,7 +14,7 @@ import Alertify from 'pgadmin.alertifyjs';
import pgAdmin from 'sources/pgadmin';
import Backform from 'pgadmin.backform';
import axios from 'axios';
-import queryToolActions from 'sources/sqleditor/query_tool_actions';
+var queryToolActions = require('sources/sqleditor/query_tool_actions');
import filterDialogModel from 'sources/sqleditor/filter_dialog_model';
import {handleQueryToolAjaxError} from 'sources/sqleditor/query_tool_http_error_handler';
@@ -40,89 +40,89 @@ let FilterDialog = {
'Cache-Control' : 'no-cache',
},
})
- .done(function (res) {
- let response = res.data.result;
-
- // Check the alertify dialog already loaded then delete it to clear
- // the cache
- if (Alertify.filterDialog) {
- delete Alertify.filterDialog;
- }
-
- // Create Dialog
- Alertify.dialog('filterDialog', function factory() {
- let $container = $('
');
- return {
- main: function() {
- this.set('title', gettext('Sort/Filter options'));
- },
- build: function() {
- this.elements.content.appendChild($container.get(0));
- Alertify.pgDialogBuild.apply(this);
- },
- setup: function() {
- return {
- buttons: [{
- text: '',
- key: 112,
- className: 'btn btn-secondary pull-left fa fa-question pg-alertify-icon-button',
- attrs: {
- name: 'dialog_help',
- type: 'button',
- label: gettext('Help'),
- url: url_for('help.static', {
- 'filename': 'editgrid.html',
- }),
+ .done(function (res) {
+ let response = res.data.result;
+
+ // Check the alertify dialog already loaded then delete it to clear
+ // the cache
+ if (Alertify.filterDialog) {
+ delete Alertify.filterDialog;
+ }
+
+ // Create Dialog
+ Alertify.dialog('filterDialog', function factory() {
+ let $container = $('
');
+ return {
+ main: function() {
+ this.set('title', gettext('Sort/Filter options'));
+ },
+ build: function() {
+ this.elements.content.appendChild($container.get(0));
+ Alertify.pgDialogBuild.apply(this);
+ },
+ setup: function() {
+ return {
+ buttons: [{
+ text: '',
+ key: 112,
+ className: 'btn btn-secondary pull-left fa fa-question pg-alertify-icon-button',
+ attrs: {
+ name: 'dialog_help',
+ type: 'button',
+ label: gettext('Help'),
+ url: url_for('help.static', {
+ 'filename': 'editgrid.html',
+ }),
+ },
+ }, {
+ text: gettext('Cancel'),
+ key: 27,
+ className: 'btn btn-secondary fa fa-times pg-alertify-button',
+ 'data-btn-name': 'cancel',
+ }, {
+ text: gettext('OK'),
+ className: 'btn btn-primary fa fa-check pg-alertify-button',
+ 'data-btn-name': 'ok',
+ }],
+ // Set options for dialog
+ options: {
+ title: title,
+ //disable both padding and overflow control.
+ padding: !1,
+ overflow: !1,
+ model: 0,
+ resizable: true,
+ maximizable: true,
+ pinnable: false,
+ closableByDimmer: false,
+ modal: false,
+ autoReset: false,
},
- }, {
- text: gettext('Cancel'),
- key: 27,
- className: 'btn btn-secondary fa fa-times pg-alertify-button',
- 'data-btn-name': 'cancel',
- }, {
- text: gettext('OK'),
- className: 'btn btn-primary fa fa-check pg-alertify-button',
- 'data-btn-name': 'ok',
- }],
- // Set options for dialog
- options: {
- title: title,
- //disable both padding and overflow control.
- padding: !1,
- overflow: !1,
- model: 0,
- resizable: true,
- maximizable: true,
- pinnable: false,
- closableByDimmer: false,
- modal: false,
- autoReset: false,
- },
- };
- },
- hooks: {
+ };
+ },
+ hooks: {
// triggered when the dialog is closed
- onclose: function() {
- if (this.view) {
- this.filterCollectionModel.stopSession();
- this.view.model.stopSession();
- this.view.remove({
- data: true,
- internal: true,
- silent: true,
- });
- }
+ onclose: function() {
+ if (this.view) {
+ this.filterCollectionModel.stopSession();
+ this.view.model.stopSession();
+ this.view.remove({
+ data: true,
+ internal: true,
+ silent: true,
+ });
+ }
+ },
},
- },
- prepare: function() {
- let self = this;
- $container.html('');
- // Disable Ok button
- this.__internal.buttons[2].element.disabled = true;
-
- // Status bar
- this.statusBar = $(
- '' +
+ prepare: function() {
+ let self = this;
+ $container.html('');
+ // Disable Ok button
+ this.__internal.buttons[2].element.disabled = true;
+
+ // Status bar
+ this.statusBar = $(
+ '
' +
'