mirror of https://gitlab.federez.net/re2o/re2o
13 changed files with 391 additions and 3 deletions
@ -0,0 +1,36 @@ |
|||
# -*- coding: utf-8 -*- |
|||
# Generated by Django 1.10.7 on 2018-05-26 22:26 |
|||
from __future__ import unicode_literals |
|||
|
|||
from django.db import migrations, models |
|||
import django.db.models.deletion |
|||
import re2o.mixins |
|||
|
|||
|
|||
class Migration(migrations.Migration): |
|||
|
|||
dependencies = [ |
|||
('machines', '0081_auto_20180521_1413'), |
|||
('topologie', '0060_server'), |
|||
] |
|||
|
|||
operations = [ |
|||
migrations.CreateModel( |
|||
name='PortProfile', |
|||
fields=[ |
|||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), |
|||
('room_default', models.BooleanField()), |
|||
('hotspot_default', models.BooleanField()), |
|||
('uplink_default', models.BooleanField()), |
|||
('orga_machine_default', models.BooleanField()), |
|||
('radius_type', models.CharField(choices=[('NO', 'NO'), ('802.1X', '802.1X'), ('MAC-radius', 'MAC-radius')], max_length=32)), |
|||
('radius_mode', models.CharField(choices=[('STRICT', 'STRICT'), ('COMMON', 'COMMON')], max_length=32)), |
|||
('vlan_tagged', models.ManyToManyField(related_name='vlan_tagged', to='machines.Vlan')), |
|||
('vlan_untagged', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='vlan_untagged', to='machines.Vlan')), |
|||
], |
|||
options={ |
|||
'permissions': (('view_port_profile', 'Can view a port profile object'),), |
|||
}, |
|||
bases=(re2o.mixins.AclMixin, models.Model), |
|||
), |
|||
] |
|||
@ -0,0 +1,66 @@ |
|||
# -*- coding: utf-8 -*- |
|||
# Generated by Django 1.10.7 on 2018-06-09 16:51 |
|||
from __future__ import unicode_literals |
|||
|
|||
from django.db import migrations, models |
|||
import django.db.models.deletion |
|||
|
|||
|
|||
class Migration(migrations.Migration): |
|||
|
|||
dependencies = [ |
|||
('topologie', '0061_portprofile'), |
|||
] |
|||
|
|||
operations = [ |
|||
migrations.AlterModelOptions( |
|||
name='portprofile', |
|||
options={'permissions': (('view_port_profile', 'Can view a port profile object'),), 'verbose_name': 'Port profile', 'verbose_name_plural': 'Port profiles'}, |
|||
), |
|||
migrations.AddField( |
|||
model_name='portprofile', |
|||
name='name', |
|||
field=models.CharField(default='Sans nom', max_length=255, verbose_name='Name'), |
|||
preserve_default=False, |
|||
), |
|||
migrations.AlterField( |
|||
model_name='portprofile', |
|||
name='hotspot_default', |
|||
field=models.BooleanField(verbose_name='Hotspot default'), |
|||
), |
|||
migrations.AlterField( |
|||
model_name='portprofile', |
|||
name='orga_machine_default', |
|||
field=models.BooleanField(verbose_name='Organisation machine default'), |
|||
), |
|||
migrations.AlterField( |
|||
model_name='portprofile', |
|||
name='radius_mode', |
|||
field=models.CharField(choices=[('STRICT', 'STRICT'), ('COMMON', 'COMMON')], max_length=32, verbose_name='RADIUS mode'), |
|||
), |
|||
migrations.AlterField( |
|||
model_name='portprofile', |
|||
name='radius_type', |
|||
field=models.CharField(choices=[('NO', 'NO'), ('802.1X', '802.1X'), ('MAC-radius', 'MAC-radius')], max_length=32, verbose_name='RADIUS type'), |
|||
), |
|||
migrations.AlterField( |
|||
model_name='portprofile', |
|||
name='room_default', |
|||
field=models.BooleanField(verbose_name='Room default'), |
|||
), |
|||
migrations.AlterField( |
|||
model_name='portprofile', |
|||
name='uplink_default', |
|||
field=models.BooleanField(verbose_name='Uplink default'), |
|||
), |
|||
migrations.AlterField( |
|||
model_name='portprofile', |
|||
name='vlan_tagged', |
|||
field=models.ManyToManyField(related_name='vlan_tagged', to='machines.Vlan', verbose_name='VLAN(s) tagged'), |
|||
), |
|||
migrations.AlterField( |
|||
model_name='portprofile', |
|||
name='vlan_untagged', |
|||
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='vlan_untagged', to='machines.Vlan', verbose_name='VLAN untagged'), |
|||
), |
|||
] |
|||
@ -0,0 +1,20 @@ |
|||
# -*- coding: utf-8 -*- |
|||
# Generated by Django 1.10.7 on 2018-06-09 16:58 |
|||
from __future__ import unicode_literals |
|||
|
|||
from django.db import migrations, models |
|||
|
|||
|
|||
class Migration(migrations.Migration): |
|||
|
|||
dependencies = [ |
|||
('topologie', '0062_auto_20180609_1151'), |
|||
] |
|||
|
|||
operations = [ |
|||
migrations.AlterField( |
|||
model_name='portprofile', |
|||
name='vlan_tagged', |
|||
field=models.ManyToManyField(blank=True, related_name='vlan_tagged', to='machines.Vlan', verbose_name='VLAN(s) tagged'), |
|||
), |
|||
] |
|||
@ -0,0 +1,20 @@ |
|||
# -*- coding: utf-8 -*- |
|||
# Generated by Django 1.10.7 on 2018-06-09 17:20 |
|||
from __future__ import unicode_literals |
|||
|
|||
from django.db import migrations, models |
|||
|
|||
|
|||
class Migration(migrations.Migration): |
|||
|
|||
dependencies = [ |
|||
('topologie', '0063_auto_20180609_1158'), |
|||
] |
|||
|
|||
operations = [ |
|||
migrations.AlterField( |
|||
model_name='portprofile', |
|||
name='radius_mode', |
|||
field=models.CharField(blank=True, choices=[('STRICT', 'STRICT'), ('COMMON', 'COMMON')], max_length=32, null=True, verbose_name='RADIUS mode'), |
|||
), |
|||
] |
|||
@ -0,0 +1,46 @@ |
|||
{% load acl %} |
|||
{% load i18n %} |
|||
|
|||
<div class="table-responsive"> |
|||
|
|||
{% if port_profile_list.paginator %} |
|||
{% include "pagination.html" with list=port_profile_list %} |
|||
{% endif %} |
|||
|
|||
<table class="table table-striped"> |
|||
<thead> |
|||
<tr> |
|||
<th>{% trans "Name" %}</th> |
|||
<th>{% trans "VLAN untagged" %}</th> |
|||
<th>{% trans "VLAN(s) tagged" %}</th> |
|||
<th>{% trans "RADIUS type" %}</th> |
|||
<th>{% trans "RADIUS mode" %}</th> |
|||
</tr> |
|||
</thead> |
|||
{% for port_profile in port_profile_list %} |
|||
<tr> |
|||
<td>{{port_profile.name}}</td> |
|||
<td>{{port_profile.vlan_untagged}}</td> |
|||
<td> |
|||
{{port_profile.vlan_tagged.all|join:", "}} |
|||
</td> |
|||
<td>{{port_profile.radius_type}}</td> |
|||
<td>{{port_profile.radius_mode}}</td> |
|||
<td class="text-right"> |
|||
{% include 'buttons/history.html' with href='topologie:history' name='portprofile' id=port_profile.pk %} |
|||
{% can_edit port_profile %} |
|||
{% include 'buttons/edit.html' with href='topologie:edit-port-profile' id=port_profile.pk %} |
|||
{% acl_end %} |
|||
{% can_delete port_profile %} |
|||
{% include 'buttons/suppr.html' with href='topologie:del-port-profile' id=port_profile.pk %} |
|||
{% acl_end %} |
|||
</td> |
|||
</tr> |
|||
{% endfor %} |
|||
</table> |
|||
|
|||
{% if port_profile_list.paginator %} |
|||
{% include "pagination.html" with list=port_profile_list %} |
|||
{% endif %} |
|||
|
|||
</div> |
|||
Loading…
Reference in new issue