diff --git a/AddPortMapForm.Designer.cs b/AddPortMapForm.Designer.cs index 451de07..f7d940d 100644 --- a/AddPortMapForm.Designer.cs +++ b/AddPortMapForm.Designer.cs @@ -28,6 +28,7 @@ /// private void InitializeComponent() { + this.components = new System.ComponentModel.Container(); System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(AddPortMapForm)); this.cancelButton = new System.Windows.Forms.Button(); this.okButton = new System.Windows.Forms.Button(); @@ -44,8 +45,9 @@ this.label6 = new System.Windows.Forms.Label(); this.tcpRadioButton = new System.Windows.Forms.RadioButton(); this.udpRadioButton = new System.Windows.Forms.RadioButton(); - this.ruleNameTextBox = new System.Windows.Forms.TextBox(); + this.nameTextBox = new System.Windows.Forms.TextBox(); this.label8 = new System.Windows.Forms.Label(); + this.mainToolTip = new System.Windows.Forms.ToolTip(this.components); ((System.ComponentModel.ISupportInitialize)(this.localNumericUpDown)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.remoteNumericUpDown)).BeginInit(); this.SuspendLayout(); @@ -171,15 +173,17 @@ this.udpRadioButton.UseVisualStyleBackColor = true; this.udpRadioButton.CheckedChanged += new System.EventHandler(this.tcpRadioButton_CheckedChanged); // - // ruleNameTextBox + // nameTextBox // - resources.ApplyResources(this.ruleNameTextBox, "ruleNameTextBox"); - this.ruleNameTextBox.Name = "ruleNameTextBox"; + resources.ApplyResources(this.nameTextBox, "nameTextBox"); + this.nameTextBox.Name = "nameTextBox"; + this.mainToolTip.SetToolTip(this.nameTextBox, resources.GetString("nameTextBox.ToolTip")); // // label8 // resources.ApplyResources(this.label8, "label8"); this.label8.Name = "label8"; + this.mainToolTip.SetToolTip(this.label8, resources.GetString("label8.ToolTip")); // // AddPortMapForm // @@ -187,7 +191,7 @@ resources.ApplyResources(this, "$this"); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.CancelButton = this.cancelButton; - this.Controls.Add(this.ruleNameTextBox); + this.Controls.Add(this.nameTextBox); this.Controls.Add(this.label8); this.Controls.Add(this.udpRadioButton); this.Controls.Add(this.tcpRadioButton); @@ -233,7 +237,8 @@ private System.Windows.Forms.Label label6; private System.Windows.Forms.RadioButton tcpRadioButton; private System.Windows.Forms.RadioButton udpRadioButton; - private System.Windows.Forms.TextBox ruleNameTextBox; + private System.Windows.Forms.TextBox nameTextBox; private System.Windows.Forms.Label label8; + private System.Windows.Forms.ToolTip mainToolTip; } } \ No newline at end of file diff --git a/AddPortMapForm.cs b/AddPortMapForm.cs index 9537348..0265807 100644 --- a/AddPortMapForm.cs +++ b/AddPortMapForm.cs @@ -1,11 +1,4 @@ using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Data; -using System.Drawing; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using System.Windows.Forms; namespace MeshCentralRouter @@ -21,7 +14,7 @@ namespace MeshCentralRouter InitializeComponent(); } - public string getRuleName() { return ruleNameTextBox.Text; } + public string getName() { return nameTextBox.Text; } public int getProtocol() { return (int)(tcpRadioButton.Checked?1:2); } public int getLocalPort() { return (int)localNumericUpDown.Value; } public int getRemotePort() { return (int)remoteNumericUpDown.Value; } @@ -50,12 +43,34 @@ namespace MeshCentralRouter } } + // If the user has indivitual device rights, add an extra device group + if (meshcentral.userRights != null) + { + bool indivitualDevices = false; + foreach (string id in meshcentral.userRights.Keys) { if (id.StartsWith("node/")) { indivitualDevices = true; } } + if (indivitualDevices) + { + MeshClass m = new MeshClass(); + m.name = Properties.Resources.IndividualDevices; + groupComboBox.Items.Add(m); + } + } + // Set default selection if (groupComboBox.Items.Count > 0) { groupComboBox.SelectedIndex = 0; } appComboBox.SelectedIndex = 1; fillNodesInDropDown(); } else { - groupComboBox.Items.Add(selectedNode.mesh); + if (selectedNode.mesh == null) + { + MeshClass m = new MeshClass(); + m.name = Properties.Resources.IndividualDevices; + groupComboBox.Items.Add(m); + } + else + { + groupComboBox.Items.Add(selectedNode.mesh); + } groupComboBox.SelectedIndex = 0; groupComboBox.Enabled = false; nodeComboBox.Items.Add(selectedNode); @@ -63,6 +78,7 @@ namespace MeshCentralRouter nodeComboBox.Enabled = false; appComboBox.SelectedIndex = 1; } + nameTextBox.Focus(); } private void fillNodesInDropDown() @@ -73,10 +89,13 @@ namespace MeshCentralRouter // Fill the nodes dropdown nodeComboBox.Items.Clear(); - foreach (string nodeid in meshcentral.nodes.Keys) + if (meshcentral.nodes != null) { - NodeClass node = meshcentral.nodes[nodeid]; - if ((node.meshid == mesh.meshid) && ((node.conn & 1) != 0)) { nodeComboBox.Items.Add(node); } + foreach (string nodeid in meshcentral.nodes.Keys) + { + NodeClass node = meshcentral.nodes[nodeid]; + if (((node.meshid == mesh.meshid) || ((mesh.meshid == null) && (meshcentral.userRights.ContainsKey(node.nodeid)))) && ((node.conn & 1) != 0)) { nodeComboBox.Items.Add(node); } + } } if (nodeComboBox.Items.Count > 0) { nodeComboBox.SelectedIndex = 0; } diff --git a/AddPortMapForm.resx b/AddPortMapForm.resx index 99d8fef..dc78a90 100644 --- a/AddPortMapForm.resx +++ b/AddPortMapForm.resx @@ -123,7 +123,7 @@ - 288, 194 + 288, 200 75, 23 @@ -151,7 +151,7 @@ Bottom, Right - 207, 194 + 207, 200 75, 23 @@ -178,7 +178,7 @@ Top, Left, Right - 157, 60 + 157, 63 206, 20 @@ -205,7 +205,7 @@ True - 12, 62 + 12, 65 55, 13 @@ -232,7 +232,7 @@ Top, Left, Right - 157, 113 + 157, 116 206, 21 @@ -256,7 +256,7 @@ True - 12, 116 + 12, 119 81, 13 @@ -283,7 +283,7 @@ True - 12, 169 + 12, 172 66, 13 @@ -310,7 +310,7 @@ Top, Left, Right - 157, 167 + 157, 170 206, 20 @@ -337,7 +337,7 @@ True - 12, 143 + 12, 146 59, 13 @@ -382,7 +382,7 @@ WinSCP - 157, 140 + 157, 143 206, 21 @@ -406,7 +406,7 @@ True - 12, 89 + 12, 92 73, 13 @@ -433,7 +433,7 @@ Top, Left, Right - 157, 86 + 157, 89 206, 21 @@ -457,7 +457,7 @@ True - 12, 36 + 12, 39 46, 13 @@ -484,7 +484,7 @@ True - 157, 36 + 157, 39 46, 17 @@ -511,7 +511,7 @@ True - 209, 36 + 209, 39 48, 17 @@ -534,30 +534,39 @@ 2 - + Top, Left, Right - + 157, 10 - + 206, 20 - + 20 - - ruleNameTextBox + + 17, 17 + + + Optional mapping name - + + nameTextBox + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - + $this - + 0 + + 17, 17 + True @@ -568,13 +577,16 @@ 12, 13 - 60, 13 + 35, 13 19 - Rule Name + Name + + + Optional mapping name label8 @@ -595,7 +607,7 @@ 6, 13 - 375, 229 + 375, 235 @@ -2297,6 +2309,12 @@ Port Mapping + + mainToolTip + + + System.Windows.Forms.ToolTip, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + AddPortMapForm diff --git a/AddRelayMapForm.Designer.cs b/AddRelayMapForm.Designer.cs index cfff2ff..0c947ac 100644 --- a/AddRelayMapForm.Designer.cs +++ b/AddRelayMapForm.Designer.cs @@ -28,6 +28,7 @@ /// private void InitializeComponent() { + this.components = new System.ComponentModel.Container(); System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(AddRelayMapForm)); this.cancelButton = new System.Windows.Forms.Button(); this.okButton = new System.Windows.Forms.Button(); @@ -46,8 +47,9 @@ this.udpRadioButton = new System.Windows.Forms.RadioButton(); this.tcpRadioButton = new System.Windows.Forms.RadioButton(); this.label7 = new System.Windows.Forms.Label(); - this.ruleNameTextBox = new System.Windows.Forms.TextBox(); + this.nameTextBox = new System.Windows.Forms.TextBox(); this.label8 = new System.Windows.Forms.Label(); + this.mainToolTip = new System.Windows.Forms.ToolTip(this.components); ((System.ComponentModel.ISupportInitialize)(this.localNumericUpDown)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.remoteNumericUpDown)).BeginInit(); this.SuspendLayout(); @@ -183,15 +185,17 @@ resources.ApplyResources(this.label7, "label7"); this.label7.Name = "label7"; // - // ruleNameTextBox + // nameTextBox // - resources.ApplyResources(this.ruleNameTextBox, "ruleNameTextBox"); - this.ruleNameTextBox.Name = "ruleNameTextBox"; + resources.ApplyResources(this.nameTextBox, "nameTextBox"); + this.nameTextBox.Name = "nameTextBox"; + this.mainToolTip.SetToolTip(this.nameTextBox, resources.GetString("nameTextBox.ToolTip")); // // label8 // resources.ApplyResources(this.label8, "label8"); this.label8.Name = "label8"; + this.mainToolTip.SetToolTip(this.label8, resources.GetString("label8.ToolTip")); // // AddRelayMapForm // @@ -199,7 +203,7 @@ resources.ApplyResources(this, "$this"); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.CancelButton = this.cancelButton; - this.Controls.Add(this.ruleNameTextBox); + this.Controls.Add(this.nameTextBox); this.Controls.Add(this.label8); this.Controls.Add(this.udpRadioButton); this.Controls.Add(this.tcpRadioButton); @@ -249,7 +253,8 @@ private System.Windows.Forms.RadioButton udpRadioButton; private System.Windows.Forms.RadioButton tcpRadioButton; private System.Windows.Forms.Label label7; - private System.Windows.Forms.TextBox ruleNameTextBox; + private System.Windows.Forms.TextBox nameTextBox; private System.Windows.Forms.Label label8; + private System.Windows.Forms.ToolTip mainToolTip; } } \ No newline at end of file diff --git a/AddRelayMapForm.cs b/AddRelayMapForm.cs index 81eb8f0..2706e59 100644 --- a/AddRelayMapForm.cs +++ b/AddRelayMapForm.cs @@ -1,12 +1,5 @@ using System; using System.Net; -using System.Collections.Generic; -using System.ComponentModel; -using System.Data; -using System.Drawing; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using System.Windows.Forms; namespace MeshCentralRouter @@ -23,7 +16,7 @@ namespace MeshCentralRouter updateInfo(); } - public string getRuleName() { return ruleNameTextBox.Text; } + public string getName() { return nameTextBox.Text; } public int getProtocol() { return (int)(tcpRadioButton.Checked ? 1 : 2); } public int getLocalPort() { return (int)localNumericUpDown.Value; } public int getRemotePort() { return (int)remoteNumericUpDown.Value; } @@ -53,12 +46,34 @@ namespace MeshCentralRouter } } + // If the user has indivitual device rights, add an extra device group + if (meshcentral.userRights != null) + { + bool indivitualDevices = false; + foreach (string id in meshcentral.userRights.Keys) { if (id.StartsWith("node/")) { indivitualDevices = true; } } + if (indivitualDevices) + { + MeshClass m = new MeshClass(); + m.name = Properties.Resources.IndividualDevices; + groupComboBox.Items.Add(m); + } + } + // Set default selection if (groupComboBox.Items.Count > 0) { groupComboBox.SelectedIndex = 0; } appComboBox.SelectedIndex = 1; fillNodesInDropDown(); } else { - groupComboBox.Items.Add(selectedNode.mesh); + if (selectedNode.mesh == null) + { + MeshClass m = new MeshClass(); + m.name = Properties.Resources.IndividualDevices; + groupComboBox.Items.Add(m); + } + else + { + groupComboBox.Items.Add(selectedNode.mesh); + } groupComboBox.SelectedIndex = 0; groupComboBox.Enabled = false; nodeComboBox.Items.Add(selectedNode); @@ -66,6 +81,7 @@ namespace MeshCentralRouter nodeComboBox.Enabled = false; appComboBox.SelectedIndex = 1; } + nameTextBox.Focus(); } private void fillNodesInDropDown() @@ -75,10 +91,13 @@ namespace MeshCentralRouter // Fill the nodes dropdown nodeComboBox.Items.Clear(); - foreach (string nodeid in meshcentral.nodes.Keys) + if (meshcentral.nodes != null) { - NodeClass node = meshcentral.nodes[nodeid]; - if ((node.meshid == mesh.meshid) && ((node.conn & 1) != 0)) { nodeComboBox.Items.Add(node); } + foreach (string nodeid in meshcentral.nodes.Keys) + { + NodeClass node = meshcentral.nodes[nodeid]; + if (((node.meshid == mesh.meshid) || ((mesh.meshid == null) && (meshcentral.userRights.ContainsKey(node.nodeid)))) && ((node.conn & 1) != 0)) { nodeComboBox.Items.Add(node); } + } } if (nodeComboBox.Items.Count > 0) { nodeComboBox.SelectedIndex = 0; } diff --git a/AddRelayMapForm.resx b/AddRelayMapForm.resx index 2b59855..e530b72 100644 --- a/AddRelayMapForm.resx +++ b/AddRelayMapForm.resx @@ -123,7 +123,7 @@ - 288, 220 + 288, 225 75, 23 @@ -151,7 +151,7 @@ Bottom, Right - 207, 220 + 207, 225 75, 23 @@ -178,7 +178,7 @@ Top, Left, Right - 157, 59 + 157, 63 206, 20 @@ -205,7 +205,7 @@ True - 12, 61 + 12, 65 55, 13 @@ -232,7 +232,7 @@ Top, Left, Right - 157, 112 + 157, 116 206, 21 @@ -256,7 +256,7 @@ True - 12, 115 + 12, 119 71, 13 @@ -283,7 +283,7 @@ True - 12, 194 + 12, 198 66, 13 @@ -310,7 +310,7 @@ Top, Left, Right - 157, 192 + 157, 196 206, 20 @@ -337,7 +337,7 @@ True - 12, 142 + 12, 146 59, 13 @@ -382,7 +382,7 @@ WinSCP - 157, 139 + 157, 143 206, 21 @@ -406,7 +406,7 @@ True - 12, 169 + 12, 173 57, 13 @@ -433,7 +433,7 @@ Top, Left, Right - 157, 166 + 157, 170 206, 20 @@ -463,7 +463,7 @@ True - 12, 88 + 12, 92 73, 13 @@ -490,7 +490,7 @@ Top, Left, Right - 157, 85 + 157, 89 206, 21 @@ -514,7 +514,7 @@ True - 209, 36 + 209, 39 48, 17 @@ -541,7 +541,7 @@ True - 157, 36 + 157, 39 46, 17 @@ -568,7 +568,7 @@ True - 12, 36 + 12, 39 46, 13 @@ -591,28 +591,34 @@ 4 - + Top, Left, Right - + 157, 10 - + 206, 20 - + 18 - - ruleNameTextBox + + 17, 17 + + + Optional mapping name - + + nameTextBox + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - + $this - + 0 @@ -625,13 +631,16 @@ 12, 13 - 60, 13 + 35, 13 17 - Rule Name + Name + + + Optional mapping name label8 @@ -652,7 +661,7 @@ 6, 13 - 375, 255 + 375, 260 @@ -2354,6 +2363,12 @@ Relay Mapping + + mainToolTip + + + System.Windows.Forms.ToolTip, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + AddRelayMapForm diff --git a/DeviceUserControl.resx b/DeviceUserControl.resx index 188e742..ce43b5a 100644 --- a/DeviceUserControl.resx +++ b/DeviceUserControl.resx @@ -237,7 +237,7 @@ - 6, 3 + 4, 1 50, 50 @@ -266,7 +266,7 @@ Microsoft Sans Serif, 8.25pt, style=Bold - 62, 12 + 60, 10 235, 15 @@ -293,7 +293,7 @@ Top, Left, Right - 62, 32 + 60, 30 235, 15 @@ -338,7 +338,7 @@ System.Windows.Forms.ContextMenuStrip, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - 367, 6 + 365, 4 58, 47 @@ -362,14 +362,14 @@ 6 - 17, 17 + 15, 17 AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0 ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAAAy - mgAAAk1TRnQBSQFMAgEBCAEAAXABAAFwAQABMgEAATIBAAT/AREBAAj/AUIBTQE2BwABNgMAASgDAAHI + mgAAAk1TRnQBSQFMAgEBCAEAAXgBAAF4AQABMgEAATIBAAT/AREBAAj/AUIBTQE2BwABNgMAASgDAAHI AwABlgMAAQEBAAEQBQABYAHq/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A /wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A /wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A @@ -1030,14 +1030,14 @@ - 127, 17 + 125, 17 AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0 ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAAC4 - mgAAAk1TRnQBSQFMAgEBCAEAAXgBAAF4AQABMgEAATIBAAT/AREBAAj/AUIBTQE2BwABNgMAASgDAAHI + mgAAAk1TRnQBSQFMAgEBCAEAAYABAAGAAQABMgEAATIBAAT/AREBAAj/AUIBTQE2BwABNgMAASgDAAHI AwABlgMAAQEBAAEQBQABYAHq/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A /wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A /wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A @@ -1722,7 +1722,7 @@ System.Windows.Forms.ContextMenuStrip, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - 303, 6 + 301, 4 58, 23 @@ -1749,7 +1749,7 @@ Top, Right - 303, 30 + 301, 28 58, 23 @@ -1776,7 +1776,7 @@ Top, Right - 367, 30 + 365, 28 58, 23 @@ -1803,7 +1803,7 @@ Top, Right - 367, 6 + 365, 4 58, 23 @@ -1833,7 +1833,7 @@ 6, 13 - 429, 56 + 425, 52 setRDPPortToolStripMenuItem diff --git a/KVMControl.cs b/KVMControl.cs index 9519aa7..044ef36 100644 --- a/KVMControl.cs +++ b/KVMControl.cs @@ -545,6 +545,7 @@ namespace MeshCentralRouter private void KVMControl_KeyDown(object sender, KeyEventArgs e) { + if ((e.KeyCode == Keys.LWin) || (e.KeyCode == Keys.RWin)) return; // Don't process the Windows key SendKey(e, 0); e.Handled = true; } diff --git a/KVMViewer.Designer.cs b/KVMViewer.Designer.cs index 678c4fa..94e8aa7 100644 --- a/KVMViewer.Designer.cs +++ b/KVMViewer.Designer.cs @@ -51,6 +51,9 @@ namespace MeshCentralRouter this.toolStripStatusLabel1 = new System.Windows.Forms.ToolStripStatusLabel(); this.updateTimer = new System.Windows.Forms.Timer(this.components); this.topPanel = new System.Windows.Forms.Panel(); + this.clipOutboundButton = new System.Windows.Forms.Button(); + this.clipInboundButton = new System.Windows.Forms.Button(); + this.statsButton = new System.Windows.Forms.Button(); this.displaySelectComboBox = new System.Windows.Forms.ComboBox(); this.settingsButton = new System.Windows.Forms.Button(); this.zoomButton = new System.Windows.Forms.Button(); @@ -58,7 +61,7 @@ namespace MeshCentralRouter this.connectButton = new System.Windows.Forms.Button(); this.consoleMessage = new System.Windows.Forms.Label(); this.consoleTimer = new System.Windows.Forms.Timer(this.components); - this.statsButton = new System.Windows.Forms.Button(); + this.mainToolTip = new System.Windows.Forms.ToolTip(this.components); this.resizeKvmControl = new MeshCentralRouter.KVMResizeControl(); this.mainStatusStrip.SuspendLayout(); this.topPanel.SuspendLayout(); @@ -93,6 +96,8 @@ namespace MeshCentralRouter // topPanel // this.topPanel.BackColor = System.Drawing.SystemColors.Control; + this.topPanel.Controls.Add(this.clipOutboundButton); + this.topPanel.Controls.Add(this.clipInboundButton); this.topPanel.Controls.Add(this.statsButton); this.topPanel.Controls.Add(this.displaySelectComboBox); this.topPanel.Controls.Add(this.settingsButton); @@ -102,6 +107,35 @@ namespace MeshCentralRouter resources.ApplyResources(this.topPanel, "topPanel"); this.topPanel.Name = "topPanel"; // + // clipOutboundButton + // + resources.ApplyResources(this.clipOutboundButton, "clipOutboundButton"); + this.clipOutboundButton.Image = global::MeshCentralRouter.Properties.Resources.icon_clipboard_out; + this.clipOutboundButton.Name = "clipOutboundButton"; + this.clipOutboundButton.TabStop = false; + this.mainToolTip.SetToolTip(this.clipOutboundButton, resources.GetString("clipOutboundButton.ToolTip")); + this.clipOutboundButton.UseVisualStyleBackColor = true; + this.clipOutboundButton.Click += new System.EventHandler(this.clipOutboundButton_Click); + // + // clipInboundButton + // + resources.ApplyResources(this.clipInboundButton, "clipInboundButton"); + this.clipInboundButton.Image = global::MeshCentralRouter.Properties.Resources.icon_clipboard_in; + this.clipInboundButton.Name = "clipInboundButton"; + this.clipInboundButton.TabStop = false; + this.mainToolTip.SetToolTip(this.clipInboundButton, resources.GetString("clipInboundButton.ToolTip")); + this.clipInboundButton.UseVisualStyleBackColor = true; + this.clipInboundButton.Click += new System.EventHandler(this.clipInboundButton_Click); + // + // statsButton + // + resources.ApplyResources(this.statsButton, "statsButton"); + this.statsButton.Name = "statsButton"; + this.statsButton.TabStop = false; + this.mainToolTip.SetToolTip(this.statsButton, resources.GetString("statsButton.ToolTip")); + this.statsButton.UseVisualStyleBackColor = true; + this.statsButton.Click += new System.EventHandler(this.statsButton_Click); + // // displaySelectComboBox // this.displaySelectComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; @@ -115,14 +149,17 @@ namespace MeshCentralRouter resources.ApplyResources(this.settingsButton, "settingsButton"); this.settingsButton.Name = "settingsButton"; this.settingsButton.TabStop = false; + this.mainToolTip.SetToolTip(this.settingsButton, resources.GetString("settingsButton.ToolTip")); this.settingsButton.UseVisualStyleBackColor = true; this.settingsButton.Click += new System.EventHandler(this.settingsToolStripMenuItem_Click); // // zoomButton // resources.ApplyResources(this.zoomButton, "zoomButton"); + this.zoomButton.Image = global::MeshCentralRouter.Properties.Resources.ZoomToFit; this.zoomButton.Name = "zoomButton"; this.zoomButton.TabStop = false; + this.mainToolTip.SetToolTip(this.zoomButton, resources.GetString("zoomButton.ToolTip")); this.zoomButton.UseVisualStyleBackColor = true; this.zoomButton.Click += new System.EventHandler(this.zoomButton_Click); // @@ -131,6 +168,7 @@ namespace MeshCentralRouter resources.ApplyResources(this.cadButton, "cadButton"); this.cadButton.Name = "cadButton"; this.cadButton.TabStop = false; + this.mainToolTip.SetToolTip(this.cadButton, resources.GetString("cadButton.ToolTip")); this.cadButton.UseVisualStyleBackColor = true; this.cadButton.Click += new System.EventHandler(this.sendCtrlAltDelToolStripMenuItem_Click); // @@ -139,6 +177,7 @@ namespace MeshCentralRouter resources.ApplyResources(this.connectButton, "connectButton"); this.connectButton.Name = "connectButton"; this.connectButton.TabStop = false; + this.mainToolTip.SetToolTip(this.connectButton, resources.GetString("connectButton.ToolTip")); this.connectButton.UseVisualStyleBackColor = true; this.connectButton.Click += new System.EventHandler(this.MenuItemDisconnect_Click); // @@ -153,14 +192,6 @@ namespace MeshCentralRouter this.consoleTimer.Interval = 5000; this.consoleTimer.Tick += new System.EventHandler(this.consoleTimer_Tick); // - // statsButton - // - resources.ApplyResources(this.statsButton, "statsButton"); - this.statsButton.Name = "statsButton"; - this.statsButton.TabStop = false; - this.statsButton.UseVisualStyleBackColor = true; - this.statsButton.Click += new System.EventHandler(this.statsButton_Click); - // // resizeKvmControl // this.resizeKvmControl.BackColor = System.Drawing.Color.Gray; @@ -206,6 +237,9 @@ namespace MeshCentralRouter private Label consoleMessage; private Timer consoleTimer; private Button statsButton; + private Button clipInboundButton; + private Button clipOutboundButton; + private ToolTip mainToolTip; } } diff --git a/KVMViewer.cs b/KVMViewer.cs index 4a59b85..1a18435 100644 --- a/KVMViewer.cs +++ b/KVMViewer.cs @@ -101,7 +101,10 @@ namespace MeshCentralRouter randomIdHex = BitConverter.ToString(randomid).Replace("-", string.Empty); state = 1; - Uri u = new Uri(server.wsurl.ToString().Replace("/control.ashx", "/") + "meshrelay.ashx?browser=1&p=2&nodeid=" + node.nodeid + "&id=" + randomIdHex + "&auth=" + server.authCookie); + string ux = server.wsurl.ToString().Replace("/control.ashx", "/"); + int i = ux.IndexOf("?"); + if (i >= 0) { ux = ux.Substring(0, i); } + Uri u = new Uri(ux + "meshrelay.ashx?browser=1&p=2&nodeid=" + node.nodeid + "&id=" + randomIdHex + "&auth=" + server.authCookie); wc = new webSocketClient(); wc.onStateChanged += Wc_onStateChanged; wc.onBinaryData += Wc_onBinaryData; @@ -267,6 +270,8 @@ namespace MeshCentralRouter } cadButton.Enabled = (state == 3); + clipInboundButton.Enabled = (state == 3); + clipOutboundButton.Enabled = (state == 3); } private void updateTimer_Tick(object sender, EventArgs e) @@ -458,5 +463,22 @@ namespace MeshCentralRouter kvmStats.Close(); kvmStats = null; } + + private void clipInboundButton_Click(object sender, EventArgs e) + { + //string textData = "abc"; + //Clipboard.SetData(DataFormats.Text, (Object)textData); + server.sendCommand("{\"action\":\"msg\",\"type\":\"getclip\",\"nodeid\":\"" + node.nodeid + "\"}"); + } + + private void clipOutboundButton_Click(object sender, EventArgs e) + { + string textData = (string)Clipboard.GetData(DataFormats.Text); + if (textData != null) + { + textData = textData.Replace("\\", "\\\\").Replace("\"", "\\\""); + server.sendCommand("{\"action\":\"msg\",\"type\":\"setclip\",\"nodeid\":\"" + node.nodeid + "\",\"data\":\"" + textData + "\"}"); + } + } } } diff --git a/KVMViewer.resx b/KVMViewer.resx index c21acfc..3ff2688 100644 --- a/KVMViewer.resx +++ b/KVMViewer.resx @@ -167,7 +167,70 @@ 264, 17 + + False + + + NoControl + + + 324, 3 + + + 30, 26 + + + 9 + + + 509, 17 + + + Push local clipboard to remote device + + + clipOutboundButton + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + topPanel + + + 0 + + + False + + + NoControl + + + 288, 3 + + + 30, 26 + + + 8 + + + Pull clipboard from remote device + + + clipInboundButton + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + topPanel + + + 1 + Top, Right @@ -186,6 +249,9 @@ Stats + + Display connection statistics + statsButton @@ -196,10 +262,10 @@ topPanel - 0 + 2 - 383, 5 + 360, 5 128, 21 @@ -220,13 +286,13 @@ topPanel - 1 + 3 NoControl - 288, 3 + 193, 3 89, 26 @@ -237,6 +303,9 @@ Settings + + Change remote desktop settings + settingsButton @@ -247,22 +316,25 @@ topPanel - 2 + 4 + + + Top, Right NoControl - 193, 3 + 953, 3 - 89, 26 + 30, 26 4 - - Zoom-to-Fit + + Toggle zoom-to-fit mode zoomButton @@ -274,7 +346,10 @@ topPanel - 3 + 5 + + + False NoControl @@ -291,6 +366,9 @@ Ctrl-Alt-Del + + Send Ctrl-Alt-Del to remote device + cadButton @@ -301,7 +379,7 @@ topPanel - 4 + 6 NoControl @@ -318,6 +396,9 @@ Connect + + Toggle remote desktop connection + connectButton @@ -328,7 +409,7 @@ topPanel - 5 + 7 Top @@ -412,7 +493,7 @@ resizeKvmControl - MeshCentralRouter.KVMResizeControl, MeshCentralRouter, Version=1.0.7533.35016, Culture=neutral, PublicKeyToken=null + MeshCentralRouter.KVMResizeControl, MeshCentralRouter, Version=1.0.7564.25887, Culture=neutral, PublicKeyToken=null $this @@ -887,6 +968,12 @@ System.Windows.Forms.Timer, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + mainToolTip + + + System.Windows.Forms.ToolTip, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + KVMViewer diff --git a/MainForm.Designer.cs b/MainForm.Designer.cs index ada6bef..e5e487d 100644 --- a/MainForm.Designer.cs +++ b/MainForm.Designer.cs @@ -90,6 +90,7 @@ this.addMapToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.addRelayMapToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.toolStripMenuItem3 = new System.Windows.Forms.ToolStripSeparator(); + this.remoteDesktopToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.httpToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.httpsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.rdpToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); @@ -123,7 +124,7 @@ this.saveMappingsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.openMapFileDialog = new System.Windows.Forms.OpenFileDialog(); this.saveMapFileDialog = new System.Windows.Forms.SaveFileDialog(); - this.remoteDesktopToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.rememberCertCheckBox = new System.Windows.Forms.CheckBox(); this.panel5.SuspendLayout(); this.mainPanel.SuspendLayout(); this.mainTabControl.SuspendLayout(); @@ -394,6 +395,7 @@ // // panel3 // + this.panel3.Controls.Add(this.rememberCertCheckBox); this.panel3.Controls.Add(this.certDetailsTextBox); this.panel3.Controls.Add(this.certDetailsButton); this.panel3.Controls.Add(this.label4); @@ -616,6 +618,12 @@ this.toolStripMenuItem3.Name = "toolStripMenuItem3"; resources.ApplyResources(this.toolStripMenuItem3, "toolStripMenuItem3"); // + // remoteDesktopToolStripMenuItem + // + this.remoteDesktopToolStripMenuItem.Name = "remoteDesktopToolStripMenuItem"; + resources.ApplyResources(this.remoteDesktopToolStripMenuItem, "remoteDesktopToolStripMenuItem"); + this.remoteDesktopToolStripMenuItem.Click += new System.EventHandler(this.remoteDesktopToolStripMenuItem_Click); + // // httpToolStripMenuItem // this.httpToolStripMenuItem.Name = "httpToolStripMenuItem"; @@ -847,11 +855,11 @@ this.saveMapFileDialog.DefaultExt = "mcrouter"; resources.ApplyResources(this.saveMapFileDialog, "saveMapFileDialog"); // - // remoteDesktopToolStripMenuItem + // rememberCertCheckBox // - this.remoteDesktopToolStripMenuItem.Name = "remoteDesktopToolStripMenuItem"; - resources.ApplyResources(this.remoteDesktopToolStripMenuItem, "remoteDesktopToolStripMenuItem"); - this.remoteDesktopToolStripMenuItem.Click += new System.EventHandler(this.remoteDesktopToolStripMenuItem_Click); + resources.ApplyResources(this.rememberCertCheckBox, "rememberCertCheckBox"); + this.rememberCertCheckBox.Name = "rememberCertCheckBox"; + this.rememberCertCheckBox.UseVisualStyleBackColor = true; // // MainForm // @@ -996,6 +1004,7 @@ private System.Windows.Forms.ToolStripMenuItem addRelayMapToolStripMenuItem; private System.Windows.Forms.ToolStripSeparator toolStripMenuItem3; private System.Windows.Forms.ToolStripMenuItem remoteDesktopToolStripMenuItem; + private System.Windows.Forms.CheckBox rememberCertCheckBox; } } diff --git a/MainForm.cs b/MainForm.cs index 9421b4d..e1b1e1d 100644 --- a/MainForm.cs +++ b/MainForm.cs @@ -285,7 +285,6 @@ namespace MeshCentralRouter private void backButton5_Click(object sender, EventArgs e) { - authLoginUrl = null; meshcentral.disconnect(); } @@ -314,7 +313,16 @@ namespace MeshCentralRouter meshcentral.onStateChanged += Meshcentral_onStateChanged; meshcentral.onNodesChanged += Meshcentral_onNodesChanged; meshcentral.onLoginTokenChanged += Meshcentral_onLoginTokenChanged; - if (lastBadConnectCert != null) { meshcentral.okCertHash = lastBadConnectCert.GetCertHashString(); } + meshcentral.onClipboardData += Meshcentral_onClipboardData; + if (lastBadConnectCert != null) + { + meshcentral.okCertHash = lastBadConnectCert.GetCertHashString(); + } + else + { + string ignoreCert = loadFromRegistry("IgnoreCert"); + if (ignoreCert != null) { meshcentral.okCertHash = ignoreCert; } + } Uri serverurl = null; if (authLoginUrl != null) { @@ -329,8 +337,17 @@ namespace MeshCentralRouter } } + private void Meshcentral_onClipboardData(string nodeid, string data) + { + if (this.InvokeRequired) { this.Invoke(new MeshCentralServer.onClipboardDataHandler(Meshcentral_onClipboardData), nodeid, data); return; } + Clipboard.SetData(DataFormats.Text, (Object)data); + } + private void nextButton3_Click(object sender, EventArgs e) { + // If we need to remember this certificate + if (rememberCertCheckBox.Checked) { saveToRegistry("IgnoreCert", lastBadConnectCert.GetCertHashString()); } + // Attempt to login, ignore bad cert. addButton.Enabled = false; addRelayButton.Enabled = false; @@ -341,6 +358,7 @@ namespace MeshCentralRouter meshcentral.onStateChanged += Meshcentral_onStateChanged; meshcentral.onNodesChanged += Meshcentral_onNodesChanged; meshcentral.onLoginTokenChanged += Meshcentral_onLoginTokenChanged; + meshcentral.onClipboardData += Meshcentral_onClipboardData; meshcentral.okCertHash = lastBadConnectCert.GetCertHashString(); Uri serverurl = null; @@ -618,6 +636,7 @@ namespace MeshCentralRouter meshcentral.onStateChanged -= Meshcentral_onStateChanged; meshcentral.onNodesChanged -= Meshcentral_onNodesChanged; meshcentral = null; + authLoginUrl = null; } else if (state == 1) { stateLabel.Visible = false; //setPanel(1); @@ -815,7 +834,7 @@ namespace MeshCentralRouter MapUserControl map = new MapUserControl(); map.xdebug = debug; map.inaddrany = inaddrany; - map.ruleName = form.getRuleName(); + map.name = form.getName(); map.protocol = form.getProtocol(); map.localPort = form.getLocalPort(); map.remotePort = form.getRemotePort(); @@ -863,10 +882,16 @@ namespace MeshCentralRouter meshcentral = new MeshCentralServer(); meshcentral.debug = debug; meshcentral.ignoreCert = ignoreCert; - if (lastBadConnectCert != null) { meshcentral.okCertHash = lastBadConnectCert.GetCertHashString(); } + if (lastBadConnectCert != null) { + meshcentral.okCertHash = lastBadConnectCert.GetCertHashString(); + } else { + string ignoreCert = loadFromRegistry("IgnoreCert"); + if (ignoreCert != null) { meshcentral.okCertHash = ignoreCert; } + } meshcentral.onStateChanged += Meshcentral_onStateChanged; meshcentral.onNodesChanged += Meshcentral_onNodesChanged; meshcentral.onLoginTokenChanged += Meshcentral_onLoginTokenChanged; + meshcentral.onClipboardData += Meshcentral_onClipboardData; if (sendEmailToken == true) { sendEmailToken = false; @@ -943,7 +968,7 @@ namespace MeshCentralRouter MapUserControl map = new MapUserControl(); map.xdebug = debug; map.inaddrany = inaddrany; - map.ruleName = form.getRuleName(); + map.name = form.getName(); map.protocol = form.getProtocol(); map.localPort = form.getLocalPort(); map.remotePort = form.getRemotePort(); @@ -1244,7 +1269,7 @@ namespace MeshCentralRouter MapUserControl map = new MapUserControl(); map.xdebug = debug; map.inaddrany = inaddrany; - map.ruleName = x["ruleName"].ToString(); + if (x.ContainsKey("name")) { map.name = x["name"].ToString(); } else { map.name = ""; } map.protocol = (int)x["protocol"]; map.localPort = (int)x["localPort"]; if (x.ContainsKey("remoteIP")) { map.remoteIP = (string)x["remoteIP"]; } @@ -1286,7 +1311,7 @@ namespace MeshCentralRouter MeshMapper map = ((MapUserControl)c).mapper; if (mapCounter == 0) { text += " {\r\n"; } else { text += ",\r\n {\r\n"; } text += " \"nodeName\": \"" + mapCtrl.node.name + "\",\r\n"; - text += " \"ruleName\": \"" + mapCtrl.ruleName + "\",\r\n"; + if ((mapCtrl.name != null) && (mapCtrl.name != "")) { text += " \"name\": \"" + mapCtrl.name + "\",\r\n"; } text += " \"meshId\": \"" + mapCtrl.node.meshid + "\",\r\n"; text += " \"nodeId\": \"" + mapCtrl.node.nodeid + "\",\r\n"; text += " \"appId\": " + mapCtrl.appId + ",\r\n"; diff --git a/MainForm.resx b/MainForm.resx index 5cd6965..e9d3556 100644 --- a/MainForm.resx +++ b/MainForm.resx @@ -948,6 +948,36 @@ 1 + + Bottom, Left + + + True + + + 208, 255 + + + 145, 17 + + + 26 + + + Remember this certificate + + + rememberCertCheckBox + + + System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + panel3 + + + 0 + Top, Bottom, Left, Right @@ -976,7 +1006,7 @@ panel3 - 0 + 1 Bottom, Left @@ -1006,7 +1036,7 @@ panel3 - 1 + 2 Top, Left, Right @@ -1042,7 +1072,7 @@ panel3 - 2 + 3 Top, Left, Right @@ -1072,7 +1102,7 @@ panel3 - 3 + 4 Bottom, Right @@ -1102,7 +1132,7 @@ panel3 - 4 + 5 Bottom, Right @@ -1132,7 +1162,7 @@ panel3 - 5 + 6 Bottom, Left, Right @@ -1162,7 +1192,7 @@ panel3 - 6 + 7 Fill @@ -1393,7 +1423,7 @@ SCP - 171, 208 + 171, 186 devicesContextMenuStrip @@ -1409,7 +1439,7 @@ AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0 ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAADg - HQAAAk1TRnQBSQFMAgEBEAEAATABAAEQAQABEAEAARABAAT/ARkBAAj/AUIBTQE2BwABNgMAASgDAAFA + HQAAAk1TRnQBSQFMAgEBEAEAARgBAAEYAQABEAEAARABAAT/ARkBAAj/AUIBTQE2BwABNgMAASgDAAFA AwABUAMAAQEBAAEYBgABPP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AJYAA/0D+AP3A/sD/yEAA/0D+gP5 A/wD/xgAAfoB+wH6A/4qAAP9A/8tAAP7A88D1QPbA88D1AO+A9QYAAP8A90D4APjA90D4APUA+MSAAP8 AZEBjwF9AU4BaAEhAfQB9QH0JAAD/gPRA8YD+ioAAcYCxwHPAtAB2ALZA90DywPBA68DmgP3FQAD2APd @@ -1576,7 +1606,7 @@ 2, 88 - 450, 52 + 446, 52 5 @@ -1615,7 +1645,7 @@ 2, 88 - 450, 52 + 446, 52 4 @@ -1705,7 +1735,7 @@ 2, 79 - 450, 52 + 446, 52 4 @@ -5739,6 +5769,12 @@ Click "Add" to get started. System.Windows.Forms.ToolStripSeparator, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + remoteDesktopToolStripMenuItem + + + System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + httpToolStripMenuItem @@ -5841,12 +5877,6 @@ Click "Add" to get started. System.Windows.Forms.SaveFileDialog, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - remoteDesktopToolStripMenuItem - - - System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - MainForm diff --git a/MapUserControl.cs b/MapUserControl.cs index 4ceb8bf..a9e3c87 100644 --- a/MapUserControl.cs +++ b/MapUserControl.cs @@ -14,7 +14,7 @@ namespace MeshCentralRouter { public partial class MapUserControl : UserControl { - public string ruleName; + public string name; public int protocol; public int localPort; public string remoteIP = null; @@ -46,9 +46,9 @@ namespace MeshCentralRouter public void UpdateInfo() { - if(this.ruleName != null) + if ((name != null) && (name != "")) { - deviceNameLabel.Text = node.name + ": " + this.ruleName; + deviceNameLabel.Text = node.name + ": " + this.name; } else { diff --git a/MapUserControl.resx b/MapUserControl.resx index 41ae00a..7f2ee4a 100644 --- a/MapUserControl.resx +++ b/MapUserControl.resx @@ -119,7 +119,7 @@ - 6, 3 + 5, 3 50, 50 @@ -151,10 +151,10 @@ NoControl - 62, 12 + 60, 11 - 294, 15 + 280, 15 1 @@ -181,10 +181,10 @@ NoControl - 62, 32 + 60, 31 - 294, 15 + 280, 15 2 @@ -208,7 +208,7 @@ Top, Right - 348, 6 + 346, 4 75, 23 @@ -235,7 +235,7 @@ Top, Right - 348, 30 + 346, 28 75, 23 @@ -266,7 +266,7 @@ AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0 ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAAAy - mgAAAk1TRnQBSQFMAgEBCAEAAUgBAAFIAQABMgEAATIBAAT/AREBAAj/AUIBTQE2BwABNgMAASgDAAHI + mgAAAk1TRnQBSQFMAgEBCAEAAVABAAFQAQABMgEAATIBAAT/AREBAAj/AUIBTQE2BwABNgMAASgDAAHI AwABlgMAAQEBAAEQBQABYAHq/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A /wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A /wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A/wD/AP8A @@ -929,14 +929,8 @@ 156, 17 - - 152, 22 - - - Stats... - - 153, 48 + 109, 26 mainContextMenuStrip @@ -944,6 +938,12 @@ System.Windows.Forms.ContextMenuStrip, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + 108, 22 + + + Stats... + True @@ -951,7 +951,7 @@ 6, 13 - 429, 56 + 425, 58 deviceImageList diff --git a/MeshCentralRouter.csproj b/MeshCentralRouter.csproj index 451ba21..b207b4c 100644 --- a/MeshCentralRouter.csproj +++ b/MeshCentralRouter.csproj @@ -722,6 +722,9 @@ + + + diff --git a/MeshCentralServer.cs b/MeshCentralServer.cs index bde55f3..ddc2656 100644 --- a/MeshCentralServer.cs +++ b/MeshCentralServer.cs @@ -554,6 +554,21 @@ namespace MeshCentralRouter if ((onNodesChanged != null) && (nodes != null)) onNodesChanged(true); break; } + case "msg": + { + if (jsonAction.ContainsKey("type")) + { + string type = (string)jsonAction["type"]; + if ((type == "getclip") && (jsonAction.ContainsKey("data")) && (jsonAction.ContainsKey("nodeid"))) + { + // We requested the remote clipboard + string nodeid = (string)jsonAction["nodeid"]; + string clipData = (string)jsonAction["data"]; + if (onClipboardData != null) { onClipboardData(nodeid, clipData); } + } + } + break; + } default: { break; @@ -569,6 +584,8 @@ namespace MeshCentralRouter public event onNodeListChangedHandler onNodesChanged; public delegate void onLoginTokenChangedHandler(); public event onLoginTokenChangedHandler onLoginTokenChanged; + public delegate void onClipboardDataHandler(string nodeid, string data); + public event onClipboardDataHandler onClipboardData; public class xwebclient : IDisposable { diff --git a/Properties/Resources.Designer.cs b/Properties/Resources.Designer.cs index fcdfe63..5711f6a 100644 --- a/Properties/Resources.Designer.cs +++ b/Properties/Resources.Designer.cs @@ -165,6 +165,26 @@ namespace MeshCentralRouter.Properties { } } + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap icon_clipboard_in { + get { + object obj = ResourceManager.GetObject("icon-clipboard-in", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap icon_clipboard_out { + get { + object obj = ResourceManager.GetObject("icon-clipboard-out", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + /// /// Looks up a localized resource of type System.Drawing.Bitmap. /// @@ -175,6 +195,15 @@ namespace MeshCentralRouter.Properties { } } + /// + /// Looks up a localized string similar to (Individual Devices). + /// + internal static string IndividualDevices { + get { + return ResourceManager.GetString("IndividualDevices", resourceCulture); + } + } + /// /// Looks up a localized string similar to Invalid username or password. /// @@ -402,5 +431,15 @@ namespace MeshCentralRouter.Properties { return ((System.Drawing.Bitmap)(obj)); } } + + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap ZoomToFit { + get { + object obj = ResourceManager.GetObject("ZoomToFit", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } } } diff --git a/Properties/Resources.resx b/Properties/Resources.resx index a9b120e..eb4e213 100644 --- a/Properties/Resources.resx +++ b/Properties/Resources.resx @@ -124,6 +124,9 @@ ..\Resources\Folder36.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + Languages + Search @@ -145,9 +148,6 @@ Changing language will close this tool. Are you sure? - - Starting... - Unable to connect @@ -166,6 +166,9 @@ ..\Resources\MeshCentral.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\Resources\icon-clipboard-out.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + Offline @@ -199,34 +202,43 @@ , {0} connections. - - ..\Resources\icons01.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + Starting... + + + ..\Resources\50-Computer.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + (Individual Devices) Two-factor Authentication - - MQTT - MeshCentral - - Languages + + MQTT ..\Resources\Empty-Banner.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\Resources\icons01.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + , 1 connection. Unable to bind to local port + + ..\Resources\icon-clipboard-in.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + Invalid username or password - - ..\Resources\50-Computer.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\Resources\ZoomToFit.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a \ No newline at end of file diff --git a/Resources/MC2-Banner.png b/Resources/MC2-Banner.png index a01fe3c..c767607 100644 Binary files a/Resources/MC2-Banner.png and b/Resources/MC2-Banner.png differ diff --git a/Resources/ZoomToFit.png b/Resources/ZoomToFit.png new file mode 100644 index 0000000..f734049 Binary files /dev/null and b/Resources/ZoomToFit.png differ diff --git a/Resources/icon-clipboard-in.png b/Resources/icon-clipboard-in.png new file mode 100644 index 0000000..c2fa198 Binary files /dev/null and b/Resources/icon-clipboard-in.png differ diff --git a/Resources/icon-clipboard-out.png b/Resources/icon-clipboard-out.png new file mode 100644 index 0000000..61df5c9 Binary files /dev/null and b/Resources/icon-clipboard-out.png differ