private ConnectionTab CreateTab(String title, MessageProducer msgProducer) { TabPage tabPage = new TabPage(); tabPage.Text = title; RichTextBox tb = new RichTextBox(); tb.ReadOnly = false; tb.Dock = DockStyle.Fill; tabPage.Controls.Add(tb); TabControlConnections.Controls.Add(tabPage); TabControlConnections.SelectedIndex = TabControlConnections.TabCount - 1; ConnectionTab tab = new ConnectionTab(tabPage, tb, msgProducer, this); ConnectionTabs.Add(tab); return(tab); }
private void startJBossToolStripMenuItem_Click(object sender, EventArgs e) { if (JBossCommand != null) { MessageBox.Show("JBoss already running!"); return; } this.Cursor = Cursors.WaitCursor; JBossCommand = new LocalCommand(); this.SuspendLayout(); ConnectionTab tab = CreateTab("JBoss", JBossCommand); JBossCommand.ExecuteCommand(Settings.Default.JBossCommand, Settings.Default.JBossCommandArguments, Settings.Default.JBossTerminate, Settings.Default.JBossTerminateArguments); this.ResumeLayout(); this.Cursor = Cursors.Default; }
private void localTerminalToolStripMenuItem_Click(object sender, EventArgs e) { if (JBossCommand != null) { MessageBox.Show("local terminal already active!"); return; } this.Cursor = Cursors.WaitCursor; LocalTerminalCommand = new LocalCommand(); this.SuspendLayout(); ConnectionTab tab = CreateTab("Local Terminal", LocalTerminalCommand); LocalTerminalCommand.ExecuteCommand(Settings.Default.LocalTerminal); this.ResumeLayout(); this.Cursor = Cursors.Default; LocalTerminalCommand.SendCommand("ls"); }
private void Connect(ConnectionInfo con) { if (String.IsNullOrWhiteSpace(Password)) { DialogResult res = Login(); if (res != DialogResult.OK) { return; } } con.Password = Password; con.UserName = Settings.Default.UserName; this.Cursor = Cursors.WaitCursor; SSHConnection ssh = new SSHConnection(); if (!ssh.Connect(con)) { Password = ""; Connect(con); this.Cursor = Cursors.Default; return; } this.SuspendLayout(); ConnectionTab tab = CreateTab(String.Format("{0} - {1}", con.ConnectionName, con.Host), ssh); //commandString = "tail -f /apps/jboss/wildfly/standalone/log/server.log"; //tab.Connection.ExecuteCommand("tail -f -n 100 /apps/jboss/wildfly/standalone/log/server.log"); this.ResumeLayout(); this.Cursor = Cursors.Default; }