mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-03 04:00:55 -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:
parent
953a9d7fd1
commit
8f8adcf71b
@ -23,7 +23,7 @@ define('pgadmin.node.publication', [
|
||||
node: 'publication',
|
||||
label: gettext('Publications'),
|
||||
type: 'coll-publication',
|
||||
columns: ['name', 'pubowner', 'proptable', 'all_table'],
|
||||
columns: ['name', 'pubowner', 'pubtable', 'all_table'],
|
||||
|
||||
});
|
||||
}
|
||||
|
@ -144,11 +144,8 @@ export default class PublicationSchema extends BaseUISchema {
|
||||
id: 'pubtable', label: gettext('Tables'), type: 'select',
|
||||
controlProps: { allowClear: true, multiple: true, creatable: true },
|
||||
options: this.fieldOptions.publicationTable,
|
||||
group: gettext('Definition'), mode: ['edit', 'create'],
|
||||
group: gettext('Definition'), mode: ['edit', 'create', 'properties'],
|
||||
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'],
|
||||
label: gettext('With'), group: gettext('Definition'),
|
||||
|
@ -147,7 +147,7 @@ define(
|
||||
});
|
||||
|
||||
pgBrowser.Events.on('pgadmin-browser:tree:selected', () => {
|
||||
|
||||
|
||||
if(myPanel.isVisible() && myPanel._type !== 'properties') {
|
||||
getPanelView(
|
||||
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', () => {
|
||||
|
||||
if(myPanel.isVisible() && myPanel._type !== 'properties') {
|
||||
|
@ -48,6 +48,7 @@ export function getPanelView(
|
||||
did={((!_.isUndefined(treeNodeInfo)) && (!_.isUndefined(treeNodeInfo['database']))) ? treeNodeInfo['database']._id: 0}
|
||||
sid={!_.isUndefined(treeNodeInfo) && !_.isUndefined(treeNodeInfo['server']) ? treeNodeInfo['server']._id : ''}
|
||||
serverConnected={!_.isUndefined(treeNodeInfo) && !_.isUndefined(treeNodeInfo['server']) ? treeNodeInfo.server.connected: false}
|
||||
dbConnected={!_.isUndefined(treeNodeInfo) && !_.isUndefined(treeNodeInfo['database']) ? treeNodeInfo.database.connected: false}
|
||||
/>
|
||||
</Theme>,
|
||||
container
|
||||
|
@ -741,6 +741,7 @@ export default function Dashboard({
|
||||
}
|
||||
|
||||
message = gettext('Loading dashboard...');
|
||||
if (did && !props.dbConnected) return;
|
||||
if (did) url += sid + '/' + did;
|
||||
else url += sid;
|
||||
|
||||
@ -771,7 +772,7 @@ export default function Dashboard({
|
||||
return () => {
|
||||
setRefresh();
|
||||
};
|
||||
}, [nodeData, val, did, preferences, infoMsg, refresh]);
|
||||
}, [nodeData, val, did, preferences, infoMsg, refresh, props.dbConnected]);
|
||||
|
||||
const RefreshButton = () =>{
|
||||
return(
|
||||
@ -874,6 +875,7 @@ Dashboard.propTypes = {
|
||||
did: PropTypes.oneOfType([PropTypes.bool, PropTypes.number]),
|
||||
row: PropTypes.object,
|
||||
serverConnected: PropTypes.bool,
|
||||
dbConnected: PropTypes.bool,
|
||||
};
|
||||
|
||||
export function ChartContainer(props) {
|
||||
|
@ -72,7 +72,7 @@ const useStyles = makeStyles((theme) => ({
|
||||
cursor: 'pointer'
|
||||
},
|
||||
link: {
|
||||
color: theme.otherVars.colorFg + '!important',
|
||||
color: theme.otherVars.stepFg + '!important',
|
||||
},
|
||||
cardColumn: {
|
||||
flex: '0 0 100%',
|
||||
|
@ -86,7 +86,7 @@ export function CollectionNodeView({
|
||||
const [data, setData] = React.useState([]);
|
||||
const [infoMsg, setInfoMsg] = React.useState('Please select an object in the tree view.');
|
||||
const [selectedObject, setSelectedObject] = React.useState([]);
|
||||
const [reload, setReload] = React.useState();
|
||||
const [reload, setReload] = React.useState(false);
|
||||
|
||||
const [pgTableColumns, setPgTableColumns] = React.useState([
|
||||
{
|
||||
@ -162,7 +162,7 @@ export function CollectionNodeView({
|
||||
if (res.success == 0) {
|
||||
pgBrowser.report_error(res.errormsg, res.info);
|
||||
}
|
||||
setReload(true);
|
||||
setReload(!reload);
|
||||
})
|
||||
.catch(function (error) {
|
||||
Notify.alert(
|
||||
|
@ -221,7 +221,6 @@ export default function Statistics({ nodeData, item, node, ...props }) {
|
||||
}
|
||||
if (message != '') {
|
||||
setMsg(message);
|
||||
setLoaderText('');
|
||||
}
|
||||
return () => {
|
||||
setTableData([]);
|
||||
|
@ -93,7 +93,6 @@ export default function(basicSettings) {
|
||||
stepBg: '#FFFFFF',
|
||||
stepFg: '#000',
|
||||
toggleBtnBg: '#000',
|
||||
colorFg: '#FFFFFF',
|
||||
emptySpaceBg: '#212121',
|
||||
}
|
||||
});
|
||||
|
@ -91,7 +91,6 @@ export default function(basicSettings) {
|
||||
stepBg: '#FFFFFF',
|
||||
stepFg: '#000',
|
||||
toggleBtnBg: '#6B6B6B',
|
||||
colorFg: '#FFFFFF',
|
||||
emptySpaceBg: '#010B15',
|
||||
}
|
||||
});
|
||||
|
@ -85,7 +85,6 @@ export default function(basicSettings) {
|
||||
padding: '5px 8px',
|
||||
},
|
||||
borderColor: '#dde0e6',
|
||||
colorFg: '#222222',
|
||||
loader: {
|
||||
backgroundColor: fade('#000', 0.65),
|
||||
color: '#fff',
|
||||
|
@ -381,23 +381,17 @@ export default function PgTable({ columns, data, isSelectRow, caveTable=true, ..
|
||||
const RenderRow = React.useCallback(
|
||||
({ index, style }) => {
|
||||
const row = rows[index];
|
||||
const [expandComplete, setExpandComplete] = React.useState(null);
|
||||
const [expandComplete, setExpandComplete] = React.useState(false);
|
||||
const rowRef = React.useRef() ;
|
||||
prepareRow(row);
|
||||
|
||||
React.useEffect(()=>{
|
||||
if(expandComplete && !row.isExpanded) {
|
||||
setExpandComplete(false);
|
||||
}
|
||||
}, [row.isExpanded]);
|
||||
|
||||
React.useEffect(()=>{
|
||||
if(rowRef.current) {
|
||||
if(expandComplete == null) {
|
||||
if(!expandComplete && rowRef.current.style.height == `${ROW_HEIGHT}px`) {
|
||||
return;
|
||||
}
|
||||
let rowHeight;
|
||||
rowRef.current.style.height='unset';
|
||||
rowRef.current.style.height = 'unset';
|
||||
if(expandComplete) {
|
||||
rowHeight = rowRef.current.offsetHeight;
|
||||
} else {
|
||||
|
@ -429,7 +429,11 @@ export default function newConnectionDialogModel(response, sgid, sid, handler, c
|
||||
&& m.get('server') !== '') {
|
||||
setTimeout(function() {
|
||||
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);
|
||||
return false;
|
||||
|
Loading…
Reference in New Issue
Block a user