mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-01-24 15:26:46 -06:00
7a2716bf77
refs #7016
45 lines
1.3 KiB
JavaScript
45 lines
1.3 KiB
JavaScript
/////////////////////////////////////////////////////////////
|
|
//
|
|
// pgAdmin 4 - PostgreSQL Tools
|
|
//
|
|
// Copyright (C) 2013 - 2022, The pgAdmin Development Team
|
|
// This software is released under the PostgreSQL Licence
|
|
//
|
|
//////////////////////////////////////////////////////////////
|
|
|
|
import { generateNodeUrl, generateCollectionURL } from '../../../../pgadmin/browser/static/js/node_ajax';
|
|
import { sprintf } from 'sources/utils';
|
|
|
|
export function getURL(
|
|
nodeData,
|
|
with_id,
|
|
getTreeNodeHierarchy,
|
|
node,
|
|
item,
|
|
panelType
|
|
) {
|
|
if (nodeData.is_collection && panelType === 'stats') {
|
|
return generateCollectionURL.call(node, item, panelType);
|
|
}
|
|
if (_.indexOf(['partition'], nodeData._type) == -1) {
|
|
return generateNodeUrl.call(
|
|
node,
|
|
getTreeNodeHierarchy,
|
|
panelType,
|
|
nodeData,
|
|
with_id,
|
|
node.url_jump_after_node
|
|
);
|
|
}
|
|
|
|
return sprintf(
|
|
'table/%s/%s/%s/%s/%s/%s',
|
|
encodeURIComponent(panelType),
|
|
encodeURIComponent(getTreeNodeHierarchy['server_group']._id),
|
|
encodeURIComponent(getTreeNodeHierarchy['server']._id),
|
|
encodeURIComponent(getTreeNodeHierarchy['database']._id),
|
|
encodeURIComponent(getTreeNodeHierarchy['partition'].schema_id),
|
|
encodeURIComponent(getTreeNodeHierarchy['partition']._id)
|
|
);
|
|
}
|