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
8d792cf1
Commit
8d792cf1
authored
Apr 09, 2020
by
Vladislav Rykov
Browse files
delete-dev added and tested
parent
b3de5f00
Changes
3
Hide whitespace changes
Inline
Side-by-side
.misc.py.swp
deleted
100644 → 0
View file @
b3de5f00
File deleted
server.py
View file @
8d792cf1
...
...
@@ -172,6 +172,15 @@ def dev():
return
redirect
(
url_for
(
'app'
))
@
server
.
route
(
'/delete-dev'
)
def
delete_dev
():
dh
=
dd
.
DeviceDao
()
dh
.
delete_datatable
(
session
[
'appkey'
],
request
.
args
.
get
(
'id'
))
res
=
dh
.
delete
(
session
[
'appkey'
],
request
.
args
.
get
(
'id'
))
return
redirect
(
url_for
(
'app'
,
appkey
=
session
[
'appkey'
]))
if
__name__
==
'__main__'
:
server
.
secret_key
=
'sdjfklsjf^$654sd^#sPH'
server
.
run
(
debug
=
True
,
host
=
'0.0.0.0'
)
...
...
templates/dev.html
View file @
8d792cf1
...
...
@@ -12,9 +12,9 @@
<p>
Description : {{ dev[2] }}
</p>
<p>
Last time up : {{ ltup }}
</p>
<a
href=
"/data"
><button
type=
"submit"
class=
"btn btn-primary"
>
Data
</button></a>
<a
href=
"/dev-conf"
><button
type=
"submit"
class=
"btn btn-primary"
>
Configure
</button></a>
<a
href=
"/delete-dev"
><button
type=
"submit"
class=
"btn btn-danger"
onclick=
"return conf();"
>
Delete Device
</button></a>
<a
href=
"/data
?id={{ dev[1] }}
"
><button
type=
"submit"
class=
"btn btn-primary"
>
Data
</button></a>
<a
href=
"/dev-conf
={{ dev[1] }}
"
><button
type=
"submit"
class=
"btn btn-primary"
>
Configure
</button></a>
<a
href=
"/delete-dev
?id={{ dev[1] }}
"
><button
type=
"submit"
class=
"btn btn-danger"
onclick=
"return conf();"
>
Delete Device
</button></a>
</div>
</div>
...
...
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