Merge branch 'develop' of https://gitlab.steamware.net/egalware-web/special/webdoorcreator into develop
This commit is contained in:
Generated
+31
-17
@@ -27,8 +27,9 @@ Partial Class Form1
|
||||
Me.lblTestAlive = New System.Windows.Forms.Label()
|
||||
Me.btnTestAlive = New System.Windows.Forms.Button()
|
||||
Me.btnFullTest = New System.Windows.Forms.Button()
|
||||
Me.lblOut = New System.Windows.Forms.Label()
|
||||
Me.btnResetQueue = New System.Windows.Forms.Button()
|
||||
Me.txtOut = New System.Windows.Forms.TextBox()
|
||||
Me.btnQueueStatus = New System.Windows.Forms.Button()
|
||||
Me.SuspendLayout()
|
||||
'
|
||||
'btnTestPing
|
||||
@@ -69,26 +70,13 @@ Partial Class Form1
|
||||
'
|
||||
'btnFullTest
|
||||
'
|
||||
Me.btnFullTest.Location = New System.Drawing.Point(13, 61)
|
||||
Me.btnFullTest.Location = New System.Drawing.Point(12, 104)
|
||||
Me.btnFullTest.Name = "btnFullTest"
|
||||
Me.btnFullTest.Size = New System.Drawing.Size(75, 23)
|
||||
Me.btnFullTest.TabIndex = 4
|
||||
Me.btnFullTest.Text = "Full Test"
|
||||
Me.btnFullTest.UseVisualStyleBackColor = True
|
||||
'
|
||||
'lblOut
|
||||
'
|
||||
Me.lblOut.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
|
||||
Me.lblOut.AutoSize = True
|
||||
Me.lblOut.BackColor = System.Drawing.SystemColors.ControlDarkDark
|
||||
Me.lblOut.ForeColor = System.Drawing.Color.Gold
|
||||
Me.lblOut.Location = New System.Drawing.Point(106, 64)
|
||||
Me.lblOut.MinimumSize = New System.Drawing.Size(650, 400)
|
||||
Me.lblOut.Name = "lblOut"
|
||||
Me.lblOut.Size = New System.Drawing.Size(650, 400)
|
||||
Me.lblOut.TabIndex = 5
|
||||
Me.lblOut.Text = "Label1"
|
||||
'
|
||||
'btnResetQueue
|
||||
'
|
||||
Me.btnResetQueue.Location = New System.Drawing.Point(13, 228)
|
||||
@@ -98,13 +86,38 @@ Partial Class Form1
|
||||
Me.btnResetQueue.Text = "Reset Queue"
|
||||
Me.btnResetQueue.UseVisualStyleBackColor = True
|
||||
'
|
||||
'txtOut
|
||||
'
|
||||
Me.txtOut.Anchor = CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Bottom) _
|
||||
Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
|
||||
Me.txtOut.BackColor = System.Drawing.SystemColors.ControlDarkDark
|
||||
Me.txtOut.ForeColor = System.Drawing.Color.Yellow
|
||||
Me.txtOut.Location = New System.Drawing.Point(109, 64)
|
||||
Me.txtOut.MinimumSize = New System.Drawing.Size(650, 400)
|
||||
Me.txtOut.Multiline = True
|
||||
Me.txtOut.Name = "txtOut"
|
||||
Me.txtOut.ScrollBars = System.Windows.Forms.ScrollBars.Vertical
|
||||
Me.txtOut.Size = New System.Drawing.Size(650, 400)
|
||||
Me.txtOut.TabIndex = 7
|
||||
Me.txtOut.Text = "---"
|
||||
'
|
||||
'btnQueueStatus
|
||||
'
|
||||
Me.btnQueueStatus.Location = New System.Drawing.Point(13, 64)
|
||||
Me.btnQueueStatus.Name = "btnQueueStatus"
|
||||
Me.btnQueueStatus.Size = New System.Drawing.Size(75, 23)
|
||||
Me.btnQueueStatus.TabIndex = 8
|
||||
Me.btnQueueStatus.Text = "Stato Queue"
|
||||
Me.btnQueueStatus.UseVisualStyleBackColor = True
|
||||
'
|
||||
'Form1
|
||||
'
|
||||
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
|
||||
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
|
||||
Me.ClientSize = New System.Drawing.Size(764, 472)
|
||||
Me.Controls.Add(Me.btnQueueStatus)
|
||||
Me.Controls.Add(Me.txtOut)
|
||||
Me.Controls.Add(Me.btnResetQueue)
|
||||
Me.Controls.Add(Me.lblOut)
|
||||
Me.Controls.Add(Me.btnFullTest)
|
||||
Me.Controls.Add(Me.lblTestAlive)
|
||||
Me.Controls.Add(Me.btnTestAlive)
|
||||
@@ -122,6 +135,7 @@ Partial Class Form1
|
||||
Friend WithEvents lblTestAlive As Label
|
||||
Friend WithEvents btnTestAlive As Button
|
||||
Friend WithEvents btnFullTest As Button
|
||||
Friend WithEvents lblOut As Label
|
||||
Friend WithEvents btnResetQueue As Button
|
||||
Friend WithEvents txtOut As TextBox
|
||||
Friend WithEvents btnQueueStatus As Button
|
||||
End Class
|
||||
|
||||
+19
-4
@@ -52,7 +52,7 @@ Public Class Form1
|
||||
Next
|
||||
sb.AppendLine("----------------------------")
|
||||
sb.AppendLine()
|
||||
lblOut.Text = sb.ToString()
|
||||
txtOut.Text = sb.ToString()
|
||||
' recupero numero da processare
|
||||
num2proc = currWDC.numTask2proc
|
||||
If (num2proc > 0) Then
|
||||
@@ -73,7 +73,7 @@ Public Class Form1
|
||||
|
||||
' mi limito a mostrare codice + contenuto DDF... dovrebbe processare invero...
|
||||
sb.AppendLine("--------------------------------------------------------")
|
||||
sb.AppendLine($"DoorId.Vers: {item.Key}.{item.Value}")
|
||||
sb.AppendLine($"DoorId.Vers: {item.Key}")
|
||||
sb.AppendLine("DDF:")
|
||||
sb.AppendLine("--------")
|
||||
sb.AppendLine(item.Value)
|
||||
@@ -99,13 +99,28 @@ Public Class Form1
|
||||
sb.AppendLine(respPut)
|
||||
sb.AppendLine("----------------------------")
|
||||
|
||||
lblOut.Text = sb.ToString()
|
||||
txtOut.Text = sb.ToString()
|
||||
End If
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub btnResetQueue_Click(sender As Object, e As EventArgs) Handles btnResetQueue.Click
|
||||
currWDC.ResetQueue()
|
||||
lblOut.Text = "Queue Resetted!"
|
||||
txtOut.Text = "Queue Resetted!"
|
||||
End Sub
|
||||
|
||||
Private Sub btnQueueStatus_Click(sender As Object, e As EventArgs) Handles btnQueueStatus.Click
|
||||
|
||||
Dim queueStatus As New Dictionary(Of String, Long)
|
||||
queueStatus = currWDC.queueStatus
|
||||
Dim sb As StringBuilder
|
||||
sb = New StringBuilder
|
||||
sb.AppendLine("----------------------------")
|
||||
For Each item As KeyValuePair(Of String, Long) In queueStatus
|
||||
sb.AppendLine($"{item.Key} | Found {item.Value} items")
|
||||
Next
|
||||
sb.AppendLine("----------------------------")
|
||||
sb.AppendLine()
|
||||
txtOut.Text = sb.ToString()
|
||||
End Sub
|
||||
End Class
|
||||
|
||||
@@ -65,9 +65,7 @@ namespace WebDoorCreator.API.Controllers
|
||||
bool fatto = false;
|
||||
if (passPhrase == "bbbBirdIsTheWord")
|
||||
{
|
||||
// vera chaimata di reset delle code
|
||||
fatto = true;
|
||||
await Task.Delay(10);
|
||||
fatto = await QDataServ.ResetQueue();
|
||||
}
|
||||
answ = fatto ? "OK" : "NO";
|
||||
return answ;
|
||||
|
||||
@@ -390,6 +390,7 @@ namespace WebDoorCreator.Data.Services
|
||||
{
|
||||
await RequestPendingUpsert(item.Name, item.Value);
|
||||
await RequestProcessingRemove(item.Name);
|
||||
fatto = true;
|
||||
}
|
||||
stopWatch.Stop();
|
||||
TimeSpan ts = stopWatch.Elapsed;
|
||||
|
||||
@@ -121,7 +121,7 @@ namespace WeebDoorCreator.SDK
|
||||
{
|
||||
{ "passPhrase", "bbbBirdIsTheWord" }
|
||||
};
|
||||
var rawData = callUrlGet(urlTakeNextItems, parList);
|
||||
var rawData = callUrlPost(urlResetQueue,"", parList);
|
||||
return rawData;
|
||||
}
|
||||
|
||||
@@ -260,6 +260,47 @@ namespace WeebDoorCreator.SDK
|
||||
// restituisco valore!
|
||||
return answ;
|
||||
}
|
||||
/// <summary>
|
||||
/// Effettua chiamata URL POST con parametri (opzionali) e payload (opzionale) e restituisce risultato
|
||||
/// </summary>
|
||||
/// <param name="URL"></param>
|
||||
/// <param name="payload"></param>
|
||||
/// <param name="paramsList"></param>
|
||||
/// <returns></returns>
|
||||
protected string callUrlPost(string URL, string payload, Dictionary<string, string> paramsList)
|
||||
{
|
||||
string answ = "";
|
||||
// cerco online
|
||||
RestClient client = new RestClient(apiUrl);
|
||||
var request = new RestRequest(URL);
|
||||
// compongo
|
||||
string paramsQuery = "";
|
||||
if (paramsList != null && paramsList.Count > 0)
|
||||
{
|
||||
foreach (var item in paramsList)
|
||||
{
|
||||
paramsQuery += $"{item.Key}={item.Value}";
|
||||
}
|
||||
request = new RestRequest($"{URL}?{paramsQuery}");
|
||||
}
|
||||
if (!string.IsNullOrEmpty(payload))
|
||||
{
|
||||
request.AddJsonBody(payload);
|
||||
}
|
||||
var response = client.Post(request);
|
||||
// controllo status code risposta
|
||||
if (response.StatusCode == System.Net.HttpStatusCode.OK)
|
||||
{
|
||||
// deserializzo risposta
|
||||
answ = response.Content;
|
||||
}
|
||||
else
|
||||
{
|
||||
answ = "KO";
|
||||
}
|
||||
// restituisco valore!
|
||||
return answ;
|
||||
}
|
||||
|
||||
#endregion Protected Methods
|
||||
|
||||
|
||||
Reference in New Issue
Block a user