Пример #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']))