8
0
Fork 0
mirror of https://gitlab2.federez.net/re2o/re2o synced 2024-12-28 01:43:46 +00:00

Remplace location par bayswitch

This commit is contained in:
Gabriel Detraz 2018-04-08 04:12:58 +02:00 committed by chirac
parent bc1267e8f8
commit a621d378ec
5 changed files with 26 additions and 6 deletions

View file

@ -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'],

View file

@ -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):

View file

@ -0,0 +1,19 @@
# -*- 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',
),
]

View file

@ -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',

View file

@ -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 %}