Commit a621d378 authored by Gabriel Detraz's avatar Gabriel Detraz Committed by chirac

Remplace location par bayswitch

parent bc1267e8
......@@ -220,10 +220,10 @@ class SortTable:
TOPOLOGIE_INDEX = {
'switch_dns': ['interface__domain__name'],
'switch_ip': ['interface__ipv4__ipv4'],
'switch_loc': ['location'],
'switch_loc': ['switchbay__name'],
'switch_ports': ['number'],
'switch_stack': ['stack__name'],
'default': ['location', 'stack', 'stack_member_id']
'default': ['switchbay', 'stack', 'stack_member_id']
}
TOPOLOGIE_INDEX_PORT = {
'port_port': ['port'],
......
......@@ -148,7 +148,7 @@ class NewSwitchForm(NewMachineForm):
"""Permet de créer un switch : emplacement, paramètres machine,
membre d'un stack (option), nombre de ports (number)"""
class Meta(EditSwitchForm.Meta):
fields = ['name', 'location', 'number', 'stack', 'stack_member_id']
fields = ['name', 'switchbay', 'number', 'stack', 'stack_member_id']
class EditRoomForm(FormRevMixin, ModelForm):
......
# -*- coding: utf-8 -*-
# Generated by Django 1.10.7 on 2018-04-08 02:06
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('topologie', '0057_auto_20180408_0316'),
]
operations = [
migrations.RemoveField(
model_name='switch',
name='location',
),
]
......@@ -121,7 +121,6 @@ class Switch(AclMixin, Machine):
PRETTY_NAME = "Switch / Commutateur"
location = models.CharField(max_length=255)
number = models.PositiveIntegerField()
stack = models.ForeignKey(
'topologie.Stack',
......
......@@ -28,12 +28,13 @@ with this program; if not, write to the Free Software Foundation, Inc.,
{% include "pagination.html" with list=switch_list %}
{% endif %}
<div class="table-responsive">
<table class="table table-striped">
<thead>
<tr>
<th>{% include "buttons/sort.html" with prefix='switch' col='dns' text='Dns' %}</th>
<th>{% include "buttons/sort.html" with prefix='switch' col='ip' text='Ipv4' %}</th>
<th>{% include "buttons/sort.html" with prefix='switch' col='loc' text='Localisation' %}</th>
<th>{% include "buttons/sort.html" with prefix='switch' col='loc' text='Emplacement' %}</th>
<th>{% include "buttons/sort.html" with prefix='switch' col='ports' text='Ports' %}</th>
<th>{% include "buttons/sort.html" with prefix='switch' col='stack' text='Stack' %}</th>
<th>Id stack</th>
......@@ -50,7 +51,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
</a>
</td>
<td>{{switch.interface_set.first.ipv4}}</td>
<td>{{switch.location}}</td>
<td>{{switch.switchbay}}</td>
<td>{{switch.number}}</td>
<td>{{switch.stack.name}}</td>
<td>{{switch.stack_member_id}}</td>
......@@ -71,6 +72,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
</tr>
{% endfor %}
</table>
</div>
{% if switch_list.paginator %}
{% include "pagination.html" with list=switch_list %}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment