add title to table icons
This commit is contained in:
@@ -10,39 +10,40 @@ from .log_handler import LogHandler
|
|||||||
def _get_device_icon(client_mode: bool):
|
def _get_device_icon(client_mode: bool):
|
||||||
'''returns the icon for the device conntection'''
|
'''returns the icon for the device conntection'''
|
||||||
if client_mode:
|
if client_mode:
|
||||||
return 'fa-download fa-rotate-180'
|
return 'fa-download fa-rotate-180', 'Server Mode'
|
||||||
|
|
||||||
return 'fa-upload fa-rotate-180'
|
return 'fa-upload fa-rotate-180', 'Client Mode'
|
||||||
|
|
||||||
|
|
||||||
def _get_cloud_icon(emu_mode: bool):
|
def _get_cloud_icon(emu_mode: bool):
|
||||||
'''returns the icon for the cloud conntection'''
|
'''returns the icon for the cloud conntection'''
|
||||||
if emu_mode:
|
if emu_mode:
|
||||||
return 'fa-cloud-arrow-up-alt'
|
return 'fa-cloud-arrow-up-alt', 'Emu Mode'
|
||||||
|
|
||||||
return 'fa-cloud'
|
return 'fa-cloud', 'Proxy Mode'
|
||||||
|
|
||||||
|
|
||||||
def _get_row(inv: InverterBase):
|
def _get_row(inv: InverterBase):
|
||||||
'''build one row for the connection table'''
|
'''build one row for the connection table'''
|
||||||
client_mode = inv.client_mode
|
client_mode = inv.client_mode
|
||||||
inv_serial = inv.local.stream.inv_serial
|
inv_serial = inv.local.stream.inv_serial
|
||||||
icon1 = _get_device_icon(client_mode)
|
icon1, descr1 = _get_device_icon(client_mode)
|
||||||
ip1, port1 = inv.addr
|
ip1, port1 = inv.addr
|
||||||
icon2 = ''
|
icon2 = ''
|
||||||
|
descr2 = ''
|
||||||
ip2 = '--'
|
ip2 = '--'
|
||||||
port2 = '--'
|
port2 = '--'
|
||||||
|
|
||||||
if inv.remote.ifc:
|
if inv.remote.ifc:
|
||||||
ip2, port2 = inv.remote.ifc.r_addr
|
ip2, port2 = inv.remote.ifc.r_addr
|
||||||
icon2 = _get_cloud_icon(client_mode)
|
icon2, descr2 = _get_cloud_icon(client_mode)
|
||||||
|
|
||||||
row = []
|
row = []
|
||||||
row.append(f'<i class="fa {icon1}"></i> {ip1}:{port1}')
|
row.append(f'<i class="fa {icon1}" title="{_(descr1)}"></i> {ip1}:{port1}')
|
||||||
row.append(f'<i class="fa {icon1}"></i> {ip1}')
|
row.append(f'<i class="fa {icon1}" title="{_(descr1)}"></i> {ip1}')
|
||||||
row.append(inv_serial)
|
row.append(inv_serial)
|
||||||
row.append(f'<i class="fa {icon2}"></i> {ip2}:{port2}')
|
row.append(f'<i class="fa {icon2}" title="{_(descr2)}"></i> {ip2}:{port2}')
|
||||||
row.append(f'<i class="fa {icon2}"></i> {ip2}')
|
row.append(f'<i class="fa {icon2}" title="{_(descr2)}"></i> {ip2}')
|
||||||
return row
|
return row
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user