mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-25 18:55:31 -06:00
Webpacking cleanups
This commit is contained in:
parent
6046be7fba
commit
dfa877262d
@ -560,8 +560,6 @@ define('pgadmin.node.exclusion_constraint', [
|
||||
|
||||
newRow.addClass("new");
|
||||
$(newRow).pgMakeVisible('backform-tab');
|
||||
} else {
|
||||
//delete m;
|
||||
}
|
||||
|
||||
return false;
|
||||
|
@ -493,8 +493,6 @@ define('pgadmin.node.foreign_key', [
|
||||
|
||||
newRow.addClass("new");
|
||||
$(newRow).pgMakeVisible('backform-tab');
|
||||
} else {
|
||||
//delete m;
|
||||
}
|
||||
|
||||
return false;
|
||||
|
@ -1,6 +1,7 @@
|
||||
define('pgadmin.node.primary_key', [
|
||||
'sources/gettext', 'sources/url_for', 'jquery', 'underscore', 'underscore.string', 'pgadmin',
|
||||
'pgadmin.browser', 'alertify', 'pgadmin.browser.collection'
|
||||
'sources/gettext', 'sources/url_for', 'jquery', 'underscore',
|
||||
'underscore.string', 'pgadmin', 'pgadmin.browser', 'alertify',
|
||||
'pgadmin.browser.collection'
|
||||
], function(gettext, url_for, $, _, S, pgAdmin, pgBrowser, alertify) {
|
||||
|
||||
// Extend the browser's node class for index constraint node
|
||||
|
@ -1,6 +1,7 @@
|
||||
define('pgadmin.node.unique_constraint', [
|
||||
'sources/gettext', 'sources/url_for', 'jquery', 'underscore', 'underscore.string', 'pgadmin',
|
||||
'pgadmin.browser', 'alertify', 'pgadmin.browser.collection'
|
||||
'sources/gettext', 'sources/url_for', 'jquery', 'underscore',
|
||||
'underscore.string', 'pgadmin', 'pgadmin.browser', 'alertify',
|
||||
'pgadmin.browser.collection'
|
||||
], function(gettext, url_for, $, _, S, pgAdmin, pgBrowser, alertify) {
|
||||
|
||||
// Extend the browser's node class for index constraint node
|
||||
|
@ -1,4 +1,6 @@
|
||||
define(['sources/gettext', 'underscore', 'jquery', 'backbone', 'backform', 'backgrid', 'alertify', 'pgadmin.browser.node', 'pgadmin.browser.node.ui'],
|
||||
define(['sources/gettext', 'underscore', 'jquery', 'backbone', 'backform',
|
||||
'backgrid', 'alertify', 'pgadmin.browser.node', 'pgadmin.browser.node.ui'
|
||||
],
|
||||
function(gettext, _, $, Backbone, Backform, Backgrid, Alertify, pgNode) {
|
||||
/**
|
||||
* Each Privilege, supporeted by an database object, will be represented
|
||||
|
@ -126,23 +126,21 @@ define(
|
||||
}
|
||||
|
||||
// show query tool only in context menu of supported nodes.
|
||||
if (true) {
|
||||
if (_.indexOf(pgAdmin.unsupported_nodes, self.type) == -1) {
|
||||
pgAdmin.Browser.add_menus([{
|
||||
name: 'show_query_tool', node: self.type, module: self,
|
||||
applies: ['context'], callback: 'show_query_tool',
|
||||
priority: 998, label: gettext('Query Tool...'),
|
||||
icon: 'fa fa-bolt',
|
||||
enable: function(itemData, item, data) {
|
||||
if (itemData._type == 'database' && itemData.allowConn)
|
||||
return true;
|
||||
else if(itemData._type != 'database')
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
}
|
||||
}]);
|
||||
}
|
||||
if (_.indexOf(pgAdmin.unsupported_nodes, self.type) == -1) {
|
||||
pgAdmin.Browser.add_menus([{
|
||||
name: 'show_query_tool', node: self.type, module: self,
|
||||
applies: ['context'], callback: 'show_query_tool',
|
||||
priority: 998, label: gettext('Query Tool...'),
|
||||
icon: 'fa fa-bolt',
|
||||
enable: function(itemData, item, data) {
|
||||
if (itemData._type == 'database' && itemData.allowConn)
|
||||
return true;
|
||||
else if(itemData._type != 'database')
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
}
|
||||
}]);
|
||||
}
|
||||
|
||||
// This will add options of scripts eg:'CREATE Script'
|
||||
@ -501,7 +499,6 @@ define(
|
||||
);
|
||||
|
||||
b.removeChild(el);
|
||||
// delete(el);
|
||||
|
||||
return p;
|
||||
};
|
||||
@ -995,8 +992,6 @@ define(
|
||||
if (view) {
|
||||
// Release the view
|
||||
view.remove({data: true, internal: true, silent: true});
|
||||
// Deallocate the view
|
||||
// delete view;
|
||||
view = null;
|
||||
// Reset the data object
|
||||
j.data('obj-view', null);
|
||||
@ -1179,7 +1174,6 @@ define(
|
||||
if (view) {
|
||||
// Release the view
|
||||
view.remove({data: true, internal: true, silent: true});
|
||||
// Deallocate the view
|
||||
view = null;
|
||||
// Reset the data object
|
||||
j.data('obj-view', null);
|
||||
|
@ -332,8 +332,8 @@ function(url_for, gettext, r, $, _, pgAdmin, Backbone, Backgrid, Flotr) {
|
||||
// Render the data in a grid
|
||||
render_grid_data: function(container) {
|
||||
var data = $(container).data('data'),
|
||||
grid = $(container).data('grid'),
|
||||
filter = $(container).data('filter');
|
||||
grid = $(container).data('grid'),
|
||||
filter = $(container).data('filter');
|
||||
|
||||
if(_.isUndefined(data)){
|
||||
return null;
|
||||
@ -608,17 +608,49 @@ function(url_for, gettext, r, $, _, pgAdmin, Backbone, Backgrid, Flotr) {
|
||||
}];
|
||||
|
||||
// Render the graphs
|
||||
pgAdmin.Dashboard.render_chart(div_sessions, data_sessions, dataset_sessions, sid, did, url_for('dashboard.session_stats'), options_line, false, session_stats_refresh);
|
||||
pgAdmin.Dashboard.render_chart(div_tps, data_tps, dataset_tps, sid, did, url_for('dashboard.tps_stats'), options_line, true, tps_stats_refresh);
|
||||
pgAdmin.Dashboard.render_chart(div_ti, data_ti, dataset_ti, sid, did, url_for('dashboard.ti_stats'), options_line, true, ti_stats_refresh);
|
||||
pgAdmin.Dashboard.render_chart(div_to, data_to, dataset_to, sid, did, url_for('dashboard.to_stats'), options_line, true, to_stats_refresh);
|
||||
pgAdmin.Dashboard.render_chart(div_bio, data_bio, dataset_bio, sid, did, url_for('dashboard.bio_stats'), options_line, true, bio_stats_refresh);
|
||||
pgAdmin.Dashboard.render_chart(
|
||||
div_sessions, data_sessions, dataset_sessions, sid, did,
|
||||
url_for('dashboard.session_stats'), options_line, false,
|
||||
session_stats_refresh
|
||||
);
|
||||
pgAdmin.Dashboard.render_chart(
|
||||
div_tps, data_tps, dataset_tps, sid, did,
|
||||
url_for('dashboard.tps_stats'), options_line, true,
|
||||
tps_stats_refresh
|
||||
);
|
||||
pgAdmin.Dashboard.render_chart(
|
||||
div_ti, data_ti, dataset_ti, sid, did,
|
||||
url_for('dashboard.ti_stats'), options_line, true,
|
||||
ti_stats_refresh
|
||||
);
|
||||
pgAdmin.Dashboard.render_chart(
|
||||
div_to, data_to, dataset_to, sid, did,
|
||||
url_for('dashboard.to_stats'), options_line, true,
|
||||
to_stats_refresh
|
||||
);
|
||||
pgAdmin.Dashboard.render_chart(
|
||||
div_bio, data_bio, dataset_bio, sid, did,
|
||||
url_for('dashboard.bio_stats'), options_line, true,
|
||||
bio_stats_refresh
|
||||
);
|
||||
|
||||
// Render the tabs, but only get data for the activity tab for now
|
||||
pgAdmin.Dashboard.render_grid(div_server_activity, sid, did, url_for('dashboard.activity'), server_activity_columns);
|
||||
pgAdmin.Dashboard.render_grid(div_server_locks, sid, did, url_for('dashboard.locks'), server_locks_columns);
|
||||
pgAdmin.Dashboard.render_grid(div_server_prepared, sid, did, url_for('dashboard.prepared'), server_prepared_columns);
|
||||
pgAdmin.Dashboard.render_grid(div_server_config, sid, did, url_for('dashboard.config'), server_config_columns);
|
||||
pgAdmin.Dashboard.render_grid(
|
||||
div_server_activity, sid, did,
|
||||
url_for('dashboard.activity'), server_activity_columns
|
||||
);
|
||||
pgAdmin.Dashboard.render_grid(
|
||||
div_server_locks, sid, did, url_for('dashboard.locks'),
|
||||
server_locks_columns
|
||||
);
|
||||
pgAdmin.Dashboard.render_grid(
|
||||
div_server_prepared, sid, did, url_for('dashboard.prepared'),
|
||||
server_prepared_columns
|
||||
);
|
||||
pgAdmin.Dashboard.render_grid(
|
||||
div_server_config, sid, did, url_for('dashboard.config'),
|
||||
server_config_columns
|
||||
);
|
||||
|
||||
pgAdmin.Dashboard.render_grid_data(div_server_activity);
|
||||
|
||||
@ -843,16 +875,45 @@ function(url_for, gettext, r, $, _, pgAdmin, Backbone, Backgrid, Flotr) {
|
||||
}];
|
||||
|
||||
// Render the graphs
|
||||
pgAdmin.Dashboard.render_chart(div_sessions, data_sessions, dataset_sessions, sid, did, url_for('dashboard.session_stats'), options_line, false, session_stats_refresh);
|
||||
pgAdmin.Dashboard.render_chart(div_tps, data_tps, dataset_tps, sid, did, url_for('dashboard.tps_stats'), options_line, true, tps_stats_refresh);
|
||||
pgAdmin.Dashboard.render_chart(div_ti, data_ti, dataset_ti, sid, did, url_for('dashboard.ti_stats'), options_line, true, ti_stats_refresh);
|
||||
pgAdmin.Dashboard.render_chart(div_to, data_to, dataset_to, sid, did, url_for('dashboard.to_stats'), options_line, true, to_stats_refresh);
|
||||
pgAdmin.Dashboard.render_chart(div_bio, data_bio, dataset_bio, sid, did, url_for('dashboard.bio_stats'), options_line, true, bio_stats_refresh);
|
||||
pgAdmin.Dashboard.render_chart(
|
||||
div_sessions, data_sessions, dataset_sessions, sid, did,
|
||||
url_for('dashboard.session_stats'), options_line, false,
|
||||
session_stats_refresh
|
||||
);
|
||||
pgAdmin.Dashboard.render_chart(
|
||||
div_tps, data_tps, dataset_tps, sid, did,
|
||||
url_for('dashboard.tps_stats'), options_line, true,
|
||||
tps_stats_refresh
|
||||
);
|
||||
pgAdmin.Dashboard.render_chart(
|
||||
div_ti, data_ti, dataset_ti, sid, did,
|
||||
url_for('dashboard.ti_stats'), options_line, true,
|
||||
ti_stats_refresh
|
||||
);
|
||||
pgAdmin.Dashboard.render_chart(
|
||||
div_to, data_to, dataset_to, sid, did,
|
||||
url_for('dashboard.to_stats'), options_line, true,
|
||||
to_stats_refresh
|
||||
);
|
||||
pgAdmin.Dashboard.render_chart(
|
||||
div_bio, data_bio, dataset_bio, sid, did,
|
||||
url_for('dashboard.bio_stats'), options_line, true,
|
||||
bio_stats_refresh
|
||||
);
|
||||
|
||||
// Render the tabs, but only get data for the activity tab for now
|
||||
pgAdmin.Dashboard.render_grid(div_database_activity, sid, did, url_for('dashboard.activity'), database_activity_columns);
|
||||
pgAdmin.Dashboard.render_grid(div_database_locks, sid, did, url_for('dashboard.locks'), database_locks_columns);
|
||||
pgAdmin.Dashboard.render_grid(div_database_prepared, sid, did, url_for('dashboard.prepared'), database_prepared_columns);
|
||||
pgAdmin.Dashboard.render_grid(
|
||||
div_database_activity, sid, did, url_for('dashboard.activity'),
|
||||
database_activity_columns
|
||||
);
|
||||
pgAdmin.Dashboard.render_grid(
|
||||
div_database_locks, sid, did, url_for('dashboard.locks'),
|
||||
database_locks_columns
|
||||
);
|
||||
pgAdmin.Dashboard.render_grid(
|
||||
div_database_prepared, sid, did, url_for('dashboard.prepared'),
|
||||
database_prepared_columns
|
||||
);
|
||||
|
||||
pgAdmin.Dashboard.render_grid_data(div_database_activity);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user