This commit is contained in:
2021-08-13 18:36:54 +00:00
parent 5ea07cd003
commit f8609e59ec
3 changed files with 22 additions and 21 deletions

View File

@@ -19,8 +19,8 @@ namespace AyaNova.PlugIn.V8
private async void btnTest_Click(object sender, EventArgs e)
{
if (!ValidateAndCleanServerAddress()) return;
btnOk.Enabled=btnTest.Enabled = false;
var result = await util.TestUrlAsync(edServerUrl.Text);
btnOk.Enabled = btnTest.Enabled = false;
var result = await util.InitAndConfirmAddressAsync(edServerUrl.Text);
btnOk.Enabled = btnTest.Enabled = true;
if (result == "OK")
{
@@ -35,17 +35,17 @@ namespace AyaNova.PlugIn.V8
{
if (!ValidateAndCleanServerAddress()) return;
btnOk.Enabled = btnTest.Enabled = false;
if (!util.Initialized)
// if (!util.Initialized)
//{
var result = await util.InitAndConfirmAddressAsync(edServerUrl.Text);
if (result != "OK")
{
var result = await util.TestUrlAsync(edServerUrl.Text);
if (result != "OK")
{
MessageBox.Show("Server could not be reached at that URL\n" + result);
btnOk.Enabled = btnTest.Enabled = true;
return;
}
MessageBox.Show("Server could not be reached at that URL\n" + result);
btnOk.Enabled = btnTest.Enabled = true;
return;
}
var res = await util.AuthenticateAsync(edUserName.Text,edPassword.Text);
// }
var res = await util.AuthenticateAsync(edUserName.Text, edPassword.Text);
if (!res)
{
MessageBox.Show("AyaNova 8 SuperUser account login failed");
@@ -80,8 +80,8 @@ namespace AyaNova.PlugIn.V8
private bool ValidateAndCleanServerAddress()
{
var serverUrl=edServerUrl.Text;
{
var serverUrl = edServerUrl.Text;
Uri u;
try
{
@@ -89,7 +89,7 @@ namespace AyaNova.PlugIn.V8
var scheme = u.Scheme;
var host = u.Host;
var port = u.Port;
edServerUrl.Text= scheme + "://" + host + ":" + port + "/" + util.API_BASE_ROUTE;
edServerUrl.Text = scheme + "://" + host + ":" + port + "/" + util.API_BASE_ROUTE;
}
catch (Exception ex)
{