From 890da5d64d8206232cba3bb8ca6151a70b669a63 Mon Sep 17 00:00:00 2001 From: Nathan Woodburn Date: Thu, 8 Jun 2023 15:47:51 +1000 Subject: [PATCH] main: Added DNS batching --- FireWallet/BatchForm.cs | 4 +++- FireWallet/DNSForm.Designer.cs | 1 + FireWallet/DNSForm.cs | 6 ++++++ FireWallet/DomainForm.cs | 2 +- FireWallet/MainForm.Designer.cs | 3 +++ 5 files changed, 14 insertions(+), 2 deletions(-) diff --git a/FireWallet/BatchForm.cs b/FireWallet/BatchForm.cs index fb03eda..e797ca6 100644 --- a/FireWallet/BatchForm.cs +++ b/FireWallet/BatchForm.cs @@ -633,6 +633,8 @@ namespace FireWallet catch (Exception ex) { AddLog("Post Error: " + ex.Message); + AddLog(await resp.Content.ReadAsStringAsync()); + AddLog(content); return "Error"; } @@ -694,7 +696,7 @@ namespace FireWallet else if (method == "UPDATE" && update != null) { - string records = "{records:[" + string.Join(", ", update.Select(record => record.ToString())) + "]}"; + string records = "{\"records\":[" + string.Join(", ", update.Select(record => record.ToString())) + "]}"; return "[\"UPDATE\", \"" + domain + "\", " + records + "]"; } diff --git a/FireWallet/DNSForm.Designer.cs b/FireWallet/DNSForm.Designer.cs index 7294f98..beb0142 100644 --- a/FireWallet/DNSForm.Designer.cs +++ b/FireWallet/DNSForm.Designer.cs @@ -170,6 +170,7 @@ comboBoxType.Size = new Size(129, 23); comboBoxType.TabIndex = 3; comboBoxType.SelectedIndexChanged += comboBoxType_SelectedIndexChanged; + comboBoxType.DropDownClosed += comboBoxType_DropDownClosed; // // DNSForm // diff --git a/FireWallet/DNSForm.cs b/FireWallet/DNSForm.cs index cedd738..53313f0 100644 --- a/FireWallet/DNSForm.cs +++ b/FireWallet/DNSForm.cs @@ -37,6 +37,7 @@ namespace FireWallet GetDNS(); comboBoxType.SelectedIndex = 0; + textBoxMain.Focus(); } @@ -613,5 +614,10 @@ namespace FireWallet } } + + private void comboBoxType_DropDownClosed(object sender, EventArgs e) + { + textBoxMain.Focus(); + } } } diff --git a/FireWallet/DomainForm.cs b/FireWallet/DomainForm.cs index 8d2332e..f50c18f 100644 --- a/FireWallet/DomainForm.cs +++ b/FireWallet/DomainForm.cs @@ -877,7 +877,6 @@ namespace FireWallet string records = string.Join(", ", DNSEdit.DNSrecords.Select(record => record.ToString())); string content = "{\"method\": \"sendupdate\", \"params\": [\"" + domain + "\", {\"records\": [" + records + "]}]}"; - AddLog(content); string response = await APIPost("", true, content); if (response == "Error") @@ -975,6 +974,7 @@ namespace FireWallet if (!dnsEdit.cancel) { mainForm.AddBatch(domain, "UPDATE", dnsEdit.DNSrecords); + this.Close(); } dnsEdit.Dispose(); } diff --git a/FireWallet/MainForm.Designer.cs b/FireWallet/MainForm.Designer.cs index 9fe3900..f40460e 100644 --- a/FireWallet/MainForm.Designer.cs +++ b/FireWallet/MainForm.Designer.cs @@ -115,6 +115,7 @@ namespace FireWallet // // toolStripStatusLabelNetwork // + toolStripStatusLabelNetwork.DisplayStyle = ToolStripItemDisplayStyle.Text; toolStripStatusLabelNetwork.Margin = new Padding(0, 3, 50, 2); toolStripStatusLabelNetwork.Name = "toolStripStatusLabelNetwork"; toolStripStatusLabelNetwork.Size = new Size(58, 17); @@ -122,6 +123,7 @@ namespace FireWallet // // toolStripStatusLabelstatus // + toolStripStatusLabelstatus.DisplayStyle = ToolStripItemDisplayStyle.Text; toolStripStatusLabelstatus.Margin = new Padding(0, 3, 50, 2); toolStripStatusLabelstatus.Name = "toolStripStatusLabelstatus"; toolStripStatusLabelstatus.Size = new Size(126, 17); @@ -129,6 +131,7 @@ namespace FireWallet // // toolStripStatusLabelaccount // + toolStripStatusLabelaccount.DisplayStyle = ToolStripItemDisplayStyle.Text; toolStripStatusLabelaccount.Margin = new Padding(0, 3, 50, 2); toolStripStatusLabelaccount.Name = "toolStripStatusLabelaccount"; toolStripStatusLabelaccount.Size = new Size(55, 17);