예제 #1
0
    def get_ui_flags(self):
        v = self.tcp_flags

        return UI.HContainer(
            UI.SelectInput(UI.SelectOption(text='Ign.',
                                           value='ign',
                                           selected=v[1] is None),
                           UI.SelectOption(text='Are',
                                           value='nrm',
                                           selected=not v[0]
                                           and v[1] is not None),
                           UI.SelectOption(text='Are not',
                                           value='inv',
                                           selected=v[0] and v[1] is not None),
                           design='mini',
                           name='tcpflags-mode'),
            UI.LT(
                UI.LTR(
                    UI.Label(text='Check:'), *[
                        UI.Checkbox(text=x,
                                    name='tcpflags-vals[]',
                                    value=x,
                                    checked=x in v[2] if v[2] else False)
                        for x in self.flags
                    ]),
                UI.LTR(
                    UI.Label(text='Mask:'), *[
                        UI.Checkbox(text=x,
                                    name='tcpflags-mask[]',
                                    value=x,
                                    checked=x in v[1] if v[1] else False)
                        for x in self.flags
                    ])),
        )
예제 #2
0
 def get_ui_states(self):
     v = self.state
     return UI.HContainer(
         UI.SelectInput(
             UI.SelectOption(text='Ign.',
                             value='ign',
                             selected=v[1] is None),
             UI.SelectOption(text='Is',
                             value='nrm',
                             selected=not v[0] and v[1] is not None),
             UI.SelectOption(text='Isn\'t',
                             value='inv',
                             selected=v[0] and v[1] is not None),
             design='mini',
             name='state-mode',
         ),
         UI.HContainer(*[
             UI.Checkbox(text=x,
                         name='state[]',
                         value=x,
                         checked=v[1] and x in v[1]) for x in self.states
         ]))