mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2026-11-02 20:30:17 -06:00
1 Fixed the issue where db connection was getting disconnected for dashboard, if network is slow.
2 Fixed publication collection node properties issue which was missed during react node porting. 3 Removed unwanted variable from theme style sheet.
This commit is contained in:
1 parent
953a9d7fd1
commit
8f8adcf71b
13 files changed
+30
-24
No files matched your search
+1
-1
@@ -23,7 +23,7 @@ define('pgadmin.node.publication', [
|
|||||||
node: 'publication',
|
node: 'publication',
|
||||||
label: gettext('Publications'),
|
label: gettext('Publications'),
|
||||||
type: 'coll-publication',
|
type: 'coll-publication',
|
||||||
columns: ['name', 'pubowner', 'proptable', 'all_table'],
|
columns: ['name', 'pubowner', 'pubtable', 'all_table'],
|
||||||
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-4
@@ -144,11 +144,8 @@ export default class PublicationSchema extends BaseUISchema {
|
|||||||
id: 'pubtable', label: gettext('Tables'), type: 'select',
|
id: 'pubtable', label: gettext('Tables'), type: 'select',
|
||||||
controlProps: { allowClear: true, multiple: true, creatable: true },
|
controlProps: { allowClear: true, multiple: true, creatable: true },
|
||||||
options: this.fieldOptions.publicationTable,
|
options: this.fieldOptions.publicationTable,
|
||||||
group: gettext('Definition'), mode: ['edit', 'create'],
|
group: gettext('Definition'), mode: ['edit', 'create', 'properties'],
|
||||||
deps: ['all_table'], disabled: obj.isAllTable,
|
deps: ['all_table'], disabled: obj.isAllTable,
|
||||||
},{
|
|
||||||
id: 'proptable', label: gettext('Tables'), type: 'text', group: gettext('Definition'),
|
|
||||||
mode: ['properties'],
|
|
||||||
},{
|
},{
|
||||||
type: 'nested-fieldset', mode: ['create','edit', 'properties'],
|
type: 'nested-fieldset', mode: ['create','edit', 'properties'],
|
||||||
label: gettext('With'), group: gettext('Definition'),
|
label: gettext('With'), group: gettext('Definition'),
|
||||||
|
|||||||
@@ -147,7 +147,7 @@ define(
|
|||||||
});
|
});
|
||||||
|
|
||||||
pgBrowser.Events.on('pgadmin-browser:tree:selected', () => {
|
pgBrowser.Events.on('pgadmin-browser:tree:selected', () => {
|
||||||
|
|
||||||
if(myPanel.isVisible() && myPanel._type !== 'properties') {
|
if(myPanel.isVisible() && myPanel._type !== 'properties') {
|
||||||
getPanelView(
|
getPanelView(
|
||||||
pgBrowser.tree,
|
pgBrowser.tree,
|
||||||
@@ -158,6 +158,18 @@ define(
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
pgBrowser.Events.on('pgadmin:database:connected', () => {
|
||||||
|
|
||||||
|
if(myPanel.isVisible() && myPanel._type == 'dashboard' && myPanel._type !== 'properties') {
|
||||||
|
getPanelView(
|
||||||
|
pgBrowser.tree,
|
||||||
|
$container[0],
|
||||||
|
pgBrowser,
|
||||||
|
myPanel._type
|
||||||
|
);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
pgBrowser.Events.on('pgadmin-browser:tree:refreshing', () => {
|
pgBrowser.Events.on('pgadmin-browser:tree:refreshing', () => {
|
||||||
|
|
||||||
if(myPanel.isVisible() && myPanel._type !== 'properties') {
|
if(myPanel.isVisible() && myPanel._type !== 'properties') {
|
||||||
|
|||||||
@@ -48,6 +48,7 @@ export function getPanelView(
|
|||||||
did={((!_.isUndefined(treeNodeInfo)) && (!_.isUndefined(treeNodeInfo['database']))) ? treeNodeInfo['database']._id: 0}
|
did={((!_.isUndefined(treeNodeInfo)) && (!_.isUndefined(treeNodeInfo['database']))) ? treeNodeInfo['database']._id: 0}
|
||||||
sid={!_.isUndefined(treeNodeInfo) && !_.isUndefined(treeNodeInfo['server']) ? treeNodeInfo['server']._id : ''}
|
sid={!_.isUndefined(treeNodeInfo) && !_.isUndefined(treeNodeInfo['server']) ? treeNodeInfo['server']._id : ''}
|
||||||
serverConnected={!_.isUndefined(treeNodeInfo) && !_.isUndefined(treeNodeInfo['server']) ? treeNodeInfo.server.connected: false}
|
serverConnected={!_.isUndefined(treeNodeInfo) && !_.isUndefined(treeNodeInfo['server']) ? treeNodeInfo.server.connected: false}
|
||||||
|
dbConnected={!_.isUndefined(treeNodeInfo) && !_.isUndefined(treeNodeInfo['database']) ? treeNodeInfo.database.connected: false}
|
||||||
/>
|
/>
|
||||||
</Theme>,
|
</Theme>,
|
||||||
container
|
container
|
||||||
|
|||||||
@@ -741,6 +741,7 @@ export default function Dashboard({
|
|||||||
}
|
}
|
||||||
|
|
||||||
message = gettext('Loading dashboard...');
|
message = gettext('Loading dashboard...');
|
||||||
|
if (did && !props.dbConnected) return;
|
||||||
if (did) url += sid + '/' + did;
|
if (did) url += sid + '/' + did;
|
||||||
else url += sid;
|
else url += sid;
|
||||||
|
|
||||||
@@ -771,7 +772,7 @@ export default function Dashboard({
|
|||||||
return () => {
|
return () => {
|
||||||
setRefresh();
|
setRefresh();
|
||||||
};
|
};
|
||||||
}, [nodeData, val, did, preferences, infoMsg, refresh]);
|
}, [nodeData, val, did, preferences, infoMsg, refresh, props.dbConnected]);
|
||||||
|
|
||||||
const RefreshButton = () =>{
|
const RefreshButton = () =>{
|
||||||
return(
|
return(
|
||||||
@@ -874,6 +875,7 @@ Dashboard.propTypes = {
|
|||||||
did: PropTypes.oneOfType([PropTypes.bool, PropTypes.number]),
|
did: PropTypes.oneOfType([PropTypes.bool, PropTypes.number]),
|
||||||
row: PropTypes.object,
|
row: PropTypes.object,
|
||||||
serverConnected: PropTypes.bool,
|
serverConnected: PropTypes.bool,
|
||||||
|
dbConnected: PropTypes.bool,
|
||||||
};
|
};
|
||||||
|
|
||||||
export function ChartContainer(props) {
|
export function ChartContainer(props) {
|
||||||
|
|||||||
@@ -72,7 +72,7 @@ const useStyles = makeStyles((theme) => ({
|
|||||||
cursor: 'pointer'
|
cursor: 'pointer'
|
||||||
},
|
},
|
||||||
link: {
|
link: {
|
||||||
color: theme.otherVars.colorFg + '!important',
|
color: theme.otherVars.stepFg + '!important',
|
||||||
},
|
},
|
||||||
cardColumn: {
|
cardColumn: {
|
||||||
flex: '0 0 100%',
|
flex: '0 0 100%',
|
||||||
|
|||||||
@@ -86,7 +86,7 @@ export function CollectionNodeView({
|
|||||||
const [data, setData] = React.useState([]);
|
const [data, setData] = React.useState([]);
|
||||||
const [infoMsg, setInfoMsg] = React.useState('Please select an object in the tree view.');
|
const [infoMsg, setInfoMsg] = React.useState('Please select an object in the tree view.');
|
||||||
const [selectedObject, setSelectedObject] = React.useState([]);
|
const [selectedObject, setSelectedObject] = React.useState([]);
|
||||||
const [reload, setReload] = React.useState();
|
const [reload, setReload] = React.useState(false);
|
||||||
|
|
||||||
const [pgTableColumns, setPgTableColumns] = React.useState([
|
const [pgTableColumns, setPgTableColumns] = React.useState([
|
||||||
{
|
{
|
||||||
@@ -162,7 +162,7 @@ export function CollectionNodeView({
|
|||||||
if (res.success == 0) {
|
if (res.success == 0) {
|
||||||
pgBrowser.report_error(res.errormsg, res.info);
|
pgBrowser.report_error(res.errormsg, res.info);
|
||||||
}
|
}
|
||||||
setReload(true);
|
setReload(!reload);
|
||||||
})
|
})
|
||||||
.catch(function (error) {
|
.catch(function (error) {
|
||||||
Notify.alert(
|
Notify.alert(
|
||||||
|
|||||||
@@ -221,7 +221,6 @@ export default function Statistics({ nodeData, item, node, ...props }) {
|
|||||||
}
|
}
|
||||||
if (message != '') {
|
if (message != '') {
|
||||||
setMsg(message);
|
setMsg(message);
|
||||||
setLoaderText('');
|
|
||||||
}
|
}
|
||||||
return () => {
|
return () => {
|
||||||
setTableData([]);
|
setTableData([]);
|
||||||
|
|||||||
@@ -93,7 +93,6 @@ export default function(basicSettings) {
|
|||||||
stepBg: '#FFFFFF',
|
stepBg: '#FFFFFF',
|
||||||
stepFg: '#000',
|
stepFg: '#000',
|
||||||
toggleBtnBg: '#000',
|
toggleBtnBg: '#000',
|
||||||
colorFg: '#FFFFFF',
|
|
||||||
emptySpaceBg: '#212121',
|
emptySpaceBg: '#212121',
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -91,7 +91,6 @@ export default function(basicSettings) {
|
|||||||
stepBg: '#FFFFFF',
|
stepBg: '#FFFFFF',
|
||||||
stepFg: '#000',
|
stepFg: '#000',
|
||||||
toggleBtnBg: '#6B6B6B',
|
toggleBtnBg: '#6B6B6B',
|
||||||
colorFg: '#FFFFFF',
|
|
||||||
emptySpaceBg: '#010B15',
|
emptySpaceBg: '#010B15',
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -85,7 +85,6 @@ export default function(basicSettings) {
|
|||||||
padding: '5px 8px',
|
padding: '5px 8px',
|
||||||
},
|
},
|
||||||
borderColor: '#dde0e6',
|
borderColor: '#dde0e6',
|
||||||
colorFg: '#222222',
|
|
||||||
loader: {
|
loader: {
|
||||||
backgroundColor: fade('#000', 0.65),
|
backgroundColor: fade('#000', 0.65),
|
||||||
color: '#fff',
|
color: '#fff',
|
||||||
|
|||||||
@@ -381,23 +381,17 @@ export default function PgTable({ columns, data, isSelectRow, caveTable=true, ..
|
|||||||
const RenderRow = React.useCallback(
|
const RenderRow = React.useCallback(
|
||||||
({ index, style }) => {
|
({ index, style }) => {
|
||||||
const row = rows[index];
|
const row = rows[index];
|
||||||
const [expandComplete, setExpandComplete] = React.useState(null);
|
const [expandComplete, setExpandComplete] = React.useState(false);
|
||||||
const rowRef = React.useRef() ;
|
const rowRef = React.useRef() ;
|
||||||
prepareRow(row);
|
prepareRow(row);
|
||||||
|
|
||||||
React.useEffect(()=>{
|
|
||||||
if(expandComplete && !row.isExpanded) {
|
|
||||||
setExpandComplete(false);
|
|
||||||
}
|
|
||||||
}, [row.isExpanded]);
|
|
||||||
|
|
||||||
React.useEffect(()=>{
|
React.useEffect(()=>{
|
||||||
if(rowRef.current) {
|
if(rowRef.current) {
|
||||||
if(expandComplete == null) {
|
if(!expandComplete && rowRef.current.style.height == `${ROW_HEIGHT}px`) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
let rowHeight;
|
let rowHeight;
|
||||||
rowRef.current.style.height='unset';
|
rowRef.current.style.height = 'unset';
|
||||||
if(expandComplete) {
|
if(expandComplete) {
|
||||||
rowHeight = rowRef.current.offsetHeight;
|
rowHeight = rowRef.current.offsetHeight;
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -429,7 +429,11 @@ export default function newConnectionDialogModel(response, sgid, sid, handler, c
|
|||||||
&& m.get('server') !== '') {
|
&& m.get('server') !== '') {
|
||||||
setTimeout(function() {
|
setTimeout(function() {
|
||||||
if(self_local.options.length) {
|
if(self_local.options.length) {
|
||||||
m.set('user', self_local.options[0].value);
|
self_local.options.forEach(user => {
|
||||||
|
if (user.selected) {
|
||||||
|
m.set('user', user.value);
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}, 10);
|
}, 10);
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
Reference in new issue
Block a user