Commit 896de2fe authored by Vladislav Rykov's avatar Vladislav Rykov
Browse files

working on conf message

parent cf8a86bf
......@@ -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():
......
......@@ -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="argid" name="argid"><br>
<input type="text" id="arg" name="arg"><br>
</div>
<div class="form-group">
<button type="submit" class="btn btn-primary">Configure</button>
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment