mirror of
https://github.com/MarginaliaSearch/MarginaliaSearch.git
synced 2025-02-23 21:18:58 +00:00
(control) Add a summary table for Actors in the Node overview
This commit is contained in:
parent
56d832d661
commit
98c0972619
@ -14,7 +14,7 @@ public record ActorRunState(String name,
|
|||||||
|
|
||||||
public String stateIcon() {
|
public String stateIcon() {
|
||||||
if (terminal) {
|
if (terminal) {
|
||||||
return "\uD83D\uDE34";
|
return "\uD83D\uDC80"; // Unicode Skull
|
||||||
}
|
}
|
||||||
else if (state.equals("MONITOR")) {
|
else if (state.equals("MONITOR")) {
|
||||||
return "\uD83D\uDD26";
|
return "\uD83D\uDD26";
|
||||||
|
@ -319,12 +319,18 @@ public class ControlNodeService {
|
|||||||
private Object nodeOverviewModel(Request request, Response response) throws SQLException {
|
private Object nodeOverviewModel(Request request, Response response) throws SQLException {
|
||||||
int nodeId = Integer.parseInt(request.params("id"));
|
int nodeId = Integer.parseInt(request.params("id"));
|
||||||
var config = nodeConfigurationService.get(nodeId);
|
var config = nodeConfigurationService.get(nodeId);
|
||||||
|
|
||||||
|
var actors = executorClient.getActorStates(Context.fromRequest(request), nodeId).states();
|
||||||
|
|
||||||
|
actors.removeIf(actor -> actor.state().equals("MONITOR"));
|
||||||
|
|
||||||
return Map.of(
|
return Map.of(
|
||||||
"node", new IndexNode(nodeId),
|
"node", new IndexNode(nodeId),
|
||||||
"status", getStatus(config),
|
"status", getStatus(config),
|
||||||
"events", getEvents(nodeId),
|
"events", getEvents(nodeId),
|
||||||
"processes", heartbeatService.getProcessHeartbeatsForNode(nodeId),
|
"processes", heartbeatService.getProcessHeartbeatsForNode(nodeId),
|
||||||
"jobs", heartbeatService.getTaskHeartbeatsForNode(nodeId),
|
"jobs", heartbeatService.getTaskHeartbeatsForNode(nodeId),
|
||||||
|
"actors", actors,
|
||||||
"tab", Map.of("overview", true)
|
"tab", Map.of("overview", true)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -11,6 +11,7 @@
|
|||||||
|
|
||||||
<div class="mt-2">
|
<div class="mt-2">
|
||||||
{{> control/partials/processes-table }}
|
{{> control/partials/processes-table }}
|
||||||
|
{{> control/partials/actor-summary-table }}
|
||||||
</div>
|
</div>
|
||||||
<div class="mt-2">
|
<div class="mt-2">
|
||||||
{{> control/partials/events-table-summary }}
|
{{> control/partials/events-table-summary }}
|
||||||
@ -21,7 +22,7 @@
|
|||||||
{{> control/partials/foot-includes }}
|
{{> control/partials/foot-includes }}
|
||||||
<script>
|
<script>
|
||||||
window.setInterval(() => {
|
window.setInterval(() => {
|
||||||
refresh(["processes", "jobs", "events"]);
|
refresh(["processes", "jobs", "events", "actors"]);
|
||||||
}, 2000);
|
}, 2000);
|
||||||
</script>
|
</script>
|
||||||
</html>
|
</html>
|
@ -15,8 +15,14 @@
|
|||||||
|
|
||||||
{{#if nodes}}
|
{{#if nodes}}
|
||||||
<div class="my-3 p-3 border bg-light">
|
<div class="my-3 p-3 border bg-light">
|
||||||
Index nodes are processing units. The search engine requires at least one, but more can be added
|
<p>
|
||||||
to spread the system load across multiple physical disks or even multiple servers.
|
Index nodes are processing units. The search engine requires at least one, but more can be added
|
||||||
|
to spread the system load across multiple physical disks or even multiple servers.
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
New index nodes register themselves automatically upon start-up. They can't be fully removed,
|
||||||
|
but can be disabled in the settings.
|
||||||
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<table class="table">
|
<table class="table">
|
||||||
|
@ -0,0 +1,20 @@
|
|||||||
|
<h2>Actor Summary</h2>
|
||||||
|
<small class="text-muted">Idle monitoring actors are hidden. See the <a href="/nodes/{{node.id}}/actors">Actors tab</a>
|
||||||
|
for a complete view.</small>
|
||||||
|
<table id="actors" class="table">
|
||||||
|
<tr>
|
||||||
|
<th>Actor</th>
|
||||||
|
<th>State</th>
|
||||||
|
</tr>
|
||||||
|
{{#each actors}}
|
||||||
|
<tr>
|
||||||
|
<td title="{{actorDescription}}">{{name}}</td>
|
||||||
|
<td title="{{stateDescription}}">{{stateIcon}} {{state}}</td>
|
||||||
|
</tr>
|
||||||
|
{{/each}}
|
||||||
|
{{#unless actors}}
|
||||||
|
<tr>
|
||||||
|
<td colspan="2">No activity</td>
|
||||||
|
</tr>
|
||||||
|
{{/unless}}
|
||||||
|
</table>
|
@ -52,4 +52,4 @@
|
|||||||
<td colspan="4">No jobs running lately</td>
|
<td colspan="4">No jobs running lately</td>
|
||||||
</tr>
|
</tr>
|
||||||
{{/unless}}
|
{{/unless}}
|
||||||
</table>
|
</table>
|
||||||
|
Loading…
Reference in New Issue
Block a user