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
3fb83614
Commit
3fb83614
authored
May 18, 2020
by
Vladislav Rykov
Browse files
automation rm implemented
parent
683cda7b
Changes
4
Hide whitespace changes
Inline
Side-by-side
app/app/__pycache__/views.cpython-37.pyc
View file @
3fb83614
No preview for this file type
app/app/dao/data/__pycache__/data.cpython-37.pyc
View file @
3fb83614
No preview for this file type
app/app/dao/data/data.py
View file @
3fb83614
...
...
@@ -73,7 +73,6 @@ def get_last_hours(cur, appkey, devid, hours, p):
last
=
get_last_n
(
appkey
,
devid
,
1
)
utcb
=
last
[
1
][
0
][
0
]
-
hours
*
3600
*
p
utcu
=
utcb
+
hours
*
3600
print
(
utcb
,
utcu
)
query
=
"""
SELECT * FROM
{}
...
...
app/app/views.py
View file @
3fb83614
...
...
@@ -603,6 +603,26 @@ def new_automation():
return
redirect
(
url_for
(
'index'
))
@
app
.
route
(
'/automation-rm'
)
def
alarm_rm
():
if
'name'
in
session
:
nq
.
delete
(
session
[
'appkey'
],
request
.
args
.
get
(
'devid'
),
request
.
args
.
get
(
'id'
))
tr
.
delete
(
session
[
'appkey'
],
request
.
args
.
get
(
'devid'
),
request
.
args
.
get
(
'id'
))
tr
.
delete_function
(
session
[
'appkey'
],
request
.
args
.
get
(
'devid'
),
request
.
args
.
get
(
'id'
))
res
=
nfs
.
delete
(
session
[
'appkey'
],
request
.
args
.
get
(
'devid'
),
request
.
args
.
get
(
'id'
))
if
res
[
0
]:
flash
(
'Automation removed'
,
'success'
)
return
redirect
(
url_for
(
'alerts'
))
else
:
flash
(
'Automation cannot be removed : {}'
.
format
(
res
[
1
]),
'danger'
)
return
redirect
(
url_for
(
'alerts'
))
else
:
return
redirect
(
url_for
(
'index'
))
def
pend_delete_all_ack
():
pend
.
delete_all_ack
()
...
...
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