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(): ...@@ -180,7 +180,23 @@ def dev_conf():
if request.method == 'GET': if request.method == 'GET':
return render_template('dev-conf.html', devname=session['devname']) return render_template('dev-conf.html', devname=session['devname'])
else: 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') @server.route('/delete-dev')
def delete_dev(): def delete_dev():
......
...@@ -7,14 +7,14 @@ ...@@ -7,14 +7,14 @@
<div class="row"> <div class="row">
<div class="col-md-6 col-md-offset-3"> <div class="col-md-6 col-md-offset-3">
<p> Device name : {{ devname }} <p> Device name : {{ devname }}
<form action="conf" method="post"> <form action="dev-conf" method="post">
<div class="form-group"> <div class="form-group">
<label>Config ID:</label><br> <label>Config ID:</label><br>
<input type="text" id="confid" name="confid"><br> <input type="text" id="confid" name="confid"><br>
</div> </div>
<div class="form-group"> <div class="form-group">
<label>Argument:</label><br> <label>Argument:</label><br>
<input type="text" id="argid" name="argid"><br> <input type="text" id="arg" name="arg"><br>
</div> </div>
<div class="form-group"> <div class="form-group">
<button type="submit" class="btn btn-primary">Configure</button> <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