Esempio n. 1
0
    def get_ui_flags(self, desc):
        v = self.tcp_flags

        return UI.LayoutTableRow(
            UI.Label(text=desc),
            UI.Select(UI.SelectOption(text='Ignore',
                                      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),
                      name='tcpflags-mode'),
            UI.LayoutTableCell(UI.LayoutTable(
                UI.LayoutTableRow(
                    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.LayoutTableRow(
                    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
                    ])),
                               colspan=2))
Esempio n. 2
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
                    ])),
        )
Esempio n. 3
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
         ]))
Esempio n. 4
0
 def get_ui_states(self, desc):
     v = self.state
     return UI.LayoutTableRow(
         UI.Label(text=desc),
         UI.Select(UI.SelectOption(text='Ignore',
                                   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),
                   name='state-mode'),
         UI.LayoutTableCell(UI.LayoutTable(
             UI.LayoutTableRow(*[
                 UI.Checkbox(text=x,
                             name='state[]',
                             value=x,
                             checked=v[1] and x in v[1])
                 for x in self.states
             ])),
                            colspan=2))