diff --git a/KVMSettingsForm.Designer.cs b/KVMSettingsForm.Designer.cs index bd489da..95de29a 100644 --- a/KVMSettingsForm.Designer.cs +++ b/KVMSettingsForm.Designer.cs @@ -110,7 +110,7 @@ // pictureBox1 // resources.ApplyResources(this.pictureBox1, "pictureBox1"); - this.pictureBox1.Image = global::MeshCentralRouter.Properties.Resources._50_Computer; + this.pictureBox1.Image = global::MeshCentralRouter.Properties.Resources.Computer50; this.pictureBox1.Name = "pictureBox1"; this.pictureBox1.TabStop = false; // diff --git a/KVMViewer.Designer.cs b/KVMViewer.Designer.cs index 94e8aa7..e7bb83e 100644 --- a/KVMViewer.Designer.cs +++ b/KVMViewer.Designer.cs @@ -110,7 +110,7 @@ namespace MeshCentralRouter // clipOutboundButton // resources.ApplyResources(this.clipOutboundButton, "clipOutboundButton"); - this.clipOutboundButton.Image = global::MeshCentralRouter.Properties.Resources.icon_clipboard_out; + this.clipOutboundButton.Image = global::MeshCentralRouter.Properties.Resources.iconClipboardOut; this.clipOutboundButton.Name = "clipOutboundButton"; this.clipOutboundButton.TabStop = false; this.mainToolTip.SetToolTip(this.clipOutboundButton, resources.GetString("clipOutboundButton.ToolTip")); @@ -120,7 +120,7 @@ namespace MeshCentralRouter // clipInboundButton // resources.ApplyResources(this.clipInboundButton, "clipInboundButton"); - this.clipInboundButton.Image = global::MeshCentralRouter.Properties.Resources.icon_clipboard_in; + this.clipInboundButton.Image = global::MeshCentralRouter.Properties.Resources.iconClipboardIn; this.clipInboundButton.Name = "clipInboundButton"; this.clipInboundButton.TabStop = false; this.mainToolTip.SetToolTip(this.clipInboundButton, resources.GetString("clipInboundButton.ToolTip")); diff --git a/KVMViewer.resx b/KVMViewer.resx index 3ff2688..b6588c7 100644 --- a/KVMViewer.resx +++ b/KVMViewer.resx @@ -175,7 +175,7 @@ NoControl - 324, 3 + 288, 3 30, 26 @@ -208,7 +208,7 @@ NoControl - 288, 3 + 324, 3 30, 26 @@ -493,7 +493,7 @@ resizeKvmControl - MeshCentralRouter.KVMResizeControl, MeshCentralRouter, Version=1.0.7564.25887, Culture=neutral, PublicKeyToken=null + MeshCentralRouter.KVMResizeControl, MeshCentralRouter, Version=1.0.7564.28683, Culture=neutral, PublicKeyToken=null $this diff --git a/MainForm.Designer.cs b/MainForm.Designer.cs index e5e487d..dd0e9e8 100644 --- a/MainForm.Designer.cs +++ b/MainForm.Designer.cs @@ -63,6 +63,7 @@ this.label2 = new System.Windows.Forms.Label(); this.tabPage3 = new System.Windows.Forms.TabPage(); this.panel3 = new System.Windows.Forms.Panel(); + this.rememberCertCheckBox = new System.Windows.Forms.CheckBox(); this.certDetailsTextBox = new System.Windows.Forms.TextBox(); this.certDetailsButton = new System.Windows.Forms.Button(); this.label4 = new System.Windows.Forms.Label(); @@ -124,7 +125,7 @@ this.saveMappingsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.openMapFileDialog = new System.Windows.Forms.OpenFileDialog(); this.saveMapFileDialog = new System.Windows.Forms.SaveFileDialog(); - this.rememberCertCheckBox = new System.Windows.Forms.CheckBox(); + this.tokenRememberCheckBox = new System.Windows.Forms.CheckBox(); this.panel5.SuspendLayout(); this.mainPanel.SuspendLayout(); this.mainTabControl.SuspendLayout(); @@ -308,6 +309,7 @@ // // panel2 // + this.panel2.Controls.Add(this.tokenRememberCheckBox); this.panel2.Controls.Add(this.emailTokenButton); this.panel2.Controls.Add(this.smsTokenButton); this.panel2.Controls.Add(this.tokenEmailSentLabel); @@ -406,6 +408,12 @@ resources.ApplyResources(this.panel3, "panel3"); this.panel3.Name = "panel3"; // + // rememberCertCheckBox + // + resources.ApplyResources(this.rememberCertCheckBox, "rememberCertCheckBox"); + this.rememberCertCheckBox.Name = "rememberCertCheckBox"; + this.rememberCertCheckBox.UseVisualStyleBackColor = true; + // // certDetailsTextBox // resources.ApplyResources(this.certDetailsTextBox, "certDetailsTextBox"); @@ -855,11 +863,11 @@ this.saveMapFileDialog.DefaultExt = "mcrouter"; resources.ApplyResources(this.saveMapFileDialog, "saveMapFileDialog"); // - // rememberCertCheckBox + // tokenRememberCheckBox // - resources.ApplyResources(this.rememberCertCheckBox, "rememberCertCheckBox"); - this.rememberCertCheckBox.Name = "rememberCertCheckBox"; - this.rememberCertCheckBox.UseVisualStyleBackColor = true; + resources.ApplyResources(this.tokenRememberCheckBox, "tokenRememberCheckBox"); + this.tokenRememberCheckBox.Name = "tokenRememberCheckBox"; + this.tokenRememberCheckBox.UseVisualStyleBackColor = true; // // MainForm // @@ -1005,6 +1013,7 @@ private System.Windows.Forms.ToolStripSeparator toolStripMenuItem3; private System.Windows.Forms.ToolStripMenuItem remoteDesktopToolStripMenuItem; private System.Windows.Forms.CheckBox rememberCertCheckBox; + private System.Windows.Forms.CheckBox tokenRememberCheckBox; } } diff --git a/MainForm.cs b/MainForm.cs index e1b1e1d..ae6aaac 100644 --- a/MainForm.cs +++ b/MainForm.cs @@ -51,13 +51,6 @@ namespace MeshCentralRouter public ArrayList mappingsToSetup = null; public bool deviceListViewMode = true; - public void setRegValue(string name, string value) { - try { Registry.SetValue(@"HKEY_CURRENT_USER\SOFTWARE\Open Source\MeshCentral Router", name, value); } catch (Exception) { } - } - public string getRegValue(string name, string value) { - try { return Registry.GetValue(@"HKEY_CURRENT_USER\SOFTWARE\Open Source\MeshCentral Router", name, value).ToString(); } catch (Exception) { return value; } - } - public bool isRouterHooked() { try @@ -144,13 +137,13 @@ namespace MeshCentralRouter [DllImport("user32.dll", CharSet = CharSet.Auto)] private static extern Int32 SendMessage(IntPtr hWnd, int msg, int wParam, [MarshalAs(UnmanagedType.LPWStr)]string lParam); - public static void saveToRegistry(string name, string value) + public void setRegValue(string name, string value) { - try { Registry.SetValue(@"HKEY_CURRENT_USER\SOFTWARE\OpenSource\MeshRouter", name, value); } catch (Exception) { } + try { Registry.SetValue(@"HKEY_CURRENT_USER\SOFTWARE\Open Source\MeshCentral Router", name, value); } catch (Exception) { } } - public static string loadFromRegistry(string name) + public string getRegValue(string name, string value) { - try { return Registry.GetValue(@"HKEY_CURRENT_USER\SOFTWARE\OpenSource\MeshRouter", name, "").ToString(); } catch (Exception) { return ""; } + try { return Registry.GetValue(@"HKEY_CURRENT_USER\SOFTWARE\Open Source\MeshCentral Router", name, value).ToString(); } catch (Exception) { return value; } } public MainForm(string[] args) @@ -165,8 +158,8 @@ namespace MeshCentralRouter Version version = Assembly.GetEntryAssembly().GetName().Version; versionLabel.Text = "v" + version.Major + "." + version.Minor + "." + version.Build; - serverNameComboBox.Text = loadFromRegistry("ServerName"); - userNameTextBox.Text = loadFromRegistry("UserName"); + serverNameComboBox.Text = getRegValue("ServerName", ""); + userNameTextBox.Text = getRegValue("UserName", ""); title = this.Text; int argflags = 0; @@ -203,6 +196,7 @@ namespace MeshCentralRouter currentPanel = newPanel; // Setup stuff + if (newPanel == 1) { tokenRememberCheckBox.Checked = false; } nextButton2.Enabled = (tokenTextBox.Text.Replace(" ", "") != ""); } @@ -314,16 +308,21 @@ namespace MeshCentralRouter meshcentral.onNodesChanged += Meshcentral_onNodesChanged; meshcentral.onLoginTokenChanged += Meshcentral_onLoginTokenChanged; meshcentral.onClipboardData += Meshcentral_onClipboardData; + meshcentral.onTwoFactorCookie += Meshcentral_onTwoFactorCookie; if (lastBadConnectCert != null) { meshcentral.okCertHash = lastBadConnectCert.GetCertHashString(); } else { - string ignoreCert = loadFromRegistry("IgnoreCert"); + string ignoreCert = getRegValue("IgnoreCert", null); if (ignoreCert != null) { meshcentral.okCertHash = ignoreCert; } } + // Load two factor cookie if present + string twoFactorCookie = getRegValue("TwoFactorCookie", null); + if ((twoFactorCookie != null) && (twoFactorCookie != "")) { twoFactorCookie = "cookie=" + twoFactorCookie; } else { twoFactorCookie = null; } + Uri serverurl = null; if (authLoginUrl != null) { try { @@ -333,7 +332,7 @@ namespace MeshCentralRouter meshcentral.connect(serverurl, null, null, null); } else { try { serverurl = new Uri("wss://" + serverNameComboBox.Text + "/control.ashx"); } catch (Exception) { } - meshcentral.connect(serverurl, userNameTextBox.Text, passwordTextBox.Text, null); + meshcentral.connect(serverurl, userNameTextBox.Text, passwordTextBox.Text, twoFactorCookie); } } @@ -343,10 +342,16 @@ namespace MeshCentralRouter Clipboard.SetData(DataFormats.Text, (Object)data); } + private void Meshcentral_onTwoFactorCookie(string cookie) + { + if (this.InvokeRequired) { this.Invoke(new MeshCentralServer.twoFactorCookieHandler(Meshcentral_onTwoFactorCookie), cookie); return; } + setRegValue("TwoFactorCookie", cookie); + } + private void nextButton3_Click(object sender, EventArgs e) { // If we need to remember this certificate - if (rememberCertCheckBox.Checked) { saveToRegistry("IgnoreCert", lastBadConnectCert.GetCertHashString()); } + if (rememberCertCheckBox.Checked) { setRegValue("IgnoreCert", lastBadConnectCert.GetCertHashString()); } // Attempt to login, ignore bad cert. addButton.Enabled = false; @@ -359,6 +364,7 @@ namespace MeshCentralRouter meshcentral.onNodesChanged += Meshcentral_onNodesChanged; meshcentral.onLoginTokenChanged += Meshcentral_onLoginTokenChanged; meshcentral.onClipboardData += Meshcentral_onClipboardData; + meshcentral.onTwoFactorCookie += Meshcentral_onTwoFactorCookie; meshcentral.okCertHash = lastBadConnectCert.GetCertHashString(); Uri serverurl = null; @@ -367,8 +373,11 @@ namespace MeshCentralRouter serverurl = new Uri("wss://" + authLoginUrl.Host + ":" + ((authLoginUrl.Port > 0) ? authLoginUrl.Port : 443) + authLoginUrl.LocalPath + "?auth=" + getValueFromQueryString(authLoginUrl.Query, "c")); meshcentral.connect(serverurl, null, null, null); } else { + // Load two factor cookie if present + string twoFactorCookie = getRegValue("TwoFactorCookie", null); + if ((twoFactorCookie != null) && (twoFactorCookie != "")) { twoFactorCookie = "cookie=" + twoFactorCookie; } else { twoFactorCookie = null; } serverurl = new Uri("wss://" + serverNameComboBox.Text + "/control.ashx"); - meshcentral.connect(serverurl, userNameTextBox.Text, passwordTextBox.Text, null); + meshcentral.connect(serverurl, userNameTextBox.Text, passwordTextBox.Text, twoFactorCookie); } } @@ -577,6 +586,13 @@ namespace MeshCentralRouter smsTokenButton.Left = emailTokenButton.Left; } tokenTextBox.Text = ""; + if (meshcentral.twoFactorCookieDays > 0) { + tokenRememberCheckBox.Visible = true; + tokenRememberCheckBox.Text = string.Format(Properties.Resources.DontAskXDays, meshcentral.twoFactorCookieDays); + } else { + tokenRememberCheckBox.Visible = false; + } + setPanel(2); tokenTextBox.Focus(); } else { setPanel(1); } @@ -652,8 +668,8 @@ namespace MeshCentralRouter addButton.Focus(); if (authLoginUrl == null) { - saveToRegistry("ServerName", serverNameComboBox.Text); - saveToRegistry("UserName", userNameTextBox.Text); + setRegValue("ServerName", serverNameComboBox.Text); + setRegValue("UserName", userNameTextBox.Text); } if (meshcentral.username != null) { this.Text = title + " - " + meshcentral.username; @@ -661,6 +677,9 @@ namespace MeshCentralRouter this.Text = title + " - " + userNameTextBox.Text; } cookieRefreshTimer.Enabled = true; + + // If we need to remember the 2nd factor, ask for a cookie now. + if (tokenRememberCheckBox.Checked) { meshcentral.sendCommand("{\"action\":\"twoFactorCookie\"}"); } } } @@ -885,13 +904,14 @@ namespace MeshCentralRouter if (lastBadConnectCert != null) { meshcentral.okCertHash = lastBadConnectCert.GetCertHashString(); } else { - string ignoreCert = loadFromRegistry("IgnoreCert"); + string ignoreCert = getRegValue("IgnoreCert", null); if (ignoreCert != null) { meshcentral.okCertHash = ignoreCert; } } meshcentral.onStateChanged += Meshcentral_onStateChanged; meshcentral.onNodesChanged += Meshcentral_onNodesChanged; meshcentral.onLoginTokenChanged += Meshcentral_onLoginTokenChanged; meshcentral.onClipboardData += Meshcentral_onClipboardData; + meshcentral.onTwoFactorCookie += Meshcentral_onTwoFactorCookie; if (sendEmailToken == true) { sendEmailToken = false; diff --git a/MainForm.resx b/MainForm.resx index e9d3556..e332dd6 100644 --- a/MainForm.resx +++ b/MainForm.resx @@ -600,6 +600,39 @@ 0 + + True + + + NoControl + + + 241, 221 + + + 131, 17 + + + 23 + + + Don't ask for {0} days. + + + False + + + tokenRememberCheckBox + + + System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + panel2 + + + 0 + NoControl @@ -628,7 +661,7 @@ panel2 - 0 + 1 NoControl @@ -658,7 +691,7 @@ panel2 - 1 + 2 True @@ -691,7 +724,7 @@ panel2 - 2 + 3 True @@ -721,7 +754,7 @@ panel2 - 3 + 4 Top, Left, Right @@ -745,7 +778,7 @@ panel2 - 4 + 5 Top, Bottom, Left, Right @@ -775,7 +808,7 @@ panel2 - 5 + 6 Bottom, Right @@ -805,7 +838,7 @@ panel2 - 6 + 7 Bottom, Right @@ -835,7 +868,7 @@ panel2 - 7 + 8 Bottom, Left, Right @@ -865,7 +898,7 @@ panel2 - 8 + 9 Top, Left, Right @@ -895,7 +928,7 @@ panel2 - 9 + 10 Fill @@ -1439,7 +1472,7 @@ AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0 ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAADg - HQAAAk1TRnQBSQFMAgEBEAEAARgBAAEYAQABEAEAARABAAT/ARkBAAj/AUIBTQE2BwABNgMAASgDAAFA + HQAAAk1TRnQBSQFMAgEBEAEAASABAAEgAQABEAEAARABAAT/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 @@ -1606,7 +1639,7 @@ 2, 88 - 446, 52 + 442, 52 5 @@ -1645,7 +1678,7 @@ 2, 88 - 446, 52 + 442, 52 4 @@ -1735,7 +1768,7 @@ 2, 79 - 446, 52 + 442, 52 4 diff --git a/MeshCentralRouter-translation.json b/MeshCentralRouter-translation.json index 60e83dd..544d889 100644 --- a/MeshCentralRouter-translation.json +++ b/MeshCentralRouter-translation.json @@ -18,40 +18,11 @@ "MainForm.resx%$this.Text" ] }, - { - "en": "&Connect...", - "fr": "&Relier...", - "xloc": [ - "KVMViewer.resx%MenuItemConnect.Text" - ] - }, - { - "en": "&Control", - "fr": "&Contrôle", - "xloc": [ - "KVMViewer.resx%toolStripMenuItem2.Text" - ] - }, - { - "en": "&Debug", - "fr": "&Déboguer", - "xloc": [ - "KVMViewer.resx%debugToolStripMenuItem.Text" - ] - }, - { - "en": "&Disconnect", - "fr": "& Déconnecter", - "xloc": [ - "KVMViewer.resx%MenuItemDisconnect.Text" - ] - }, { "cs": "& Informace ...", "de": "&Die Info...", "en": "&Info...", "es": "& Info ...", - "fr": "&Info...", "hi": "और जानकारी ...", "it": "&Informazioni...", "ja": "情報...", @@ -66,7 +37,6 @@ }, { "en": "&Open Mappings...", - "fr": "& Ouvrir les mappages ...", "xloc": [ "MainForm.resx%openMappingsToolStripMenuItem.Text" ] @@ -88,46 +58,16 @@ "MainForm.resx%openToolStripMenuItem.Text" ] }, - { - "en": "&Pause", - "fr": "&Pause", - "xloc": [ - "KVMViewer.resx%pauseToolStripMenuItem.Text" - ] - }, - { - "en": "&Refresh", - "fr": "&Rafraîchir", - "xloc": [ - "KVMViewer.resx%refreshToolStripMenuItem.Text" - ] - }, { "en": "&Save Mappings...", - "fr": "& Enregistrer les mappages ...", "xloc": [ "MainForm.resx%saveMappingsToolStripMenuItem.Text" ] }, { - "en": "&Status", - "fr": "&Statut", + "en": "(Individual Devices)", "xloc": [ - "KVMViewer.resx%statusToolStripMenuItem.Text" - ] - }, - { - "en": "&View", - "fr": "&Vue", - "xloc": [ - "KVMViewer.resx%viewToolStripMenuItem.Text" - ] - }, - { - "en": "&Zoom-to-fit", - "fr": "& Zoomer pour ajuster", - "xloc": [ - "KVMViewer.resx%zoomtofitToolStripMenuItem.Text" + "Properties%Resources.resx%IndividualDevices" ] }, { @@ -168,44 +108,54 @@ }, { "en": "---", - "fr": "---", "xloc": [ "KVMViewer.resx%mainToolStripStatusLabel.Text" ] }, + { + "en": "0 Bytes", + "xloc": [ + "KVMStats.resx%kvmCompInBytesLabel.Text", + "KVMStats.resx%kvmCompOutBytesLabel.Text", + "KVMStats.resx%kvmInBytesLabel.Text", + "KVMStats.resx%kvmOutBytesLabel.Text", + "MappingStats.resx%kvmCompInBytesLabel.Text", + "MappingStats.resx%kvmCompOutBytesLabel.Text", + "MappingStats.resx%kvmInBytesLabel.Text", + "MappingStats.resx%kvmOutBytesLabel.Text" + ] + }, + { + "en": "0%", + "xloc": [ + "KVMStats.resx%inRatioLabel.Text", + "KVMStats.resx%outRatioLabel.Text", + "MappingStats.resx%inRatioLabel.Text", + "MappingStats.resx%outRatioLabel.Text" + ] + }, { "cs": "127,0,0,1", "en": "127.0.0.1", - "fr": "127.0.0.1", "xloc": [ "AddRelayMapForm.resx%remoteIpTextBox.Text" ] }, { "en": "AMT", - "fr": "AMT", "hi": "एएमटी", "xloc": [ "Properties%Resources.resx%AMT" ] }, - { - "en": "Actions", - "fr": "Actions", - "xloc": [ - "KVMViewer.resx%actionsToolStripMenuItem.Text" - ] - }, { "en": "Add &Map...", - "fr": "Ajouter une & carte ...", "xloc": [ "MainForm.resx%addMapToolStripMenuItem.Text" ] }, { "en": "Add &Relay Map...", - "fr": "Ajouter une carte de & relais ...", "xloc": [ "MainForm.resx%addRelayMapToolStripMenuItem.Text" ] @@ -250,7 +200,6 @@ "cs": "Činidlo", "en": "Agent", "es": "Agente", - "fr": "Agent", "hi": "एजेंट", "it": "Agente", "ja": "エージェント", @@ -287,7 +236,6 @@ "de": "Anwendung", "en": "Application", "es": "Solicitud", - "fr": "Application", "hi": "आवेदन", "it": "Applicazione", "ja": "応用", @@ -394,7 +342,6 @@ }, { "en": "CIRA", - "fr": "CIRA", "hi": "सीआईआरए", "ja": "チラ", "ko": "시라", @@ -499,6 +446,13 @@ "MainForm.resx%nextButton5.Text" ] }, + { + "en": "Compressed Network Traffic", + "xloc": [ + "KVMStats.resx%groupBox1.Text", + "MappingStats.resx%groupBox1.Text" + ] + }, { "en": "Compression Settings", "fr": "Paramètres de compression", @@ -612,6 +566,13 @@ "MainForm.resx%devicesTabPage.Text" ] }, + { + "en": "Don't ask for {0} days.", + "xloc": [ + "MainForm.resx%tokenRememberCheckBox.Text", + "Properties%Resources.resx%DontAskXDays" + ] + }, { "cs": "Výstup", "de": "Ausgang", @@ -627,7 +588,6 @@ "ru": "Выход", "zh-chs": "出口", "xloc": [ - "KVMViewer.resx%MenuItemExit.Text", "MainForm.resx%exitToolStripMenuItem.Text" ] }, @@ -635,7 +595,6 @@ "cs": "E-mailem", "en": "Email", "es": "Correo electrónico", - "fr": "Email", "hi": "ईमेल", "it": "E-mail", "ja": "Eメール", @@ -748,7 +707,6 @@ }, { "en": "HTTP", - "fr": "HTTP", "hi": "एचटीटीपी", "xloc": [ "DeviceUserControl.resx%httpButton.Text", @@ -757,7 +715,6 @@ }, { "en": "HTTPS", - "fr": "HTTPS", "xloc": [ "DeviceUserControl.resx%httpsButton.Text", "MainForm.resx%httpsToolStripMenuItem.Text" @@ -781,6 +738,22 @@ "MainForm.resx%nextButton3.Text" ] }, + { + "en": "Incoming Bytes", + "xloc": [ + "KVMStats.resx%label12.Text", + "KVMStats.resx%label4.Text", + "MappingStats.resx%label12.Text", + "MappingStats.resx%label4.Text" + ] + }, + { + "en": "Incoming Compression", + "xloc": [ + "KVMStats.resx%label11.Text", + "MappingStats.resx%label11.Text" + ] + }, { "cs": "Nainstalujte...", "de": "Installieren...", @@ -803,7 +776,6 @@ "cs": "Instalace", "en": "Installation", "es": "Instalación", - "fr": "Installation", "hi": "स्थापना", "it": "Installazione", "ja": "取り付け", @@ -910,7 +882,6 @@ }, { "en": "MQTT", - "fr": "MQTT", "xloc": [ "Properties%Resources.resx%MQTT" ] @@ -936,7 +907,6 @@ }, { "en": "MeshCentral", - "fr": "MeshCentral", "zh-chs": "网格中心", "xloc": [ "Properties%Resources.resx%MeshCentralTitle" @@ -1008,6 +978,8 @@ "ru": "имя", "zh-chs": "名称", "xloc": [ + "AddPortMapForm.resx%label8.Text", + "AddRelayMapForm.resx%label8.Text", "AppLaunchForm.resx%label1.Text", "MainForm.resx%nameColumnHeader.Text" ] @@ -1100,6 +1072,8 @@ "AppLaunchForm.resx%okButton.Text", "InstallForm.resx%okButton.Text", "KVMSettingsForm.resx%okButton.Text", + "KVMStats.resx%okButton.Text", + "MappingStats.resx%okButton.Text", "SettingsForm.resx%okButton.Text", "altPortForm.resx%okButton.Text", "rdpPortForm.resx%okButton.Text" @@ -1173,6 +1147,22 @@ "MapUserControl.resx%appButton.Text" ] }, + { + "en": "Outgoing Bytes", + "xloc": [ + "KVMStats.resx%label2.Text", + "KVMStats.resx%label3.Text", + "MappingStats.resx%label2.Text", + "MappingStats.resx%label3.Text" + ] + }, + { + "en": "Outgoing Compression", + "xloc": [ + "KVMStats.resx%label10.Text", + "MappingStats.resx%label10.Text" + ] + }, { "cs": "Heslo", "de": "Passwort", @@ -1287,7 +1277,6 @@ }, { "en": "RDP", - "fr": "RDP", "hi": "आरडीपी", "xloc": [ "DeviceUserControl.resx%rdpButton.Text", @@ -1367,6 +1356,12 @@ "AddRelayMapForm.resx%$this.Text" ] }, + { + "en": "Remember this certificate", + "xloc": [ + "MainForm.resx%rememberCertCheckBox.Text" + ] + }, { "en": "Remote Desktop", "fr": "Bureau à distance", @@ -1374,6 +1369,12 @@ "KVMViewer.resx%$this.Text" ] }, + { + "en": "Remote Desktop Data", + "xloc": [ + "KVMStats.resx%groupBox2.Text" + ] + }, { "en": "Remote Desktop Settings", "fr": "Paramètres du bureau à distance", @@ -1381,9 +1382,14 @@ "KVMSettingsForm.resx%$this.Text" ] }, + { + "en": "Remote Desktop Stats", + "xloc": [ + "KVMStats.resx%$this.Text" + ] + }, { "en": "Remote Desktop...", - "fr": "Bureau à distance...", "xloc": [ "MainForm.resx%remoteDesktopToolStripMenuItem.Text" ] @@ -1468,6 +1474,12 @@ "MapUserControl.resx%closeButton.Text" ] }, + { + "en": "Routing Stats", + "xloc": [ + "MappingStats.resx%$this.Text" + ] + }, { "cs": "Stav směrování", "de": "Routing-Status", @@ -1488,7 +1500,6 @@ }, { "en": "SCP", - "fr": "SCP", "xloc": [ "DeviceUserControl.resx%scpButton.Text", "MainForm.resx%scpToolStripMenuItem.Text" @@ -1496,7 +1507,6 @@ }, { "en": "SMS", - "fr": "SMS", "hi": "एसएमएस", "it": "sms", "nl": "sms", @@ -1526,7 +1536,6 @@ }, { "en": "SSH", - "fr": "SSH", "zh-chs": "SSH协议", "xloc": [ "DeviceUserControl.resx%sshButton.Text", @@ -1558,13 +1567,6 @@ "Properties%Resources.resx%SearchPlaceHolder" ] }, - { - "en": "Send &Ctrl-Alt-Del", - "fr": "Envoyer & Ctrl-Alt-Suppr", - "xloc": [ - "KVMViewer.resx%sendCtrlAltDelToolStripMenuItem.Text" - ] - }, { "cs": "Odeslat token na zaregistrovanou e-mailovou adresu?", "de": "Token an registrierte E-Mail-Adresse senden?", @@ -1652,13 +1654,6 @@ "ServerUserControl.resx%serverNameLabel.Text" ] }, - { - "en": "Session Settings...", - "fr": "Paramètres de session ...", - "xloc": [ - "KVMViewer.resx%settingsToolStripMenuItem.Text" - ] - }, { "cs": "Nastavit port RDP ...", "de": "RDP-Port einstellen ...", @@ -1757,7 +1752,6 @@ "de": "Seite? ˅", "en": "Site", "es": "Sitio", - "fr": "Site", "hi": "साइट", "it": "Luogo", "ja": "地点", @@ -1825,11 +1819,22 @@ }, { "en": "State", - "fr": "Etat", "xloc": [ "MainForm.resx%stateColumnHeader.Text" ] }, + { + "en": "Stats", + "xloc": [ + "KVMViewer.resx%statsButton.Text" + ] + }, + { + "en": "Stats...", + "xloc": [ + "MapUserControl.resx%statsToolStripMenuItem.Text" + ] + }, { "cs": "Zastavil", "de": "Gestoppt", @@ -1868,7 +1873,6 @@ }, { "en": "TCP", - "fr": "TCP", "hi": "टीसीपी", "zh-chs": "TCP协议", "xloc": [ @@ -1912,6 +1916,12 @@ "MainForm.resx%tabPage2.Text" ] }, + { + "en": "Tunnelling Data", + "xloc": [ + "MappingStats.resx%groupBox2.Text" + ] + }, { "cs": "Dvoufaktorové ověření", "de": "Zwei-Faktor-Authentifizierung", @@ -1932,7 +1942,6 @@ }, { "en": "UDP", - "fr": "UDP", "hi": "यूडीपी", "zh-chs": "UDP协议", "xloc": [ @@ -2067,22 +2076,13 @@ ] }, { - "en": "Zoom-to-Fit", - "fr": "Ajustement Zoom", + "en": "label1", "xloc": [ - "KVMViewer.resx%zoomButton.Text" - ] - }, - { - "en": "menuStrip1", - "fr": "menuStrip1", - "xloc": [ - "KVMViewer.resx%mainMenu.Text" + "KVMViewer.resx%consoleMessage.Text" ] }, { "en": "statusStrip1", - "fr": "statusStrip1", "xloc": [ "KVMViewer.resx%mainStatusStrip.Text" ] @@ -2095,7 +2095,6 @@ }, { "en": "v0.8.0", - "fr": "v0.8.0", "xloc": [ "MainForm.resx%versionLabel.Text" ] diff --git a/MeshCentralServer.cs b/MeshCentralServer.cs index ddc2656..6a883bf 100644 --- a/MeshCentralServer.cs +++ b/MeshCentralServer.cs @@ -62,6 +62,7 @@ namespace MeshCentralRouter public bool ignoreCert = false; public string userid = null; public string username = null; + public int twoFactorCookieDays = 0; public Dictionary userRights = null; public Dictionary userGroups = null; @@ -205,6 +206,7 @@ namespace MeshCentralRouter if (jsonAction.ContainsKey("email2fasent")) { disconnectEmail2FASent = (bool)jsonAction["email2fasent"]; } else { disconnectEmail2FASent = false; } if (jsonAction.ContainsKey("sms2fa")) { disconnectSms2FA = (bool)jsonAction["sms2fa"]; } else { disconnectSms2FA = false; } if (jsonAction.ContainsKey("sms2fasent")) { disconnectSms2FASent = (bool)jsonAction["sms2fasent"]; } else { disconnectSms2FASent = false; } + if (jsonAction.ContainsKey("twoFactorCookieDays") && (jsonAction["twoFactorCookieDays"].GetType() == typeof(int))) { twoFactorCookieDays = (int)jsonAction["twoFactorCookieDays"]; } break; } case "serverinfo": @@ -569,6 +571,15 @@ namespace MeshCentralRouter } break; } + case "twoFactorCookie": + { + if (jsonAction.ContainsKey("cookie")) + { + string cookie = (string)jsonAction["cookie"]; + if (onTwoFactorCookie != null) { onTwoFactorCookie(cookie); } + } + break; + } default: { break; @@ -586,6 +597,8 @@ namespace MeshCentralRouter public event onLoginTokenChangedHandler onLoginTokenChanged; public delegate void onClipboardDataHandler(string nodeid, string data); public event onClipboardDataHandler onClipboardData; + public delegate void twoFactorCookieHandler(string cookie); + public event twoFactorCookieHandler onTwoFactorCookie; public class xwebclient : IDisposable { diff --git a/Properties/Resources.Designer.cs b/Properties/Resources.Designer.cs index 5711f6a..dc3da4e 100644 --- a/Properties/Resources.Designer.cs +++ b/Properties/Resources.Designer.cs @@ -60,16 +60,6 @@ namespace MeshCentralRouter.Properties { } } - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap _50_Computer { - get { - object obj = ResourceManager.GetObject("50-Computer", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - /// /// Looks up a localized string similar to Agent. /// @@ -97,6 +87,25 @@ namespace MeshCentralRouter.Properties { } } + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap Computer50 { + get { + object obj = ResourceManager.GetObject("Computer50", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Looks up a localized string similar to Don't ask for {0} days.. + /// + internal static string DontAskXDays { + get { + return ResourceManager.GetString("DontAskXDays", resourceCulture); + } + } + /// /// Looks up a localized string similar to Email sent. /// @@ -168,9 +177,9 @@ namespace MeshCentralRouter.Properties { /// /// Looks up a localized resource of type System.Drawing.Bitmap. /// - internal static System.Drawing.Bitmap icon_clipboard_in { + internal static System.Drawing.Bitmap iconClipboardIn { get { - object obj = ResourceManager.GetObject("icon-clipboard-in", resourceCulture); + object obj = ResourceManager.GetObject("iconClipboardIn", resourceCulture); return ((System.Drawing.Bitmap)(obj)); } } @@ -178,9 +187,9 @@ namespace MeshCentralRouter.Properties { /// /// Looks up a localized resource of type System.Drawing.Bitmap. /// - internal static System.Drawing.Bitmap icon_clipboard_out { + internal static System.Drawing.Bitmap iconClipboardOut { get { - object obj = ResourceManager.GetObject("icon-clipboard-out", resourceCulture); + object obj = ResourceManager.GetObject("iconClipboardOut", resourceCulture); return ((System.Drawing.Bitmap)(obj)); } } diff --git a/Properties/Resources.resx b/Properties/Resources.resx index eb4e213..a45b023 100644 --- a/Properties/Resources.resx +++ b/Properties/Resources.resx @@ -166,7 +166,7 @@ ..\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 @@ -205,7 +205,7 @@ Starting... - + ..\Resources\50-Computer.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a @@ -232,7 +232,7 @@ 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 @@ -241,4 +241,7 @@ ..\Resources\ZoomToFit.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + Don't ask for {0} days. + \ No newline at end of file