Skip to content

Commit

Permalink
Merge pull request #18 from iz1kga/webInterfaceStyle
Browse files Browse the repository at this point in the history
Web interface optimizations
  • Loading branch information
iz1kga authored Mar 9, 2021
2 parents 4c5664d + 4f98686 commit 83bd63c
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 7 deletions.
11 changes: 7 additions & 4 deletions iMeshDashboard/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,16 +211,19 @@ def sendMessage():
@basic_auth.required
def setNode():
if request.method == 'POST':
print(request.form)
interface.setOwner(request.form['flongName'])
prefs = interface.radioConfig.preferences
alt = int(request.form['faltitude'])
lat = float(request.form['flatitude'])
lon = float(request.form['flongitude'])
ts = int(time.time())
prefs.fixed_position = True
interface.sendPosition(lat, lon, alt, ts)
interface.writeConfig()
if not interface.myInfo.has_gps and not (config['Position']['enabled']=='True'):
prefs.fixed_position = True
interface.sendPosition(lat, lon, alt, ts)
interface.writeConfig()
else:
print("Cannot set node parameters beacuse has gps: %s or has fixed position config in config file: %s" %
(interface.myInfo.has_gps, (config['Position']['enabled']=='True'),))
return redirect(url_for('configPage'))

@app.route('/login', methods=['GET', 'POST'])
Expand Down
1 change: 1 addition & 0 deletions iMeshDashboard/templates/config.html
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
<input type="text" id="faltitude" name="faltitude" value="{{ nodeInfo['position']['altitude'] }}"><br><br>
<input type="submit" value="SET">
</form>
Position and Altitude can be set if device dosn't have GPS and no fixed position is set in config file
</div>
</div>
</div>
Expand Down
9 changes: 6 additions & 3 deletions iMeshDashboard/templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,12 @@
<span id="nodeInfo">Node Info</span>
</div>
<div class="card-body">
Hardware:{{ info['hw_model']}}<br>
Firmware:{{ info['firmware_version']}}<br>
Region:{{ info['region']}}<br>
<b>Hardware:</b> {{ info['hw_model'] | safe }}<br>
<b>Firmware:</b> {{ info['firmware_version'] | safe }}<br>
<b>Region:</b> {{ info['region'] | safe }}<br>
<b>nodeId:</b> {{ nodeInfo['user']['id'] | safe }}<br>
<b>longName:</b> {{ nodeInfo['user']['longName'] | safe }}<br>
<b>shortName:</b> {{ nodeInfo['user']['shortName'] | safe }}<br>
</div>
</div>
</div>
Expand Down

0 comments on commit 83bd63c

Please sign in to comment.