feat(itim): Services assignable to cluster

ref: #247 #125
This commit is contained in:
2024-08-19 15:28:40 +09:30
parent 66b8bd5a74
commit 32f45f2d5f
2 changed files with 13 additions and 6 deletions

View File

@ -66,18 +66,20 @@
<h3>Services</h3>
{% include 'icons/issue_link.html.j2' with issue=125 %}
<table>
<tr>
<th>Name</th>
<th>Ports</th>
</tr>
{% if cluster.services.all %}
{% for device in cluster.devices.all %}
{% if services %}
{% for service in services.all %}
<tr>
<td></td>
<td></td>
<td><a href="{% url 'ITIM:_service_view' service.id %}">{{ service.name }}</a></td>
<td>
{% for port in service.port.all %}
{{ port.protocol }}/{{ port.number }} - {{ port.description }},
{% endfor %}
</td>
</tr>
{% endfor%}
{% else %}

View File

@ -8,6 +8,7 @@ from core.views.common import AddView, ChangeView, DeleteView, IndexView
from itim.forms.clusters import ClusterForm, DetailForm
from itim.models.clusters import Cluster
from itim.models.services import Service
from settings.models.user_settings import UserSettings
@ -159,6 +160,10 @@ class View(ChangeView):
context['model_delete_url'] = reverse('ITIM:_cluster_delete', args=(self.kwargs['pk'],))
context['services'] = Service.objects.filter(
cluster = self.kwargs['pk']
)
context['content_title'] = self.object.name