misc: refactored ui.display.video as ui.web
This commit is contained in:
parent
91b409053b
commit
81a89d43e0
@ -35,7 +35,7 @@ class Agent(Client, Automata, AsyncAdvertiser, AsyncTrainer):
|
|||||||
self._supported_channels = utils.iface_channels(config['main']['iface'])
|
self._supported_channels = utils.iface_channels(config['main']['iface'])
|
||||||
self._view = view
|
self._view = view
|
||||||
self._view.set_agent(self)
|
self._view.set_agent(self)
|
||||||
self._web_ui = Server(self, self._config['ui']['display'])
|
self._web_ui = Server(self, config['ui'])
|
||||||
|
|
||||||
self._access_points = []
|
self._access_points = []
|
||||||
self._last_pwnd = None
|
self._last_pwnd = None
|
||||||
|
@ -43,7 +43,7 @@ main:
|
|||||||
enabled: false
|
enabled: false
|
||||||
api_key: ~
|
api_key: ~
|
||||||
bt-tether:
|
bt-tether:
|
||||||
enabled: false # if you want to use this, set ui.display.video.address to 0.0.0.0
|
enabled: false # if you want to use this, set ui.display.web.address to 0.0.0.0
|
||||||
devices:
|
devices:
|
||||||
android-phone:
|
android-phone:
|
||||||
enabled: false
|
enabled: false
|
||||||
@ -241,6 +241,17 @@ ui:
|
|||||||
# preserve your display over time, you should set this value to 0.0 so that the display will be refreshed only
|
# preserve your display over time, you should set this value to 0.0 so that the display will be refreshed only
|
||||||
# if any of the important data fields changed (the uptime and blinking cursor won't trigger a refresh).
|
# if any of the important data fields changed (the uptime and blinking cursor won't trigger a refresh).
|
||||||
fps: 0.0
|
fps: 0.0
|
||||||
|
# web ui
|
||||||
|
web:
|
||||||
|
enabled: true
|
||||||
|
address: '0.0.0.0'
|
||||||
|
origin: null
|
||||||
|
port: 8080
|
||||||
|
# command to be executed when a new png frame is available
|
||||||
|
# for instance, to use with framebuffer based displays:
|
||||||
|
# on_frame: 'fbi --noverbose -a -d /dev/fb1 -T 1 /root/pwnagotchi.png > /dev/null 2>&1'
|
||||||
|
on_frame: ''
|
||||||
|
# hardware display
|
||||||
display:
|
display:
|
||||||
enabled: true
|
enabled: true
|
||||||
rotation: 180
|
rotation: 180
|
||||||
@ -250,16 +261,6 @@ ui:
|
|||||||
# Waveshare tri-color 2.13in display can be over-driven with color set as 'fastAndFurious'
|
# Waveshare tri-color 2.13in display can be over-driven with color set as 'fastAndFurious'
|
||||||
# THIS IS POTENTIALLY DANGEROUS. DO NOT USE UNLESS YOU UNDERSTAND THAT IT COULD KILL YOUR DISPLAY
|
# THIS IS POTENTIALLY DANGEROUS. DO NOT USE UNLESS YOU UNDERSTAND THAT IT COULD KILL YOUR DISPLAY
|
||||||
color: 'black'
|
color: 'black'
|
||||||
video:
|
|
||||||
enabled: true
|
|
||||||
address: '0.0.0.0'
|
|
||||||
origin: null
|
|
||||||
port: 8080
|
|
||||||
# command to be executed when a new png frame is available
|
|
||||||
# for instance, to use with framebuffer based displays:
|
|
||||||
# on_frame: 'fbi --noverbose -a -d /dev/fb1 -T 1 /root/pwnagotchi.png > /dev/null 2>&1'
|
|
||||||
on_frame: ''
|
|
||||||
|
|
||||||
|
|
||||||
# bettercap rest api configuration
|
# bettercap rest api configuration
|
||||||
bettercap:
|
bettercap:
|
||||||
|
@ -25,9 +25,6 @@ class Display(View):
|
|||||||
)
|
)
|
||||||
self._render_thread_instance.start()
|
self._render_thread_instance.start()
|
||||||
|
|
||||||
def set_ready(self):
|
|
||||||
self._webui.start()
|
|
||||||
|
|
||||||
def is_inky(self):
|
def is_inky(self):
|
||||||
return self._implementation.name == 'inky'
|
return self._implementation.name == 'inky'
|
||||||
|
|
||||||
@ -91,8 +88,8 @@ class Display(View):
|
|||||||
|
|
||||||
def _on_view_rendered(self, img):
|
def _on_view_rendered(self, img):
|
||||||
try:
|
try:
|
||||||
if self._config['ui']['display']['video']['on_frame'] != '':
|
if self._config['ui']['web']['on_frame'] != '':
|
||||||
os.system(self._config['ui']['display']['video']['on_frame'])
|
os.system(self._config['ui']['web']['on_frame'])
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logging.error("%s" % e)
|
logging.error("%s" % e)
|
||||||
|
|
||||||
|
@ -16,13 +16,13 @@ from pwnagotchi.ui.web.handler import Handler
|
|||||||
|
|
||||||
class Server:
|
class Server:
|
||||||
def __init__(self, agent, config):
|
def __init__(self, agent, config):
|
||||||
self._enabled = config['video']['enabled']
|
self._enabled = config['web']['enabled']
|
||||||
self._port = config['video']['port']
|
self._port = config['web']['port']
|
||||||
self._address = config['video']['address']
|
self._address = config['web']['address']
|
||||||
self._origin = None
|
self._origin = None
|
||||||
self._agent = agent
|
self._agent = agent
|
||||||
if 'origin' in config['video']:
|
if 'origin' in config['web']:
|
||||||
self._origin = config['video']['origin']
|
self._origin = config['web']['origin']
|
||||||
|
|
||||||
if self._enabled:
|
if self._enabled:
|
||||||
_thread.start_new_thread(self._http_serve, ())
|
_thread.start_new_thread(self._http_serve, ())
|
||||||
|
@ -107,7 +107,7 @@ def main():
|
|||||||
color: black
|
color: black
|
||||||
refresh: 30
|
refresh: 30
|
||||||
type: {display}
|
type: {display}
|
||||||
video:
|
web:
|
||||||
enabled: true
|
enabled: true
|
||||||
address: "0.0.0.0"
|
address: "0.0.0.0"
|
||||||
port: 8080
|
port: 8080
|
||||||
|
Loading…
x
Reference in New Issue
Block a user