main: Added DNS batching

This commit is contained in:
Nathan Woodburn 2023-06-08 15:47:51 +10:00
parent 2f7427d5b4
commit 890da5d64d
Signed by: nathanwoodburn
GPG Key ID: 203B000478AD0EF1
5 changed files with 14 additions and 2 deletions

View File

@ -633,6 +633,8 @@ namespace FireWallet
catch (Exception ex) catch (Exception ex)
{ {
AddLog("Post Error: " + ex.Message); AddLog("Post Error: " + ex.Message);
AddLog(await resp.Content.ReadAsStringAsync());
AddLog(content);
return "Error"; return "Error";
} }
@ -694,7 +696,7 @@ namespace FireWallet
else if (method == "UPDATE" && update != null) 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 + "]"; return "[\"UPDATE\", \"" + domain + "\", " + records + "]";
} }

View File

@ -170,6 +170,7 @@
comboBoxType.Size = new Size(129, 23); comboBoxType.Size = new Size(129, 23);
comboBoxType.TabIndex = 3; comboBoxType.TabIndex = 3;
comboBoxType.SelectedIndexChanged += comboBoxType_SelectedIndexChanged; comboBoxType.SelectedIndexChanged += comboBoxType_SelectedIndexChanged;
comboBoxType.DropDownClosed += comboBoxType_DropDownClosed;
// //
// DNSForm // DNSForm
// //

View File

@ -37,6 +37,7 @@ namespace FireWallet
GetDNS(); GetDNS();
comboBoxType.SelectedIndex = 0; comboBoxType.SelectedIndex = 0;
textBoxMain.Focus();
} }
@ -613,5 +614,10 @@ namespace FireWallet
} }
} }
private void comboBoxType_DropDownClosed(object sender, EventArgs e)
{
textBoxMain.Focus();
}
} }
} }

View File

@ -877,7 +877,6 @@ namespace FireWallet
string records = string.Join(", ", DNSEdit.DNSrecords.Select(record => record.ToString())); string records = string.Join(", ", DNSEdit.DNSrecords.Select(record => record.ToString()));
string content = "{\"method\": \"sendupdate\", \"params\": [\"" + domain + "\", {\"records\": [" + records + "]}]}"; string content = "{\"method\": \"sendupdate\", \"params\": [\"" + domain + "\", {\"records\": [" + records + "]}]}";
AddLog(content);
string response = await APIPost("", true, content); string response = await APIPost("", true, content);
if (response == "Error") if (response == "Error")
@ -975,6 +974,7 @@ namespace FireWallet
if (!dnsEdit.cancel) if (!dnsEdit.cancel)
{ {
mainForm.AddBatch(domain, "UPDATE", dnsEdit.DNSrecords); mainForm.AddBatch(domain, "UPDATE", dnsEdit.DNSrecords);
this.Close();
} }
dnsEdit.Dispose(); dnsEdit.Dispose();
} }

View File

@ -115,6 +115,7 @@ namespace FireWallet
// //
// toolStripStatusLabelNetwork // toolStripStatusLabelNetwork
// //
toolStripStatusLabelNetwork.DisplayStyle = ToolStripItemDisplayStyle.Text;
toolStripStatusLabelNetwork.Margin = new Padding(0, 3, 50, 2); toolStripStatusLabelNetwork.Margin = new Padding(0, 3, 50, 2);
toolStripStatusLabelNetwork.Name = "toolStripStatusLabelNetwork"; toolStripStatusLabelNetwork.Name = "toolStripStatusLabelNetwork";
toolStripStatusLabelNetwork.Size = new Size(58, 17); toolStripStatusLabelNetwork.Size = new Size(58, 17);
@ -122,6 +123,7 @@ namespace FireWallet
// //
// toolStripStatusLabelstatus // toolStripStatusLabelstatus
// //
toolStripStatusLabelstatus.DisplayStyle = ToolStripItemDisplayStyle.Text;
toolStripStatusLabelstatus.Margin = new Padding(0, 3, 50, 2); toolStripStatusLabelstatus.Margin = new Padding(0, 3, 50, 2);
toolStripStatusLabelstatus.Name = "toolStripStatusLabelstatus"; toolStripStatusLabelstatus.Name = "toolStripStatusLabelstatus";
toolStripStatusLabelstatus.Size = new Size(126, 17); toolStripStatusLabelstatus.Size = new Size(126, 17);
@ -129,6 +131,7 @@ namespace FireWallet
// //
// toolStripStatusLabelaccount // toolStripStatusLabelaccount
// //
toolStripStatusLabelaccount.DisplayStyle = ToolStripItemDisplayStyle.Text;
toolStripStatusLabelaccount.Margin = new Padding(0, 3, 50, 2); toolStripStatusLabelaccount.Margin = new Padding(0, 3, 50, 2);
toolStripStatusLabelaccount.Name = "toolStripStatusLabelaccount"; toolStripStatusLabelaccount.Name = "toolStripStatusLabelaccount";
toolStripStatusLabelaccount.Size = new Size(55, 17); toolStripStatusLabelaccount.Size = new Size(55, 17);