MCPcopy Create free account
hub / github.com/pgadmin-org/pgadmin4 / showServerPassword

Function showServerPassword

web/pgadmin/static/js/Dialogs/index.jsx:27–70  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

25
26// This functions is used to show the connect server password dialog.
27export function showServerPassword() {
28 let title = arguments[0],
29 formJson = arguments[1],
30 nodeObj = arguments[2],
31 nodeData = arguments[3],
32 treeNodeInfo = arguments[4],
33 itemNodeData = arguments[5],
34 status = arguments[6],
35 onSuccess = arguments[7],
36 onFailure = arguments[8];
37
38 pgAdmin.Browser.notifier.showModal(title, (onClose) => {
39 return (
40 <ConnectServerContent
41 closeModal={()=>{
42 onClose();
43 }}
44 data={formJson}
45 onOK={(formData)=>{
46 const api = getApiInstance();
47 let _url = nodeObj.generate_url(itemNodeData, 'connect', nodeData, true);
48 if (!status) {
49 treeNodeInfo.setLeaf(itemNodeData);
50 treeNodeInfo.removeIcon(itemNodeData);
51 treeNodeInfo.addIcon(itemNodeData, {icon: 'icon-server-connecting'});
52 }
53
54 api.post(_url, formData)
55 .then(res=>{
56 onClose();
57 return onSuccess(
58 res.data, nodeObj, nodeData, treeNodeInfo, itemNodeData, status
59 );
60 })
61 .catch((err)=>{
62 return onFailure(
63 err, null, nodeObj, nodeData, treeNodeInfo, itemNodeData, status
64 );
65 });
66 }}
67 />
68 );
69 }, {id: 'id-connect-server'});
70}
71
72function masterPassCallbacks(masterpass_callback_queue) {
73 while(masterpass_callback_queue.length > 0) {

Callers 2

onFailureFunction · 0.90
onFailureFunction · 0.90

Calls 9

getApiInstanceFunction · 0.85
showModalMethod · 0.80
generate_urlMethod · 0.80
setLeafMethod · 0.80
removeIconMethod · 0.80
addIconMethod · 0.80
onCloseFunction · 0.70
onSuccessFunction · 0.50
onFailureFunction · 0.50

Tested by

no test coverage detected