如何将Gate One嵌入我们的Web应用中

 

var newTerminal = function() { // Introducing the superSandbox()! Use it to wrap any code that you don't want to load until dependencies are met. // In this example we won't call newTerminal() until GateOne.Terminal and GateOne.Terminal.Input are loaded. GateOne.Base.superSandbox("NewExternalTerm", ["GateOne.Terminal", "GateOne.Terminal.Input"], function(window, undefined) { "use strict"; var existingContainer = GateOne.Utils.getNode('#'+GateOne.prefs.prefix+'container'); var container = GateOne.Utils.createElement('div', { 'id': 'container', 'class': 'terminal', 'style': {'height': '100%', 'width': '100%'} }); var gateone = GateOne.Utils.getNode('#gateone'); // Don't actually submit the form if (!existingContainer) { gateone.appendChild(container); } else { container = existingContainer; } // Create the new terminal termNum = GateOne.Terminal.newTerminal(null, null, container); }); }; // Uses newExternalTerminal as GateOne.init()'s callback. // The callback will be called after Gate One is initialized. window.onload = function() { // Initialize Gate One: GateOne.init({ url: 'https://127.0.0.1', embedded: true, }, newTerminal); };

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/14233.html