def get_info(self, iface): ui = UI.Container( UI.Formline( UI.HContainer( UI.Image(file='/dl/network/%s.png' % ('up' if iface.up else 'down')), UI.Label(text=iface.name, bold=True)), text='Interface', ), UI.Formline( UI.Label(text=self.get_ip(iface)), text='Address', ), UI.Formline( UI.Label(text='Up %s, down %s' % ( str_fsize(self.get_tx(iface)), str_fsize(self.get_rx(iface)), )), text='Traffic', ), ) return ui
def get_info(self, iface): ui = UI.Container( UI.Formline( UI.HContainer( UI.Image(file='/dl/network/%s.png'%('up' if iface.up else 'down')), UI.Label(text=iface.name, bold=True) ), text='Interface', ), UI.Formline( UI.Label(text=self.get_ip(iface)), text='Address', ), UI.Formline( UI.Label(text='Up %s, down %s' % ( str_fsize(self.get_tx(iface)), str_fsize(self.get_rx(iface)), )), text='Traffic', ), ) return ui
def trans_fsize(x): return str_fsize(int(x['value']))