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
cf8a86bf
Commit
cf8a86bf
authored
Apr 09, 2020
by
Vladislav Rykov
Browse files
dev-conf view added
parent
8d792cf1
Changes
5
Hide whitespace changes
Inline
Side-by-side
server.py
View file @
cf8a86bf
...
...
@@ -156,6 +156,9 @@ def dev():
dev
=
dh
.
get
(
session
[
'appkey'
],
request
.
args
.
get
(
'id'
))
ltup
=
'recently'
session
[
'devid'
]
=
dev
[
1
][
1
]
session
[
'devname'
]
=
dev
[
1
][
0
]
return
render_template
(
'dev.html'
,
dev
=
dev
[
1
],
appkey
=
session
[
'appkey'
],
ltup
=
ltup
)
else
:
res
=
dh
.
create
(
request
.
form
[
'devname'
],
request
.
form
[
'devid'
],
session
[
'appkey'
],
request
.
form
[
'devdesc'
])
...
...
@@ -172,6 +175,13 @@ def dev():
return
redirect
(
url_for
(
'app'
))
@
server
.
route
(
'/dev-conf'
,
methods
=
[
'GET'
,
'POST'
])
def
dev_conf
():
if
request
.
method
==
'GET'
:
return
render_template
(
'dev-conf.html'
,
devname
=
session
[
'devname'
])
else
:
pass
@
server
.
route
(
'/delete-dev'
)
def
delete_dev
():
dh
=
dd
.
DeviceDao
()
...
...
templates/dev-conf.html
0 → 100644
View file @
cf8a86bf
{% extends 'layout.html' %}
{% block title %} Configure Device: {% endblock %}
{% block content %}
<div
class=
"row"
>
<div
class=
"col-md-6 col-md-offset-3"
>
<p>
Device name : {{ devname }}
<form
action=
"conf"
method=
"post"
>
<div
class=
"form-group"
>
<label>
Config ID:
</label><br>
<input
type=
"text"
id=
"confid"
name=
"confid"
><br>
</div>
<div
class=
"form-group"
>
<label>
Argument:
</label><br>
<input
type=
"text"
id=
"argid"
name=
"argid"
><br>
</div>
<div
class=
"form-group"
>
<button
type=
"submit"
class=
"btn btn-primary"
>
Configure
</button>
</div>
{% if feedback %}
<p
class=
"text-danger float-right"
>
{{ feedback }}
</p>
{% endif %}
</form>
</div>
</div>
{% endblock %}
templates/dev.html
View file @
cf8a86bf
...
...
@@ -13,7 +13,7 @@
<p>
Last time up : {{ ltup }}
</p>
<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=
"/dev-conf
?id
={{ 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>
...
...
templates/layout.html
View file @
cf8a86bf
...
...
@@ -17,7 +17,7 @@
<span
class=
"icon-bar"
></span>
<span
class=
"icon-bar"
></span>
</button>
<a
class=
"navbar-brand"
href=
"
#
"
>
Simple
IoT Server
</a>
<a
class=
"navbar-brand"
href=
"
/
"
>
HPC
&
A
IoT Server
</a>
</div>
<div
id=
"navbar"
class=
"collapse navbar-collapse"
>
<ul
class=
"nav navbar-nav"
>
...
...
templates/new-app.html
View file @
cf8a86bf
...
...
@@ -5,7 +5,7 @@
{% block content %}
<div
class=
"row"
>
<div
class=
"col-md-6 col-md-offset3"
>
<div
class=
"col-md-6 col-md-offset
-
3"
>
<form
action=
"app"
method=
"post"
>
<div
class=
"form-group"
>
<label>
Name:
</label><br>
...
...
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