diff --git a/web/pgadmin/tools/backup/templates/backup/js/backup.js b/web/pgadmin/tools/backup/templates/backup/js/backup.js index 36956fe..d8de0d7 100644 --- a/web/pgadmin/tools/backup/templates/backup/js/backup.js +++ b/web/pgadmin/tools/backup/templates/backup/js/backup.js @@ -11,6 +11,24 @@ define([ return pgBrowser.Backup; } +/* +===================== +TODO LIST FOR BACKUP: +===================== +1) Add Object tree on object tab which allows user to select + objects which can be backed up +2) Allow user to select/deselect objects +3) If database is selected in browser + show all database children objects selected in Object tree +4) If schema is selected in browser + show all schema children objects selected in Object tree +5) If table is selected then show table/schema/database selected + in Object tree +6) if root objects like database/schema is not selected and their + children are selected then add them separately with in tables attribute + with schema. +*/ + var CustomSwitchControl = Backform.CustomSwitchControl = Backform.SwitchControl.extend({ template: _.template([ '', @@ -599,6 +617,23 @@ define([ // Set current database into model this.view.model.set('database', treeInfo.database.label); + // We will remove once object tree is implemented + // If selected node is Schema then add it in model + if(d._type == 'schema') { + var schemas = []; + schemas.push(d.label); + this.view.model.set('schemas', schemas); + } + // If selected node is Table then add it in model along with + // its schema + if(d._type == 'table') { + var tables = [], + selected_table = []; + selected_table.push(treeInfo.schema.label) + selected_table.push(d.label); + this.view.model.set('tables', selected_table); + } + var self = this, baseUrl = "{{ url_for('backup.index') }}" + "create_job/backup_object/" + treeInfo.server._id,