Skip to content

Commit

Permalink
Added shutdown, and fixed committer.
Browse files Browse the repository at this point in the history
  • Loading branch information
krisdb2009 committed Mar 5, 2024
1 parent 941fdf5 commit a6c168c
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 8 deletions.
5 changes: 3 additions & 2 deletions Tikhole.Engine/Committer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ private void Matcher_ResponseMatched(object? sender, ResponseMatchedEventArgs e)
reply = ListSet(ctv.ID, address, comment);
if (reply.Length == 4)
{
Missed++;
TrackListRemove(ctk);
}
else
Expand All @@ -95,7 +96,7 @@ private void Matcher_ResponseMatched(object? sender, ResponseMatchedEventArgs e)
ID = ctv.ID,
Timeout = DateTime.Now.AddSeconds(ListTTL)
});
return;
continue;
}
}
}
Expand All @@ -110,7 +111,7 @@ private void Matcher_ResponseMatched(object? sender, ResponseMatchedEventArgs e)
};
TrackListAdd(ctk, ctv);
added = true;
return;
continue;
}
Missed++;
reply = ListPrint(address, e.AddressListName);
Expand Down
12 changes: 6 additions & 6 deletions Tikhole.Website/Components/Pages/Dashboard.razor
Original file line number Diff line number Diff line change
Expand Up @@ -40,23 +40,23 @@
<div class="row row-cols-1 row-cols-md-3 g-4 mb-3">
<div class="col">
<div class="card h-100">
<div class="card-header">🗣️ <b>Requests</b></div>
<div class="card-header">🗣️ <b>Incomming Requests</b></div>
<div class="card-body text-center">
<h1>@Engine.Listener.Requests</h1>
</div>
</div>
</div>
<div class="col">
<div class="card h-100">
<div class="card-header">🔎 <b>Matches</b></div>
<div class="card-header">🔎 <b>Matched Requests</b></div>
<div class="card-body text-center">
<h1>@Engine.Matcher.Matches</h1>
</div>
</div>
</div>
<div class="col">
<div class="card h-100">
<div class="card-header">📃 <b>Entries</b></div>
<div class="card-header">📃 <b>RouterOS List Entries</b></div>
<div class="card-body text-center">
<h1>@Engine.Committer.TrackList.Keys.Count</h1>
</div>
Expand All @@ -66,23 +66,23 @@
<div class="row row-cols-1 row-cols-md-3 g-4 mb-3">
<div class="col">
<div class="card h-100">
<div class="card-header">➕ <b>Committed</b></div>
<div class="card-header">➕ <b>Committed Entries</b></div>
<div class="card-body text-center">
<h1>@Engine.Committer.Committed</h1>
</div>
</div>
</div>
<div class="col">
<div class="card h-100">
<div class="card-header">🔃 <b>Updated</b></div>
<div class="card-header">🔃 <b>Updated Entries</b></div>
<div class="card-body text-center">
<h1>@Engine.Committer.Updated</h1>
</div>
</div>
</div>
<div class="col">
<div class="card h-100">
<div class="card-header">🎯 <b>Missed</b></div>
<div class="card-header">🎯 <b>Missed Entries</b></div>
<div class="card-body text-center">
<h1>@Engine.Committer.Missed</h1>
</div>
Expand Down
5 changes: 5 additions & 0 deletions Tikhole.Website/Components/Pages/Settings.razor
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
<button @onclick="RestartTikhole" class="btn btn-dark">🔃 Restart Tikhole</button>
<button @onclick="StopTikhole" class="btn btn-dark">🛑 Stop Tikhole</button>
<button @onclick="SyncLists" class="btn btn-dark">🟰 Sync Lists</button>
<button @onclick="Shutdown" class="btn btn-dark">❌ Shutdown</button>
<hr />
@if (Error != "")
{
Expand Down Expand Up @@ -122,6 +123,10 @@
Info = "";
StateHasChanged();
}
private void Shutdown()
{
_ = Tikhole.WebApplication?.StopAsync();
}
private string CommitterEndpoint
{
get
Expand Down

0 comments on commit a6c168c

Please sign in to comment.