Skip to content

Commit

Permalink
Merge pull request #283 from ImperialCollegeLondon/ers_logs
Browse files Browse the repository at this point in the history
ERS logs page
  • Loading branch information
jamesturner246 authored Dec 20, 2024
2 parents 6577b17 + d98d647 commit bdcebf8
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 5 deletions.
32 changes: 32 additions & 0 deletions controller/templates/controller/ers_logs.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{% extends "main/base.html" %}
{% block title %}
Controller - ERS Logs
{% endblock title %}
{% block extra_css %}
<style>
#hide-messages-button {
filter: invert(1);
float: right;
}
.message-item {
font-family: 'Arial', sans-serif;
font-size: 0.875rem;
line-height: 1.4;
}
.flex-container {
display: flex;
gap: 15px;
}
.flex-container .fsm-panel {
flex: 1;
}
.flex-container .message-panel {
width: 100%;
}
</style>
{% endblock extra_css %}
{% block content %}
<div class="container-fluid no-padding no-margin">
<div class="flex-container" id="main-content">{% include "main/messages.html" with topic="ERS" %}</div>
</div>
{% endblock content %}
1 change: 1 addition & 0 deletions controller/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,6 @@
urlpatterns = [
path("", pages.index, name="index"),
path("app_tree", pages.app_tree_view, name="app_tree"),
path("ers_logs", pages.ers_logs, name="ers_logs"),
path("partials/", include(partial_urlpatterns)),
]
6 changes: 6 additions & 0 deletions controller/views/pages.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,9 @@ def app_tree_view(request: HttpRequest) -> HttpResponse:
request=request,
template_name="controller/app_tree_view.html",
)


@login_required
def ers_logs(request: HttpRequest) -> HttpResponse:
"""View that renders the ERS log messages page."""
return render(request=request, template_name="controller/ers_logs.html")
2 changes: 0 additions & 2 deletions drunc_ui/settings/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,6 @@
KAFKA_ADDRESS = os.getenv("KAFKA_ADDRESS", "kafka:9092")

KAFKA_TOPIC_REGEX = {
# ALL matches all topics.
"ALL": "^.*$",
# PROCMAN matches topics of the form "control.<session>.process_manager".
"PROCMAN": "^control\..+\.process_manager$",
# ERS matches only the topic "erskafka-reporting".
Expand Down
6 changes: 3 additions & 3 deletions main/templates/main/messages.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@ <h5 class="d-inline">Messages</h5>
type="search"
name="search"
placeholder="Search messages..."
hx-get="{% url 'main:messages' topic|default:"ALL" %}"
hx-get="{% url 'main:messages' topic %}"
hx-trigger="input changed delay:500ms, every 1s"
hx-target="#message-list"
hx-include="#filter-form">
<!-- Severity Filter Dropdown -->
<select name="severity"
class="form-select mb-2"
hx-get="{% url 'main:messages' topic|default:"ALL" %}"
hx-get="{% url 'main:messages' topic %}"
hx-target="#message-list"
hx-include="#filter-form">
<option value="">All Severities</option>
Expand All @@ -39,7 +39,7 @@ <h5 class="d-inline">Messages</h5>
</form>
<div id="message-list"
class="list-group"
hx-get="{% url 'main:messages' topic|default:"ALL" %}"
hx-get="{% url 'main:messages' topic %}"
hx-trigger="load"></div>
</div>
</div>
Expand Down

0 comments on commit bdcebf8

Please sign in to comment.