Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Kafka message sidebar panel #109

Merged
merged 10 commits into from
Sep 27, 2024
1 change: 1 addition & 0 deletions main/templates/main/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
{% bootstrap_css %}
{% bootstrap_javascript %}
{% block extra_css %}{% endblock %}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need this empty extra css block here?

Copy link
Contributor Author

@jamesturner246 jamesturner246 Sep 26, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is where I injected the custom CSS into the head in the index template. The contents of extra_css in index.html are substituted into extra_css in the <main> section of base.html.

Not sure if there's a more proper way to do it.

</head>

<body>
Expand Down
58 changes: 35 additions & 23 deletions main/templates/main/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,30 +3,42 @@

{% block title %}Home{% endblock title %}

{% block content %}

<div class="col">
{% block extra_css %}
<style>
.card-body {
max-height: 85vh;
overflow-y: auto;
}
</style>
{% endblock extra_css %}

{% if messages %}
<h2>Messages</h2>
<div style="white-space: pre-wrap;">
{% for message in messages %}
{{ message }}
{% endfor %}
{% block content %}
<div class="row">
<div class="col">
<form method="post", action="{% url 'main:process_action' %}">
{% csrf_token %}
<a href="{% url 'main:boot_process' %}" class="btn btn-primary">Boot</a>
<input type="submit" value="Restart" class="btn btn-success", name="action", onclick="return confirm('Restart selected processes?')">
<input type="submit" value="Flush" class="btn btn-warning", name="action", onclick="return confirm('Flush selected processes?')">
<input type="submit" value="Kill" class="btn btn-danger", name="action", onclick="return confirm('Kill selected processes?')">
{% render_table table %}
</form>
</div>
<div class="col">
<div class="card">
<div class="card-header">
Messages
</div>
<div class="card-body">
<ul class="list-group">
{% if messages %}
{% for message in messages %}
<li class="list-group-item">{{ message }}</li>
{% endfor %}
{% endif %}
</ul>
</div>
</div>
</div>
<hr class="solid">
{% endif %}

<form method="post", action="{% url 'main:process_action' %}">
{% csrf_token %}
<a href="{% url 'main:boot_process' %}" class="btn btn-primary">Boot</a>
<input type="submit" value="Restart" class="btn btn-success", name="action", onclick="return confirm('Restart selected processes?')">
<input type="submit" value="Flush" class="btn btn-warning", name="action", onclick="return confirm('Flush selected processes?')">
<input type="submit" value="Kill" class="btn btn-danger", name="action", onclick="return confirm('Kill selected processes?')">
{% render_table table %}
</form>

</div>


{% endblock content %}