示例#1
0
 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
示例#2
0
 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
示例#3
0
def trans_fsize(x):
    return str_fsize(int(x['value']))
示例#4
0
def trans_fsize(x):
    return str_fsize(int(x['value']))