Compare commits

...
25 Commits
Author SHA1 Message Date
Dave Page 5ae681f2ba Bump version for RC2 release. 2017-09-18 16:15:13 +01:00
Harshal Dhumal f0ad26ba7a Fix for Exception when the server is restarted. Fixes #2713
This issue was caused because we recently added session_write_delay in session.
So session won't be written/updated to disk from memory until specified seconds are elapsed.

However we must forcefully write/update session to disk if user loges in or out irrespective of session_write_delay to keep sessions from memory and disk in sync as user logged in status is kept in session.
2017-09-18 14:39:43 +01:00
Akshay Joshi bdc08d94c4 Fix View Data option and column config for Foreign Tables. Fixes #2691 2017-09-18 14:32:17 +01:00
Murtuza Zabuawala 8bededa859 Fix disable trigger menu option. Fixes #2707 2017-09-18 12:37:59 +01:00
Murtuza Zabuawala e64c52a446 Fix tablespace move prompt message. Fixes #2708 2017-09-18 12:36:04 +01:00
Murtuza Zabuawala 5ebfd88f11 Correct alignment of the X button on dismissable alerts. 2017-09-18 11:57:44 +01:00
Murtuza Zabuawala bc5a5a5b45 Fix error message regexp in the query tool that could fail in some cases. Fixes #2700 2017-09-18 11:55:04 +01:00
Harshal Dhumal da40573f0b Fix user manager role handling. Fixes #2641 2017-09-18 11:45:57 +01:00
Harshal Dhumal 765e130336 Support Flask-Security 3.0 2017-09-18 11:40:09 +01:00
Dave Page a317df1351 Ensure builtins.SERVER_MODE is set in the WSGI wrapper. 2017-09-18 10:33:26 +01:00
Surinder Kumar 026ef7b8b7 Support React v15.5 and later where the code fails to run because React's PropTypes is no more part of React Module. 2017-09-18 10:08:12 +01:00
Harshal Dhumal 30e7016077 Changed array representation and formatting for the data types in Query Tool and View Data. Fixes #2671 2017-09-18 12:07:15 +05:30
Murtuza Zabuawala 8150f93c06 Fix menu left-hand margin. 2017-09-15 14:45:02 +01:00
Atul Sharma c3ea3b7bdf Replace the "Roboto" font family with "Open Sans" for alertify dialogs. 2017-09-15 14:08:29 +01:00
Murtuza Zabuawala 9cfb2f3cbe Fix filtering of system schemas so pg_* is hidden but pg* is not. Fixes #2709 2017-09-15 13:50:06 +01:00
Ashesh Vashi 55e14e4d78 Handle the executor nodes, which are unknown to the Explain module,
gracefully by showing the 'ex_unknown.png' for such nodes.

Reported by: Murtuza
Refs #2706
2017-09-15 10:51:37 +05:30
Atul Sharma 788f7f3a69 Bundle fonts with pgAdmin so we have a standard set for all platforms.
Research by Shirley at Pivotal.
2017-09-13 16:01:14 +01:00
Surinder Kumar e819465e38 Always pack React in prod mode to avoid a bug in debug mode that prevents the history tab working. 2017-09-13 15:50:09 +01:00
Chethana Kumar ff79dfc186 Update cast icons with improved design. 2017-09-13 10:43:39 +01:00
Chethana Kumar 3779c36d0f Update server and database icons with a clearer design. 2017-09-13 09:59:07 +01:00
Murtuza Zabuawala 80ce889c3d Fix an issue in User mapping module where users were not listed. Fixes #2693 2017-09-13 09:53:25 +01:00
Murtuza Zabuawala 5891bda06a Fix an issue where base types are not displaying in the create/edit domain dialog, also corrected the condition to show hidden system types. Fixes #2692 2017-09-13 09:52:16 +01:00
Surinder Kumar 120dbcc7d8 Run webpack in production mode when building for releases. Fixes #2660 2017-09-13 09:47:01 +01:00
Teng Zhang 512afd6618 Highlighting greenplum keywords in sql editor 2017-09-11 19:39:50 +05:30
Chethana Kumar f79b7f26b1 Using the svg icons for domain constraint, and server browser nodes. 2017-09-11 18:24:04 +05:30
86 changed files with 1586 additions and 1046 deletions

No files matched your search

