mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-25 18:55:31 -06:00
Allow the dashboard panel to be closed. Fixes #2506
This commit is contained in:
committed by
Dave Page
parent
2d65312910
commit
501120701e
@@ -58,9 +58,11 @@ class DashboardModule(PgAdminModule):
|
||||
title=gettext('Dashboard'),
|
||||
icon='fa fa-tachometer',
|
||||
content='',
|
||||
isCloseable=False,
|
||||
isPrivate=True,
|
||||
isIframe=False)
|
||||
isCloseable=True,
|
||||
isPrivate=False,
|
||||
limit=1,
|
||||
isIframe=False,
|
||||
canHide=True)
|
||||
]
|
||||
|
||||
def register_preferences(self):
|
||||
|
||||
@@ -11,6 +11,8 @@ function(r, $, pgAdmin, _, Backbone, gettext) {
|
||||
if (pgAdmin.Dashboard)
|
||||
return;
|
||||
|
||||
var dashboardVisible = true;
|
||||
|
||||
pgAdmin.Dashboard = {
|
||||
init: function() {
|
||||
if (this.initialized)
|
||||
@@ -55,7 +57,7 @@ function(r, $, pgAdmin, _, Backbone, gettext) {
|
||||
|
||||
// Handle treeview clicks
|
||||
object_selected: function(item, itemData, node) {
|
||||
if (itemData && itemData._type) {
|
||||
if (itemData && itemData._type && dashboardVisible) {
|
||||
var treeHierarchy = node.getTreeNodeHierarchy(item),
|
||||
url = '{{ url_for('dashboard.index') }}',
|
||||
sid = -1, did = -1, b = pgAdmin.Browser,
|
||||
@@ -124,6 +126,9 @@ function(r, $, pgAdmin, _, Backbone, gettext) {
|
||||
// { data: [[0, y0], [1, y1]...], label: 'Label 3', [options] }
|
||||
// ]
|
||||
|
||||
if (!dashboardVisible)
|
||||
return;
|
||||
|
||||
y = 0;
|
||||
if (dataset.length == 0) {
|
||||
if (counter == true)
|
||||
@@ -862,6 +867,9 @@ function(r, $, pgAdmin, _, Backbone, gettext) {
|
||||
}
|
||||
});
|
||||
|
||||
},
|
||||
toggleVisibility: function(flag) {
|
||||
dashboardVisible = flag;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user