Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
R
Re2o
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Container Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Levy--Falk Hugo
Re2o
Commits
51793bde
Commit
51793bde
authored
Jun 30, 2018
by
chirac
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Boolean direct pour désactiver un port + logo
parent
b2d45d00
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
39 additions
and
7 deletions
+39
-7
auth.py
freeradius_utils/auth.py
+3
-3
forms.py
topologie/forms.py
+2
-1
0066_auto_20180630_1855.py
topologie/migrations/0066_auto_20180630_1855.py
+25
-0
models.py
topologie/models.py
+5
-1
aff_port.html
topologie/templates/topologie/aff_port.html
+2
-0
sidebar.html
topologie/templates/topologie/sidebar.html
+2
-2
No files found.
freeradius_utils/auth.py
View file @
51793bde
...
...
@@ -369,15 +369,15 @@ def decide_vlan_and_register_switch(nas_machine, nas_type, port_number,
else
:
DECISION_VLAN
=
VLAN_OK
if
not
port
.
state
:
return
(
sw_name
,
port
.
room
,
u'Port desactive'
,
VLAN_NOK
)
if
port_profil
.
radius_type
==
'NO'
:
return
(
sw_name
,
""
,
u"Pas d'authentification sur ce port"
+
extra_log
,
DECISION_VLAN
)
if
port_profil
.
radius_type
==
'BLOQ'
:
return
(
sw_name
,
port
.
room
,
u'Port desactive'
,
VLAN_NOK
)
if
port_profil
.
radius_type
==
'STRICT'
:
room
=
port
.
room
if
not
room
:
...
...
topologie/forms.py
View file @
51793bde
...
...
@@ -81,7 +81,7 @@ class EditPortForm(FormRevMixin, ModelForm):
lent sans)"""
class
Meta
(
PortForm
.
Meta
):
fields
=
[
'room'
,
'related'
,
'machine_interface'
,
'custom_profil'
,
'details'
]
'state'
,
'details'
]
def
__init__
(
self
,
*
args
,
**
kwargs
):
prefix
=
kwargs
.
pop
(
'prefix'
,
self
.
Meta
.
model
.
__name__
)
...
...
@@ -110,6 +110,7 @@ class AddPortForm(FormRevMixin, ModelForm):
'machine_interface'
,
'related'
,
'custom_profil'
,
'state'
,
'details'
]
...
...
topologie/migrations/0066_auto_20180630_1855.py
0 → 100644
View file @
51793bde
# -*- coding: utf-8 -*-
# Generated by Django 1.10.7 on 2018-06-30 16:55
from
__future__
import
unicode_literals
from
django.db
import
migrations
,
models
class
Migration
(
migrations
.
Migration
):
dependencies
=
[
(
'topologie'
,
'0065_auto_20180630_1703'
),
]
operations
=
[
migrations
.
AddField
(
model_name
=
'port'
,
name
=
'state'
,
field
=
models
.
BooleanField
(
default
=
True
,
help_text
=
'Etat du port Actif'
,
verbose_name
=
'Etat du port Actif'
),
),
migrations
.
AlterField
(
model_name
=
'portprofile'
,
name
=
'profil_default'
,
field
=
models
.
CharField
(
blank
=
True
,
choices
=
[(
'room'
,
'room'
),
(
'accespoint'
,
'accesspoint'
),
(
'uplink'
,
'uplink'
),
(
'asso_machine'
,
'asso_machine'
),
(
'nothing'
,
'nothing'
)],
max_length
=
32
,
null
=
True
,
unique
=
True
,
verbose_name
=
'profil default'
),
),
]
topologie/models.py
View file @
51793bde
...
...
@@ -397,7 +397,11 @@ class Port(AclMixin, RevMixin, models.Model):
blank
=
True
,
null
=
True
)
state
=
models
.
BooleanField
(
default
=
True
,
help_text
=
'Etat du port Actif'
,
verbose_name
=
_
(
"Etat du port Actif"
)
)
details
=
models
.
CharField
(
max_length
=
255
,
blank
=
True
)
class
Meta
:
...
...
topologie/templates/topologie/aff_port.html
View file @
51793bde
...
...
@@ -32,6 +32,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
<th>
{% include "buttons/sort.html" with prefix='port' col='room' text='Room' %}
</th>
<th>
{% include "buttons/sort.html" with prefix='port' col='interface' text='Interface machine' %}
</th>
<th>
{% include "buttons/sort.html" with prefix='port' col='related' text='Related' %}
</th>
<th>
Etat du port
</th>
<th>
Profil du port
</th>
<th>
Détails
</th>
<th></th>
...
...
@@ -65,6 +66,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
{% acl_end %}
{% endif %}
</td>
<td>
{% if port.state %}
<i
class=
"text-success"
>
Actif
</i>
{% else %}
<i
class=
"text-danger"
>
Désactivé
</i>
{% endif %}
</td>
<td>
{% if not port.custom_profil %}
<u>
Par défaut
</u>
: {% endif %}{{port.get_port_profil}}
</td>
<td>
{{ port.details }}
</td>
<td
class=
"text-right"
>
...
...
topologie/templates/topologie/sidebar.html
View file @
51793bde
...
...
@@ -34,8 +34,8 @@ with this program; if not, write to the Free Software Foundation, Inc.,
Switchs
</a>
<a
class=
"list-group-item list-group-item-info"
href=
"{% url "
topologie:index-port-profile
"
%}"
>
<i
class=
"fa fa-
slider
s"
></i>
Profil
des ports switchs
<i
class=
"fa fa-
cog
s"
></i>
Config
des ports switchs
</a>
<a
class=
"list-group-item list-group-item-info"
href=
"{% url "
topologie:index-ap
"
%}"
>
<i
class=
"fa fa-wifi"
></i>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment