///////////////////////////////////////////////////////////// // // pgAdmin 4 - PostgreSQL Tools // // Copyright (C) 2013 - 2022, The pgAdmin Development Team // This software is released under the PostgreSQL Licence // ////////////////////////////////////////////////////////////// import React from 'react'; import ReactDOM from 'react-dom'; import Theme from 'sources/Theme'; import CloudWizard from './CloudWizard'; // Cloud Wizard define('pgadmin.misc.cloud', [ 'sources/gettext', 'sources/url_for', 'jquery', 'underscore', 'pgadmin.alertifyjs', 'pgadmin.browser', 'pgadmin.browser.wizard', ], function( gettext, url_for, $, _, Alertify, pgBrowser ) { // if module is already initialized, refer to that. if (pgBrowser.Cloud) { return pgBrowser.Cloud; } // Create an Object Cloud of pgBrowser class pgBrowser.Cloud = { init: function() { if (this.initialized) return; this.initialized = true; // Define the nodes on which the menus to be appear var menus = [{ name: 'register_and_deploy_cloud_instance', module: this, applies: ['object', 'context'], callback: 'start_cloud_wizard', priority: 15, label: gettext('Deploy Cloud Instance...'), icon: 'wcTabIcon icon-server', enable: true, data: {action: 'create'}, category: 'register', node: 'server_group', }, { name: 'register_and_deploy_cloud_instance', module: this, applies: ['object', 'context'], callback: 'start_cloud_wizard', priority: 15, label: gettext('Deploy Cloud Instance...'), icon: 'wcTabIcon icon-server', enable: true, data: {action: 'create'}, category: 'register', node: 'server', }]; pgBrowser.add_menus(menus); return this; }, // Callback to draw Wizard Dialog start_cloud_wizard: function() { // Declare Wizard dialog if (!Alertify.cloudWizardDialog) { Alertify.dialog('cloudWizardDialog', function factory() { // Generate wizard main container var $container = $('
'); return { main: function () { /*This is intentional (SonarQube)*/ }, setup: function () { return { // Set options for dialog options: { frameless: true, resizable: true, autoReset: false, maximizable: true, closable: true, closableByDimmer: false, modal: true, pinnable: false, }, }; }, build: function () { this.elements.content.appendChild($container.get(0)); Alertify.pgDialogBuild.apply(this); var t = pgBrowser.tree, i = t.selected(), d = this.d = i ? t.itemData(i) : undefined, info = this.info = pgBrowser.tree.getTreeNodeHierarchy(i); setTimeout(function () { if (document.getElementById('cloudWizardDlg')) { ReactDOM.render(