+3
View File
@@ -28,6 +28,9 @@ install-node:
bundle:
cd web && yarn run bundle
bundle-dev:
cd web && yarn run bundle:dev
linter:
cd web && yarn run linter
+3 -1
View File
@@ -33,4 +33,6 @@ Unit (Length) d8e6237 MIT https://github.com/heygrady/Unit
Natural Sort 9565816 MIT https://github.com/javve/natural-sort/blob/master/index.js
SlickGrid 2.3.7-8ff6814 MIT https://github.com/6pac/SlickGrid
jQuery-UI 1.11.3 MIT https://jqueryui.com/
BigNumber 3.0.1 MIT http://mikemcl.github.io/bignumber.js
BigNumber 3.0.1 MIT http://mikemcl.github.io/bignumber.js
Source Code Pro 1.1 SIL OFL https://fonts.googleapis.com/css?family=Source+Code+Pro:400,700
Open Sans 2.0 AL https://fonts.googleapis.com/css?family=Open+Sans:400,400i,600,700
+2 -2
View File
@@ -55,12 +55,12 @@ APP_REVISION = 0
# Application version suffix, e.g. 'beta1', 'dev'. Usually an empty string
# for GA releases.
APP_SUFFIX = 'rc1'
APP_SUFFIX = 'rc2'
# Numeric application version for upgrade checks. Should be in the format:
# [X]XYYZZ, where X is the release version, Y is the revision, with a leading
# zero if needed, and Z represents the suffix, with a leading zero if needed
APP_VERSION_INT = 20001
APP_VERSION_INT = 20002
# DO NOT CHANGE!
# The application version string, constructed from the components
+5 -7
View File
@@ -54,7 +54,7 @@
"bootstrap-switch": "3.3.2",
"bowser": "1.6.1",
"browserify": "~14.1.0",
"codemirror": "^5.28.0",
"codemirror": "^5.29.0",
"css-loader": "0.14.0",
"cssnano": "^3.10.0",
"dropzone": "^5.1.1",
@@ -70,6 +70,7 @@
"jquery-contextmenu": "^2.5.0",
"jquery-ui": "^1.12.1",
"moment": "^2.18.1",
"prop-types": "^15.5.10",
"react": "file:../web/pgadmin/static/vendor/react",
"react-dom": "file:../web/pgadmin/static/vendor/react-dom",
"react-split-pane": "^0.1.63",
@@ -85,14 +86,11 @@
},
"scripts": {
"linter": "yarn run eslint pgadmin/static/jsx/**/*.jsx pgadmin/static/js/selection/*.js regression/javascript/**/*.jsx regression/javascript/**/*.js *.js",
"webpacker": "yarn run webpack -- --config webpack.config.js",
"webpacker": "yarn run webpack -- --config webpack.config.js --progress",
"webpacker:watch": "yarn run webpack -- --config webpack.config.js --progress --watch",
"webpacker:dev": "yarn run webpack -- --config webpack.config.js",
"webpacker:prod": "yarn run linter && yarn run webpack -- --config webpack.config.js",
"bundle": "yarn run linter && yarn run webpacker",
"bundle:watch": "yarn run linter && yarn run webpacker:watch",
"bundle:dev": "yarn run linter && yarn run webpacker:dev",
"bundle:prod": "cross-env NODE_ENV=production yarn run webpacker:prod",
"bundle:dev": "yarn run linter && yarn run webpacker",
"bundle": "cross-env NODE_ENV=production yarn run bundle:dev",
"test:karma-once": "yarn run linter && yarn run karma start -- --single-run",
"test:karma": "yarn run linter && yarn run karma start",
"test:feature": "yarn run bundle && python regression/runtests.py --pkg feature_tests",
+8
View File
@@ -14,6 +14,14 @@ root = os.path.dirname(os.path.realpath(__file__))
if sys.path[0] != root:
sys.path.insert(0, root)
if sys.version_info[0] >= 3:
import builtins
else:
import __builtin__ as builtins
# Ensure the global server mode is set.
builtins.SERVER_MODE = True
import config
# When running it as a WSGI application, directory for the configuration file
+6 -3
View File
@@ -17,7 +17,7 @@ from importlib import import_module
from flask import Flask, abort, request, current_app, session, url_for
from flask_babel import Babel, gettext
from flask_htmlmin import HTMLMIN
from flask_login import user_logged_in
from flask_login import user_logged_in, user_logged_out
from flask_security import Security, SQLAlchemyUserDatastore
from flask_mail import Mail
from flask_security.utils import login_user
@@ -328,7 +328,7 @@ def create_app(app_name=None):
app.config.update(dict(SECRET_KEY=config.SECRET_KEY))
app.config.update(dict(SECURITY_PASSWORD_SALT=config.SECURITY_PASSWORD_SALT))
security.init_app(app)
security.init_app(app, user_datastore)
app.session_interface = create_session_interface(app)
@@ -368,7 +368,6 @@ def create_app(app_name=None):
##########################################################################
@user_logged_in.connect_via(app)
def on_user_logged_in(sender, user):
# Keep hold of the user ID
user_id = user.id
@@ -497,6 +496,10 @@ def create_app(app_name=None):
except:
pass
@user_logged_in.connect_via(app)
@user_logged_out.connect_via(app)
def force_session_write(app, user):
session.force_write = True
##########################################################################
# Load plugin modules
+1 -1
View File
@@ -1 +1 @@
<svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><defs><style>.cls-1{fill:#def4fd;}.cls-2,.cls-7{fill:#354a5f;}.cls-3{fill:#2880b9;}.cls-4,.cls-6{fill:none;stroke-miterlimit:10;}.cls-4,.cls-5{stroke:#2980b9;}.cls-4,.cls-5,.cls-6,.cls-7{stroke-linecap:round;stroke-width:0.75px;}.cls-5{fill:#2980b9;}.cls-5,.cls-7{stroke-linejoin:round;}.cls-6,.cls-7{stroke:#354a5f;}</style></defs><title>cast</title><rect class="cls-1" x="9.03" y="1.28" width="3.65" height="3.65" rx="0.63" ry="0.63"/><path class="cls-2" d="M12.05,1.65a.25.25,0,0,1,.25.25V4.3a.25.25,0,0,1-.25.25H9.65A.25.25,0,0,1,9.4,4.3V1.9a.25.25,0,0,1,.25-.25h2.4m0-.75H9.65a1,1,0,0,0-1,1V4.3a1,1,0,0,0,1,1h2.4a1,1,0,0,0,1-1V1.9a1,1,0,0,0-1-1Z"/><rect class="cls-1" x="1.33" y="10.08" width="3.65" height="3.65" rx="0.63" ry="0.63"/><path class="cls-3" d="M4.35,10.45a.25.25,0,0,1,.25.25v2.4a.25.25,0,0,1-.25.25H1.95a.25.25,0,0,1-.25-.25V10.7a.25.25,0,0,1,.25-.25h2.4m0-.75H1.95a1,1,0,0,0-1,1v2.4a1,1,0,0,0,1,1h2.4a1,1,0,0,0,1-1V10.7a1,1,0,0,0-1-1Z"/><line class="cls-4" x1="6.45" y1="3.1" x2="3.15" y2="3.1"/><line class="cls-4" x1="3.15" y1="3.1" x2="3.15" y2="6.4"/><polygon class="cls-5" points="3.12 7.96 1.59 6.37 4.71 6.43 3.12 7.96"/><line class="cls-6" x1="7.55" y1="11.9" x2="10.85" y2="11.9"/><line class="cls-6" x1="10.85" y1="11.9" x2="10.85" y2="8.6"/><polygon class="cls-7" points="10.88 7.04 12.4 8.63 9.29 8.57 10.88 7.04"/></svg>
<svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><defs><style>.cls-1{fill:#def4fd;}.cls-2{fill:#354a5f;}.cls-3{fill:#2880b9;}.cls-4,.cls-6{fill:#2980b9;}.cls-4,.cls-5{stroke:#2980b9;}.cls-4,.cls-5,.cls-6,.cls-7{stroke-linecap:round;stroke-linejoin:round;stroke-width:0.75px;}.cls-5,.cls-7{fill:none;}.cls-6,.cls-7{stroke:#354a5f;}</style></defs><title>coll-cast</title><rect class="cls-1" x="7.24" y="2.38" width="4.65" height="4.65" rx="0.63" ry="0.63"/><path class="cls-2" d="M11.27,2.75a.25.25,0,0,1,.25.25V6.4a.25.25,0,0,1-.25.25H7.87a.25.25,0,0,1-.25-.25V3a.25.25,0,0,1,.25-.25h3.4m0-.75H7.87a1,1,0,0,0-1,1V6.4a1,1,0,0,0,1,1h3.4a1,1,0,0,0,1-1V3a1,1,0,0,0-1-1Z"/><path class="cls-1" d="M1.23,8.94h3.4a.62.62,0,0,1,.62.62V13a.63.63,0,0,1-.62.63H1.23A.63.63,0,0,1,.61,13V9.56A.63.63,0,0,1,1.23,8.94Z"/><path class="cls-3" d="M4.63,9.31a.25.25,0,0,1,.25.25V13a.25.25,0,0,1-.25.25H1.23A.25.25,0,0,1,1,13V9.56a.25.25,0,0,1,.25-.25h3.4m0-.75H1.23a1,1,0,0,0-1,1V13a1,1,0,0,0,1,1h3.4a1,1,0,0,0,1-1V9.56a1,1,0,0,0-1-1Z"/><polygon class="cls-4" points="2.92 7.81 1.94 6.8 3.93 6.84 2.92 7.81"/><path class="cls-5" d="M3,7.31c-.65-2.21,1-3.5,2.92-2.7"/><polygon class="cls-6" points="9.5 8.22 10.48 9.23 8.48 9.2 9.5 8.22"/><path class="cls-7" d="M9.39,8.72c.65,2.21-1,3.5-2.92,2.7"/></svg>

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

@@ -1 +1 @@
<svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><defs><style>.cls-1{fill:#def4fd;}.cls-2,.cls-7{fill:#354a5f;}.cls-3{fill:#2880b9;}.cls-4,.cls-6{fill:none;stroke-miterlimit:10;}.cls-4,.cls-5{stroke:#2980b9;}.cls-4,.cls-5,.cls-6,.cls-7{stroke-linecap:round;stroke-width:0.75px;}.cls-5{fill:#2980b9;}.cls-5,.cls-7{stroke-linejoin:round;}.cls-6,.cls-7{stroke:#354a5f;}</style></defs><title>coll-cast</title><rect class="cls-1" x="9.03" y="1.27" width="3.65" height="3.65" rx="0.63" ry="0.63"/><path class="cls-2" d="M12.05,1.65a.25.25,0,0,1,.25.25V4.3a.25.25,0,0,1-.25.25H9.65A.25.25,0,0,1,9.4,4.3V1.9a.25.25,0,0,1,.25-.25h2.4m0-.75H9.65a1,1,0,0,0-1,1V4.3a1,1,0,0,0,1,1h2.4a1,1,0,0,0,1-1V1.9a1,1,0,0,0-1-1Z"/><path class="cls-1" d="M2,10.08h2.4A.63.63,0,0,1,5,10.7v2.4a.63.63,0,0,1-.62.63H2a.62.62,0,0,1-.62-.62V10.7A.62.62,0,0,1,2,10.08Z"/><path class="cls-3" d="M4.35,10.45a.25.25,0,0,1,.25.25v2.4a.25.25,0,0,1-.25.25H1.95a.25.25,0,0,1-.25-.25V10.7a.25.25,0,0,1,.25-.25h2.4m0-.75H1.95a1,1,0,0,0-1,1v2.4a1,1,0,0,0,1,1h2.4a1,1,0,0,0,1-1V10.7a1,1,0,0,0-1-1Z"/><line class="cls-4" x1="6.45" y1="3.1" x2="3.15" y2="3.1"/><line class="cls-4" x1="3.15" y1="3.1" x2="3.15" y2="6.4"/><polygon class="cls-5" points="3.12 7.96 1.59 6.37 4.71 6.43 3.12 7.96"/><line class="cls-6" x1="7.55" y1="11.9" x2="10.85" y2="11.9"/><line class="cls-6" x1="10.85" y1="11.9" x2="10.85" y2="8.6"/><polygon class="cls-7" points="10.88 7.04 12.4 8.63 9.29 8.57 10.88 7.04"/></svg>
<svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><defs><style>.cls-1{fill:#def4fd;}.cls-2{fill:#717f8e;}.cls-3{fill:#354a5f;}.cls-4{fill:#2880b9;}.cls-5,.cls-7{fill:#2980b9;}.cls-5,.cls-6{stroke:#2980b9;}.cls-5,.cls-6,.cls-7,.cls-8{stroke-linecap:round;stroke-linejoin:round;stroke-width:0.75px;}.cls-6,.cls-8{fill:none;}.cls-7,.cls-8{stroke:#354a5f;}</style></defs><title>cast</title><rect class="cls-1" x="0.51" y="2.26" width="10.54" height="10.54" rx="0.75" ry="0.75"/><path class="cls-2" d="M10.29,2.51a.5.5,0,0,1,.5.5v9a.5.5,0,0,1-.5.5h-9a.5.5,0,0,1-.5-.5V3a.5.5,0,0,1,.5-.5h9m0-.5h-9a1,1,0,0,0-1,1v9a1,1,0,0,0,1,1h9a1,1,0,0,0,1-1V3a1,1,0,0,0-1-1Z"/><rect class="cls-1" x="1.46" y="3.23" width="10.54" height="10.54" rx="0.75" ry="0.75"/><path class="cls-3" d="M11.24,3.48a.5.5,0,0,1,.5.5v9a.5.5,0,0,1-.5.5h-9a.5.5,0,0,1-.5-.5V4a.5.5,0,0,1,.5-.5h9m0-.5h-9a1,1,0,0,0-1,1v9a1,1,0,0,0,1,1h9a1,1,0,0,0,1-1V4a1,1,0,0,0-1-1Z"/><path class="cls-1" d="M8.16,4.68H9.94a.63.63,0,0,1,.63.63V7.09a.63.63,0,0,1-.62.63H8.16a.62.62,0,0,1-.62-.62V5.31A.63.63,0,0,1,8.16,4.68Z"/><path class="cls-3" d="M9.94,5.06a.25.25,0,0,1,.25.25V7.09a.25.25,0,0,1-.25.25H8.16a.25.25,0,0,1-.25-.25V5.31a.25.25,0,0,1,.25-.25H9.94m0-.75H8.16a1,1,0,0,0-1,1V7.09a1,1,0,0,0,1,1H9.94a1,1,0,0,0,1-1V5.31a1,1,0,0,0-1-1Z"/><rect class="cls-1" x="2.89" y="9.28" width="3.03" height="3.03" rx="0.63" ry="0.63"/><path class="cls-4" d="M5.29,9.65a.25.25,0,0,1,.25.25v1.78a.25.25,0,0,1-.25.25H3.51a.25.25,0,0,1-.25-.25V9.9a.25.25,0,0,1,.25-.25H5.29m0-.75H3.51a1,1,0,0,0-1,1v1.78a1,1,0,0,0,1,1H5.29a1,1,0,0,0,1-1V9.9a1,1,0,0,0-1-1Z"/><polygon class="cls-5" points="4.39 8.38 3.71 7.67 5.1 7.69 4.39 8.38"/><path class="cls-6" d="M4.46,8c-.45-1.55.71-2.45,2-1.89"/><polygon class="cls-7" points="9 8.66 9.68 9.37 8.29 9.34 9 8.66"/><path class="cls-8" d="M8.92,9c.45,1.55-.71,2.45-2,1.89"/></svg>

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.9 KiB

@@ -119,8 +119,8 @@ define('pgadmin.node.user_mapping', [
mode: ['edit', 'create', 'properties'], select2: { allowClear: false },
disabled: function(m) { return !m.isNew(); },
transform: function(data) {
var self = this;
node = self.field.get('schema_node');
var self = this,
node = self.field.get('schema_node');
var res =
Backform.NodeListByNameControl.prototype.defaults.transform.apply(
this, arguments
@@ -493,7 +493,8 @@ AND relname = typname AND relkind != 'c') AND
relnamespace=typnamespace AND relname = substring(typname FROM 2)::name
AND relkind != 'c'))"""
if self.blueprint.show_system_objects:
# To show hidden objects
if not self.blueprint.show_system_objects:
condition += " AND nsp.nspname != 'information_schema'"
# Get Types
@@ -0,0 +1 @@
<svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><defs><style>.cls-1{fill:#f2f2f2;}.cls-2,.cls-4,.cls-5{fill:none;stroke-linecap:round;stroke-linejoin:round;}.cls-2{stroke:#717f8e;}.cls-2,.cls-4{stroke-width:0.75px;}.cls-3{fill:#717f8e;}.cls-4{stroke:#def4fd;}.cls-5{stroke:#d0021b;stroke-width:1.5px;}</style></defs><title>domain_constraintsbad</title><polygon class="cls-1" points="9.73 12.98 1.71 13.06 1.71 6.92 5.76 2.71 9.81 6.76 9.73 12.98"/><line class="cls-2" x1="0.36" y1="8.12" x2="5.76" y2="2.72"/><line class="cls-2" x1="5.76" y1="2.72" x2="11.16" y2="8.12"/><line class="cls-2" x1="1.71" y1="6.77" x2="1.71" y2="13.07"/><line class="cls-2" x1="1.71" y1="13.07" x2="9.81" y2="13.07"/><line class="cls-2" x1="9.81" y1="13.07" x2="9.81" y2="6.77"/><circle class="cls-3" cx="5.76" cy="9.13" r="2.78"/><polyline class="cls-4" points="4.22 9.6 5.35 10.56 7.18 8.06"/><line class="cls-5" x1="11.31" y1="5.64" x2="8.31" y2="8.64"/><line class="cls-5" x1="11.31" y1="8.64" x2="8.31" y2="5.64"/></svg>

After

Width:  |  Height:  |  Size: 1.0 KiB

@@ -8,7 +8,7 @@
}
.icon-check-bad, .icon-domain_constraints-bad {
background-image: url('{{ url_for('NODE-%s.static' % node_type, filename='img/domain_constraints-bad.png' )}}') !important;
background-image: url('{{ url_for('NODE-%s.static' % node_type, filename='img/domain_constraints-bad.svg' )}}') !important;
background-repeat: no-repeat;
background-size: 20px !important;
align-content: center;
@@ -334,7 +334,7 @@ define('pgadmin.node.foreign_table', [
// Fetch Columns from server
var fnd_columns = columns.where({inheritedid: parseInt(i)});
if (fnd_columns && fnd_columns.length <= 0) {
inhted_columns = self.fetchColumns(i);
var inhted_columns = self.fetchColumns(i);
columns.add(inhted_columns);
}
});
@@ -601,7 +601,7 @@ define('pgadmin.node.foreign_table', [
}
},{
id: 'columns', label: gettext('Columns'), cell: 'string',
type: 'collection', group: gettext('Columns'), visible: false, mode: ['edit', 'create'],
type: 'collection', group: gettext('Columns'), mode: ['edit', 'create'],
model: ColumnsModel, canAdd: true, canDelete: true, canEdit: true,
columns: ['attname', 'datatype', 'inheritedfrom'],
canDeleteRow: function(m) {
@@ -615,7 +615,7 @@ define('pgadmin.node.foreign_table', [
},
{
id: 'constraints', label: gettext('Constraints'), cell: 'string',
type: 'collection', group: gettext('Constraints'), visible: false, mode: ['edit', 'create'],
type: 'collection', group: gettext('Constraints'), mode: ['edit', 'create'],
model: ConstraintModel, canAdd: true, canDelete: true, columns: ['conname','consrc', 'connoinherit', 'convalidated'],
canEdit: function(o) {
if (o instanceof Backbone.Model) {
@@ -695,7 +695,7 @@ define('pgadmin.node.foreign_table', [
if (_.indexOf(['schema'], d._type) > -1)
return true;
if ('coll-foreign-table' == d._type) {
if ('coll-foreign_table' == d._type) {
//Check if we are not child of catalog
var prev_i = t.hasParent(i) ? t.parent(i) : null,
prev_d = prev_i ? t.itemData(prev_i) : null;
@@ -1,5 +1,5 @@
{% macro VALID_CATALOGS(server_type) -%}
AND n.nspname NOT LIKE E'pg\_%' {% if server_type == 'ppas' %}
AND n.nspname NOT LIKE 'pg\_%' {% if server_type == 'ppas' %}
AND n.nspname NOT IN ('information_schema', 'pgagent', 'dbo', 'sys') {% else %}
AND n.nspname NOT IN ('information_schema') {% endif %}
{%- endmacro %}
@@ -5,7 +5,7 @@ FROM
(SELECT oid, relname, relnamespace FROM pg_catalog.pg_class
WHERE relkind in ('r', 'p') AND NOT relispartition) r
JOIN (SELECT oid AS nspoid, nspname FROM
pg_catalog.pg_namespace WHERE nspname NOT LIKE E'pg\_%') n
pg_catalog.pg_namespace WHERE nspname NOT LIKE 'pg\_%') n
ON (r.relnamespace = n.nspoid)
JOIN (SELECT attrelid, attname, atttypid FROM
pg_catalog.pg_attribute WHERE attnum > 0 ORDER BY attrelid, attnum) a
@@ -20,4 +20,4 @@ FROM
ORDER BY attrelid, attnum) attributes
GROUP BY attrelid) current_table ON current_table.attrelid != all_tables.oid
AND current_table.attnames = all_tables.attnames
AND current_table.atttypes = all_tables.atttypes
AND current_table.atttypes = all_tables.atttypes
@@ -13,7 +13,7 @@ SELECT rel.oid, rel.relname AS name, rel.reltablespace AS spcoid,rel.relacl AS r
JOIN pg_proc pc ON pc.pronamespace=pt.pronamespace AND pc.proname='slonyversion'
WHERE tgrelid=rel.oid) AS isrepl,
(SELECT count(*) FROM pg_trigger WHERE tgrelid=rel.oid AND tgisinternal = FALSE) AS triggercount,
(SELECT ARRAY(SELECT CASE WHEN (nspname NOT LIKE E'pg\_%') THEN
(SELECT ARRAY(SELECT CASE WHEN (nspname NOT LIKE 'pg\_%') THEN
quote_ident(nspname)||'.'||quote_ident(c.relname)
ELSE quote_ident(c.relname) END AS inherited_tables
FROM pg_inherits i
@@ -1,6 +1,6 @@
{% import 'table/sql/macros/db_catalogs.macro' as CATALOG %}
SELECT c.oid, c.relname , nspname,
CASE WHEN nspname NOT LIKE E'pg\_%' THEN
CASE WHEN nspname NOT LIKE 'pg\_%' THEN
quote_ident(nspname)||'.'||quote_ident(c.relname)
ELSE quote_ident(c.relname)
END AS inherits
@@ -14,4 +14,4 @@ WHERE relkind='r' AND NOT relispartition
{% if tid %}
AND c.oid != tid
{% endif %}
ORDER BY relnamespace, c.relname
ORDER BY relnamespace, c.relname
@@ -13,7 +13,7 @@ SELECT rel.oid, rel.relname AS name, rel.reltablespace AS spcoid,rel.relacl AS r
JOIN pg_proc pc ON pc.pronamespace=pt.pronamespace AND pc.proname='slonyversion'
WHERE tgrelid=rel.oid) AS isrepl,
(SELECT count(*) FROM pg_trigger WHERE tgrelid=rel.oid AND tgisinternal = FALSE) AS triggercount,
(SELECT ARRAY(SELECT CASE WHEN (nspname NOT LIKE E'pg\_%') THEN
(SELECT ARRAY(SELECT CASE WHEN (nspname NOT LIKE 'pg\_%') THEN
quote_ident(nspname)||'.'||quote_ident(c.relname)
ELSE quote_ident(c.relname) END AS inherited_tables
FROM pg_inherits i
@@ -12,7 +12,7 @@ SELECT rel.oid, rel.relname AS name, rel.reltablespace AS spcoid,rel.relacl AS r
JOIN pg_proc pc ON pc.pronamespace=pt.pronamespace AND pc.proname='slonyversion'
WHERE tgrelid=rel.oid) AS isrepl,
(SELECT count(*) FROM pg_trigger WHERE tgrelid=rel.oid AND tgisinternal = FALSE) AS triggercount,
(SELECT ARRAY(SELECT CASE WHEN (nspname NOT LIKE E'pg\_%') THEN
(SELECT ARRAY(SELECT CASE WHEN (nspname NOT LIKE 'pg\_%') THEN
quote_ident(nspname)||'.'||quote_ident(c.relname)
ELSE quote_ident(c.relname) END AS inherited_tables
FROM pg_inherits i
@@ -1,6 +1,6 @@
{% import 'table/sql/macros/db_catalogs.macro' as CATALOG %}
SELECT c.oid, c.relname , nspname,
CASE WHEN nspname NOT LIKE E'pg\_%' THEN
CASE WHEN nspname NOT LIKE 'pg\_%' THEN
quote_ident(nspname)||'.'||quote_ident(c.relname)
ELSE quote_ident(c.relname)
END AS inherits
@@ -14,4 +14,4 @@ WHERE relkind='r'
{% if tid %}
AND c.oid != tid
{% endif %}
ORDER BY relnamespace, c.relname
ORDER BY relnamespace, c.relname
@@ -3,6 +3,6 @@ FROM pg_namespace nsp, pg_class cl
WHERE relnamespace=nsp.oid AND relkind='r'
AND nsp.nspname NOT LIKE E'pg\_temp\_%'
{% if not show_sysobj %}
AND (nsp.nspname NOT LIKE E'pg\_%' AND nsp.nspname NOT in ('information_schema'))
AND (nsp.nspname NOT LIKE 'pg\_%' AND nsp.nspname NOT in ('information_schema'))
{% endif %}
ORDER BY nspname, relname
ORDER BY nspname, relname
@@ -15,7 +15,7 @@ FROM (
JOIN pg_proc pc ON pc.pronamespace=pt.pronamespace AND pc.proname='slonyversion'
WHERE tgrelid=rel.oid) AS isrepl,
(SELECT count(*) FROM pg_trigger WHERE tgrelid=rel.oid) AS triggercount,
(SELECT ARRAY(SELECT CASE WHEN (nspname NOT LIKE E'pg\_%') THEN
(SELECT ARRAY(SELECT CASE WHEN (nspname NOT LIKE 'pg\_%') THEN
quote_ident(nspname)||'.'||quote_ident(c.relname)
ELSE quote_ident(c.relname) END AS inherited_tables
FROM pg_inherits i
@@ -71,4 +71,4 @@ FROM (
WHERE rel.relkind IN ('r','s','t') AND rel.relnamespace = {{ scid }}
{% if tid %} AND rel.oid = {{ tid }}::oid {% endif %}
) AS TableInformation
ORDER BY name
ORDER BY name
@@ -15,7 +15,7 @@ FROM (
JOIN pg_proc pc ON pc.pronamespace=pt.pronamespace AND pc.proname='slonyversion'
WHERE tgrelid=rel.oid) AS isrepl,
(SELECT count(*) FROM pg_trigger WHERE tgrelid=rel.oid) AS triggercount,
(SELECT ARRAY(SELECT CASE WHEN (nspname NOT LIKE E'pg\_%') THEN
(SELECT ARRAY(SELECT CASE WHEN (nspname NOT LIKE 'pg\_%') THEN
quote_ident(nspname)||'.'||quote_ident(c.relname)
ELSE quote_ident(c.relname) END AS inherited_tables
FROM pg_inherits i
@@ -1,5 +1,5 @@
{% macro VALID_CATALOGS(server_type) -%}
AND n.nspname NOT LIKE E'pg\_%' {% if server_type == 'ppas' %}
AND n.nspname NOT LIKE 'pg\_%' {% if server_type == 'ppas' %}
AND n.nspname NOT IN ('information_schema', 'pgagent', 'dbo', 'sys') {% else %}
AND n.nspname NOT IN ('information_schema') {% endif %}
{%- endmacro %}
{%- endmacro %}
@@ -6,7 +6,7 @@ FROM pg_proc p, pg_namespace n, pg_language l
AND l.lanname != 'edbspl' AND prorettype = 2279
-- If Show SystemObjects is not true
{% if not show_system_objects %}
AND (nspname NOT LIKE E'pg\_%' AND nspname NOT in ('information_schema'))
AND (nspname NOT LIKE 'pg\_%' AND nspname NOT in ('information_schema'))
{% endif %}
-- Find function for specific OID
{% if tgfoid %}
@@ -100,11 +100,11 @@ define('pgadmin.node.trigger', [
callbacks: {
/* Enable trigger */
enable_trigger: function(args) {
var input = args || {};
obj = this,
t = pgBrowser.tree,
i = input.item || t.selected(),
d = i && i.length == 1 ? t.itemData(i) : undefined;
var input = args || {},
obj = this,
t = pgBrowser.tree,
i = input.item || t.selected(),
d = i && i.length == 1 ? t.itemData(i) : undefined;
if (!d)
return false;
@@ -122,7 +122,7 @@ define('pgadmin.node.trigger', [
data.icon = 'icon-trigger';
t.addIcon(i, {icon: data.icon});
t.unload(i);
t.setInode(i);
t.setInode(false);
t.deselect(i);
// Fetch updated data from server
setTimeout(function() {
@@ -143,11 +143,11 @@ define('pgadmin.node.trigger', [
},
/* Disable trigger */
disable_trigger: function(args) {
var input = args || {};
obj = this,
t = pgBrowser.tree,
i = input.item || t.selected(),
d = i && i.length == 1 ? t.itemData(i) : undefined;
var input = args || {},
obj = this,
t = pgBrowser.tree,
i = input.item || t.selected(),
d = i && i.length == 1 ? t.itemData(i) : undefined;
if (!d)
return false;
@@ -165,7 +165,7 @@ define('pgadmin.node.trigger', [
data.icon = 'icon-trigger-bad';
t.addIcon(i, {icon: data.icon});
t.unload(i);
t.setInode(i);
t.setInode(false);
t.deselect(i);
// Fetch updated data from server
setTimeout(function() {
@@ -11,7 +11,7 @@ WHERE
nsp.oid={{scid}}::oid AND
{% else %}
{% if not show_sysobj %}
nspname NOT LIKE E'pg\_%' AND
nspname NOT LIKE 'pg\_%' AND
{% endif %}
{% endif %}
NOT (
@@ -11,7 +11,7 @@ WHERE
nsp.oid={{scid}}::oid AND
{% else %}
{% if not show_sysobj %}
nspname NOT LIKE E'pg\_%' AND
nspname NOT LIKE 'pg\_%' AND
{% endif %}
{% endif %}
NOT (
@@ -11,7 +11,7 @@ WHERE
nsp.oid={{scid}}::oid AND
{% else %}
{% if not show_sysobj %}
nspname NOT LIKE E'pg\_%' AND
nspname NOT LIKE 'pg\_%' AND
{% endif %}
{% endif %}
NOT (
@@ -12,7 +12,7 @@ WHERE
nsp.oid={{scid}}::oid AND
{% else %}
{% if not show_sysobj %}
nspname NOT LIKE E'pg\_%' AND
nspname NOT LIKE 'pg\_%' AND
{% endif %}
{% endif %}
NOT (
@@ -12,7 +12,7 @@ WHERE
nsp.oid={{scid}}::oid AND
{% else %}
{% if not show_sysobj %}
nspname NOT LIKE E'pg\_%' AND
nspname NOT LIKE 'pg\_%' AND
{% endif %}
{% endif %}
NOT (
@@ -93,6 +93,16 @@ class DataTypeReader:
"""
res = []
try:
# Check if template path is already set or not
# if not then we will set the template path here
if not hasattr(self, 'data_type_template_path'):
self.data_type_template_path = 'datatype/sql/' + (
'#{0}#{1}#'.format(
self.manager.server_type,
self.manager.version
) if self.manager.server_type == 'gpdb' else
'#{0}#'.format(self.manager.version)
)
SQL = render_template(
"/".join([self.data_type_template_path,'get_types.sql']),
@@ -1 +1 @@
<svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><defs><style>.cls-1{fill:#def4fd;}.cls-2{fill:#2980b9;}</style></defs><title>coll-database</title><path class="cls-1" d="M10.82,4.5A.87.87,0,0,0,11,4c0-1.1-2.46-2-5.5-2S0,2.9,0,4a.87.87,0,0,0,.18.5A.87.87,0,0,0,0,5a.87.87,0,0,0,.18.5.78.78,0,0,0,0,1,.78.78,0,0,0,0,1,.78.78,0,0,0,0,1,.78.78,0,0,0,0,1A.87.87,0,0,0,0,10c0,1.1,2.46,2,5.5,2s5.5-.9,5.5-2a.87.87,0,0,0-.18-.5.78.78,0,0,0,0-1,.78.78,0,0,0,0-1,.78.78,0,0,0,0-1,.78.78,0,0,0,0-1A.87.87,0,0,0,11,5,.87.87,0,0,0,10.82,4.5Z"/><ellipse class="cls-2" cx="5.5" cy="4" rx="5.5" ry="2"/><path class="cls-2" d="M5.5,11C2.94,11,.79,10.36.18,9.5A.87.87,0,0,0,0,10c0,1.1,2.46,2,5.5,2s5.5-.9,5.5-2a.87.87,0,0,0-.18-.5C10.21,10.36,8.06,11,5.5,11Z"/><path class="cls-2" d="M5.5,8C2.94,8,.79,7.36.18,6.5A.87.87,0,0,0,0,7C0,8.1,2.46,9,5.5,9S11,8.1,11,7a.87.87,0,0,0-.18-.5C10.21,7.36,8.06,8,5.5,8Z"/></svg>
<svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><defs><style>.cls-1{fill:#def4fd;}.cls-2{fill:#2980b9;}</style></defs><title>coll-database</title><path class="cls-1" d="M11,5.5a.87.87,0,0,0,.18-.5c0-1.1-2.46-2-5.5-2S.16,3.9.16,5a.87.87,0,0,0,.18.5.78.78,0,0,0,0,1,.78.78,0,0,0,0,1,.78.78,0,0,0,0,1,.78.78,0,0,0,0,1,.78.78,0,0,0,0,1,.87.87,0,0,0-.18.5c0,1.1,2.46,2,5.5,2s5.5-.9,5.5-2a.87.87,0,0,0-.18-.5.78.78,0,0,0,0-1,.78.78,0,0,0,0-1,.78.78,0,0,0,0-1,.78.78,0,0,0,0-1,.78.78,0,0,0,0-1Z"/><ellipse class="cls-2" cx="5.66" cy="5" rx="5.5" ry="2"/><path class="cls-2" d="M5.66,12C3.09,12,.95,11.36.34,10.5a.87.87,0,0,0-.18.5c0,1.1,2.46,2,5.5,2s5.5-.9,5.5-2a.87.87,0,0,0-.18-.5C10.36,11.36,8.22,12,5.66,12Z"/><path class="cls-2" d="M5.66,8C3.09,8,.95,7.36.34,6.5A.87.87,0,0,0,.16,7c0,1.1,2.46,2,5.5,2s5.5-.9,5.5-2A.87.87,0,0,0,11,6.5C10.36,7.36,8.22,8,5.66,8Z"/><path class="cls-2" d="M5.66,10C3.09,10,.95,9.36.34,8.5A.87.87,0,0,0,.16,9c0,1.1,2.46,2,5.5,2s5.5-.9,5.5-2A.87.87,0,0,0,11,8.5C10.36,9.36,8.22,10,5.66,10Z"/></svg>

Before

Width:  |  Height:  |  Size: 941 B

After

Width:  |  Height:  |  Size: 1.0 KiB

@@ -1 +1 @@
<svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><defs><style>.cls-1{fill:#def4fd;}.cls-2{fill:#2980b9;}</style></defs><title>database</title><path class="cls-1" d="M10.82,4.5A.87.87,0,0,0,11,4c0-1.1-2.46-2-5.5-2S0,2.9,0,4a.87.87,0,0,0,.18.5.78.78,0,0,0,0,1,.78.78,0,0,0,0,1,.78.78,0,0,0,0,1,.78.78,0,0,0,0,1,.78.78,0,0,0,0,1A.87.87,0,0,0,0,10c0,1.1,2.46,2,5.5,2s5.5-.9,5.5-2a.87.87,0,0,0-.18-.5.78.78,0,0,0,0-1,.78.78,0,0,0,0-1,.78.78,0,0,0,0-1,.78.78,0,0,0,0-1A.78.78,0,0,0,10.82,4.5Z"/><ellipse class="cls-2" cx="5.5" cy="4" rx="5.5" ry="2"/><path class="cls-2" d="M5.5,11C2.94,11,.79,10.36.18,9.5A.87.87,0,0,0,0,10c0,1.1,2.46,2,5.5,2s5.5-.9,5.5-2a.87.87,0,0,0-.18-.5C10.21,10.36,8.06,11,5.5,11Z"/></svg>
<svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><defs><style>.cls-1{fill:#def4fd;}.cls-2{fill:#2980b9;}</style></defs><title>database</title><path class="cls-1" d="M10.82,4.5A.87.87,0,0,0,11,4c0-1.1-2.46-2-5.5-2S0,2.9,0,4a.87.87,0,0,0,.18.5.78.78,0,0,0,0,1,.78.78,0,0,0,0,1,.78.78,0,0,0,0,1,.78.78,0,0,0,0,1,.78.78,0,0,0,0,1A.87.87,0,0,0,0,10c0,1.1,2.46,2,5.5,2s5.5-.9,5.5-2a.87.87,0,0,0-.18-.5.78.78,0,0,0,0-1,.78.78,0,0,0,0-1,.78.78,0,0,0,0-1,.78.78,0,0,0,0-1A.78.78,0,0,0,10.82,4.5Z"/><ellipse class="cls-2" cx="5.5" cy="4" rx="5.5" ry="2"/><path class="cls-2" d="M5.5,11C2.94,11,.79,10.36.18,9.5A.87.87,0,0,0,0,10c0,1.1,2.46,2,5.5,2s5.5-.9,5.5-2a.87.87,0,0,0-.18-.5C10.21,10.36,8.06,11,5.5,11Z"/><path class="cls-2" d="M5.5,8C2.94,8,.79,7.36.18,6.5A.87.87,0,0,0,0,7C0,8.1,2.46,9,5.5,9S11,8.1,11,7a.87.87,0,0,0-.18-.5C10.21,7.36,8.06,8,5.5,8Z"/></svg>

Before

Width:  |  Height:  |  Size: 751 B

After

Width:  |  Height:  |  Size: 899 B

+1 -1
View File
@@ -1 +1 @@
<svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><defs><style>.cls-1{fill:#f2f2f2;}.cls-2{fill:#717f8e;}.cls-3{fill:none;stroke:#d0021b;stroke-linecap:round;stroke-linejoin:round;stroke-width:1.5px;}</style></defs><title>databasebad</title><path class="cls-1" d="M11.82,5.5A.87.87,0,0,0,12,5c0-1.1-2.46-2-5.5-2S1,3.9,1,5a.87.87,0,0,0,.18.5.78.78,0,0,0,0,1,.78.78,0,0,0,0,1,.78.78,0,0,0,0,1,.78.78,0,0,0,0,1,.78.78,0,0,0,0,1A.87.87,0,0,0,1,11c0,1.1,2.46,2,5.5,2s5.5-.9,5.5-2a.87.87,0,0,0-.18-.5.78.78,0,0,0,0-1,.78.78,0,0,0,0-1,.78.78,0,0,0,0-1,.78.78,0,0,0,0-1,.78.78,0,0,0,0-1Z"/><ellipse class="cls-2" cx="6.5" cy="5" rx="5.5" ry="2"/><path class="cls-2" d="M6.5,12c-2.56,0-4.71-.64-5.32-1.5A.87.87,0,0,0,1,11c0,1.1,2.46,2,5.5,2s5.5-.9,5.5-2a.87.87,0,0,0-.18-.5C11.21,11.36,9.06,12,6.5,12Z"/><line class="cls-3" x1="12.5" y1="2.5" x2="9.5" y2="5.5"/><line class="cls-3" x1="12.5" y1="5.5" x2="9.5" y2="2.5"/></svg>
<svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><defs><style>.cls-1{fill:#f2f2f2;}.cls-2{fill:#717f8e;}.cls-3{fill:none;stroke:#d0021b;stroke-linecap:round;stroke-linejoin:round;stroke-width:1.5px;}</style></defs><title>databasebad</title><path class="cls-1" d="M10.9,5.5a.87.87,0,0,0,.18-.5c0-1.1-2.46-2-5.5-2S.08,3.9.08,5a.87.87,0,0,0,.18.5.78.78,0,0,0,0,1,.78.78,0,0,0,0,1,.78.78,0,0,0,0,1,.78.78,0,0,0,0,1,.78.78,0,0,0,0,1,.87.87,0,0,0-.18.5c0,1.1,2.46,2,5.5,2s5.5-.9,5.5-2a.87.87,0,0,0-.18-.5.78.78,0,0,0,0-1,.78.78,0,0,0,0-1,.78.78,0,0,0,0-1,.78.78,0,0,0,0-1,.78.78,0,0,0,0-1Z"/><ellipse class="cls-2" cx="5.58" cy="5" rx="5.5" ry="2"/><path class="cls-2" d="M5.58,12C3,12,.88,11.36.26,10.5a.87.87,0,0,0-.18.5c0,1.1,2.46,2,5.5,2s5.5-.9,5.5-2a.87.87,0,0,0-.18-.5C10.29,11.36,8.15,12,5.58,12Z"/><line class="cls-3" x1="11.58" y1="2.5" x2="8.58" y2="5.5"/><line class="cls-3" x1="11.58" y1="5.5" x2="8.58" y2="2.5"/><path class="cls-2" d="M5.58,9C3,9,.87,8.4.26,7.54A.87.87,0,0,0,.08,8c0,1.1,2.46,2,5.5,2s5.5-.9,5.5-2a.87.87,0,0,0-.18-.5C10.29,8.4,8.14,9,5.58,9Z"/></svg>

Before

Width:  |  Height:  |  Size: 960 B

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 553 B

@@ -0,0 +1 @@
<svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 15 16"><defs><style>.cls-1{fill:#f2f2f2;}.cls-2{fill:#717f8e;}.cls-3,.cls-5,.cls-6{fill:#2980b9;}.cls-3{stroke:#717f8e;}.cls-3,.cls-6{stroke-miterlimit:1;stroke-width:0.5px;}.cls-4{fill:#def4fd;}.cls-6{stroke:#2980b9;}</style></defs><title>server</title><rect class="cls-1" x="0.49" y="2.6" width="9.85" height="3.1" rx="1.13" ry="1.13"/><path class="cls-2" d="M9.22,3a.75.75,0,0,1,.75.75v.85a.75.75,0,0,1-.75.75H1.62a.75.75,0,0,1-.75-.75V3.72A.75.75,0,0,1,1.62,3h7.6m0-.75H1.62a1.5,1.5,0,0,0-1.5,1.5v.85a1.5,1.5,0,0,0,1.5,1.5h7.6a1.5,1.5,0,0,0,1.5-1.5V3.72a1.5,1.5,0,0,0-1.5-1.5Z"/><line class="cls-3" x1="3.79" y1="4.15" x2="1.69" y2="4.15"/><rect class="cls-4" x="0.49" y="6.45" width="9.85" height="3.1" rx="1.13" ry="1.13"/><path class="cls-5" d="M9.22,6.82a.75.75,0,0,1,.75.75v.85a.75.75,0,0,1-.75.75H1.62a.75.75,0,0,1-.75-.75V7.57a.75.75,0,0,1,.75-.75h7.6m0-.75H1.62a1.5,1.5,0,0,0-1.5,1.5v.85a1.5,1.5,0,0,0,1.5,1.5h7.6a1.5,1.5,0,0,0,1.5-1.5V7.57a1.5,1.5,0,0,0-1.5-1.5Z"/><line class="cls-6" x1="3.79" y1="8" x2="1.69" y2="8"/><path class="cls-1" d="M1.62,10.3h7.6a1.12,1.12,0,0,1,1.12,1.12v.85A1.13,1.13,0,0,1,9.22,13.4H1.62A1.13,1.13,0,0,1,.49,12.28v-.85A1.13,1.13,0,0,1,1.62,10.3Z"/><path class="cls-2" d="M9.22,10.68a.75.75,0,0,1,.75.75v.85a.75.75,0,0,1-.75.75H1.62a.75.75,0,0,1-.75-.75v-.85a.75.75,0,0,1,.75-.75h7.6m0-.75H1.62a1.5,1.5,0,0,0-1.5,1.5v.85a1.5,1.5,0,0,0,1.5,1.5h7.6a1.5,1.5,0,0,0,1.5-1.5v-.85a1.5,1.5,0,0,0-1.5-1.5Z"/><line class="cls-3" x1="3.79" y1="11.85" x2="1.69" y2="11.85"/></svg>

After

Width:  |  Height:  |  Size: 1.6 KiB

+1 -1
View File
@@ -1 +1 @@
<svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><defs><style>.cls-1{fill:#f2f2f2;}.cls-2{fill:#717f8e;}.cls-3,.cls-4{fill:none;}.cls-3{stroke:#717f8e;stroke-miterlimit:1;stroke-width:0.5px;}.cls-4{stroke:#d0021b;stroke-linecap:round;stroke-linejoin:round;stroke-width:1.5px;}</style></defs><title>serverbad</title><rect class="cls-1" x="0.8" y="3.07" width="9.85" height="11.1" rx="1.13" ry="1.13"/><path class="cls-2" d="M9.52,3.45a.75.75,0,0,1,.75.75v8.85a.75.75,0,0,1-.75.75H1.92a.75.75,0,0,1-.75-.75V4.2a.75.75,0,0,1,.75-.75h7.6m0-.75H1.92A1.5,1.5,0,0,0,.42,4.2v8.85a1.5,1.5,0,0,0,1.5,1.5h7.6a1.5,1.5,0,0,0,1.5-1.5V4.2A1.5,1.5,0,0,0,9.52,2.7Z"/><line class="cls-3" x1="4.1" y1="4.62" x2="1.99" y2="4.62"/><line class="cls-3" x1="8.58" y1="7.79" x2="2.49" y2="7.79"/><line class="cls-3" x1="8.58" y1="9.79" x2="2.49" y2="9.79"/><line class="cls-3" x1="8.58" y1="11.79" x2="2.49" y2="11.79"/><line class="cls-4" x1="12.22" y1="1.47" x2="9.22" y2="4.47"/><line class="cls-4" x1="12.22" y1="4.47" x2="9.22" y2="1.47"/></svg>
<svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 15 16"><defs><style>.cls-1{fill:#f2f2f2;}.cls-2{fill:#717f8e;}.cls-3,.cls-5{fill:#2980b9;}.cls-3{stroke:#717f8e;stroke-miterlimit:1;stroke-width:0.5px;}.cls-4{fill:#def4fd;}.cls-6{fill:none;stroke:#d0021b;stroke-linecap:round;stroke-linejoin:round;stroke-width:1.5px;}</style></defs><title>serverbad</title><rect class="cls-1" x="0.38" y="2.62" width="9.85" height="3.1" rx="1.13" ry="1.13"/><path class="cls-2" d="M9.1,3a.75.75,0,0,1,.75.75V4.6a.75.75,0,0,1-.75.75H1.5A.75.75,0,0,1,.75,4.6V3.75A.75.75,0,0,1,1.5,3H9.1m0-.75H1.5A1.5,1.5,0,0,0,0,3.75V4.6A1.5,1.5,0,0,0,1.5,6.1H9.1a1.5,1.5,0,0,0,1.5-1.5V3.75a1.5,1.5,0,0,0-1.5-1.5Z"/><line class="cls-3" x1="3.68" y1="4.17" x2="1.58" y2="4.17"/><rect class="cls-4" x="0.38" y="6.47" width="9.85" height="3.1" rx="1.13" ry="1.13"/><path class="cls-5" d="M9.1,6.85a.75.75,0,0,1,.75.75v.85a.75.75,0,0,1-.75.75H1.5a.75.75,0,0,1-.75-.75V7.6a.75.75,0,0,1,.75-.75H9.1m0-.75H1.5A1.5,1.5,0,0,0,0,7.6v.85a1.5,1.5,0,0,0,1.5,1.5H9.1a1.5,1.5,0,0,0,1.5-1.5V7.6A1.5,1.5,0,0,0,9.1,6.1Z"/><line class="cls-3" x1="3.68" y1="8.02" x2="1.58" y2="8.02"/><rect class="cls-1" x="0.38" y="10.32" width="9.85" height="3.1" rx="1.13" ry="1.13"/><path class="cls-2" d="M9.1,10.7a.75.75,0,0,1,.75.75v.85A.75.75,0,0,1,9.1,13H1.5a.75.75,0,0,1-.75-.75v-.85a.75.75,0,0,1,.75-.75H9.1m0-.75H1.5A1.5,1.5,0,0,0,0,11.45v.85a1.5,1.5,0,0,0,1.5,1.5H9.1a1.5,1.5,0,0,0,1.5-1.5v-.85a1.5,1.5,0,0,0-1.5-1.5Z"/><line class="cls-3" x1="3.68" y1="11.87" x2="1.58" y2="11.87"/><line class="cls-6" x1="12.1" y1="1.65" x2="9.1" y2="4.65"/><line class="cls-6" x1="12.1" y1="4.65" x2="9.1" y2="1.65"/></svg>

Before

Width:  |  Height:  |  Size: 1.0 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

@@ -268,7 +268,7 @@ define('pgadmin.node.tablespace', [
alertify.confirm(
gettext('Move objects...'),
gettext(
'Are you sure you wish to move objects %(old_tablespace)s to %s(new_tablespace)s',
'Are you sure you wish to move the objects from %(old_tablespace)s to %(new_tablespace)s?',
{old_tablespace: args.old_tblspc, new_tablespace: args.tblspc}
),
function() {
@@ -1,5 +1,5 @@
.icon-server {
background-image: url('{{ url_for('NODE-server.static', filename='img/server.png') }}') !important;
background-image: url('{{ url_for('NODE-server.static', filename='img/server.svg') }}') !important;
background-repeat: no-repeat;
background-size: 20px !important;
align-content: center;
+23 -10
View File
@@ -1,9 +1,9 @@
/* Styles for the main browser */
.browser-pane-container {
position: absolute;
top: 50px;
left: 0px;
width: 100%;
position: absolute;
top: 50px;
left: 0px;
width: 100%;
height: calc(100% - 50px); /* Offset for the nav bar */
z-index: -1;
}
@@ -13,19 +13,19 @@
}
.browser-inner-pane {
padding: 0px;
padding: 0px;
overflow: hidden;
}
.browser-center-pane {
overflow: hidden;
padding: 0px;
overflow: hidden;
padding: 0px;
padding-bottom: 50px /* Offset the nav bar to ensure there's enough scroll space */
}
.browser-tab-bar {
padding-left: 5px;
padding-top: 5px;
padding-left: 5px;
padding-top: 5px;
background-color: #E6E6E6;
}
@@ -38,7 +38,7 @@
}
.browser-tab-content {
width: 100%;
width: 100%;
height: 100%;
}
@@ -49,3 +49,16 @@
.aciTree .aciTreeLi div.aciTreeLine {
display: table !important;
}
code,
kbd,
pre,
samp,
.CodeMirror pre {
font-family: 'Source Code Pro';
}
.sql-editor-grid-container {
font-family: 'Open Sans' !important;
}
+10 -3
View File
@@ -7,12 +7,19 @@
"4": ["", "Hello World", "text"],
"5": ["\"\"", "", "text", "Two double quotes"],
"6": ["\\\"\\\"", "\"\"", "text", "double backslash followed by a double quote"],
"7": ["\\\\\"\\\\\"", "\\\"\\\"", "text", "double backslash followed by a double quote"],
"7": ["\\\\\"\\\\\"", "\\\\\"\\\\\"", "text", "double backslash followed by a double quote"],
"8": ["", "[null]", "text"],
"9": ["", "[51,52]", "json"],
"10": ["[61,62]", "[61,62]", "json"],
"11": ["", "true", "bool"],
"12": ["", "[null]", "bool"]
"12": ["", "[null]", "bool"],
"13": ["", "[null]", "text[]"],
"14": ["{}", "{}", "text[]"],
"15": ["{data,,'',\"\",\\'\\',\\\"\\\"}", "{data,[null],,,'',\"\"}", "text[]"],
"16": ["{}", "{}", "int[]"],
"17": ["{123,,456}", "{123,[null],456}", "int[]"],
"18": ["", "[null]", "boolean[]"],
"19": ["{false,,true}", "{false,[null],true}", "boolean[]"]
}
}
}
}
@@ -67,6 +67,13 @@ CREATE TABLE public.defaults
json_null json,
boolean_defaults boolean DEFAULT true,
boolean_null boolean,
text_arr text[],
text_arr_empty text[],
text_arr_null text[],
int_arr integer[],
int_arr_empty integer[],
boolean_arr boolean[],
boolean_arr_null boolean[],
CONSTRAINT defaults_pkey PRIMARY KEY (id)
)
"""
@@ -169,17 +176,16 @@ CREATE TABLE public.defaults
ActionChains(self.driver).move_to_element(cell_el).double_click(
cell_el
).perform()
cell_type = data[2]
value = data[0]
if cell_type == 'int':
if cell_type in ['int', 'int[]']:
if value == 'clear':
cell_el.find_element_by_css_selector('input').clear()
else:
ActionChains(self.driver).send_keys(value).perform()
elif cell_type in ['text', 'json']:
elif cell_type in ['text', 'json', 'text[]', 'boolean[]']:
self.page.find_by_xpath(
"//*[contains(@class, 'pg_textarea')]").click()
ActionChains(self.driver).send_keys(value).perform()
@@ -231,7 +237,6 @@ CREATE TABLE public.defaults
self.page.find_by_xpath(row0_cell0_xpath).click()
self.page.find_by_xpath("//*[@id='btn-copy-row']").click()
self.page.find_by_xpath("//*[@id='btn-paste-row']").click()
# Update primary key of copied cell
self._update_cell(row1_cell1_xpath, [2, "", "int"])
self.page.find_by_xpath(
@@ -261,13 +266,12 @@ CREATE TABLE public.defaults
self._verify_row_data(False)
def _add_row(self):
for idx in range(1, len(config_data.keys())):
for idx in range(1, len(config_data.keys()) + 1):
cell_xpath = CheckForViewDataTest._get_cell_xpath(
'r'+str(idx), 1
)
time.sleep(0.2)
self._update_cell(cell_xpath, config_data[str(idx)])
self.page.find_by_id("btn-save").click() # Save data
# There should be some delay after save button is clicked, as it
# takes some time to complete save ajax call otherwise discard unsaved
@@ -290,12 +294,9 @@ CREATE TABLE public.defaults
# List of row values in an array
cells = [el.text for el in result_row.find_elements_by_tag_name('div')]
for idx in range(1, len(config_data.keys())):
for idx in range(1, len(config_data.keys()) + 1):
# after copy & paste row, the first cell of row 1 and
# row 2(being primary keys) won't match
# see if cell values matched to actual value
if idx != 1 and not is_new_row:
self.assertEquals(cells[idx], config_data[str(idx)][1])
elif is_new_row:
if (idx != 1 and not is_new_row) or is_new_row:
self.assertEquals(cells[idx], config_data[str(idx)][1])
@@ -28,7 +28,7 @@
}
.ajs-bg-bgprocess > .pg-bg-bgprocess > .pg-bg-notify-body {
font-family: monospace;
font-family: "Source Code Pro";
white-space: nowrap;
}
@@ -76,7 +76,7 @@
}
.fileinfo table#contents tr td p {
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
font-family: "Open Sans";
}
.fileinfo > h1 {
@@ -260,12 +260,14 @@ var PlanModel = Backbone.Model.extend({
node_type = node_type.substring(0,7);
// Get the image information for current node
var mapperObj = (_.isFunction(imageMapper[node_type]) &&
var mappedImage = (_.isFunction(imageMapper[node_type]) &&
imageMapper[node_type].apply(undefined, [data])) ||
imageMapper[node_type] || 'Undefined';
imageMapper[node_type] || {
"image": "ex_unknown.png", "image_text": node_type
};
data["image"] = mapperObj["image"];
data["image_text"] = mapperObj["image_text"];
data["image"] = mappedImage["image"];
data["image_text"] = mappedImage["image_text"];
// Start calculating xpos, ypos, width and height for child plans if any
if ('Plans' in data) {
@@ -1,5 +1,5 @@
.aciTree .aciTreeText {
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
font-family: 'Open Sans';
font-size: 12px;
}
@@ -18,4 +18,4 @@
.aciTree .aciTreeSelected > .aciTreeLine .aciTreeItem {
background-color: #e7f2ff;
border-color: #84acdd;
}
}
+9 -7
View File
@@ -2,6 +2,7 @@
/* Ensure simple forms don't hit the top of the screen */
body {
font-family: 'Open Sans';
padding-top: 50px;
padding-bottom: 20px;
}
@@ -104,7 +105,7 @@ iframe {
border-width: 5px 0 5px 5px;
border-left-color: #cccccc;
margin-top: 5px;
margin-right: -2px;
margin-right: -10px;
}
.dropdown-submenu:hover>a:after {
@@ -152,10 +153,6 @@ iframe {
margin-bottom: 0;
}
.dropdown-menu > li > a {
padding: 3px 5px;
}
.dropdown-menu > li > a > i {
margin-left: -17px;
width: 13px;
@@ -1005,7 +1002,7 @@ ul.nav.nav-tabs {
}
span.button-label {
font-family: "Helvetica Neue",Helvetica,Arial,sans-serif;
font-family: 'Open Sans';
font-size: initial;
}
@@ -1015,7 +1012,7 @@ span.button-label {
border-radius: 3px;
color: #333;
display: block;
font-family: Menlo,Monaco,Consolas,"Courier New",monospace;
font-family: 'Source Code Pro';
font-size: 12px;
line-height: 1.42857;
margin: 0 0 10px;
@@ -1344,3 +1341,8 @@ body {
.override_label_class_font_size {
font-size: inherit !important;
}
/* To align 'X' in alert on login page */
.alert-dismissable, .alert-dismissible {
padding-right: 35px !important;
}
@@ -48,7 +48,7 @@
/* Codemirror buttons */
.CodeMirror-dialog button {
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
font-family: 'Open Sans';
color: white;
font-size: 70%;
background-image: -webkit-linear-gradient(top, #337ab7 0%, #265a88 100%);
@@ -72,4 +72,4 @@
.CodeMirror-gutters {
z-index: 2;
}
}
+16 -1
View File
@@ -812,4 +812,19 @@ lgg-el-container[el=md] .pg-el-lg-8,
.Resizer.disabled:hover {
border-color: transparent;
}
}
@font-face {
font-family: 'Open Sans';
src: url('../fonts/OpenSans-Regular.ttf');
font-weight: normal;
font-style: normal;
}
@font-face {
font-family: 'Source Code Pro';
src: url('../fonts/SourceCodePro-Regular.ttf');
font-weight: normal;
font-style: normal;
}
+9 -5
View File
@@ -57,19 +57,19 @@
font-weight: bold; }
.text-14 {
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
font-family: 'Open Sans';
font-size: 14px; }
.text-13 {
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
font-family: 'Open Sans';
font-size: 13px; }
.text-12 {
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
font-family: 'Open Sans';
font-size: 12px; }
.text-11 {
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
font-family: 'Open Sans';
font-size: 11px; }
.bg-primary-blue {
@@ -103,4 +103,8 @@
color: #FFFFFF; }
.opacity-5 {
opacity: 0.5; }
opacity: 0.5; }
.alertify .ajs-body {
font-family: 'Open Sans';
}
@@ -285,7 +285,7 @@
right: 5px;
}
.context-menu-list {
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
font-family: 'Open Sans';;
font-size: 13px;
}
@@ -300,7 +300,7 @@ font-size: 13px;
.context-menu-item {
display:block;
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
font-family: 'Open Sans';
font-size: 13px;
font-weight: normal;
}
@@ -387,4 +387,4 @@ i.wcTabIcon {
.wcFrameTitleBar.wcTabTop .wcFrameButtonBar {
right: 30px !important;
}
}
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+139 -26
View File
@@ -48,6 +48,10 @@
return $buttons;
}
function is_valid_array(val) {
val = $.trim(val)
return !(val != "" && (val.charAt(0) != '{' || val.charAt(val.length - 1) != '}'));
}
/*
* This function handles the [default] and [null] values for cells
* if row is copied, otherwise returns the editor value.
@@ -189,15 +193,41 @@
this.loadValue = function (item) {
var col = args.column;
if (_.isUndefined(item[args.column.field]) && col.has_default_val) {
$input.val(defaultValue = "");
if (_.isUndefined(item[args.column.field]) || _.isNull(item[args.column.field])) {
$input.val(defaultValue = "");
return;
}
else if (item[args.column.field] === "") {
$input.val(defaultValue = "''");
}
else {
$input.val(defaultValue = item[args.column.field]);
$input.select();
if (!args.column.is_array) {
if (item[args.column.field] === "") {
$input.val(defaultValue = "''");
} else if (item[args.column.field] === "''") {
$input.val(defaultValue = "\\'\\'");
} else if (item[args.column.field] === '""') {
$input.val(defaultValue = '\\"\\"');
} else {
$input.val(defaultValue = item[args.column.field]);
$input.select();
}
} else {
var data = [];
for (var k in item[args.column.field]) {
if (_.isUndefined(item[args.column.field][k]) || _.isNull(item[args.column.field][k])) {
data.push('');
} else if (item[args.column.field][k] === "") {
data.push("''");
} else if (item[args.column.field][k] === "''") {
data.push("\\'\\'");
} else if (item[args.column.field][k] === '""') {
data.push('\\"\\"');
} else {
data.push(item[args.column.field][k]);
$input.select();
}
}
defaultValue = data;
$input.val('{' + data.join() +'}');
}
};
@@ -207,18 +237,43 @@
if (value === "") {
return null;
}
// single/double quotes represent an empty string
// If found return ''
else if (value === "''" || value === '""') {
return '';
}
else {
// If found string literals - \"\", \'\', \\'\\' and \\\\'\\\\'
// then remove slashes.
value = value.replace("\\'\\'", "''");
value = value.replace('\\"\\"', '""');
value = value = value.replace(/\\\\/g, '\\');
return value;
if (!args.column.is_array) {
if (value === "''" || value === '""') {
return '';
} else if (value === "\\'\\'") {
return "''";
} else if (value === '\\"\\"') {
return '""';
} else {
return value;
}
} else {
// Remove leading { and trailing }.
// Also remove leading and trailing whitespaces.
var value = $.trim(value.slice(1, -1));
if(value == '') {
return [];
}
var data = [];
value = value.split(',');
for (var k in value) {
if (value[k] == "") {
data.push(null); //empty string from editor is null value.
} else if (value[k] === "''" || value[k] === '""') {
data.push(''); // double quote from editor is blank string;
} else if (value[k] === "\\'\\'") {
data.push("''");
} else if (value[k] === '\\"\\"') {
data.push('""');
} else {
data.push(value[k]);
}
}
return data;
}
};
@@ -233,7 +288,7 @@
return false;
} else {
return (!($input.val() == "" && _.isNull(defaultValue))) &&
($input.val() != defaultValue);
($input.val() !== defaultValue);
}
};
@@ -245,6 +300,13 @@
}
}
if (args.column.is_array && !is_valid_array($input.val())) {
return {
valid: false,
msg: "Array must start with '{' and end with '}'"
};
}
return {
valid: true,
msg: null
@@ -859,7 +921,13 @@
this.loadValue = function (item) {
defaultValue = item[args.column.field];
$input.val(defaultValue);
if(args.column.is_array && !_.isNull(defaultValue) && !_.isUndefined(defaultValue)) {
$input.val('{' + defaultValue.join() +'}');
} else {
$input.val(defaultValue);
}
$input[0].defaultValue = defaultValue;
$input.select();
};
@@ -868,6 +936,24 @@
if ($input.val() === "") {
return null;
}
if(args.column.is_array) {
// Remove leading { and trailing }.
// Also remove leading and trailing whitespaces.
var val = $.trim($input.val().slice(1, -1));
if(val == '') {
return [];
}
val = val.split(',');
for (var k in val) {
if (val[k] == "") {
val[k] = null; //empty string from editor is null value.
}
}
return val;
}
return $input.val();
};
@@ -887,20 +973,47 @@
};
this.validate = function () {
if (isNaN($input.val())) {
var value = $input.val();
if (!args.column.is_array && isNaN(value)) {
return {
valid: false,
msg: "Please enter a valid integer"
msg: "Please enter a valid number"
};
}
if (args.column.validator) {
var validationResults = args.column.validator($input.val());
var validationResults = args.column.validator(value);
if (!validationResults.valid) {
return validationResults;
}
}
if (args.column.is_array) {
if (!is_valid_array(value)) {
return {
valid: false,
msg: "Array must start with '{' and end with '}'"
};
}
var val = $.trim(value.slice(1, -1)),
arr;
if(val == '') {
arr = [];
} else {
var arr = val.split(',');
}
for (var k in arr) {
if (isNaN(arr[k])) {
return {
valid: false,
msg: "Please enter a valid numbers"
};
}
}
}
return {
valid: true,
msg: null
+116 -35
View File
@@ -14,20 +14,45 @@
"Numbers": NumbersFormatter,
"Checkmark": CheckmarkFormatter,
"Text": TextFormatter,
"Binary": BinaryFormatter,
"JsonStringArray": JsonArrayFormatter,
"NumbersArray": NumbersArrayFormatter,
"TextArray": TextArrayFormatter,
}
}
});
function JsonFormatter(row, cell, value, columnDef, dataContext) {
// If column has default value, set placeholder
function NullAndDefaultFormatter(row, cell, value, columnDef, dataContext) {
if (_.isUndefined(value) && columnDef.has_default_val) {
return "<span class='pull-left disabled_cell'>[default]</span>";
return "<span class='pull-left disabled_cell'>[default]</span>";
}
else if (
(_.isUndefined(value) && columnDef.not_null) ||
(_.isUndefined(value) || value === null)
) {
return "<span class='pull-left disabled_cell'>[null]</span>";
}
return null;
}
function NullAndDefaultNumberFormatter(row, cell, value, columnDef, dataContext) {
if (_.isUndefined(value) && columnDef.has_default_val) {
return "<span class='pull-right disabled_cell'>[default]</span>";
}
else if (
(_.isUndefined(value) && columnDef.not_null) ||
(_.isUndefined(value) || value === null)
) {
return "<span class='pull-right disabled_cell'>[null]</span>";
}
return null;
}
function JsonFormatter(row, cell, value, columnDef, dataContext) {
// If column has default value, set placeholder
var data = NullAndDefaultFormatter(row, cell, value, columnDef, dataContext);
if (data) {
return data;
} else {
// Stringify only if it's json object
if (typeof value === "object" && !Array.isArray(value)) {
@@ -48,57 +73,113 @@
}
}
function JsonArrayFormatter(row, cell, value, columnDef, dataContext) {
// If column has default value, set placeholder
var data = NullAndDefaultFormatter(row, cell, value, columnDef, dataContext);
if (data) {
return data;
} else {
var data = [];
for (var k in value) {
// Stringify only if it's json object
var v = value[k];
if (typeof v === "object" && !Array.isArray(v)) {
return data.push(_.escape(JSON.stringify(v)));
} else if (Array.isArray(v)) {
var temp = [];
$.each(v, function(i, val) {
if (typeof val === "object") {
temp.push(JSON.stringify(val));
} else {
temp.push(val)
}
});
return data.push(_.escape("[" + temp.join() + "]"));
} else {
return data.push(_.escape(v));
}
}
return '{' + data.join() + '}';
}
}
function NumbersFormatter(row, cell, value, columnDef, dataContext) {
// If column has default value, set placeholder
if (_.isUndefined(value) && columnDef.has_default_val) {
return "<span class='pull-right disabled_cell'>[default]</span>";
}
else if (
(_.isUndefined(value) || value === null || value === "") ||
(_.isUndefined(value) && columnDef.not_null)
) {
return "<span class='pull-right disabled_cell'>[null]</span>";
}
else {
var data = NullAndDefaultNumberFormatter(row, cell, value, columnDef, dataContext);
if (data) {
return data;
} else {
return "<span style='float:right'>" + _.escape(value) + "</span>";
}
}
function NumbersArrayFormatter(row, cell, value, columnDef, dataContext) {
// If column has default value, set placeholder
var data = NullAndDefaultNumberFormatter(row, cell, value, columnDef, dataContext);
if (data) {
return data;
} else {
data = [];
for(var k in value) {
if (value[k] == null) {
data.push("<span class='disabled_cell'>[null]</span>");
} else {
data.push(_.escape(value[k]));
}
}
return "<span style='float:right'>{" + data.join() + "}</span>";
}
}
function CheckmarkFormatter(row, cell, value, columnDef, dataContext) {
/* Checkbox has 3 states
* 1) checked=true
* 2) unchecked=false
* 3) indeterminate=null
*/
if (_.isUndefined(value) && columnDef.has_default_val) {
return "<span class='pull-left disabled_cell'>[default]</span>";
var data = NullAndDefaultFormatter(row, cell, value, columnDef, dataContext);
if (data) {
return data;
} else {
return value ? "true" : "false";
}
else if (
(_.isUndefined(value) && columnDef.not_null) ||
(value == null || value === "")
) {
return "<span class='pull-left disabled_cell'>[null]</span>";
}
return value ? "true" : "false";
}
function TextFormatter(row, cell, value, columnDef, dataContext) {
// If column has default value, set placeholder
if (_.isUndefined(value) && columnDef.has_default_val) {
return "<span class='pull-left disabled_cell'>[default]</span>";
}
else if (
(_.isUndefined(value) && columnDef.not_null) ||
(_.isUndefined(value) || _.isNull(value))
) {
return "<span class='pull-left disabled_cell'>[null]</span>";
} else if(columnDef.column_type_internal == 'bytea' ||
columnDef.column_type_internal == 'bytea[]') {
return "<span class='pull-left disabled_cell'>[" + _.escape(value) + "]</span>";
}
else {
var data = NullAndDefaultFormatter(row, cell, value, columnDef, dataContext);
if (data) {
return data;
} else {
return _.escape(value);
}
}
function TextArrayFormatter(row, cell, value, columnDef, dataContext) {
// If column has default value, set placeholder
var data = NullAndDefaultFormatter(row, cell, value, columnDef, dataContext);
if (data) {
return data;
} else {
data = [];
for(var k in value) {
if (value[k] === null) {
data.push("<span class='disabled_cell'>[null]</span>");
} else {
data.push(_.escape(value[k]));
}
}
return "{" + data.join() + "}";
}
}
function BinaryFormatter(row, cell, value, columnDef, dataContext) {
// If column has default value, set placeholder
var data = NullAndDefaultFormatter(row, cell, value, columnDef, dataContext);
if (data) {
return data;
} else {
return "<span class='pull-left disabled_cell'>[" + _.escape(value) + "]</span>";
}
}
})(jQuery);
@@ -14,7 +14,9 @@ import Shapes from '../../react_shapes';
export default class HistoryErrorMessage extends React.Component {
parseErrorMessage(message) {
return message.match(/ERROR:\s*([^\n\r]*)/i)[1];
return message.match(/ERROR:\s*([^\n\r]*)/i) ?
message.match(/ERROR:\s*([^\n\r]*)/i)[1] :
message;
}
render() {
@@ -27,4 +29,4 @@ export default class HistoryErrorMessage extends React.Component {
HistoryErrorMessage.propTypes = {
historyEntry: Shapes.historyDetail,
};
};
@@ -13,6 +13,7 @@ import React from 'react';
import ReactDOM from 'react-dom';
import _ from 'underscore';
import moment from 'moment';
import PropTypes from 'prop-types';
import QueryHistoryEntry from './query_history_entry';
import QueryHistoryEntryDateGroup from './query_history_entry_date_group';
@@ -150,7 +151,7 @@ export default class QueryHistoryEntries extends React.Component {
}
QueryHistoryEntries.propTypes = {
historyEntries: React.PropTypes.array.isRequired,
selectedEntry: React.PropTypes.number.isRequired,
onSelectEntry: React.PropTypes.func.isRequired,
historyEntries: PropTypes.array.isRequired,
selectedEntry: PropTypes.number.isRequired,
onSelectEntry: PropTypes.func.isRequired,
};
@@ -10,6 +10,7 @@
import React from 'react';
import Shapes from '../react_shapes';
import moment from 'moment';
import PropTypes from 'prop-types';
export default class QueryHistoryEntry extends React.Component {
formatDate(date) {
@@ -54,5 +55,5 @@ export default class QueryHistoryEntry extends React.Component {
QueryHistoryEntry.propTypes = {
historyEntry: Shapes.historyDetail,
isSelected: React.PropTypes.bool,
};
isSelected: PropTypes.bool,
};
@@ -9,6 +9,7 @@
import React from 'react';
import moment from 'moment';
import PropTypes from 'prop-types';
export default class QueryHistoryEntryDateGroup extends React.Component {
@@ -40,7 +41,7 @@ export default class QueryHistoryEntryDateGroup extends React.Component {
}
QueryHistoryEntryDateGroup.propTypes = {
date: React.PropTypes.instanceOf(Date).isRequired,
date: PropTypes.instanceOf(Date).isRequired,
};
QueryHistoryEntryDateGroup.formatString = 'MMM DD YYYY';
+12 -11
View File
@@ -8,24 +8,25 @@
//////////////////////////////////////////////////////////////////////////
import React from 'react';
import PropTypes from 'prop-types';
let historyDetail =
React.PropTypes.shape({
query: React.PropTypes.string,
start_time: React.PropTypes.instanceOf(Date),
status: React.PropTypes.bool,
total_time: React.PropTypes.string,
row_affected: React.PropTypes.int,
message: React.PropTypes.string,
PropTypes.shape({
query: PropTypes.string,
start_time: PropTypes.instanceOf(Date),
status: PropTypes.bool,
total_time: PropTypes.string,
row_affected: PropTypes.int,
message: PropTypes.string,
});
let historyCollectionClass =
React.PropTypes.shape({
historyList: React.PropTypes.array.isRequired,
onChange: React.PropTypes.func.isRequired,
PropTypes.shape({
historyList: PropTypes.array.isRequired,
onChange: PropTypes.func.isRequired,
});
export default {
historyDetail,
historyCollectionClass,
};
};
+1 -1
View File
@@ -42,7 +42,7 @@
padding: 0 12px 0 10px;
align-self: center;
// To make sure IE picks up the correct font
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
font-family: 'Open Sans';
}
.alert-info {
@@ -143,7 +143,7 @@
}
button.pg-alertify-button {
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
font-family: 'Open Sans';
font-size: 14px;
-webkit-font-smoothing: auto;
}
+1 -1
View File
@@ -1,4 +1,4 @@
$font-family-1: "Helvetica Neue", Arial, sans-serif;
$font-family-1: "Open Sans";
.text-bold {
font-weight: bold;
@@ -7,7 +7,7 @@
.entry {
@extend .text-14;
@extend .bg-white-1;
font-family: monospace;
font-family: 'Source Code Pro';
border: 2px solid transparent;
margin-left: 1px;
padding: 0 8px 0 5px;
@@ -15,7 +15,7 @@
.other-info {
@extend .text-13;
@extend .font-gray-4;
font-family: monospace;
font-family: 'Source Code Pro';
display: flex;
flex-direction: row;
justify-content: space-between;
@@ -34,7 +34,7 @@
}
.date-label {
font-family: monospace;
font-family: 'Source Code Pro';
background: #e8e8e8;
padding: 2px 9px;
font-size: 11px;
@@ -183,7 +183,7 @@
.content-value {
@extend .bg-white-1;
@extend .text-13;
font-family: Menlo, Monaco, Consolas, "Courier New", monospace;
font-family: 'Source Code Pro';
border: 0;
padding-left: 0;
position: absolute;
+7
View File
@@ -184,6 +184,12 @@ def panel(trans_id, is_query_tool, editor_title):
else:
sURL = None
# Fetch server type from request
if request.args and request.args['server_type'] != '':
server_type = request.args['server_type']
else:
server_type = None
# We need client OS information to render correct Keyboard shortcuts
user_agent = UserAgent(request.headers.get('User-Agent'))
@@ -217,6 +223,7 @@ def panel(trans_id, is_query_tool, editor_title):
is_desktop_mode=app.PGADMIN_RUNTIME,
is_linux=is_linux_platform,
is_new_browser_tab=new_browser_tab,
server_type=server_type,
client_platform=user_agent.platform
)
@@ -28,7 +28,7 @@ define('pgadmin.datagrid', [
// Define list of nodes on which view data option appears
var supported_nodes = [
'table', 'view', 'mview',
'foreign-table', 'catalog_object', 'partition'
'foreign_table', 'catalog_object', 'partition'
],
/* Enable/disable View data menu in tools based
@@ -164,7 +164,7 @@ define('pgadmin.datagrid', [
+ nsp_name + '.' + d.label;
// Initialize the data grid.
self.initialize_data_grid(baseUrl, grid_title, '');
self.initialize_data_grid(baseUrl, grid_title, '', parentData.server.server_type);
},
// This is a callback function to show filtered data when user click on menu item.
@@ -283,7 +283,7 @@ define('pgadmin.datagrid', [
success: function(res) {
if (res.data.status) {
// Initialize the data grid.
self.initialize_data_grid(that.baseUrl, grid_title, sql);
self.initialize_data_grid(that.baseUrl, grid_title, sql, parentData.server.server_type);
}
else {
alertify.alert(
@@ -336,7 +336,7 @@ define('pgadmin.datagrid', [
return grid_title;
},
initialize_data_grid: function(baseUrl, grid_title, sql_filter) {
initialize_data_grid: function(baseUrl, grid_title, sql_filter, server_type) {
var self = this;
self.grid_title = grid_title;
@@ -361,7 +361,8 @@ define('pgadmin.datagrid', [
'editor_title': encodeURIComponent(self.grid_title)
};
var baseUrl = url_for('datagrid.panel', url_params);
var baseUrl = url_for('datagrid.panel', url_params) +
"?query_url=&server_type=" + encodeURIComponent(server_type);
var grid_title = gettext('Edit Data - ') + self.grid_title;
if (res.data.newBrowserTab) {
var newWin = window.open(baseUrl, '_blank');
@@ -465,7 +466,7 @@ define('pgadmin.datagrid', [
}
var baseUrl = url_for('datagrid.panel', url_params) +
'?' + "query_url=" + encodeURI(sURL);
'?' + "query_url=" + encodeURI(sURL) + "&server_type=" + encodeURIComponent(parentData.server.server_type);
// Create title for CREATE/DELETE scripts
if (panel_title) {
@@ -369,6 +369,6 @@
// Start the query tool.
sqlEditorController.start({{ is_query_tool }}, "{{ editor_title }}",
script_sql, {{ is_new_browser_tab }});
script_sql, {{ is_new_browser_tab }}, "{{ server_type }}");
});
{% endblock %}
@@ -42,7 +42,7 @@
.CodeMirror-foldmarker {
color: blue;
text-shadow: #b9f 1px 1px 2px, #b9f -1px -1px 2px, #b9f 1px -1px 2px, #b9f -1px 1px 2px;
font-family: arial;
font-family: "Open Sans";
line-height: .3;
cursor: pointer;
}
@@ -71,7 +71,7 @@
/* To make font same as Query tool in messages tab */
.messages {
white-space: pre-wrap;
font-family: monospace;
font-family: "Source Code Pro";
padding-top: 5px;
padding-left: 10px;
overflow: auto;
@@ -81,4 +81,4 @@
-moz-user-select: text;
-ms-user-select: text;
user-select: text;
}
}
@@ -10,7 +10,7 @@ WHERE
nsp.oid={{nspid}}::oid AND
{% else %}
{% if not show_sysobj %}
nspname NOT LIKE E'pg\_%' AND
nspname NOT LIKE 'pg\_%' AND
{% endif %}
{% endif %}
NOT (
@@ -11,7 +11,7 @@ WHERE
nsp.oid={{nspid}}::oid AND
{% else %}
{% if not show_sysobj %}
nspname NOT LIKE E'pg\_%' AND
nspname NOT LIKE 'pg\_%' AND
{% endif %}
{% endif %}
NOT (
+34 -28
View File
@@ -446,7 +446,8 @@ class TableCommand(GridCommand):
query_res = dict()
count = 0
list_of_rowid = []
list_of_sql = []
operations = ('added', 'updated', 'deleted')
list_of_sql = {}
_rowid = None
if conn.connected():
@@ -457,7 +458,7 @@ class TableCommand(GridCommand):
# Iterate total number of records to be updated/inserted
for of_type in changed_data:
# No need to go further if its not add/update/delete operation
if of_type not in ('added', 'updated', 'deleted'):
if of_type not in operations:
continue
# if no data to be save then continue
if len(changed_data[of_type]) < 1:
@@ -480,6 +481,7 @@ class TableCommand(GridCommand):
# For newly added rows
if of_type == 'added':
list_of_sql[of_type] = []
# When new rows are added, only changed columns data is
# sent from client side. But if column is not_null and has
@@ -506,12 +508,13 @@ class TableCommand(GridCommand):
nsp_name=self.nsp_name,
data_type=column_type,
pk_names=pk_names)
list_of_sql.append(sql)
list_of_sql[of_type].append({'sql': sql, 'data': data})
# Reset column data
column_data = {}
# For updated rows
elif of_type == 'updated':
list_of_sql[of_type] = []
for each_row in changed_data[of_type]:
data = changed_data[of_type][each_row]['data']
pk = changed_data[of_type][each_row]['primary_keys']
@@ -521,11 +524,12 @@ class TableCommand(GridCommand):
object_name=self.object_name,
nsp_name=self.nsp_name,
data_type=column_type)
list_of_sql.append(sql)
list_of_rowid.append(data)
list_of_sql[of_type].append({'sql': sql, 'data': data})
list_of_rowid.append(data.get(client_primary_key))
# For deleted rows
elif of_type == 'deleted':
list_of_sql[of_type] = []
is_first = True
rows_to_delete = []
keys = None
@@ -559,33 +563,35 @@ class TableCommand(GridCommand):
no_of_keys=no_of_keys,
object_name=self.object_name,
nsp_name=self.nsp_name)
list_of_sql.append(sql)
list_of_sql[of_type].append({'sql': sql, 'data': {}})
for i, sql in enumerate(list_of_sql):
if sql:
status, res = conn.execute_void(sql)
rows_affected = conn.rows_affected()
for opr, sqls in list_of_sql.items():
for item in sqls:
if item['sql']:
status, res = conn.execute_void(
item['sql'], item['data'])
rows_affected = conn.rows_affected()
# store the result of each query in dictionary
query_res[count] = {'status': status, 'result': res,
'sql': sql, 'rows_affected': rows_affected}
count += 1
# store the result of each query in dictionary
query_res[count] = {'status': status, 'result': res,
'sql': sql, 'rows_affected': rows_affected}
if not status:
conn.execute_void('ROLLBACK;')
# If we roll backed every thing then update the message for
# each sql query.
for val in query_res:
if query_res[val]['status']:
query_res[val]['result'] = 'Transaction ROLLBACK'
if not status:
conn.execute_void('ROLLBACK;')
# If we roll backed every thing then update the message for
# each sql query.
for val in query_res:
if query_res[val]['status']:
query_res[val]['result'] = 'Transaction ROLLBACK'
# If list is empty set rowid to 1
try:
_rowid = list_of_rowid[i] if list_of_rowid else 1
except Exception:
_rowid = 0
# If list is empty set rowid to 1
try:
_rowid = list_of_rowid[count] if list_of_rowid else 1
except Exception:
_rowid = 0
return status, res, query_res, _rowid
return status, res, query_res, _rowid
count += 1
# Commit the transaction if there is no error found
conn.execute_void('COMMIT;')
@@ -654,7 +660,7 @@ class ForeignTableCommand(GridCommand):
It is a derived class for ForeignTable type.
"""
object_type = 'foreign-table'
object_type = 'foreign_table'
def __init__(self, **kwargs):
"""
@@ -99,7 +99,7 @@
.sql-editor-message {
white-space:pre-wrap;
font-family: monospace;
font-family: "Source Code Pro";
padding-top: 5px;
padding-left: 10px;
overflow: auto;
@@ -151,7 +151,7 @@
.CodeMirror-foldmarker {
color: blue;
text-shadow: #b9f 1px 1px 2px, #b9f -1px -1px 2px, #b9f 1px -1px 2px, #b9f -1px 1px 2px;
font-family: arial;
font-family: "Open Sans";
line-height: .3;
cursor: pointer;
}
@@ -206,7 +206,7 @@
background: white;
font-size: 90%;
font-family: monospace;
font-family: "Source Code Pro";
max-height: 20em;
overflow-y: auto;
@@ -522,4 +522,4 @@ input.editor-checkbox:focus {
}
.pg_buttons {
text-align:right;
}
}
@@ -110,7 +110,7 @@ define('tools.querytool', [
self.filter_obj = CodeMirror.fromTextArea(filter.get(0), {
lineNumbers: true,
indentUnit: 4,
mode: "text/x-pgsql",
mode: self.handler.server_type === "gpdb" ? "text/x-gpsql" : "text/x-pgsql",
foldOptions: {
widget: "\u2026"
},
@@ -155,7 +155,7 @@ define('tools.querytool', [
lineNumbers: true,
indentUnit: 4,
styleSelectedText: true,
mode: "text/x-pgsql",
mode: self.handler.server_type === "gpdb" ? "text/x-gpsql" : "text/x-pgsql",
foldOptions: {
widget: "\u2026"
},
@@ -577,7 +577,8 @@ define('tools.querytool', [
column_type: c.column_type,
column_type_internal: c.column_type_internal,
not_null: c.not_null,
has_default_val: c.has_default_val
has_default_val: c.has_default_val,
is_array: c.is_array
};
// Get the columns width based on longer string among data type or
@@ -592,26 +593,28 @@ define('tools.querytool', [
else {
options['width'] = column_size[table_name][c.name];
}
// If grid is editable then add editor else make it readonly
if (c.cell == 'Json') {
options['editor'] = is_editable ? Slick.Editors.JsonText
: Slick.Editors.ReadOnlyJsonText;
options['formatter'] = Slick.Formatters.JsonString;
options['formatter'] = c.is_array ? Slick.Formatters.JsonStringArray : Slick.Formatters.JsonString;
} else if (c.cell == 'number' ||
$.inArray(c.type, ['oid', 'xid', 'real']) !== -1
) {
options['editor'] = is_editable ? Slick.Editors.CustomNumber
: Slick.Editors.ReadOnlyText;
options['formatter'] = Slick.Formatters.Numbers;
options['formatter'] = c.is_array ? Slick.Formatters.NumbersArray : Slick.Formatters.Numbers;
} else if (c.cell == 'boolean') {
options['editor'] = is_editable ? Slick.Editors.Checkbox
: Slick.Editors.ReadOnlyCheckbox;
options['formatter'] = Slick.Formatters.Checkmark;
} else {
options['formatter'] = c.is_array ? Slick.Formatters.CheckmarkArray : Slick.Formatters.Checkmark;
} else if (c.cell == 'binary') {
// We do not support editing binary data in SQL editor and data grid.
options['formatter'] = Slick.Formatters.Binary;
}else {
options['editor'] = is_editable ? Slick.Editors.pgText
: Slick.Editors.ReadOnlypgText;
options['formatter'] = Slick.Formatters.Text;
options['formatter'] = c.is_array ? Slick.Formatters.TextArray : Slick.Formatters.Text;
}
grid_columns.push(options)
@@ -1514,7 +1517,7 @@ define('tools.querytool', [
* call the render method of the grid view to render the backgrid
* header and loading icon and start execution of the sql query.
*/
start: function (is_query_tool, editor_title, script_sql, is_new_browser_tab) {
start: function (is_query_tool, editor_title, script_sql, is_new_browser_tab, server_type) {
var self = this;
self.is_query_tool = is_query_tool;
@@ -1528,6 +1531,7 @@ define('tools.querytool', [
self.has_more_rows = false;
self.fetching_rows = false;
self.close_on_save = false;
self.server_type = server_type;
// We do not allow to call the start multiple times.
if (self.gridView)
@@ -2001,7 +2005,6 @@ define('tools.querytool', [
',' + c.scale + ')' :
')';
}
// Identify cell type of column.
switch (type) {
case "json":
@@ -2011,12 +2014,19 @@ define('tools.querytool', [
col_cell = 'Json';
break;
case "smallint":
case "smallint[]":
case "integer":
case "integer[]":
case "bigint":
case "bigint[]":
case "decimal":
case "decimal[]":
case "numeric":
case "numeric[]":
case "real":
case "real[]":
case "double precision":
case "double precision[]":
col_cell = 'number';
break;
case "boolean":
@@ -2024,6 +2034,8 @@ define('tools.querytool', [
break;
case "character":
case "character[]":
case "\"char\"":
case "\"char\"[]":
case "character varying":
case "character varying[]":
if (c.internal_size && c.internal_size >= 0 && c.internal_size != 65535) {
@@ -2032,25 +2044,31 @@ define('tools.querytool', [
}
col_cell = 'string';
break;
case "bytea":
case "bytea[]":
col_cell = 'binary';
break;
default:
col_cell = 'string';
}
column_label = c.display_name + '<br>' + col_type;
var col = {
'name': c.name,
'display_name': c.display_name,
'column_type': col_type,
'column_type_internal': type,
'pos': c.pos,
'label': column_label,
'cell': col_cell,
'can_edit': self.can_edit,
'type': type,
'not_null': c.not_null,
'has_default_val': c.has_default_val
};
var array_type_bracket_index = type.lastIndexOf('[]'),
col = {
'name': c.name,
'display_name': c.display_name,
'column_type': col_type,
'column_type_internal': type,
'pos': c.pos,
'label': column_label,
'cell': col_cell,
'can_edit': self.can_edit,
'type': type,
'not_null': c.not_null,
'has_default_val': c.has_default_val,
'is_array': array_type_bracket_index > -1 && array_type_bracket_index + 2 == type.length
};
columns.push(col);
});
@@ -2980,7 +2998,15 @@ define('tools.querytool', [
),
copied_rows = rows.map(function (rowIndex) {
return data[rowIndex];
});
}),
array_types = [];
// for quick look up create list of array data types
for (var k in self.columns) {
if (self.columns[k].is_array) {
array_types.push(self.columns[k].name);
}
}
rows = rows.length == 0 ? self.last_copied_rows : rows
@@ -2999,7 +3025,8 @@ define('tools.querytool', [
_.each(arr, function (val, i) {
if (arr[i] !== undefined) {
if (_.isObject(arr[i])) {
// Do not stringify array types.
if (_.isObject(arr[i]) && array_types.indexOf(i) == -1) {
obj[String(i)] = JSON.stringify(arr[i]);
} else {
obj[String(i)] = arr[i];
@@ -4,13 +4,5 @@ INSERT INTO {{ conn|qtIdent(nsp_name, object_name) }} (
{% if not loop.first %}, {% endif %}{{ conn|qtIdent(col) }}{% endfor %}
) VALUES (
{% for col in data_to_be_saved %}
{########################################################}
{# THIS IS TO CHECK IF DATA TYPE IS ARRAY? #}
{% if data_type[col].endswith('[]') %}
{% set col_value = "{%s}"|format(data_to_be_saved[col])|qtLiteral %}
{% else %}
{% set col_value = data_to_be_saved[col]|qtLiteral %}
{% endif %}
{########################################################}
{% if not loop.first %}, {% endif %}{{ col_value }}{% endfor %}
);
{% if not loop.first %}, {% endif %}%({{ col }})s::{{ data_type[col] }}{% endfor %}
);
@@ -1,15 +1,7 @@
{# Update the row with primary keys (specified in primary_keys) #}
UPDATE {{ conn|qtIdent(nsp_name, object_name) }} SET
{% for col in data_to_be_saved %}
{########################################################}
{# THIS IS TO CHECK IF DATA TYPE IS ARRAY? #}
{% if data_type[col].endswith('[]') %}
{% set col_value = "{%s}"|format(data_to_be_saved[col])|qtLiteral %}
{% else %}
{% set col_value = data_to_be_saved[col]|qtLiteral %}
{% endif %}
{########################################################}
{% if not loop.first %}, {% endif %}{{ conn|qtIdent(col) }} = {{ col_value }}{% endfor %}
{% if not loop.first %}, {% endif %}{{ conn|qtIdent(col) }} = %({{ col }})s::{{ data_type[col] }}{% endfor %}
WHERE
{% for pk in primary_keys %}
{% if not loop.first %} AND {% endif %}{{ conn|qtIdent(pk) }} = {{ primary_keys[pk]|qtLiteral }}{% endfor %};
{% if not loop.first %} AND {% endif %}{{ conn|qtIdent(pk) }} = {{ primary_keys[pk]|qtLiteral }}{% endfor %};
@@ -96,7 +96,7 @@ define([
if(m instanceof Backbone.Collection) {
return true;
}
if (m.get("id") == userInfo['user_id']){
if (m.get("id") == userInfo['id']){
return false;
} else {
return true;
@@ -110,7 +110,7 @@ define([
if(m instanceof Backbone.Collection) {
return true;
}
if (m.get("id") == userInfo['user_id']){
if (m.get("id") == userInfo['id']){
return false;
} else {
return true;
@@ -283,7 +283,7 @@ define([
self = this;
e.preventDefault();
if (self.model.get("id") == userInfo['user_id']) {
if (self.model.get("id") == userInfo['id']) {
alertify.alert(
gettext('Cannot delete user.'),
gettext('Cannot delete currently logged in user.'),
@@ -394,6 +394,15 @@ define([
footerTpl = _.template([
'<div class="pg-prop-footer">',
'<div class="pg-prop-status-bar" style="visibility:hidden">',
'<div class="media error-in-footer bg-red-1 border-red-2 font-red-3 text-14">',
'<div class="media-body media-middle">',
'<div class="alert-icon error-icon">',
'<i class="fa fa-exclamation-triangle" aria-hidden="true"></i>',
'</div>',
'<div class="alert-text">',
'</div>',
'</div>',
'</div>',
'</div>',
'</div>'].join("\n")),
$footer = $(footerTpl()),
@@ -430,7 +439,8 @@ define([
self.on('pgadmin-session:model:invalid', function(msg, m, c) {
self.invalidUsers[m.cid] = msg;
m.trigger('pgadmin:user:invalid', m);
$statusBar.html(msg).css("visibility", "visible");
$statusBar.find('.alert-text').html(msg);
$statusBar.css("visibility", "visible");
});
self.on('pgadmin-session:model:valid', function(m, c) {
delete self.invalidUsers[m.cid];
@@ -459,9 +469,11 @@ define([
}
if(msg){
$statusBar.html(msg).css("visibility", "visible");
$statusBar.find('.alert-text').html(msg);
$statusBar.css("visibility", "visible");
} else {
$statusBar.empty().css("visibility", "hidden");
$statusBar.find('.alert-text').empty();
$statusBar.css("visibility", "hidden");
}
},
saveUser: function(m) {
+55 -20
View File
@@ -50,31 +50,65 @@ else:
_ = gettext
unicode_type_for_record = psycopg2.extensions.new_type(
(2249,),
"RECORD",
psycopg2.extensions.UNICODE
)
unicode_array_type_for_record_array = psycopg2.extensions.new_array_type(
(2287,),
"ARRAY_RECORD",
unicode_type_for_record
)
# This registers a unicode type caster for datatype 'RECORD'.
psycopg2.extensions.register_type(
psycopg2.extensions.new_type((2249,), "RECORD",
psycopg2.extensions.UNICODE)
psycopg2.extensions.register_type(unicode_type_for_record)
# This registers a array unicode type caster for datatype 'ARRAY_RECORD'.
psycopg2.extensions.register_type(unicode_array_type_for_record_array)
# define type caster to convert various pg types into string type
pg_types_to_string_type = psycopg2.extensions.new_type(
(
# To cast bytea, interval type
17, 1186,
# to cast int4range, int8range, numrange tsrange, tstzrange, daterange
3904, 3926, 3906, 3908, 3910, 3912, 3913,
# date, timestamp, timestamptz, bigint, double precision
1700, 1082, 1114, 1184, 20, 701,
# real
700
),
'TYPECAST_TO_STRING', psycopg2.STRING
)
# define type caster to convert pg array types of above types into
# array of string type
pg_array_types_to_array_of_string_type = psycopg2.extensions.new_array_type(
(
# To cast bytea[] type
1001,
# bigint[]
1016,
# double precision[], real[]
1022, 1021
),
'TYPECAST_TO_ARRAY_OF_STRING', pg_types_to_string_type
)
# This registers a type caster to convert various pg types into string type
psycopg2.extensions.register_type(
psycopg2.extensions.new_type(
(
# To cast bytea, bytea[] and interval type
17, 1001, 1186,
psycopg2.extensions.register_type(pg_types_to_string_type)
# to cast int4range, int8range, numrange tsrange, tstzrange,
# daterange
3904, 3926, 3906, 3908, 3910, 3912, 3913,
# date, timestamp, timestamptz, bigint, double precision, bigint[]
1700, 1082, 1114, 1184, 20, 701, 1016,
# double precision[], real, real[]
1022, 700, 1021
),
'TYPECAST_TO_STRING', psycopg2.STRING)
)
# This registers a type caster to convert various pg array types into
# array of string type
psycopg2.extensions.register_type(pg_array_types_to_array_of_string_type)
def register_string_typecasters(connection):
@@ -145,6 +179,7 @@ def register_binary_typecasters(connection):
connection
)
class Connection(BaseConnection):
"""
class Connection(object)
+3 -1
View File
@@ -58,6 +58,7 @@ class ManagedSession(CallbackDict, SessionMixin):
self.modified = False
self.randval = randval
self.last_write = None
self.force_write = False
self.hmac_digest = hmac_digest
def sign(self, secret):
@@ -219,12 +220,13 @@ class FileBackedSessionManager(SessionManager):
current_time = time.time()
if not session.hmac_digest:
session.sign(self.secret)
else:
elif not session.force_write:
if session.last_write is not None \
and (current_time - float(session.last_write)) < self.disk_write_delay:
return
session.last_write = current_time
session.force_write = False
fname = os.path.join(self.path, session.sid)
with open(fname, 'wb') as f:
dump(
+2 -1
View File
@@ -74,7 +74,7 @@ const optimizeAssetsPlugin = new OptimizeCssAssetsPlugin({
// based on 'NODE_ENV' variable. [used only in production]
const definePlugin = new webpack.DefinePlugin({
'process.env': {
'NODE_ENV': JSON.stringify(envType),
'NODE_ENV': JSON.stringify('production'),
},
});
@@ -319,6 +319,7 @@ module.exports = {
optimizeAssetsPlugin,
definePlugin,
hardSourceWebpackPlugin,
sourceMapDevToolPlugin,
]: [
extractSass,
extractStyle,
+921 -727
View File
File diff suppressed because it is too large. Load diff