[pgadmin-hackers] [pgAdmin4]: Initial patch for Import table

2016-05-05 Thread Neel Patel
Hi,

Please find attached patch file which contains the table Import
functionality.
Attached patch file is depend on the following patch which is not committed
yet.

   - File Manager patch
   - Table node patch

Do review it and let us know for comments.

Thanks,
Neel Patel


import_v1.patch
Description: Binary data

-- 
Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers


[pgadmin-hackers] [pgAdmin4]: Reload Server Configuration

2016-05-05 Thread Neel Patel
Hi,

Please find attached patch file to reload the server configuration.

Do review it and let me know for any comments.

Thanks,
Neel Patel


reload_config_v1.patch
Description: Binary data

-- 
Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers


[pgadmin-hackers] Backgrid Select2cell multiselect support [pgadmin4]

2016-05-05 Thread Harshal Dhumal
Hi,

PFA patch for backgrid Select2cell in which I have added multiselect
support which was missing.

-- 
*Harshal Dhumal*
*Software Engineer *



EenterpriseDB 
diff --git a/web/pgadmin/static/js/backgrid/backgrid.pgadmin.js b/web/pgadmin/static/js/backgrid/backgrid.pgadmin.js
index 55ba7c0..d2d4486 100644
--- a/web/pgadmin/static/js/backgrid/backgrid.pgadmin.js
+++ b/web/pgadmin/static/js/backgrid/backgrid.pgadmin.js
@@ -396,7 +396,7 @@
 editor: null,
 
 defaults: _.defaults({
-  select2: {},
+  select2: {multiple:false},
   opt: {
 label: null,
 value: null,
@@ -471,11 +471,18 @@
   var optionText = null,
   optionValue = null,
   model = this.model,
-  selectedValues = model.get(this.column.get("name"));
+  selectedValues = model.get(this.column.get("name")),
+  self = this,
+  select2_opts = _.extend(
+{openOnEnter: false},
+col.select2, this.defaults.select2
+),
+  selectTpl = _.template('>');
 
   delete this.$select;
-  self = this,
-  $select = self.$select = $('').appendTo(this.$el);
+
+  $select = self.$select = $(selectTpl(
+  {multiple:select2_opts.multiple})).appendTo(this.$el);
 
   for (var i = 0; i < optionValues.length; i++) {
 var opt = optionValues[i];
@@ -501,11 +508,6 @@
 }
   }
 
-  var select2_opts = _.extend(
-{openOnEnter: false},
-col.select2, this.defaults.select2
-);
-
   if(col && _.has(col.disabled)) {
 _.extend(select2_opts, {
   disabled: evalF(col.disabled, col, model)

-- 
Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers


[pgadmin-hackers] PATCH: FTS configuration node

2016-05-05 Thread Sanket Mehta
Hi,

PFA first patch for FTS configuration node.

It depends upon backgrid select2cell multi select control, for which
Harshal has sent the patch recently.
Please do apply his patch first and then apply this patch.

Please do review it and let me know if any changes are required.


Regards,
Sanket Mehta
Sr Software engineer
Enterprisedb
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/fts_configurations/__init__.py b/web/pgadmin/browser/server_groups/servers/databases/schemas/fts_configurations/__init__.py
new file mode 100644
index 000..4b6f575
--- /dev/null
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/fts_configurations/__init__.py
@@ -0,0 +1,946 @@
+##
+#
+# pgAdmin 4 - PostgreSQL Tools
+#
+# Copyright (C) 2016, The pgAdmin Development Team
+# This software is released under the PostgreSQL Licence
+#
+##
+
+"""Defines views for management of Fts Configuration node"""
+
+import json
+from flask import render_template, make_response, current_app, request, jsonify
+from flask.ext.babel import gettext as _
+from pgadmin.utils.ajax import make_json_response, \
+make_response as ajax_response, internal_server_error, gone
+from pgadmin.browser.utils import PGChildNodeView
+from pgadmin.browser.server_groups.servers.databases.schemas.utils \
+import SchemaChildModule
+from pgadmin.browser.server_groups.servers.databases import DatabaseModule
+import pgadmin.browser.server_groups.servers.databases.schemas as schemas
+from pgadmin.utils.ajax import precondition_required
+from pgadmin.utils.driver import get_driver
+from config import PG_DEFAULT_DRIVER
+from functools import wraps
+
+
+class FtsConfigurationModule(SchemaChildModule):
+"""
+ class FtsConfigurationModule(SchemaChildModule)
+
+A module class for FTS Configuration node derived from SchemaChildModule.
+
+Methods:
+---
+* __init__(*args, **kwargs)
+  - Method is used to initialize the FtsConfigurationModule and
+it's base module.
+
+* get_nodes(gid, sid, did, scid)
+  - Method is used to generate the browser collection node.
+
+* node_inode()
+  - Method is overridden from its base class to make the node as leaf node
+
+* script_load()
+  - Load the module script for FTS Configuration, when any of the schema
+  node is initialized.
+"""
+NODE_TYPE = 'fts_configuration'
+COLLECTION_LABEL = _('FTS Configurations')
+
+def __init__(self, *args, **kwargs):
+self.min_ver = None
+self.max_ver = None
+self.manager = None
+super(FtsConfigurationModule, self).__init__(*args, **kwargs)
+
+def get_nodes(self, gid, sid, did, scid):
+"""
+Generate the collection node
+:param gid: group id
+:param sid: server id
+:param did: database id
+:param scid: schema id
+"""
+yield self.generate_browser_collection_node(scid)
+
+@property
+def node_inode(self):
+"""
+Override the property to make the node as leaf node
+"""
+return False
+
+@property
+def script_load(self):
+"""
+Load the module script for fts template, when any of the schema
+node is initialized.
+"""
+return DatabaseModule.NODE_TYPE
+
+
+blueprint = FtsConfigurationModule(__name__)
+
+
+class FtsConfigurationView(PGChildNodeView):
+"""
+class FtsConfigurationView(PGChildNodeView)
+
+A view class for FTS Configuration node derived from PGChildNodeView.
+This class is responsible for all the stuff related to view like
+create/update/delete FTS Configuration,
+showing properties of node, showing sql in sql pane.
+
+Methods:
+---
+* __init__(**kwargs)
+  - Method is used to initialize the FtsConfigurationView and it's base view.
+
+* module_js()
+  - This property defines (if javascript) exists for this node.
+Override this property for your own logic
+
+* check_precondition()
+  - This function will behave as a decorator which will checks
+database connection before running view, it will also attaches
+manager,conn & template_path properties to self
+
+* tokenize_options(self, option_value):
+-   This function will tokenize the string stored in database
+e.g. database store the value as below
+key1=value1, key2=value2, key3=value3, 
+This function will extract key and value from above string
+
+* list()
+  - This function is used to list all the  nodes within that collection.
+
+* nodes()
+  - This function will be used to create all the child node within collection.
+Here it will create all the FTS Configuration nodes.
+
+* node()
+  - This function will be used to create a node g

Re: [pgadmin-hackers] PATCH: FTS configuration node

2016-05-05 Thread Harshal Dhumal
+ patch link

http://www.postgresql.org/message-id/CAFiP3vwkka+=1foj7kr2zbc4azecoca9eo9dz34-oyy_9ge...@mail.gmail.com

-- 
*Harshal Dhumal*
*Software Engineer *



EenterpriseDB 

On Thu, May 5, 2016 at 8:18 PM, Sanket Mehta 
wrote:

> Hi,
>
> PFA first patch for FTS configuration node.
>
> It depends upon backgrid select2cell multi select control, for which
> Harshal has sent the patch recently.
> Please do apply his patch first and then apply this patch.
>
> Please do review it and let me know if any changes are required.
>
>
> Regards,
> Sanket Mehta
> Sr Software engineer
> Enterprisedb
>
>
> --
> Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgadmin-hackers
>
>


[pgadmin-hackers] pgAdmin 4 commit: Dashboards v1

2016-05-05 Thread Dave Page
Dashboards v1

Branch
--
master

Details
---
http://git.postgresql.org/gitweb?p=pgadmin4.git;a=commitdiff;h=0628ee0425b653596d1815d19b09ba4b8caa6096

Modified Files
--
web/pgadmin/browser/server_groups/__init__.py  |4 +-
.../browser/server_groups/servers/__init__.py  |   22 +-
.../servers/templates/servers/servers.js   |   14 +
.../browser/templates/browser/js/browser.js|6 +-
web/pgadmin/dashboard/__init__.py  |  279 +-
web/pgadmin/dashboard/static/css/dashboard.css |   55 +
web/pgadmin/dashboard/static/img/welcome_logo.png  |  Bin 0 -> 22526 bytes
.../templates/dashboard/database_dashboard.html|   91 +-
.../dashboard/templates/dashboard/js/dashboard.js  |  863 ++-
.../templates/dashboard/server_dashboard.html  |   94 +-
.../templates/dashboard/sql/9.1_plus/activity.sql  |   13 +
.../templates/dashboard/sql/9.1_plus/bio_stats.sql |3 +
.../templates/dashboard/sql/9.1_plus/config.sql|   10 +
.../templates/dashboard/sql/9.1_plus/locks.sql |   23 +
.../templates/dashboard/sql/9.1_plus/prepared.sql  |   12 +
.../dashboard/sql/9.1_plus/session_stats.sql   |4 +
.../templates/dashboard/sql/9.1_plus/ti_stats.sql  |4 +
.../templates/dashboard/sql/9.1_plus/to_stats.sql  |3 +
.../templates/dashboard/sql/9.1_plus/tps_stats.sql |4 +
.../templates/dashboard/welcome_dashboard.html |   78 +-
web/pgadmin/static/css/overrides.css   |2 +-
web/pgadmin/static/js/flotr2/bean-min.js   |   10 +
web/pgadmin/static/js/flotr2/bean.js   |  503 ++
web/pgadmin/static/js/flotr2/flotr2.amd.js | 5642 
web/pgadmin/templates/base.html|   11 +-
web/pgadmin/utils/menu.py  |5 +-
26 files changed, 7638 insertions(+), 117 deletions(-)


-- 
Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers