2019-01-02 04:24:12 -06:00
|
|
|
/////////////////////////////////////////////////////////////
|
|
|
|
//
|
|
|
|
// pgAdmin 4 - PostgreSQL Tools
|
|
|
|
//
|
2021-01-04 04:04:45 -06:00
|
|
|
// Copyright (C) 2013 - 2021, The pgAdmin Development Team
|
2019-01-02 04:24:12 -06:00
|
|
|
// This software is released under the PostgreSQL Licence
|
|
|
|
//
|
|
|
|
//////////////////////////////////////////////////////////////
|
|
|
|
|
2017-07-18 09:13:16 -05:00
|
|
|
define('tools.restore', [
|
2018-01-12 01:29:51 -06:00
|
|
|
'sources/gettext', 'sources/url_for', 'jquery', 'underscore', 'backbone',
|
2019-10-10 01:35:28 -05:00
|
|
|
'pgadmin.alertifyjs', 'pgadmin.browser',
|
2018-02-27 05:18:36 -06:00
|
|
|
'pgadmin.backgrid', 'pgadmin.backform', 'sources/utils',
|
2018-06-05 05:36:19 -05:00
|
|
|
'tools/restore/static/js/menu_utils',
|
|
|
|
'sources/nodes/supported_database_node',
|
|
|
|
'tools/restore/static/js/restore_dialog',
|
2017-06-07 05:23:02 -05:00
|
|
|
], function(
|
2019-10-10 01:35:28 -05:00
|
|
|
gettext, url_for, $, _, Backbone, alertify, pgBrowser, Backgrid, Backform,
|
2019-03-14 10:11:16 -05:00
|
|
|
commonUtils, menuUtils, supportedNodes, restoreDialog
|
2017-06-07 05:23:02 -05:00
|
|
|
) {
|
2016-05-15 09:29:57 -05:00
|
|
|
|
2018-01-12 01:29:51 -06:00
|
|
|
// if module is already initialized, refer to that.
|
|
|
|
if (pgBrowser.Restore) {
|
|
|
|
return pgBrowser.Restore;
|
|
|
|
}
|
|
|
|
|
|
|
|
//Restore Model (Objects like Database/Schema/Table)
|
|
|
|
var RestoreObjectModel = Backbone.Model.extend({
|
|
|
|
idAttribute: 'id',
|
|
|
|
defaults: {
|
|
|
|
custom: false,
|
|
|
|
file: undefined,
|
|
|
|
role: undefined,
|
|
|
|
format: 'custom',
|
|
|
|
verbose: true,
|
|
|
|
blobs: true,
|
|
|
|
encoding: undefined,
|
|
|
|
database: undefined,
|
|
|
|
schemas: undefined,
|
|
|
|
tables: undefined,
|
|
|
|
functions: undefined,
|
|
|
|
triggers: undefined,
|
|
|
|
trigger_funcs: undefined,
|
|
|
|
indexes: undefined,
|
|
|
|
},
|
|
|
|
|
|
|
|
// Default values!
|
|
|
|
initialize: function(attrs) {
|
|
|
|
// Set default options according to node type selection by user
|
|
|
|
var node_type = attrs.node_data.type;
|
|
|
|
|
|
|
|
if (node_type) {
|
|
|
|
// Only_Schema option
|
|
|
|
if (node_type === 'function' || node_type === 'index' ||
|
|
|
|
node_type === 'trigger') {
|
|
|
|
this.set({
|
|
|
|
'only_schema': true,
|
|
|
|
}, {
|
|
|
|
silent: true,
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
// Only_Data option
|
|
|
|
if (node_type === 'table') {
|
|
|
|
this.set({
|
|
|
|
'only_data': true,
|
|
|
|
}, {
|
|
|
|
silent: true,
|
|
|
|
});
|
|
|
|
}
|
2016-05-15 09:29:57 -05:00
|
|
|
|
2018-01-12 01:29:51 -06:00
|
|
|
// Clean option
|
|
|
|
if (node_type === 'function' || node_type === 'trigger_function') {
|
|
|
|
this.set({
|
|
|
|
'clean': true,
|
|
|
|
}, {
|
|
|
|
silent: true,
|
|
|
|
});
|
2016-05-15 09:29:57 -05:00
|
|
|
}
|
2018-01-12 01:29:51 -06:00
|
|
|
}
|
|
|
|
Backbone.Model.prototype.initialize.apply(this, arguments);
|
|
|
|
},
|
|
|
|
schema: [{
|
|
|
|
id: 'format',
|
|
|
|
label: gettext('Format'),
|
|
|
|
type: 'text',
|
|
|
|
disabled: false,
|
|
|
|
control: 'select2',
|
|
|
|
select2: {
|
|
|
|
allowClear: false,
|
|
|
|
width: '100%',
|
|
|
|
},
|
|
|
|
options: [{
|
|
|
|
label: gettext('Custom or tar'),
|
|
|
|
value: 'custom',
|
2016-05-15 09:29:57 -05:00
|
|
|
},
|
2018-01-12 01:29:51 -06:00
|
|
|
{
|
|
|
|
label: gettext('Directory'),
|
|
|
|
value: 'directory',
|
|
|
|
},
|
|
|
|
],
|
|
|
|
}, {
|
|
|
|
id: 'file',
|
|
|
|
label: gettext('Filename'),
|
|
|
|
type: 'text',
|
|
|
|
disabled: false,
|
2018-06-29 09:14:37 -05:00
|
|
|
control: Backform.FileControl.extend({
|
|
|
|
render: function() {
|
|
|
|
var attributes = this.model.toJSON();
|
|
|
|
if (attributes.format == 'directory') {
|
|
|
|
this.field.attributes.dialog_type = 'select_folder';
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
this.field.attributes.dialog_type = 'select_file';
|
|
|
|
}
|
|
|
|
|
|
|
|
Backform.InputControl.prototype.render.apply(this, arguments);
|
|
|
|
return this;
|
|
|
|
},
|
|
|
|
}),
|
2018-01-12 01:29:51 -06:00
|
|
|
dialog_type: 'select_file',
|
|
|
|
supp_types: ['*', 'backup', 'sql', 'patch'],
|
2018-06-29 09:14:37 -05:00
|
|
|
deps: ['format'],
|
2018-01-12 01:29:51 -06:00
|
|
|
}, {
|
|
|
|
id: 'no_of_jobs',
|
|
|
|
label: gettext('Number of jobs'),
|
|
|
|
type: 'int',
|
|
|
|
}, {
|
|
|
|
id: 'role',
|
|
|
|
label: gettext('Role name'),
|
|
|
|
control: 'node-list-by-name',
|
|
|
|
node: 'role',
|
|
|
|
select2: {
|
|
|
|
allowClear: false,
|
|
|
|
},
|
|
|
|
}, {
|
|
|
|
type: 'nested',
|
|
|
|
control: 'fieldset',
|
|
|
|
label: gettext('Sections'),
|
|
|
|
group: gettext('Restore options'),
|
Improvement in the look and feel of the whole application
Changed the SCSS/CSS for the below third party libraries to adopt the
new look 'n' feel:
- wcDocker
- Alertify dialogs, and notifications
- AciTree
- Bootstrap Navbar
- Bootstrap Tabs
- Bootstrap Drop-Down menu
- Backgrid
- Select2
Adopated the new the look 'n' feel for the dialogs, wizard, properties,
tab panels, tabs, fieldset, subnode control, spinner control, HTML
table, and other form controls.
- Font is changed to Roboto
- Using SCSS variables to define the look 'n' feel
- Designer background images for the Login, and Forget password pages in
'web' mode
- Improved the look 'n' feel for the key selection in the preferences
dialog
- Table classes consistency changes across the application
- File Open and Save dialog list view changes
Author(s): Aditya Toshniwal & Khushboo Vashi
2018-12-21 05:44:55 -06:00
|
|
|
contentClass: 'row',
|
2016-05-15 09:29:57 -05:00
|
|
|
schema: [{
|
2018-01-12 01:29:51 -06:00
|
|
|
id: 'pre_data',
|
|
|
|
label: gettext('Pre-data'),
|
2019-02-05 10:22:35 -06:00
|
|
|
type: 'switch',
|
|
|
|
extraToggleClasses: 'pg-el-sm-6',
|
|
|
|
controlLabelClassName: 'control-label pg-el-sm-5 pg-el-12',
|
|
|
|
controlsClassName: 'pgadmin-controls pg-el-sm-7 pg-el-12',
|
2018-01-12 01:29:51 -06:00
|
|
|
group: gettext('Sections'),
|
|
|
|
deps: ['only_data', 'only_schema'],
|
|
|
|
disabled: function(m) {
|
|
|
|
return this.node.type !== 'function' && this.node.type !== 'table' &&
|
|
|
|
this.node.type !== 'trigger' &&
|
|
|
|
this.node.type !== 'trigger_function' &&
|
|
|
|
(m.get('only_data') || m.get('only_schema'));
|
|
|
|
},
|
|
|
|
}, {
|
|
|
|
id: 'data',
|
|
|
|
label: gettext('Data'),
|
2019-02-05 10:22:35 -06:00
|
|
|
type: 'switch',
|
|
|
|
extraToggleClasses: 'pg-el-sm-6',
|
|
|
|
controlLabelClassName: 'control-label pg-el-sm-5 pg-el-12',
|
|
|
|
controlsClassName: 'pgadmin-controls pg-el-sm-7 pg-el-12',
|
2018-01-12 01:29:51 -06:00
|
|
|
group: gettext('Sections'),
|
|
|
|
deps: ['only_data', 'only_schema'],
|
|
|
|
disabled: function(m) {
|
|
|
|
return this.node.type !== 'function' && this.node.type !== 'table' &&
|
|
|
|
this.node.type !== 'trigger' &&
|
|
|
|
this.node.type !== 'trigger_function' &&
|
|
|
|
(m.get('only_data') || m.get('only_schema'));
|
|
|
|
},
|
|
|
|
}, {
|
|
|
|
id: 'post_data',
|
|
|
|
label: gettext('Post-data'),
|
2019-02-05 10:22:35 -06:00
|
|
|
type: 'switch',
|
|
|
|
extraToggleClasses: 'pg-el-sm-6',
|
|
|
|
controlLabelClassName: 'control-label pg-el-sm-5 pg-el-12',
|
|
|
|
controlsClassName: 'pgadmin-controls pg-el-sm-7 pg-el-12',
|
2018-01-12 01:29:51 -06:00
|
|
|
group: gettext('Sections'),
|
|
|
|
deps: ['only_data', 'only_schema'],
|
|
|
|
disabled: function(m) {
|
|
|
|
return this.node.type !== 'function' && this.node.type !== 'table' &&
|
|
|
|
this.node.type !== 'trigger' &&
|
|
|
|
this.node.type !== 'trigger_function' &&
|
|
|
|
(m.get('only_data') || m.get('only_schema'));
|
2016-05-15 09:29:57 -05:00
|
|
|
},
|
|
|
|
}],
|
2018-01-12 01:29:51 -06:00
|
|
|
}, {
|
|
|
|
type: 'nested',
|
|
|
|
control: 'fieldset',
|
|
|
|
label: gettext('Type of objects'),
|
|
|
|
group: gettext('Restore options'),
|
Improvement in the look and feel of the whole application
Changed the SCSS/CSS for the below third party libraries to adopt the
new look 'n' feel:
- wcDocker
- Alertify dialogs, and notifications
- AciTree
- Bootstrap Navbar
- Bootstrap Tabs
- Bootstrap Drop-Down menu
- Backgrid
- Select2
Adopated the new the look 'n' feel for the dialogs, wizard, properties,
tab panels, tabs, fieldset, subnode control, spinner control, HTML
table, and other form controls.
- Font is changed to Roboto
- Using SCSS variables to define the look 'n' feel
- Designer background images for the Login, and Forget password pages in
'web' mode
- Improved the look 'n' feel for the key selection in the preferences
dialog
- Table classes consistency changes across the application
- File Open and Save dialog list view changes
Author(s): Aditya Toshniwal & Khushboo Vashi
2018-12-21 05:44:55 -06:00
|
|
|
contentClass: 'row',
|
2018-01-12 01:29:51 -06:00
|
|
|
schema: [{
|
|
|
|
id: 'only_data',
|
|
|
|
label: gettext('Only data'),
|
2019-02-05 10:22:35 -06:00
|
|
|
type: 'switch',
|
|
|
|
extraToggleClasses: 'pg-el-sm-6',
|
|
|
|
controlLabelClassName: 'control-label pg-el-sm-5 pg-el-12',
|
|
|
|
controlsClassName: 'pgadmin-controls pg-el-sm-7 pg-el-12',
|
2018-01-12 01:29:51 -06:00
|
|
|
group: gettext('Type of objects'),
|
|
|
|
deps: ['pre_data', 'data', 'post_data', 'only_schema'],
|
|
|
|
disabled: function(m) {
|
|
|
|
return (this.node.type !== 'database' && this.node.type !== 'schema') ||
|
|
|
|
(m.get('pre_data') ||
|
|
|
|
m.get('data') ||
|
|
|
|
m.get('post_data') ||
|
|
|
|
m.get('only_schema')
|
|
|
|
);
|
|
|
|
},
|
|
|
|
}, {
|
|
|
|
id: 'only_schema',
|
|
|
|
label: gettext('Only schema'),
|
2019-02-05 10:22:35 -06:00
|
|
|
type: 'switch',
|
|
|
|
extraToggleClasses: 'pg-el-sm-6',
|
|
|
|
controlLabelClassName: 'control-label pg-el-sm-5 pg-el-12',
|
|
|
|
controlsClassName: 'pgadmin-controls pg-el-sm-7 pg-el-12',
|
2018-01-12 01:29:51 -06:00
|
|
|
group: gettext('Type of objects'),
|
|
|
|
deps: ['pre_data', 'data', 'post_data', 'only_data'],
|
|
|
|
disabled: function(m) {
|
|
|
|
return (this.node.type !== 'database' && this.node.type !== 'schema') ||
|
|
|
|
(m.get('pre_data') ||
|
|
|
|
m.get('data') ||
|
|
|
|
m.get('post_data') ||
|
|
|
|
m.get('only_data')
|
|
|
|
);
|
|
|
|
},
|
|
|
|
}],
|
|
|
|
}, {
|
|
|
|
type: 'nested',
|
|
|
|
control: 'fieldset',
|
|
|
|
label: gettext('Do not save'),
|
|
|
|
group: gettext('Restore options'),
|
Improvement in the look and feel of the whole application
Changed the SCSS/CSS for the below third party libraries to adopt the
new look 'n' feel:
- wcDocker
- Alertify dialogs, and notifications
- AciTree
- Bootstrap Navbar
- Bootstrap Tabs
- Bootstrap Drop-Down menu
- Backgrid
- Select2
Adopated the new the look 'n' feel for the dialogs, wizard, properties,
tab panels, tabs, fieldset, subnode control, spinner control, HTML
table, and other form controls.
- Font is changed to Roboto
- Using SCSS variables to define the look 'n' feel
- Designer background images for the Login, and Forget password pages in
'web' mode
- Improved the look 'n' feel for the key selection in the preferences
dialog
- Table classes consistency changes across the application
- File Open and Save dialog list view changes
Author(s): Aditya Toshniwal & Khushboo Vashi
2018-12-21 05:44:55 -06:00
|
|
|
contentClass: 'row',
|
2018-01-12 01:29:51 -06:00
|
|
|
schema: [{
|
|
|
|
id: 'dns_owner',
|
|
|
|
label: gettext('Owner'),
|
2019-02-05 10:22:35 -06:00
|
|
|
type: 'switch',
|
|
|
|
extraToggleClasses: 'pg-el-sm-6',
|
|
|
|
controlLabelClassName: 'control-label pg-el-sm-5 pg-el-12',
|
|
|
|
controlsClassName: 'pgadmin-controls pg-el-sm-7 pg-el-12',
|
2018-01-12 01:29:51 -06:00
|
|
|
disabled: false,
|
|
|
|
group: gettext('Do not save'),
|
|
|
|
}, {
|
|
|
|
id: 'dns_privilege',
|
|
|
|
label: gettext('Privilege'),
|
2019-02-05 10:22:35 -06:00
|
|
|
type: 'switch',
|
|
|
|
extraToggleClasses: 'pg-el-sm-6',
|
|
|
|
controlLabelClassName: 'control-label pg-el-sm-5 pg-el-12',
|
|
|
|
controlsClassName: 'pgadmin-controls pg-el-sm-7 pg-el-12',
|
2018-01-12 01:29:51 -06:00
|
|
|
disabled: false,
|
|
|
|
group: gettext('Do not save'),
|
|
|
|
}, {
|
|
|
|
id: 'dns_tablespace',
|
|
|
|
label: gettext('Tablespace'),
|
2019-02-05 10:22:35 -06:00
|
|
|
type: 'switch',
|
|
|
|
extraToggleClasses: 'pg-el-sm-6',
|
|
|
|
controlLabelClassName: 'control-label pg-el-sm-5 pg-el-12',
|
|
|
|
controlsClassName: 'pgadmin-controls pg-el-sm-7 pg-el-12',
|
2018-01-12 01:29:51 -06:00
|
|
|
disabled: false,
|
|
|
|
group: gettext('Do not save'),
|
2018-08-22 01:47:50 -05:00
|
|
|
}, {
|
|
|
|
id: 'no_comments',
|
|
|
|
label: gettext('Comments'),
|
2019-02-05 10:22:35 -06:00
|
|
|
type: 'switch',
|
|
|
|
extraToggleClasses: 'pg-el-sm-6',
|
|
|
|
controlLabelClassName: 'control-label pg-el-sm-5 pg-el-12',
|
|
|
|
controlsClassName: 'pgadmin-controls pg-el-sm-7 pg-el-12',
|
2018-08-22 01:47:50 -05:00
|
|
|
disabled: false,
|
|
|
|
group: gettext('Do not save'),
|
|
|
|
visible: function() {
|
|
|
|
var t = pgBrowser.tree,
|
|
|
|
i = t.selected(),
|
2021-09-27 06:14:26 -05:00
|
|
|
d = i ? t.itemData(i) : undefined,
|
|
|
|
s = _.isUndefined(d) ? undefined : pgBrowser.tree.getTreeNodeHierarchy(i)['server'];
|
2018-08-22 01:47:50 -05:00
|
|
|
|
2020-06-18 10:20:34 -05:00
|
|
|
return _.isUndefined(s) ? false : s.version >= 110000;
|
2018-08-22 01:47:50 -05:00
|
|
|
},
|
2018-01-12 01:29:51 -06:00
|
|
|
}],
|
|
|
|
}, {
|
|
|
|
type: 'nested',
|
|
|
|
control: 'fieldset',
|
|
|
|
label: gettext('Queries'),
|
|
|
|
group: gettext('Restore options'),
|
Improvement in the look and feel of the whole application
Changed the SCSS/CSS for the below third party libraries to adopt the
new look 'n' feel:
- wcDocker
- Alertify dialogs, and notifications
- AciTree
- Bootstrap Navbar
- Bootstrap Tabs
- Bootstrap Drop-Down menu
- Backgrid
- Select2
Adopated the new the look 'n' feel for the dialogs, wizard, properties,
tab panels, tabs, fieldset, subnode control, spinner control, HTML
table, and other form controls.
- Font is changed to Roboto
- Using SCSS variables to define the look 'n' feel
- Designer background images for the Login, and Forget password pages in
'web' mode
- Improved the look 'n' feel for the key selection in the preferences
dialog
- Table classes consistency changes across the application
- File Open and Save dialog list view changes
Author(s): Aditya Toshniwal & Khushboo Vashi
2018-12-21 05:44:55 -06:00
|
|
|
contentClass: 'row',
|
2018-01-12 01:29:51 -06:00
|
|
|
schema: [{
|
|
|
|
id: 'include_create_database',
|
|
|
|
label: gettext('Include CREATE DATABASE statement'),
|
2019-02-05 10:22:35 -06:00
|
|
|
type: 'switch',
|
|
|
|
extraToggleClasses: 'pg-el-sm-6',
|
|
|
|
controlLabelClassName: 'control-label pg-el-sm-5 pg-el-12',
|
|
|
|
controlsClassName: 'pgadmin-controls pg-el-sm-7 pg-el-12',
|
2018-01-12 01:29:51 -06:00
|
|
|
disabled: false,
|
|
|
|
group: gettext('Queries'),
|
|
|
|
}, {
|
|
|
|
id: 'clean',
|
|
|
|
label: gettext('Clean before restore'),
|
2019-02-05 10:22:35 -06:00
|
|
|
type: 'switch',
|
|
|
|
extraToggleClasses: 'pg-el-sm-6',
|
|
|
|
controlLabelClassName: 'control-label pg-el-sm-5 pg-el-12',
|
|
|
|
controlsClassName: 'pgadmin-controls pg-el-sm-7 pg-el-12',
|
2018-01-12 01:29:51 -06:00
|
|
|
group: gettext('Queries'),
|
|
|
|
disabled: function() {
|
|
|
|
return this.node.type === 'function' ||
|
|
|
|
this.node.type === 'trigger_function';
|
|
|
|
},
|
|
|
|
}, {
|
|
|
|
id: 'single_transaction',
|
|
|
|
label: gettext('Single transaction'),
|
2019-02-05 10:22:35 -06:00
|
|
|
type: 'switch',
|
|
|
|
extraToggleClasses: 'pg-el-sm-6',
|
|
|
|
controlLabelClassName: 'control-label pg-el-sm-5 pg-el-12',
|
|
|
|
controlsClassName: 'pgadmin-controls pg-el-sm-7 pg-el-12',
|
2018-01-12 01:29:51 -06:00
|
|
|
disabled: false,
|
|
|
|
group: gettext('Queries'),
|
|
|
|
}],
|
|
|
|
}, {
|
|
|
|
type: 'nested',
|
|
|
|
control: 'fieldset',
|
|
|
|
label: gettext('Disable'),
|
|
|
|
group: gettext('Restore options'),
|
Improvement in the look and feel of the whole application
Changed the SCSS/CSS for the below third party libraries to adopt the
new look 'n' feel:
- wcDocker
- Alertify dialogs, and notifications
- AciTree
- Bootstrap Navbar
- Bootstrap Tabs
- Bootstrap Drop-Down menu
- Backgrid
- Select2
Adopated the new the look 'n' feel for the dialogs, wizard, properties,
tab panels, tabs, fieldset, subnode control, spinner control, HTML
table, and other form controls.
- Font is changed to Roboto
- Using SCSS variables to define the look 'n' feel
- Designer background images for the Login, and Forget password pages in
'web' mode
- Improved the look 'n' feel for the key selection in the preferences
dialog
- Table classes consistency changes across the application
- File Open and Save dialog list view changes
Author(s): Aditya Toshniwal & Khushboo Vashi
2018-12-21 05:44:55 -06:00
|
|
|
contentClass: 'row',
|
2018-01-12 01:29:51 -06:00
|
|
|
schema: [{
|
|
|
|
id: 'disable_trigger',
|
|
|
|
label: gettext('Trigger'),
|
2019-02-05 10:22:35 -06:00
|
|
|
type: 'switch',
|
|
|
|
extraToggleClasses: 'pg-el-sm-6',
|
|
|
|
controlLabelClassName: 'control-label pg-el-sm-5 pg-el-12',
|
|
|
|
controlsClassName: 'pgadmin-controls pg-el-sm-7 pg-el-12',
|
2018-01-12 01:29:51 -06:00
|
|
|
group: gettext('Disable'),
|
|
|
|
}, {
|
|
|
|
id: 'no_data_fail_table',
|
|
|
|
label: gettext('No data for Failed Tables'),
|
2019-02-05 10:22:35 -06:00
|
|
|
type: 'switch',
|
|
|
|
extraToggleClasses: 'pg-el-sm-6',
|
|
|
|
controlLabelClassName: 'control-label pg-el-sm-5 pg-el-12',
|
|
|
|
controlsClassName: 'pgadmin-controls pg-el-sm-7 pg-el-12',
|
2018-01-12 01:29:51 -06:00
|
|
|
disabled: false,
|
|
|
|
group: gettext('Disable'),
|
|
|
|
}],
|
|
|
|
}, {
|
|
|
|
type: 'nested',
|
|
|
|
control: 'fieldset',
|
|
|
|
label: gettext('Miscellaneous / Behavior'),
|
|
|
|
group: gettext('Restore options'),
|
Improvement in the look and feel of the whole application
Changed the SCSS/CSS for the below third party libraries to adopt the
new look 'n' feel:
- wcDocker
- Alertify dialogs, and notifications
- AciTree
- Bootstrap Navbar
- Bootstrap Tabs
- Bootstrap Drop-Down menu
- Backgrid
- Select2
Adopated the new the look 'n' feel for the dialogs, wizard, properties,
tab panels, tabs, fieldset, subnode control, spinner control, HTML
table, and other form controls.
- Font is changed to Roboto
- Using SCSS variables to define the look 'n' feel
- Designer background images for the Login, and Forget password pages in
'web' mode
- Improved the look 'n' feel for the key selection in the preferences
dialog
- Table classes consistency changes across the application
- File Open and Save dialog list view changes
Author(s): Aditya Toshniwal & Khushboo Vashi
2018-12-21 05:44:55 -06:00
|
|
|
contentClass: 'row',
|
2018-01-12 01:29:51 -06:00
|
|
|
schema: [{
|
|
|
|
id: 'verbose',
|
|
|
|
label: gettext('Verbose messages'),
|
2019-02-05 10:22:35 -06:00
|
|
|
type: 'switch',
|
|
|
|
extraToggleClasses: 'pg-el-sm-6',
|
|
|
|
controlLabelClassName: 'control-label pg-el-sm-5 pg-el-12',
|
|
|
|
controlsClassName: 'pgadmin-controls pg-el-sm-7 pg-el-12',
|
2018-01-12 01:29:51 -06:00
|
|
|
disabled: false,
|
|
|
|
group: gettext('Miscellaneous / Behavior'),
|
|
|
|
}, {
|
|
|
|
id: 'use_set_session_auth',
|
|
|
|
label: gettext('Use SET SESSION AUTHORIZATION'),
|
2019-02-05 10:22:35 -06:00
|
|
|
type: 'switch',
|
|
|
|
extraToggleClasses: 'pg-el-sm-6',
|
|
|
|
controlLabelClassName: 'control-label pg-el-sm-5 pg-el-12',
|
|
|
|
controlsClassName: 'pgadmin-controls pg-el-sm-7 pg-el-12',
|
2018-01-12 01:29:51 -06:00
|
|
|
disabled: false,
|
|
|
|
group: gettext('Miscellaneous / Behavior'),
|
|
|
|
}, {
|
|
|
|
id: 'exit_on_error',
|
|
|
|
label: gettext('Exit on error'),
|
2019-02-05 10:22:35 -06:00
|
|
|
type: 'switch',
|
|
|
|
extraToggleClasses: 'pg-el-sm-6',
|
|
|
|
controlLabelClassName: 'control-label pg-el-sm-5 pg-el-12',
|
|
|
|
controlsClassName: 'pgadmin-controls pg-el-sm-7 pg-el-12',
|
2018-01-12 01:29:51 -06:00
|
|
|
disabled: false,
|
|
|
|
group: gettext('Miscellaneous / Behavior'),
|
|
|
|
}],
|
|
|
|
}],
|
|
|
|
validate: function() {
|
|
|
|
return null;
|
|
|
|
},
|
|
|
|
});
|
2016-05-15 09:29:57 -05:00
|
|
|
|
2018-01-12 01:29:51 -06:00
|
|
|
// Create an Object Restore of pgBrowser class
|
|
|
|
pgBrowser.Restore = {
|
|
|
|
init: function() {
|
|
|
|
if (this.initialized)
|
|
|
|
return;
|
|
|
|
|
|
|
|
this.initialized = true;
|
|
|
|
|
|
|
|
// Define the nodes on which the menus to be appear
|
|
|
|
var menus = [{
|
|
|
|
name: 'restore_object',
|
|
|
|
module: this,
|
|
|
|
applies: ['tools'],
|
|
|
|
callback: 'restore_objects',
|
|
|
|
priority: 13,
|
|
|
|
label: gettext('Restore...'),
|
|
|
|
icon: 'fa fa-upload',
|
2018-06-05 05:36:19 -05:00
|
|
|
enable: supportedNodes.enabled.bind(
|
2021-09-27 06:14:26 -05:00
|
|
|
null, pgBrowser.tree, menuUtils.restoreSupportedNodes
|
2018-06-05 05:36:19 -05:00
|
|
|
),
|
2021-02-02 03:17:58 -06:00
|
|
|
data: {
|
2021-02-03 00:45:37 -06:00
|
|
|
data_disabled: gettext('Please select any schema or table from the browser tree to Restore data.'),
|
2021-02-02 03:17:58 -06:00
|
|
|
},
|
2018-01-12 01:29:51 -06:00
|
|
|
}];
|
|
|
|
|
2018-06-05 05:36:19 -05:00
|
|
|
for (var idx = 0; idx < menuUtils.restoreSupportedNodes.length; idx++) {
|
2018-01-12 01:29:51 -06:00
|
|
|
menus.push({
|
2018-06-05 05:36:19 -05:00
|
|
|
name: 'restore_' + menuUtils.restoreSupportedNodes[idx],
|
|
|
|
node: menuUtils.restoreSupportedNodes[idx],
|
2018-01-12 01:29:51 -06:00
|
|
|
module: this,
|
|
|
|
applies: ['context'],
|
|
|
|
callback: 'restore_objects',
|
|
|
|
priority: 13,
|
|
|
|
label: gettext('Restore...'),
|
|
|
|
icon: 'fa fa-upload',
|
2018-06-05 05:36:19 -05:00
|
|
|
enable: supportedNodes.enabled.bind(
|
2021-09-27 06:14:26 -05:00
|
|
|
null, pgBrowser.tree, menuUtils.restoreSupportedNodes
|
2018-06-05 05:36:19 -05:00
|
|
|
),
|
2018-01-12 01:29:51 -06:00
|
|
|
});
|
|
|
|
}
|
2016-08-08 05:59:37 -05:00
|
|
|
|
2018-01-12 01:29:51 -06:00
|
|
|
pgBrowser.add_menus(menus);
|
|
|
|
return this;
|
|
|
|
},
|
|
|
|
// Callback to draw Backup Dialog for objects
|
|
|
|
restore_objects: function(action, treeItem) {
|
2018-06-05 05:36:19 -05:00
|
|
|
let dialog = new restoreDialog.RestoreDialog(
|
|
|
|
pgBrowser, $, alertify, RestoreObjectModel
|
|
|
|
);
|
2020-08-07 06:47:51 -05:00
|
|
|
dialog.draw(action, treeItem, pgBrowser.stdW.calc(pgBrowser.stdW.md), pgBrowser.stdH.calc(pgBrowser.stdH.md));
|
2018-01-12 01:29:51 -06:00
|
|
|
},
|
|
|
|
};
|
|
|
|
return pgBrowser.Restore;
|
|
|
|
});
|