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)
{
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 + "]";
}

View File

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

View File

@ -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();
}
}
}

View File

@ -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();
}

View File

@ -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);