mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-01-24 15:26:46 -06:00
c2b23465cc
2) Port process watcher to React. Fixes #7404
32 lines
844 B
JavaScript
32 lines
844 B
JavaScript
import React from 'react';
|
|
import ReactDOM from 'react-dom';
|
|
import pgAdmin from 'sources/pgadmin';
|
|
import Theme from '../../../../static/js/Theme';
|
|
import ProcessDetails from './ProcessDetails';
|
|
import gettext from 'sources/gettext';
|
|
|
|
export default function showDetails(p) {
|
|
let pgBrowser = pgAdmin.Browser;
|
|
|
|
// Register dialog panel
|
|
pgBrowser.Node.registerUtilityPanel();
|
|
let panel = pgBrowser.Node.addUtilityPanel(pgBrowser.stdW.md),
|
|
j = panel.$container.find('.obj_properties').first();
|
|
panel.title(gettext('Process Watcher - %s', p.type_desc));
|
|
panel.focus();
|
|
|
|
panel.on(window.wcDocker.EVENT.CLOSED, ()=>{
|
|
ReactDOM.unmountComponentAtNode(j[0]);
|
|
});
|
|
|
|
ReactDOM.render(
|
|
<Theme>
|
|
<ProcessDetails
|
|
data={p}
|
|
closeModal={()=>{
|
|
panel.close();
|
|
}}
|
|
/>
|
|
</Theme>, j[0]);
|
|
}
|