Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Nounous
re2o
Commits
b455de0d
Commit
b455de0d
authored
Aug 09, 2018
by
grisel-davy
Committed by
chirac
Aug 12, 2018
Browse files
bouton de regen des services
parent
f983a8c2
Changes
3
Hide whitespace changes
Inline
Side-by-side
machines/templates/machines/aff_service.html
View file @
b455de0d
...
...
@@ -32,7 +32,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
<th>
Temps minimum avant nouvelle régénération
</th>
<th>
Temps avant nouvelle génération obligatoire (max)
</th>
<th>
Serveurs inclus
</th>
<th>
</th>
<th>
Demander la regeneration
</th>
<th></th>
</tr>
</thead>
...
...
@@ -41,7 +41,8 @@ with this program; if not, write to the Free Software Foundation, Inc.,
<td>
{{ service.service_type }}
</td>
<td>
{{ service.min_time_regen }}
</td>
<td>
{{ service.regular_time_regen }}
</td>
<td>
{% for serv in service.servers.all %}{{ serv }}, {% endfor %}
</td>
<td>
{% for serv in service.servers.all %}{{ serv }}, {% endfor %}
</td>
<td><a
role=
"button"
class=
"btn btn-danger"
href=
"{% url 'machines:regen-service' service.id %}"
><i
class=
"fas fa-sync"
></i></a></td>
<td
class=
"text-right"
>
{% can_edit service %}
{% include 'buttons/edit.html' with href='machines:edit-service' id=service.id %}
...
...
machines/urls.py
View file @
b455de0d
...
...
@@ -124,6 +124,7 @@ urlpatterns = [
views
.
edit_service
,
name
=
'edit-service'
),
url
(
r
'^del_service/$'
,
views
.
del_service
,
name
=
'del-service'
),
url
(
r
'^regen_service/(?P<serviceid>[0-9]+)$'
,
views
.
regen_service
,
name
=
'regen-service'
),
url
(
r
'^index_service/$'
,
views
.
index_service
,
name
=
'index-service'
),
url
(
r
'^add_role/$'
,
views
.
add_role
,
name
=
'add-role'
),
url
(
r
'^edit_role/(?P<roleid>[0-9]+)$'
,
...
...
machines/views.py
View file @
b455de0d
...
...
@@ -33,7 +33,7 @@ The views for the Machines app
from
__future__
import
unicode_literals
from
django.urls
import
reverse
from
django.http
import
HttpResponse
from
django.http
import
HttpResponse
,
HttpResponseRedirect
from
django.shortcuts
import
render
,
redirect
from
django.contrib
import
messages
from
django.contrib.auth.decorators
import
login_required
,
permission_required
...
...
@@ -128,6 +128,7 @@ from .models import (
Role
,
Service
,
Service_link
,
regen
,
Vlan
,
Nas
,
Txt
,
...
...
@@ -1261,6 +1262,15 @@ def del_service(request, instances):
request
)
@
login_required
@
can_edit
(
Service
)
def
regen_service
(
request
,
service
,
**
_kwargs
):
"""Ask for a regen of the service"""
regen
(
service
)
return
index_service
(
request
)
@
login_required
@
can_create
(
Vlan
)
...
...
Write
Preview
Supports
Markdown
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