Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

expert page: Add lsusb output #110

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 15 additions & 3 deletions src/modules/adsb-feeder/filesystem/root/opt/adsb/adsb-setup/app.py
Original file line number Diff line number Diff line change
@@ -1,22 +1,24 @@
import filecmp
import io
import json
from operator import is_
import os.path
import pathlib
import pickle
import platform
import re
import shutil
import subprocess
from time import sleep
import zipfile
from base64 import b64encode
from datetime import datetime
from operator import is_
from os import path, urandom
from time import sleep
from typing import Dict, List
from zlib import compress

# nofmt: on
# isort: off
from flask import Flask, flash, redirect, render_template, request, send_file, url_for

from utils import (
Expand All @@ -42,6 +44,9 @@
cleanup_str,
print_err,
)
# nofmt: off
# isort: on

from werkzeug.utils import secure_filename


Expand Down Expand Up @@ -784,7 +789,14 @@ def expert(self):
self._constants.env_by_tags("tailscale_ll").value = ""
else:
self._constants.env_by_tags("tailscale_name").value = ""
return render_template("expert.html")
# embed lsusb output in the page
try:
lsusb = subprocess.run(
"lsusb", shell=True, check=True, capture_output=True
).stdout.decode()
except:
lsusb = "lsusb failed"
return render_template("expert.html", lsusb=lsusb)

def secure_image(self):
output: str = ""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,11 @@ <h5 class="mt-3">Restart all containers</h5>
</div>
</form>
</div>
<div class="col-12 col-lg-6">
<h5 class="mt-3">lsusb output</h5>
<div class="row">
<pre class="col-12">{{ lsusb }}</pre>
</div>
<!-- FULL_IMAGE_ONLY_START -->
<div class="col-12 col-lg-6">
<h5 class="mt-3">Add Zerotier</h5>
Expand Down