Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
R
re2o
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Nounous
re2o
Commits
5dce3629
Commit
5dce3629
authored
Jul 23, 2018
by
Maël Kervella
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
translation and cleanup
parent
352a4166
Changes
13
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
110 additions
and
169 deletions
+110
-169
machines/forms.py
machines/forms.py
+2
-2
machines/migrations/0084_auto_20180623_1651.py
machines/migrations/0084_auto_20180623_1651.py
+12
-16
machines/migrations/0085_auto_20180623_1817.py
machines/migrations/0085_auto_20180623_1817.py
+0
-20
machines/migrations/0086_auto_20180624_1254.py
machines/migrations/0086_auto_20180624_1254.py
+0
-30
machines/models.py
machines/models.py
+10
-12
machines/templates/machines/aff_machines.html
machines/templates/machines/aff_machines.html
+1
-1
machines/templates/machines/aff_sshfingerprint.html
machines/templates/machines/aff_sshfingerprint.html
+14
-12
machines/templates/machines/aff_sshfpralgo.html
machines/templates/machines/aff_sshfpralgo.html
+21
-21
machines/templates/machines/index_sshfingerprint.html
machines/templates/machines/index_sshfingerprint.html
+7
-8
machines/templates/machines/index_sshfpralgo.html
machines/templates/machines/index_sshfpralgo.html
+7
-8
machines/templates/machines/machine.html
machines/templates/machines/machine.html
+14
-17
machines/templates/machines/sidebar.html
machines/templates/machines/sidebar.html
+1
-1
machines/views.py
machines/views.py
+21
-21
No files found.
machines/forms.py
View file @
5dce3629
...
@@ -600,7 +600,7 @@ class EditOuverturePortListForm(FormRevMixin, ModelForm):
...
@@ -600,7 +600,7 @@ class EditOuverturePortListForm(FormRevMixin, ModelForm):
class
SshFingerprintForm
(
FormRevMixin
,
ModelForm
):
class
SshFingerprintForm
(
FormRevMixin
,
ModelForm
):
"""Edit
ion d'une sshfingerprint
"""
"""Edit
s a SSH fingerprint.
"""
class
Meta
:
class
Meta
:
model
=
SshFingerprint
model
=
SshFingerprint
exclude
=
(
'machine'
,)
exclude
=
(
'machine'
,)
...
@@ -615,7 +615,7 @@ class SshFingerprintForm(FormRevMixin, ModelForm):
...
@@ -615,7 +615,7 @@ class SshFingerprintForm(FormRevMixin, ModelForm):
class
SshFprAlgoForm
(
FormRevMixin
,
ModelForm
):
class
SshFprAlgoForm
(
FormRevMixin
,
ModelForm
):
"""Edit
ion de la liste des algo pour sshfpr
"""
"""Edit
s a SSH fingerprint algorithm.
"""
class
Meta
:
class
Meta
:
model
=
SshFprAlgo
model
=
SshFprAlgo
fields
=
'__all__'
fields
=
'__all__'
...
...
machines/migrations/0084_auto_20180623_1651.py
View file @
5dce3629
...
@@ -10,7 +10,7 @@ import re2o.mixins
...
@@ -10,7 +10,7 @@ import re2o.mixins
class
Migration
(
migrations
.
Migration
):
class
Migration
(
migrations
.
Migration
):
dependencies
=
[
dependencies
=
[
(
'machines'
,
'0083_r
ole
'
),
(
'machines'
,
'0083_r
emove_duplicate_rights
'
),
]
]
operations
=
[
operations
=
[
...
@@ -18,11 +18,15 @@ class Migration(migrations.Migration):
...
@@ -18,11 +18,15 @@ class Migration(migrations.Migration):
name
=
'SshFingerprint'
,
name
=
'SshFingerprint'
,
fields
=
[
fields
=
[
(
'id'
,
models
.
AutoField
(
auto_created
=
True
,
primary_key
=
True
,
serialize
=
False
,
verbose_name
=
'ID'
)),
(
'id'
,
models
.
AutoField
(
auto_created
=
True
,
primary_key
=
True
,
serialize
=
False
,
verbose_name
=
'ID'
)),
(
'hash_entry'
,
models
.
TextField
(
max_length
=
512
)),
(
'pub_key_entry'
,
models
.
TextField
(
help_text
=
'SSH public key'
,
max_length
=
2048
)),
(
'comment'
,
models
.
CharField
(
blank
=
True
,
max_length
=
255
,
null
=
True
)),
(
'comment'
,
models
.
CharField
(
blank
=
True
,
help_text
=
'Comment'
,
max_length
=
255
,
null
=
True
)),
(
'algo'
,
models
.
ForeignKey
(
on_delete
=
django
.
db
.
models
.
deletion
.
PROTECT
,
to
=
'machines.SshFprAlgo'
)),
(
'machine'
,
models
.
ForeignKey
(
on_delete
=
django
.
db
.
models
.
deletion
.
CASCADE
,
to
=
'machines.Machine'
)),
],
],
options
=
{
options
=
{
'permissions'
:
((
'view_sshfingerprint'
,
'Peut voir un objet sshfingerprint'
),),
'permissions'
:
((
'view_sshfingerprint'
,
'Can see an SSH fingerprint'
),),
'verbose_name'
:
'SSH fingerprint'
,
'verbose_name_plural'
:
'SSH fingerprints'
},
},
bases
=
(
re2o
.
mixins
.
RevMixin
,
re2o
.
mixins
.
AclMixin
,
models
.
Model
),
bases
=
(
re2o
.
mixins
.
RevMixin
,
re2o
.
mixins
.
AclMixin
,
models
.
Model
),
),
),
...
@@ -30,21 +34,13 @@ class Migration(migrations.Migration):
...
@@ -30,21 +34,13 @@ class Migration(migrations.Migration):
name
=
'SshFprAlgo'
,
name
=
'SshFprAlgo'
,
fields
=
[
fields
=
[
(
'id'
,
models
.
AutoField
(
auto_created
=
True
,
primary_key
=
True
,
serialize
=
False
,
verbose_name
=
'ID'
)),
(
'id'
,
models
.
AutoField
(
auto_created
=
True
,
primary_key
=
True
,
serialize
=
False
,
verbose_name
=
'ID'
)),
(
'name'
,
models
.
Text
Field
(
max_length
=
256
)),
(
'name'
,
models
.
Char
Field
(
max_length
=
256
)),
],
],
options
=
{
options
=
{
'permissions'
:
((
'view_sshfpralgo'
,
'Peut voir un algo de chiffrement'
),),
'permissions'
:
((
'view_sshfpralgo'
,
'Can see an SSH fingerprint algorithm'
),),
'verbose_name'
:
'SSH fingerprint algorithm'
,
'verbose_name_plural'
:
'SSH fingerprint algorithms'
},
},
bases
=
(
re2o
.
mixins
.
RevMixin
,
re2o
.
mixins
.
AclMixin
,
models
.
Model
),
bases
=
(
re2o
.
mixins
.
RevMixin
,
re2o
.
mixins
.
AclMixin
,
models
.
Model
),
),
),
migrations
.
AddField
(
model_name
=
'sshfingerprint'
,
name
=
'algo'
,
field
=
models
.
ForeignKey
(
on_delete
=
django
.
db
.
models
.
deletion
.
PROTECT
,
to
=
'machines.SshFprAlgo'
),
),
migrations
.
AddField
(
model_name
=
'sshfingerprint'
,
name
=
'machine'
,
field
=
models
.
ForeignKey
(
on_delete
=
django
.
db
.
models
.
deletion
.
CASCADE
,
to
=
'machines.Machine'
),
),
]
]
machines/migrations/0085_auto_20180623_1817.py
deleted
100644 → 0
View file @
352a4166
# -*- coding: utf-8 -*-
# Generated by Django 1.10.7 on 2018-06-23 16:17
from
__future__
import
unicode_literals
from
django.db
import
migrations
,
models
class
Migration
(
migrations
.
Migration
):
dependencies
=
[
(
'machines'
,
'0084_auto_20180623_1651'
),
]
operations
=
[
migrations
.
AlterField
(
model_name
=
'sshfpralgo'
,
name
=
'name'
,
field
=
models
.
CharField
(
max_length
=
256
),
),
]
machines/migrations/0086_auto_20180624_1254.py
deleted
100644 → 0
View file @
352a4166
# -*- coding: utf-8 -*-
# Generated by Django 1.10.7 on 2018-06-24 10:54
from
__future__
import
unicode_literals
from
django.db
import
migrations
,
models
class
Migration
(
migrations
.
Migration
):
dependencies
=
[
(
'machines'
,
'0085_auto_20180623_1817'
),
]
operations
=
[
migrations
.
RenameField
(
model_name
=
'sshfingerprint'
,
old_name
=
'hash_entry'
,
new_name
=
'pub_key_entry'
,
),
migrations
.
AlterField
(
model_name
=
'sshfingerprint'
,
name
=
'comment'
,
field
=
models
.
CharField
(
blank
=
True
,
help_text
=
'Commentaire'
,
max_length
=
255
,
null
=
True
),
),
migrations
.
AlterField
(
model_name
=
'sshfingerprint'
,
name
=
'pub_key_entry'
,
field
=
models
.
TextField
(
help_text
=
'Clef publique ssh'
,
max_length
=
2048
),
),
]
machines/models.py
View file @
5dce3629
...
@@ -201,14 +201,10 @@ class Machine(RevMixin, FieldPermissionModelMixin, models.Model):
...
@@ -201,14 +201,10 @@ class Machine(RevMixin, FieldPermissionModelMixin, models.Model):
return
str
(
self
.
user
)
+
' - '
+
str
(
self
.
id
)
+
' - '
+
str
(
self
.
name
)
return
str
(
self
.
user
)
+
' - '
+
str
(
self
.
id
)
+
' - '
+
str
(
self
.
name
)
class
SshFingerprint
(
RevMixin
,
AclMixin
,
models
.
Model
):
class
SshFingerprint
(
RevMixin
,
AclMixin
,
models
.
Model
):
"""Stockage de la clef ssh publique d'une machine
"""A fingerpirnt of an SSH public key"""
et calcul de ses hash"""
PRETTY_NAME
=
"Clef publique ssh"
machine
=
models
.
ForeignKey
(
'Machine'
,
on_delete
=
models
.
CASCADE
)
machine
=
models
.
ForeignKey
(
'Machine'
,
on_delete
=
models
.
CASCADE
)
pub_key_entry
=
models
.
TextField
(
pub_key_entry
=
models
.
TextField
(
help_text
=
"
Clef publique ssh
"
,
help_text
=
"
SSH public key
"
,
max_length
=
2048
max_length
=
2048
)
)
algo
=
models
.
ForeignKey
(
algo
=
models
.
ForeignKey
(
...
@@ -216,7 +212,7 @@ class SshFingerprint(RevMixin, AclMixin, models.Model):
...
@@ -216,7 +212,7 @@ class SshFingerprint(RevMixin, AclMixin, models.Model):
on_delete
=
models
.
PROTECT
on_delete
=
models
.
PROTECT
)
)
comment
=
models
.
CharField
(
comment
=
models
.
CharField
(
help_text
=
"Comment
aire
"
,
help_text
=
"Comment"
,
max_length
=
255
,
max_length
=
255
,
null
=
True
,
null
=
True
,
blank
=
True
blank
=
True
...
@@ -224,8 +220,10 @@ class SshFingerprint(RevMixin, AclMixin, models.Model):
...
@@ -224,8 +220,10 @@ class SshFingerprint(RevMixin, AclMixin, models.Model):
class
Meta
:
class
Meta
:
permissions
=
(
permissions
=
(
(
"view_sshfingerprint"
,
"
Peut voir un objet ssh
fingerprint"
),
(
"view_sshfingerprint"
,
"
Can see an SSH
fingerprint"
),
)
)
verbose_name
=
"SSH fingerprint"
verbose_name_plural
=
"SSH fingerprints"
def
can_view
(
self
,
user_request
,
*
_args
,
**
_kwargs
):
def
can_view
(
self
,
user_request
,
*
_args
,
**
_kwargs
):
return
self
.
machine
.
can_view
(
user_request
,
*
_args
,
**
_kwargs
)
return
self
.
machine
.
can_view
(
user_request
,
*
_args
,
**
_kwargs
)
...
@@ -241,15 +239,15 @@ class SshFingerprint(RevMixin, AclMixin, models.Model):
...
@@ -241,15 +239,15 @@ class SshFingerprint(RevMixin, AclMixin, models.Model):
class
SshFprAlgo
(
RevMixin
,
AclMixin
,
models
.
Model
):
class
SshFprAlgo
(
RevMixin
,
AclMixin
,
models
.
Model
):
"""Un aglorithme de création de la fingerprint ssh"""
"""An algorithm to compute SSH fingerprints"""
PRETTY_NAME
=
"Algo de clef ssh"
name
=
models
.
CharField
(
max_length
=
256
)
name
=
models
.
CharField
(
max_length
=
256
)
class
Meta
:
class
Meta
:
permissions
=
(
permissions
=
(
(
"view_sshfpralgo"
,
"
Peut voir un algo de chiffrement
"
),
(
"view_sshfpralgo"
,
"
Can see an SSH fingerprint algorithm
"
),
)
)
verbose_name
=
"SSH fingerprint algorithm"
verbose_name_plural
=
"SSH fingerprint algorithms"
def
__str__
(
self
):
def
__str__
(
self
):
return
str
(
self
.
name
)
return
str
(
self
.
name
)
...
...
machines/templates/machines/aff_machines.html
View file @
5dce3629
...
@@ -122,7 +122,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
...
@@ -122,7 +122,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
{% can_create SshFingerprint interface.machine.id %}
{% can_create SshFingerprint interface.machine.id %}
<li>
<li>
<a
href=
"{% url 'machines:index-sshfingerprint' interface.machine.id %}"
>
<a
href=
"{% url 'machines:index-sshfingerprint' interface.machine.id %}"
>
<i
class=
"fa fa-edit"
></i>
Gerer les fingerprint ssh
<i
class=
"fa fa-edit"
></i>
Manage the SSH fingerprints
</a>
</a>
</li>
</li>
{% acl_end %}
{% acl_end %}
...
...
machines/templates/machines/aff_sshfingerprint.html
View file @
5dce3629
...
@@ -21,14 +21,16 @@ with this program; if not, write to the Free Software Foundation, Inc.,
...
@@ -21,14 +21,16 @@ with this program; if not, write to the Free Software Foundation, Inc.,
{% endcomment %}
{% endcomment %}
{% load acl %}
{% load acl %}
{% load logs_extra %}
<div
class=
"table-responsive"
>
<div
class=
"table-responsive"
>
<table
class=
"table table-striped long_text"
>
<table
class=
"table table-striped long_text"
>
<thead>
<thead>
<tr>
<tr>
<th
class=
"long_text"
>
Entrée du hash
</th>
<th
class=
"long_text"
>
SSH public key
</th>
<th>
Algorithme utilisé
</th>
<th>
Algorithm used
</th>
<th>
Commentaire
</th>
<th>
Comment
</th>
<th></th>
<th></th>
</tr>
</tr>
</thead>
</thead>
{% for sshfpr in sshfingerprint_list %}
{% for sshfpr in sshfingerprint_list %}
...
@@ -36,14 +38,14 @@ with this program; if not, write to the Free Software Foundation, Inc.,
...
@@ -36,14 +38,14 @@ with this program; if not, write to the Free Software Foundation, Inc.,
<td
class=
"long_text"
>
{{ sshfpr.pub_key_entry }}
</td>
<td
class=
"long_text"
>
{{ sshfpr.pub_key_entry }}
</td>
<td>
{{ sshfpr.algo }}
</td>
<td>
{{ sshfpr.algo }}
</td>
<td>
{{ sshfpr.comment }}
</td>
<td>
{{ sshfpr.comment }}
</td>
<td
class=
"text-right"
>
<td
class=
"text-right"
>
{% can_edit sshfpr %}
{% can_edit sshfpr %}
{% include 'buttons/edit.html' with href='machines:edit-sshfingerprint' id=sshfpr.id %}
{% include 'buttons/edit.html' with href='machines:edit-sshfingerprint' id=sshfpr.id %}
{% acl_end %}
{% acl_end %}
{% can_delete sshfpr %}
{% can_delete sshfpr %}
{% include 'buttons/suppr.html' with href='machines:del-sshfingerprint' id=sshfpr.id %}
{% include 'buttons/suppr.html' with href='machines:del-sshfingerprint' id=sshfpr.id %}
{% acl_end %}
{% acl_end %}
{% include 'buttons/history.html' with href='machines:history' name='sshfingerprint' id=sshfpr.id
%}
{% history_button sshfpr
%}
</td>
</td>
</tr>
</tr>
{% endfor %}
{% endfor %}
...
...
machines/templates/machines/aff_sshfpralgo.html
View file @
5dce3629
...
@@ -21,27 +21,27 @@ with this program; if not, write to the Free Software Foundation, Inc.,
...
@@ -21,27 +21,27 @@ with this program; if not, write to the Free Software Foundation, Inc.,
{% endcomment %}
{% endcomment %}
{% load acl %}
{% load acl %}
{% load logs_extra %}
<table
class=
"table table-striped"
>
<table
class=
"table table-striped"
>
<thead>
<thead>
<tr>
<th>
Nom de l'algo
</th>
<th></th>
</tr>
</thead>
{% for sshfpralgo in sshfpralgo_list %}
<tr>
<tr>
<td>
{{ sshfpralgo.name }}
</td>
<th>
Algorithm name
</th>
<td
class=
"text-right"
>
<th></th>
{% can_edit sshfpralgo %}
{% include 'buttons/edit.html' with href='machines:edit-sshfpralgo' id=sshfpralgo.id %}
{% acl_end %}
{% can_delete sshfpralgo %}
{% include 'buttons/suppr.html' with href='machines:del-sshfpralgo' id=sshfpralgo.id %}
{% acl_end %}
{% include 'buttons/history.html' with href='machines:history' name='sshfpralgo' id=sshfpralgo.id %}
</td>
</tr>
</tr>
{% endfor %}
</thead>
</table>
{% for sshfpralgo in sshfpralgo_list %}
<tr>
<td>
{{ sshfpralgo.name }}
</td>
<td
class=
"text-right"
>
{% can_edit sshfpralgo %}
{% include 'buttons/edit.html' with href='machines:edit-sshfpralgo' id=sshfpralgo.id %}
{% acl_end %}
{% can_delete sshfpralgo %}
{% include 'buttons/suppr.html' with href='machines:del-sshfpralgo' id=sshfpralgo.id %}
{% acl_end %}
{% history_button sshfpralgo %}
</td>
</tr>
{% endfor %}
</table>
machines/templates/machines/index_sshfingerprint.html
View file @
5dce3629
...
@@ -27,13 +27,12 @@ with this program; if not, write to the Free Software Foundation, Inc.,
...
@@ -27,13 +27,12 @@ with this program; if not, write to the Free Software Foundation, Inc.,
{% block title %}Machines{% endblock %}
{% block title %}Machines{% endblock %}
{% block content %}
{% block content %}
<h2>
Liste des fingerprint ssh
</h2>
<h2>
SSH fingerprints
</h2>
{% can_create SshFingerprint machine_id %}
{% can_create SshFingerprint machine_id %}
<a
class=
"btn btn-primary btn-sm"
role=
"button"
href=
"{% url 'machines:new-sshfingerprint' machine_id %}"
><i
class=
"fa fa-plus"
></i>
Ajouter une fingerprint ssh
</a>
<a
class=
"btn btn-primary btn-sm"
role=
"button"
href=
"{% url 'machines:new-sshfingerprint' machine_id %}"
>
{% acl_end %}
<i
class=
"fa fa-plus"
></i>
Add an SSH fingerprint
{% include "machines/aff_sshfingerprint.html" with sshfingerprint_list=sshfingerprint_list %}
</a>
<br
/>
{% acl_end %}
<br
/>
{% include "machines/aff_sshfingerprint.html" with sshfingerprint_list=sshfingerprint_list %}
<br
/>
{% endblock %}
{% endblock %}
machines/templates/machines/index_sshfpralgo.html
View file @
5dce3629
...
@@ -27,13 +27,12 @@ with this program; if not, write to the Free Software Foundation, Inc.,
...
@@ -27,13 +27,12 @@ with this program; if not, write to the Free Software Foundation, Inc.,
{% block title %}Machines{% endblock %}
{% block title %}Machines{% endblock %}
{% block content %}
{% block content %}
<h2>
Liste des algo fingerprint ssh
</h2>
<h2>
SSH fingerprint algorithms
</h2>
{% can_create SshFprAlgo %}
{% can_create SshFprAlgo %}
<a
class=
"btn btn-primary btn-sm"
role=
"button"
href=
"{% url 'machines:new-sshfpralgo' %}"
><i
class=
"fa fa-plus"
></i>
Ajouter un algo ssh
</a>
<a
class=
"btn btn-primary btn-sm"
role=
"button"
href=
"{% url 'machines:new-sshfpralgo' %}"
>
{% acl_end %}
<i
class=
"fa fa-plus"
></i>
Add an SSH fingerprint algorithm
{% include "machines/aff_sshfpralgo.html" with sshfpralgo_list=sshfpralgo_list %}
</a>
<br
/>
{% acl_end %}
<br
/>
{% include "machines/aff_sshfpralgo.html" with sshfpralgo_list=sshfpralgo_list %}
<br
/>
{% endblock %}
{% endblock %}
machines/templates/machines/machine.html
View file @
5dce3629
...
@@ -33,6 +33,12 @@ with this program; if not, write to the Free Software Foundation, Inc.,
...
@@ -33,6 +33,12 @@ with this program; if not, write to the Free Software Foundation, Inc.,
{% if machineform %}
{% if machineform %}
{% bootstrap_form_errors machineform %}
{% bootstrap_form_errors machineform %}
{% endif %}
{% endif %}
{% if sshfingerprintform %}
{% bootstrap_form_errors sshfingerprintform %}
{% endif %}
{% if sshfpralgoform %}
{% bootstrap_form_errors sshfpralgoform %}
{% endif %}
{% if interfaceform %}
{% if interfaceform %}
{% bootstrap_form_errors interfaceform %}
{% bootstrap_form_errors interfaceform %}
{% endif %}
{% endif %}
...
@@ -78,15 +84,6 @@ with this program; if not, write to the Free Software Foundation, Inc.,
...
@@ -78,15 +84,6 @@ with this program; if not, write to the Free Software Foundation, Inc.,
{% if ipv6form %}
{% if ipv6form %}
{% bootstrap_form_errors ipv6form %}
{% bootstrap_form_errors ipv6form %}
{% endif %}
{% endif %}
{% if sshfingerprintform %}
{% bootstrap_form_errors sshfingerprintform %}
{% endif %}
{% if sshfpralgoform %}
{% bootstrap_form_errors sshfpralgoform %}
{% endif %}
<form
class=
"form"
method=
"post"
>
<form
class=
"form"
method=
"post"
>
{% csrf_token %}
{% csrf_token %}
...
@@ -94,6 +91,14 @@ with this program; if not, write to the Free Software Foundation, Inc.,
...
@@ -94,6 +91,14 @@ with this program; if not, write to the Free Software Foundation, Inc.,
<h3>
Machine
</h3>
<h3>
Machine
</h3>
{% massive_bootstrap_form machineform 'user' %}
{% massive_bootstrap_form machineform 'user' %}
{% endif %}
{% endif %}
{% if sshfingerprintform %}
<h3>
SSH fingerprint
</h3>
{% bootstrap_form sshfingerprintform %}
{% endif %}
{% if sshfpralgoform %}
<h3>
SSH fingerprint algorithm
</h3>
{% bootstrap_form sshfpralgoform %}
{% endif %}
{% if interfaceform %}
{% if interfaceform %}
<h3>
Interface
</h3>
<h3>
Interface
</h3>
{% if i_mbf_param %}
{% if i_mbf_param %}
...
@@ -162,14 +167,6 @@ with this program; if not, write to the Free Software Foundation, Inc.,
...
@@ -162,14 +167,6 @@ with this program; if not, write to the Free Software Foundation, Inc.,
<h3>
Ipv6
</h3>
<h3>
Ipv6
</h3>
{% bootstrap_form ipv6form %}
{% bootstrap_form ipv6form %}
{% endif %}
{% endif %}
{% if sshfingerprintform %}
<h3>
SshFingerprint
</h3>
{% bootstrap_form sshfingerprintform %}
{% endif %}
{% if sshfpralgoform %}
<h3>
Algorithme de fingerprint ssh
</h3>
{% bootstrap_form sshfpralgoform %}
{% endif %}
{% bootstrap_button action_name button_type="submit" icon="star" %}
{% bootstrap_button action_name button_type="submit" icon="star" %}
</form>
</form>
<br
/>
<br
/>
...
...
machines/templates/machines/sidebar.html
View file @
5dce3629
...
@@ -47,7 +47,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
...
@@ -47,7 +47,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
{% can_view_all SshFprAlgo %}
{% can_view_all SshFprAlgo %}
<a
class=
"list-group-item list-group-item-info"
href=
"{% url "
machines:index-sshfpralgo
"
%}"
>
<a
class=
"list-group-item list-group-item-info"
href=
"{% url "
machines:index-sshfpralgo
"
%}"
>
<i
class=
"fa fa-list-ul"
></i>
<i
class=
"fa fa-list-ul"
></i>
Algo de fingerprint ssh
SSH fingerprint algorithm
</a>
</a>
{% acl_end %}
{% acl_end %}
{% can_view_all IpType %}
{% can_view_all IpType %}
...
...
machines/views.py
View file @
5dce3629
...
@@ -468,7 +468,7 @@ def del_ipv6list(request, ipv6list, **_kwargs):
...
@@ -468,7 +468,7 @@ def del_ipv6list(request, ipv6list, **_kwargs):
@
can_create
(
SshFingerprint
)
@
can_create
(
SshFingerprint
)
@
can_edit
(
Machine
)
@
can_edit
(
Machine
)
def
new_sshfingerprint
(
request
,
machine
,
**
_kwargs
):
def
new_sshfingerprint
(
request
,
machine
,
**
_kwargs
):
"""
Nouvelle ssh
fingerprint"""
"""
Creates an SSH
fingerprint"""
sshfingerprint_instance
=
SshFingerprint
(
machine
=
machine
)
sshfingerprint_instance
=
SshFingerprint
(
machine
=
machine
)
sshfingerprint
=
SshFingerprintForm
(
sshfingerprint
=
SshFingerprintForm
(
request
.
POST
or
None
,
request
.
POST
or
None
,
...
@@ -476,13 +476,13 @@ def new_sshfingerprint(request, machine, **_kwargs):
...
@@ -476,13 +476,13 @@ def new_sshfingerprint(request, machine, **_kwargs):
)
)
if
sshfingerprint
.
is_valid
():
if
sshfingerprint
.
is_valid
():
sshfingerprint
.
save
()
sshfingerprint
.
save
()
messages
.
success
(
request
,
"
Fingerprint ssh ajoutée
"
)
messages
.
success
(
request
,
"
The SSH fingerprint was added
"
)
return
redirect
(
reverse
(
return
redirect
(
reverse
(
'machines:index-sshfingerprint'
,
'machines:index-sshfingerprint'
,
kwargs
=
{
'machineid'
:
str
(
machine
.
id
)}
kwargs
=
{
'machineid'
:
str
(
machine
.
id
)}
))
))
return
form
(
return
form
(
{
'sshfingerprintform'
:
sshfingerprint
,
'action_name'
:
'Cr
éer
'
},
{
'sshfingerprintform'
:
sshfingerprint
,
'action_name'
:
'Cr
eate
'
},
'machines/machine.html'
,
'machines/machine.html'
,
request
request
)
)
...
@@ -491,7 +491,7 @@ def new_sshfingerprint(request, machine, **_kwargs):
...
@@ -491,7 +491,7 @@ def new_sshfingerprint(request, machine, **_kwargs):
@
login_required
@
login_required
@
can_edit
(
SshFingerprint
)
@
can_edit
(
SshFingerprint
)
def
edit_sshfingerprint
(
request
,
sshfingerprint_instance
,
**
_kwargs
):
def
edit_sshfingerprint
(
request
,
sshfingerprint_instance
,
**
_kwargs
):
"""Edit
ion d'une ssh
fingerprint"""
"""Edit
s an SSH
fingerprint"""
sshfingerprint
=
SshFingerprintForm
(
sshfingerprint
=
SshFingerprintForm
(
request
.
POST
or
None
,
request
.
POST
or
None
,
instance
=
sshfingerprint_instance
instance
=
sshfingerprint_instance
...
@@ -499,13 +499,13 @@ def edit_sshfingerprint(request, sshfingerprint_instance, **_kwargs):
...
@@ -499,13 +499,13 @@ def edit_sshfingerprint(request, sshfingerprint_instance, **_kwargs):
if
sshfingerprint
.
is_valid
():
if
sshfingerprint
.
is_valid
():
if
sshfingerprint
.
changed_data
:
if
sshfingerprint
.
changed_data
:
sshfingerprint
.
save
()
sshfingerprint
.
save
()
messages
.
success
(
request
,
"
Ssh fingerprint modifiée
"
)
messages
.
success
(
request
,
"
The SSH fingerprint was edited
"
)
return
redirect
(
reverse
(
return
redirect
(
reverse
(
'machines:index-sshfingerprint'
,
'machines:index-sshfingerprint'
,
kwargs
=
{
'machineid'
:
str
(
sshfingerprint_instance
.
machine
.
id
)}
kwargs
=
{
'machineid'
:
str
(
sshfingerprint_instance
.
machine
.
id
)}
))
))
return
form
(
return
form
(
{
'sshfingerprintform'
:
sshfingerprint
,
'action_name'
:
'Edit
er
'
},
{
'sshfingerprintform'
:
sshfingerprint
,
'action_name'
:
'Edit'
},
'machines/machine.html'
,
'machines/machine.html'
,
request
request
)
)
...
@@ -514,11 +514,11 @@ def edit_sshfingerprint(request, sshfingerprint_instance, **_kwargs):
...
@@ -514,11 +514,11 @@ def edit_sshfingerprint(request, sshfingerprint_instance, **_kwargs):
@
login_required
@
login_required
@
can_delete
(
SshFingerprint
)
@
can_delete
(
SshFingerprint
)
def
del_sshfingerprint
(
request
,
sshfingerprint
,
**
_kwargs
):
def
del_sshfingerprint
(
request
,
sshfingerprint
,
**
_kwargs
):
"""
Supprime une ssh
fingerprint"""
"""
Deletes an SSH
fingerprint"""
if
request
.
method
==
"POST"
:
if
request
.
method
==
"POST"
:
machineid
=
sshfingerprint
.
machine
.
id
machineid
=
sshfingerprint
.
machine
.
id
sshfingerprint
.
delete
()
sshfingerprint
.
delete
()
messages
.
success
(
request
,
"
La sshfingerprint a été détruite
"
)
messages
.
success
(
request
,
"
The SSH fingerprint was deleted
"
)
return
redirect
(
reverse
(
return
redirect
(
reverse
(
'machines:index-sshfingerprint'
,
'machines:index-sshfingerprint'
,
kwargs
=
{
'machineid'
:
str
(
machineid
)}
kwargs
=
{
'machineid'
:
str
(
machineid
)}
...
@@ -533,18 +533,18 @@ def del_sshfingerprint(request, sshfingerprint, **_kwargs):
...
@@ -533,18 +533,18 @@ def del_sshfingerprint(request, sshfingerprint, **_kwargs):
@
login_required
@
login_required
@
can_create
(
SshFprAlgo
)
@
can_create
(
SshFprAlgo
)
def
new_sshfpralgo
(
request
,
**
_kwargs
):
def
new_sshfpralgo
(
request
,
**
_kwargs
):
"""
Nouvelle sshfpralgo
"""
"""
Creates an SSH fingeprint algorithm
"""
sshfpralgo
=
SshFprAlgoForm
(
sshfpralgo
=
SshFprAlgoForm
(
request
.
POST
or
None
,
request
.
POST
or
None
,
)
)
if
sshfpralgo
.
is_valid
():
if
sshfpralgo
.
is_valid
():
sshfpralgo
.
save
()
sshfpralgo
.
save
()
messages
.
success
(
request
,
"
Algo Fingerprint ssh ajouté
"
)
messages
.
success
(
request
,
"
The SSH fingerprint algorithm was added
"
)
return
redirect
(
reverse
(
return
redirect
(
reverse
(
'machines:index-sshfpralgo'
'machines:index-sshfpralgo'
))
))
return
form
(
return
form
(
{
'sshfpralgoform'
:
sshfpralgo
,
'action_name'
:
'Cr
éer
'
},
{
'sshfpralgoform'
:
sshfpralgo
,
'action_name'
:
'Cr
eate
'
},
'machines/machine.html'
,
'machines/machine.html'
,
request
request
)
)
...
@@ -553,7 +553,7 @@ def new_sshfpralgo(request, **_kwargs):
...
@@ -553,7 +553,7 @@ def new_sshfpralgo(request, **_kwargs):
@
login_required
@
login_required
@
can_edit
(
SshFprAlgo
)
@
can_edit
(
SshFprAlgo
)
def
edit_sshfpralgo
(
request
,
sshfpralgo_instance
,
**
_kwargs
):
def
edit_sshfpralgo
(
request
,
sshfpralgo_instance
,
**
_kwargs
):
"""Edit
ion d'une sshfpralgo
"""
"""Edit
s an SSH fingerprint algorithm
"""
sshfpralgo
=
SshFprAlgoForm
(
sshfpralgo
=
SshFprAlgoForm
(
request
.
POST
or
None
,
request
.
POST
or
None
,
instance
=
sshfpralgo_instance