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
Vladislav Rykov
THSO.server
Commits
dcbba1e7
Commit
dcbba1e7
authored
May 25, 2020
by
Vladislav Rykov
Browse files
device config remove fixed
parent
58739b2e
Changes
4
Show whitespace changes
Inline
Side-by-side
app/app/__pycache__/views.cpython-37.pyc
View file @
dcbba1e7
No preview for this file type
app/app/templates/new/public/.device-configuration.html.swp
View file @
dcbba1e7
No preview for this file type
app/app/templates/new/public/device-configuration.html
View file @
dcbba1e7
...
@@ -2,6 +2,8 @@
...
@@ -2,6 +2,8 @@
{% block title %} HPC
&
A IoT - Device Configuration {% endblock %}
{% block title %} HPC
&
A IoT - Device Configuration {% endblock %}
{% block header %}
<link
href=
"https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css"
rel=
"stylesheet"
>
{% endblock %}
{% block location %}
<a
class=
"h4 mb-0 text-white text-uppercase d-none d-lg-inline-block"
href=
"./applications"
>
Applications
</a>
{% block location %}
<a
class=
"h4 mb-0 text-white text-uppercase d-none d-lg-inline-block"
href=
"./applications"
>
Applications
</a>
<p
class=
"h4 mb-0 text-white text-uppercase d-none d-lg-inline-block"
>
-
</p>
<p
class=
"h4 mb-0 text-white text-uppercase d-none d-lg-inline-block"
>
-
</p>
<a
class=
"h4 mb-0 text-white text-uppercase d-none d-lg-inline-block"
href=
"/application/{{ app[1] }}"
>
{{ app[0] }}
</a>
<a
class=
"h4 mb-0 text-white text-uppercase d-none d-lg-inline-block"
href=
"/application/{{ app[1] }}"
>
{{ app[0] }}
</a>
...
@@ -60,7 +62,7 @@
...
@@ -60,7 +62,7 @@
{% endif %}
{% endif %}
</span>
</span>
</td>
</td>
<td>
<a
href=
"/
dev-conf-rm
?conf={{ c[3] }}"
>
<span
class=
"
glyphicon glyphicon
-remove"
</
span
>
</a>
</td>
<td>
<a
href=
"/
application/{{ app[1] }}/device/{{ dev[1] }}/remove-configuration
?conf={{ c[3] }}"
>
<span
class=
"
fa fa
-remove"
</
span
>
</a>
</td>
</tr>
</tr>
{% endfor %}
{% endfor %}
</tbody>
</tbody>
...
...
app/app/views.py
View file @
dcbba1e7
...
@@ -423,19 +423,19 @@ def dev_conf():
...
@@ -423,19 +423,19 @@ def dev_conf():
else
:
else
:
return
redirect
(
url_for
(
'index'
))
return
redirect
(
url_for
(
'index'
))
@
app
.
route
(
'/
dev-conf-rm
'
)
@
app
.
route
(
'/
application/<appkey>/device/<devid>/remove-configuration
'
)
def
dev_conf_rm
():
def
dev_conf_rm
(
appkey
,
devid
):
if
'name'
in
session
and
'appkey'
in
session
and
'devid'
in
session
:
if
'name'
in
session
:
res
=
pend
.
delete
(
session
[
'appkey'
],
session
[
'
devid
'
]
,
request
.
args
.
get
(
'conf'
)
+
'_'
)
res
=
pend
.
delete
(
appkey
,
devid
,
request
.
args
.
get
(
'conf'
)
+
'_'
)
if
res
[
0
]:
if
res
[
0
]:
flash
(
'Configuration message successfully removed.'
,
'success'
)
flash
(
'Configuration message successfully removed.'
,
'success'
)
return
redirect
(
url_for
(
'
dev_c
on
f
'
))
return
redirect
(
url_for
(
'
applicati
on
s
'
))
else
:
else
:
flash
(
'Error removing configuration message: {}'
.
format
(
res
[
1
]),
'danger'
)
flash
(
'Error removing configuration message: {}'
.
format
(
res
[
1
]),
'danger'
)
return
redirect
(
url_for
(
'
dev_c
on
f
'
))
return
redirect
(
url_for
(
'
applicati
on
s
'
))
else
:
else
:
return
redirect
(
url_for
(
'
index
'
))
return
redirect
(
url_for
(
'
login
'
))
@
app
.
route
(
'/delete-dev'
)
@
app
.
route
(
'/delete-dev'
)
...
...
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