mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-25 18:55:31 -06:00
1) Added support for setting PostgreSQL connection parameters. #4728
2) Fixed an issue where Kerberos authentication to the server is not imported/exported. #5732 3) Increase the length of the value column of the setting table. #5746 4) Upgrade Flask-Migrate to 4.0.0. #5525
This commit is contained in:
@@ -51,12 +51,18 @@ export default class VariableSchema extends BaseUISchema {
|
||||
value: undefined,
|
||||
role: null,
|
||||
database: null,
|
||||
keyword: null,
|
||||
});
|
||||
this.vnameOptions = vnameOptions;
|
||||
this.databaseOptions = databaseOptions;
|
||||
this.roleOptions = roleOptions;
|
||||
this.varTypes = {};
|
||||
this.keys = keys;
|
||||
this.allReadOnly = false;
|
||||
}
|
||||
|
||||
setAllReadOnly(isReadOnly) {
|
||||
this.allReadOnly = isReadOnly;
|
||||
}
|
||||
|
||||
setVarTypes(options) {
|
||||
@@ -67,6 +73,19 @@ export default class VariableSchema extends BaseUISchema {
|
||||
});
|
||||
}
|
||||
|
||||
getPlaceHolderMsg(variable) {
|
||||
let msg = '';
|
||||
if (variable?.min_server_version && variable?.max_server_version) {
|
||||
msg = gettext('%s <= Supported version >= %s', variable?.max_server_version, variable?.min_server_version);
|
||||
} else if (variable?.min_server_version) {
|
||||
msg = gettext('Supported version >= %s', variable?.min_server_version);
|
||||
} else if (variable?.max_server_version) {
|
||||
msg = gettext('Supported version <= %s', variable?.max_server_version);
|
||||
}
|
||||
|
||||
return msg;
|
||||
}
|
||||
|
||||
getValueFieldProps(variable) {
|
||||
switch(variable?.vartype) {
|
||||
case 'bool':
|
||||
@@ -74,17 +93,44 @@ export default class VariableSchema extends BaseUISchema {
|
||||
case 'enum':
|
||||
return {
|
||||
cell: 'select',
|
||||
options: (variable.enumvals || []).map((val)=>({
|
||||
options: (variable.enumvals || []).map((val)=>(typeof(val)=='string' ? {
|
||||
label: val,
|
||||
value: val
|
||||
}))
|
||||
}: val)),
|
||||
controlProps: {
|
||||
placeholder: this.getPlaceHolderMsg(variable)
|
||||
}
|
||||
};
|
||||
case 'integer':
|
||||
return 'int';
|
||||
return {
|
||||
cell: 'int',
|
||||
controlProps: {
|
||||
placeholder: this.getPlaceHolderMsg(variable)
|
||||
}
|
||||
};
|
||||
case 'real':
|
||||
return 'numeric';
|
||||
return {
|
||||
cell: 'numeric',
|
||||
controlProps: {
|
||||
placeholder: this.getPlaceHolderMsg(variable)
|
||||
}
|
||||
};
|
||||
case 'string':
|
||||
return 'text';
|
||||
return {
|
||||
cell: 'text',
|
||||
controlProps: {
|
||||
placeholder: this.getPlaceHolderMsg(variable)
|
||||
}
|
||||
};
|
||||
case 'file':
|
||||
return {
|
||||
cell: 'file',
|
||||
controlProps: {
|
||||
dialogType: 'select_file',
|
||||
supportedTypes: ['*'],
|
||||
placeholder: this.getPlaceHolderMsg(variable)
|
||||
}
|
||||
};
|
||||
default:
|
||||
return '';
|
||||
}
|
||||
@@ -99,8 +145,8 @@ export default class VariableSchema extends BaseUISchema {
|
||||
},
|
||||
{
|
||||
id: 'name', label: gettext('Name'), type:'text',
|
||||
readonly: function(state) {
|
||||
return !obj.isNew(state);
|
||||
editable: function(state) {
|
||||
return obj.isNew(state) || !obj.allReadOnly;
|
||||
},
|
||||
cell: ()=>({
|
||||
cell: 'select',
|
||||
@@ -109,9 +155,16 @@ export default class VariableSchema extends BaseUISchema {
|
||||
controlProps: { allowClear: false },
|
||||
}),
|
||||
},
|
||||
{
|
||||
id: 'keyword', label: gettext('Keyword'), type: '', cell: '',
|
||||
deps: ['name'], minWidth: 25,
|
||||
depChange: (state, source, topState, actionObj)=>{
|
||||
return { keyword: actionObj.value };
|
||||
}
|
||||
},
|
||||
{
|
||||
id: 'value', label: gettext('Value'), type: 'text',
|
||||
deps: ['name'],
|
||||
deps: ['name'], editable: !obj.allReadOnly,
|
||||
depChange: (state, source)=>{
|
||||
if(source[source.length-1] == 'name') {
|
||||
let variable = this.varTypes[state.name];
|
||||
|
||||
Reference in New Issue
Block a user