mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-25 18:55:31 -06:00
Handle the template property on databases appropriately. Fixes #1800
This commit is contained in:
parent
394381bf75
commit
66b9e22d01
@ -269,6 +269,7 @@ function($, _, S, pgAdmin, pgBrowser, Alertify) {
|
||||
deftblacl: [],
|
||||
deffuncacl: [],
|
||||
defseqacl: [],
|
||||
is_template: false,
|
||||
deftypeacl: []
|
||||
},
|
||||
|
||||
@ -321,7 +322,7 @@ function($, _, S, pgAdmin, pgBrowser, Alertify) {
|
||||
editable: false, type: 'text', group: 'Definition',
|
||||
disabled: function(m) { return !m.isNew(); },
|
||||
control: 'node-list-by-name', url: 'get_databases', cache_level: 'server',
|
||||
select2: { allowClear: false },
|
||||
select2: { allowClear: false }, mode: ['create'],
|
||||
transform: function(data, cell) {
|
||||
var res = [],
|
||||
control = cell || this,
|
||||
@ -362,6 +363,15 @@ function($, _, S, pgAdmin, pgBrowser, Alertify) {
|
||||
},{
|
||||
id: 'datconnlimit', label: '{{ _('Connection limit') }}',
|
||||
editable: false, type: 'int', group: 'Definition', min: -1
|
||||
},{
|
||||
id: 'is_template', label: '{{ _('Template?') }}',
|
||||
editable: false, type: 'switch', group: 'Definition',
|
||||
disabled: true, mode: ['properties', 'edit'],
|
||||
options: {
|
||||
'onText': 'Yes', 'offText': 'No',
|
||||
'onColor': 'success', 'offColor': 'primary',
|
||||
'size': 'small'
|
||||
}
|
||||
},{
|
||||
id: 'datallowconn', label: '{{ _('Allow connections?') }}',
|
||||
editable: false, type: 'switch', group: 'Definition',
|
||||
|
@ -1,10 +1,10 @@
|
||||
SELECT
|
||||
db.oid as did, db.datname as name, db.dattablespace AS spcoid,
|
||||
db.oid AS did, db.datname AS name, db.dattablespace AS spcoid,
|
||||
spcname, datallowconn, pg_encoding_to_char(encoding) AS encoding,
|
||||
pg_get_userbyid(datdba) AS datowner, datcollate, datctype, datconnlimit,
|
||||
has_database_privilege(db.oid, 'CREATE') as cancreate,
|
||||
has_database_privilege(db.oid, 'CREATE') AS cancreate,
|
||||
current_setting('default_tablespace') AS default_tablespace,
|
||||
descr.description as comments,
|
||||
descr.description AS comments, db.datistemplate AS is_template,
|
||||
{### Default ACL for Tables ###}
|
||||
(SELECT array_to_string(ARRAY(
|
||||
SELECT array_to_string(defaclacl::text[], ', ')
|
||||
|
@ -1,10 +1,10 @@
|
||||
SELECT
|
||||
db.oid as did, db.datname as name, db.dattablespace AS spcoid,
|
||||
db.oid AS did, db.datname AS name, db.dattablespace AS spcoid,
|
||||
spcname, datallowconn, pg_encoding_to_char(encoding) AS encoding,
|
||||
pg_get_userbyid(datdba) AS datowner, datcollate, datctype, datconnlimit,
|
||||
has_database_privilege(db.oid, 'CREATE') as cancreate,
|
||||
has_database_privilege(db.oid, 'CREATE') AS cancreate,
|
||||
current_setting('default_tablespace') AS default_tablespace,
|
||||
descr.description as comments,
|
||||
descr.description AS comments, db.datistemplate AS is_template,
|
||||
{### Default ACL for Tables ###}
|
||||
(SELECT array_to_string(ARRAY(
|
||||
SELECT array_to_string(defaclacl::text[], ', ')
|
||||
|
@ -1,10 +1,10 @@
|
||||
SELECT
|
||||
db.oid as did, db.datname as name, db.dattablespace AS spcoid,
|
||||
db.oid AS did, db.datname AS name, db.dattablespace AS spcoid,
|
||||
spcname, datallowconn, pg_encoding_to_char(encoding) AS encoding,
|
||||
pg_get_userbyid(datdba) AS datowner, datcollate, datctype, datconnlimit,
|
||||
has_database_privilege(db.oid, 'CREATE') as cancreate,
|
||||
has_database_privilege(db.oid, 'CREATE') AS cancreate,
|
||||
current_setting('default_tablespace') AS default_tablespace,
|
||||
descr.description as comments,
|
||||
descr.description AS comments, db.datistemplate AS is_template,
|
||||
{### Default ACL for Tables ###}
|
||||
(SELECT array_to_string(ARRAY(
|
||||
SELECT array_to_string(defaclacl::text[], ', ')
|
||||
|
Loading…
Reference in New Issue
Block a user