mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-25 18:55:31 -06:00
Use the same layout mechanism used as in the panel using elementary
layout support in different dialogs. Fixes #1358.
This commit is contained in:
parent
f1dd39e5e9
commit
3350eaceab
@ -12,17 +12,19 @@ define(
|
|||||||
if (!alertify.aboutDialog) {
|
if (!alertify.aboutDialog) {
|
||||||
alertify.dialog('aboutDialog', function factory() {
|
alertify.dialog('aboutDialog', function factory() {
|
||||||
return {
|
return {
|
||||||
main:function(title, message) {
|
main: function(title, message) {
|
||||||
this.set('title', title);
|
this.set('title', title);
|
||||||
this.message = message;
|
this.message = message;
|
||||||
},
|
},
|
||||||
setup:function() {
|
setup: function() {
|
||||||
return {
|
return {
|
||||||
buttons:[{ text: "OK", key: 27, className: "btn btn-primary" }],
|
buttons:[{ text: "OK", key: 27, className: "btn btn-primary" }],
|
||||||
options: { modal: 0, resizable: true }
|
options: {modal: 0, resizable: true}
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
build:function() {},
|
build: function() {
|
||||||
|
alertify.pgDialogBuild.apply(this);
|
||||||
|
},
|
||||||
prepare:function() {
|
prepare:function() {
|
||||||
this.setContent(this.message);
|
this.setContent(this.message);
|
||||||
}
|
}
|
||||||
|
@ -160,65 +160,67 @@ function($, _, S, pgAdmin, pgBrowser, alertify) {
|
|||||||
if(!alertify.move_objects_dlg) {
|
if(!alertify.move_objects_dlg) {
|
||||||
alertify.dialog('move_objects_dlg' ,function factory() {
|
alertify.dialog('move_objects_dlg' ,function factory() {
|
||||||
return {
|
return {
|
||||||
main: function() {
|
main: function() {
|
||||||
var title = '{{ _('Move objects to another tablespace') }} ';
|
var title = '{{ _('Move objects to another tablespace') }} ';
|
||||||
this.set('title', title);
|
this.set('title', title);
|
||||||
},
|
},
|
||||||
setup:function() {
|
build: function() {
|
||||||
return {
|
alertify.pgDialogBuild.apply(this);
|
||||||
buttons: [{
|
},
|
||||||
text: '', key: 27, className: 'btn btn-default pull-left fa fa-lg fa-question',
|
setup:function() {
|
||||||
attrs:{name:'dialog_help', type:'button', label: '{{ _('Users') }}',
|
return {
|
||||||
url: '{{ url_for('help.static', filename='move_objects.html') }}'}
|
buttons: [{
|
||||||
},{
|
text: '', key: 27, className: 'btn btn-default pull-left fa fa-lg fa-question',
|
||||||
text: '{{ _('OK') }}', key: 27, className: 'btn btn-primary fa fa-lg fa-save pg-alertify-button'
|
attrs:{name:'dialog_help', type:'button', label: '{{ _('Users') }}',
|
||||||
},{
|
url: '{{ url_for('help.static', filename='move_objects.html') }}'}
|
||||||
text: '{{ _('Cancel') }}', key: 27, className: 'btn btn-danger fa fa-lg fa-times pg-alertify-button'
|
},{
|
||||||
}],
|
text: '{{ _('OK') }}', key: 27, className: 'btn btn-primary fa fa-lg fa-save pg-alertify-button'
|
||||||
// Set options for dialog
|
},{
|
||||||
options: {
|
text: '{{ _('Cancel') }}', key: 27, className: 'btn btn-danger fa fa-lg fa-times pg-alertify-button'
|
||||||
//disable both padding and overflow control.
|
}],
|
||||||
padding : !1,
|
// Set options for dialog
|
||||||
overflow: !1,
|
options: {
|
||||||
modal: false,
|
//disable both padding and overflow control.
|
||||||
resizable: true,
|
padding : !1,
|
||||||
maximizable: true,
|
overflow: !1,
|
||||||
pinnable: false,
|
modal: false,
|
||||||
closableByDimmer: false
|
resizable: true,
|
||||||
}
|
maximizable: true,
|
||||||
};
|
pinnable: false,
|
||||||
},
|
closableByDimmer: false
|
||||||
hooks: {
|
|
||||||
// Triggered when the dialog is closed
|
|
||||||
onclose: function() {
|
|
||||||
if (this.view) {
|
|
||||||
// clear our backform model/view
|
|
||||||
this.view.remove({data: true, internal: true, silent: true});
|
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
},
|
},
|
||||||
prepare: function() {
|
hooks: {
|
||||||
var self = this,
|
// Triggered when the dialog is closed
|
||||||
$container = $("<div class='move_objects'></div>");
|
onclose: function() {
|
||||||
//Disbale Okay button
|
if (this.view) {
|
||||||
this.__internal.buttons[1].element.disabled = true;
|
// clear our backform model/view
|
||||||
// Find current/selected node
|
this.view.remove({data: true, internal: true, silent: true});
|
||||||
var t = pgBrowser.tree,
|
}
|
||||||
i = t.selected(),
|
}
|
||||||
d = i && i.length == 1 ? t.itemData(i) : undefined,
|
},
|
||||||
node = d && pgBrowser.Nodes[d._type];
|
prepare: function() {
|
||||||
|
var self = this,
|
||||||
|
$container = $("<div class='move_objects'></div>");
|
||||||
|
//Disbale Okay button
|
||||||
|
this.__internal.buttons[1].element.disabled = true;
|
||||||
|
// Find current/selected node
|
||||||
|
var t = pgBrowser.tree,
|
||||||
|
i = t.selected(),
|
||||||
|
d = i && i.length == 1 ? t.itemData(i) : undefined,
|
||||||
|
node = d && pgBrowser.Nodes[d._type];
|
||||||
|
|
||||||
if (!d)
|
if (!d)
|
||||||
return;
|
return;
|
||||||
// Create treeInfo
|
// Create treeInfo
|
||||||
var treeInfo = node.getTreeNodeHierarchy.apply(node, [i]);
|
var treeInfo = node.getTreeNodeHierarchy.apply(node, [i]);
|
||||||
// Instance of backbone model
|
// Instance of backbone model
|
||||||
var newModel = new objModel(
|
var newModel = new objModel({}, {node_info: treeInfo}),
|
||||||
{}, {node_info: treeInfo}
|
fields = Backform.generateViewSchema(
|
||||||
),
|
treeInfo, newModel, 'create', node,
|
||||||
fields = Backform.generateViewSchema(
|
treeInfo.server, true
|
||||||
treeInfo, newModel, 'create', node, treeInfo.server, true
|
);
|
||||||
);
|
|
||||||
|
|
||||||
var view = this.view = new Backform.Dialog({
|
var view = this.view = new Backform.Dialog({
|
||||||
el: $container, model: newModel, schema: fields
|
el: $container, model: newModel, schema: fields
|
||||||
|
@ -327,9 +327,9 @@ define(
|
|||||||
dialogContentCleanup();
|
dialogContentCleanup();
|
||||||
|
|
||||||
$container.append(
|
$container.append(
|
||||||
"<div class='col-xs-3 preferences_tree aciTree'></div>"
|
"<div class='pg-el-xs-3 preferences_tree aciTree'></div>"
|
||||||
).append(
|
).append(
|
||||||
"<div class='col-xs-9 preferences_content'>" +
|
"<div class='pg-el-xs-9 preferences_content'>" +
|
||||||
" {{ _('Category is not selected.')|safe }}" +
|
" {{ _('Category is not selected.')|safe }}" +
|
||||||
"</div>"
|
"</div>"
|
||||||
);
|
);
|
||||||
@ -349,7 +349,7 @@ define(
|
|||||||
|
|
||||||
this.show();
|
this.show();
|
||||||
},
|
},
|
||||||
setup:function(){
|
setup: function() {
|
||||||
return {
|
return {
|
||||||
buttons:[{
|
buttons:[{
|
||||||
text: '', key: 27, className: 'btn btn-default pull-left fa fa-lg fa-question',
|
text: '', key: 27, className: 'btn btn-default pull-left fa fa-lg fa-question',
|
||||||
@ -371,7 +371,7 @@ define(
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
callback: function(e){
|
callback: function(e) {
|
||||||
if (e.button.element.name == "dialog_help") {
|
if (e.button.element.name == "dialog_help") {
|
||||||
e.cancel = true;
|
e.cancel = true;
|
||||||
pgBrowser.showHelp(e.button.element.name, e.button.element.getAttribute('url'),
|
pgBrowser.showHelp(e.button.element.name, e.button.element.getAttribute('url'),
|
||||||
@ -385,6 +385,7 @@ define(
|
|||||||
},
|
},
|
||||||
build: function() {
|
build: function() {
|
||||||
this.elements.content.appendChild($container.get(0));
|
this.elements.content.appendChild($container.get(0));
|
||||||
|
alertify.pgDialogBuild.apply(this)
|
||||||
},
|
},
|
||||||
hooks: {
|
hooks: {
|
||||||
onshow: function() {
|
onshow: function() {
|
||||||
|
@ -45,7 +45,7 @@ TODO LIST FOR BACKUP:
|
|||||||
' <span class="<%=Backform.helpMessageClassName%>"><%=helpMessage%></span>',
|
' <span class="<%=Backform.helpMessageClassName%>"><%=helpMessage%></span>',
|
||||||
'<% } %>'
|
'<% } %>'
|
||||||
].join("\n")),
|
].join("\n")),
|
||||||
className: 'pgadmin-control-group form-group col-xs-6'
|
className: 'pgadmin-control-group form-group pg-el-md-6 pg-el-xs-12'
|
||||||
});
|
});
|
||||||
|
|
||||||
//Backup Model (Server Node)
|
//Backup Model (Server Node)
|
||||||
@ -382,6 +382,9 @@ TODO LIST FOR BACKUP:
|
|||||||
main: function(title) {
|
main: function(title) {
|
||||||
this.set('title', title);
|
this.set('title', title);
|
||||||
},
|
},
|
||||||
|
build: function() {
|
||||||
|
alertify.pgDialogBuild.apply(this);
|
||||||
|
},
|
||||||
setup:function() {
|
setup:function() {
|
||||||
return {
|
return {
|
||||||
buttons: [{
|
buttons: [{
|
||||||
@ -546,6 +549,9 @@ TODO LIST FOR BACKUP:
|
|||||||
main: function(title) {
|
main: function(title) {
|
||||||
this.set('title', title);
|
this.set('title', title);
|
||||||
},
|
},
|
||||||
|
build: function() {
|
||||||
|
alertify.pgDialogBuild.apply(this);
|
||||||
|
},
|
||||||
setup:function() {
|
setup:function() {
|
||||||
return {
|
return {
|
||||||
buttons: [{
|
buttons: [{
|
||||||
|
@ -402,6 +402,7 @@ define([
|
|||||||
*/
|
*/
|
||||||
build: function() {
|
build: function() {
|
||||||
this.elements.content.appendChild($container.get(0));
|
this.elements.content.appendChild($container.get(0));
|
||||||
|
alertify.pgDialogBuild.apply(this);
|
||||||
},
|
},
|
||||||
|
|
||||||
//Returns list of Acls defined for nodes
|
//Returns list of Acls defined for nodes
|
||||||
@ -653,7 +654,7 @@ define([
|
|||||||
|
|
||||||
// Create a grid container
|
// Create a grid container
|
||||||
var gridBody =
|
var gridBody =
|
||||||
$('<div class="db_objects_container col-xs-12"></div>');
|
$('<div class="db_objects_container pg-el-xs-12"></div>');
|
||||||
|
|
||||||
// Remove grid if exits before render
|
// Remove grid if exits before render
|
||||||
if (this.grid) {
|
if (this.grid) {
|
||||||
@ -664,7 +665,7 @@ define([
|
|||||||
this.grid = new Backgrid.Grid({
|
this.grid = new Backgrid.Grid({
|
||||||
columns: _.clone(columns),
|
columns: _.clone(columns),
|
||||||
collection: coll,
|
collection: coll,
|
||||||
className: "backgrid table-bordered object_type_table col-xs-12"
|
className: "backgrid table-bordered object_type_table pg-el-xs-12"
|
||||||
});
|
});
|
||||||
|
|
||||||
// Render selection Type grid and paginator
|
// Render selection Type grid and paginator
|
||||||
|
@ -322,6 +322,10 @@ define(
|
|||||||
this.setting('pg_item_data', data);
|
this.setting('pg_item_data', data);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
build: function() {
|
||||||
|
Alertify.pgDialogBuild.apply(this)
|
||||||
|
},
|
||||||
|
|
||||||
setup: function() {
|
setup: function() {
|
||||||
return {
|
return {
|
||||||
buttons:[{
|
buttons:[{
|
||||||
|
@ -186,10 +186,10 @@ define(
|
|||||||
Alertify.dialog('MaintenanceDialog', function factory() {
|
Alertify.dialog('MaintenanceDialog', function factory() {
|
||||||
|
|
||||||
return {
|
return {
|
||||||
main:function(title) {
|
main: function(title) {
|
||||||
this.set('title', title);
|
this.set('title', title);
|
||||||
},
|
},
|
||||||
setup:function() {
|
setup: function() {
|
||||||
return {
|
return {
|
||||||
buttons:[{
|
buttons:[{
|
||||||
text: '', key: 27, className: 'btn btn-default pull-left fa fa-lg fa-info',
|
text: '', key: 27, className: 'btn btn-default pull-left fa fa-lg fa-info',
|
||||||
@ -267,8 +267,8 @@ define(
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
build:function() {
|
build: function() {
|
||||||
|
Alertify.pgDialogBuild.apply(this)
|
||||||
},
|
},
|
||||||
hooks: {
|
hooks: {
|
||||||
onclose: function() {
|
onclose: function() {
|
||||||
@ -277,7 +277,7 @@ define(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
prepare:function() {
|
prepare: function() {
|
||||||
// Main maintenance tool dialog container
|
// Main maintenance tool dialog container
|
||||||
var $container = $("<div class='maintenance_dlg'></div>");
|
var $container = $("<div class='maintenance_dlg'></div>");
|
||||||
|
|
||||||
|
@ -26,7 +26,7 @@ define([
|
|||||||
' <span class="<%=Backform.helpMessageClassName%>"><%=helpMessage%></span>',
|
' <span class="<%=Backform.helpMessageClassName%>"><%=helpMessage%></span>',
|
||||||
'<% } %>'
|
'<% } %>'
|
||||||
].join("\n")),
|
].join("\n")),
|
||||||
className: 'pgadmin-control-group form-group col-xs-6'
|
className: 'pgadmin-control-group form-group pg-el-xs-4'
|
||||||
});
|
});
|
||||||
|
|
||||||
//Restore Model (Objects like Database/Schema/Table)
|
//Restore Model (Objects like Database/Schema/Table)
|
||||||
@ -305,6 +305,9 @@ define([
|
|||||||
this.setting('pg_item', item);
|
this.setting('pg_item', item);
|
||||||
this.setting('pg_item_data', data);
|
this.setting('pg_item_data', data);
|
||||||
},
|
},
|
||||||
|
build: function() {
|
||||||
|
alertify.pgDialogBuild.apply(this)
|
||||||
|
},
|
||||||
setup:function() {
|
setup:function() {
|
||||||
return {
|
return {
|
||||||
buttons: [{
|
buttons: [{
|
||||||
|
@ -374,6 +374,9 @@ define([
|
|||||||
main: function(title) {
|
main: function(title) {
|
||||||
this.set('title', title);
|
this.set('title', title);
|
||||||
},
|
},
|
||||||
|
build: function() {
|
||||||
|
alertify.pgDialogBuild.apply(this)
|
||||||
|
},
|
||||||
setup:function() {
|
setup:function() {
|
||||||
return {
|
return {
|
||||||
buttons: [{
|
buttons: [{
|
||||||
|
Loading…
Reference in New Issue
Block a user