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
896de2fe
Commit
896de2fe
authored
Apr 09, 2020
by
Vladislav Rykov
Browse files
working on conf message
parent
cf8a86bf
Changes
2
Show whitespace changes
Inline
Side-by-side
server.py
View file @
896de2fe
...
...
@@ -180,7 +180,23 @@ def dev_conf():
if
request
.
method
==
'GET'
:
return
render_template
(
'dev-conf.html'
,
devname
=
session
[
'devname'
])
else
:
pass
argslen
=
len
(
request
.
form
[
'arg'
])
+
1
args
=
bytearray
(
argslen
+
2
)
args
[
0
]
=
int
(
request
.
form
[
'confid'
])
args
[
1
]
=
argslen
bstr
=
request
.
form
[
'arg'
].
encode
(
'utf-8'
)
i
=
0
while
i
<
argslen
:
print
(
args
[
2
+
i
])
args
[
2
+
i
]
=
bstr
[
i
]
i
+=
1
print
(
'msg = '
,
args
)
print
(
type
(
request
.
form
[
'arg'
].
encode
(
'utf-8'
)))
print
(
request
.
form
[
'arg'
].
encode
(
'utf-8'
))
return
redirect
(
url_for
(
'dev'
,
id
=
session
[
'devid'
]))
@
server
.
route
(
'/delete-dev'
)
def
delete_dev
():
...
...
templates/dev-conf.html
View file @
896de2fe
...
...
@@ -7,14 +7,14 @@
<div
class=
"row"
>
<div
class=
"col-md-6 col-md-offset-3"
>
<p>
Device name : {{ devname }}
<form
action=
"conf"
method=
"post"
>
<form
action=
"
dev-
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=
"arg
id
"
name=
"arg
id
"
><br>
<input
type=
"text"
id=
"arg"
name=
"arg"
><br>
</div>
<div
class=
"form-group"
>
<button
type=
"submit"
class=
"btn btn-primary"
>
Configure
</button>
...
...
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