Exemplo n.º 1
0
 def __init__(self):
     # type: () -> None
     varnames = [
         self.ident + "_" + str(x) for x in defines.interface_oper_states()
     ]
     super(FilterInvtableOperStatus, self).__init__(self._invinfo, varnames,
                                                    [])
Exemplo n.º 2
0
 def __init__(self, *, inv_info: str, ident: str, title: str) -> None:
     super().__init__(ident=ident,
                      title=title,
                      sort_index=800,
                      info=inv_info,
                      htmlvars=[ident + "_" + str(x) for x in defines.interface_oper_states()],
                      link_columns=[])
Exemplo n.º 3
0
 def display(self):
     html.begin_checkbox_group()
     for state, state_name in sorted(defines.interface_oper_states().items()):
         if state >= 8:
             continue  # skip artificial state 8 (degraded) and 9 (admin down)
         varname = self.ident + "_" + str(state)
         html.checkbox(varname, True, label=state_name)
         if state in (4, 7):
             html.br()
     html.end_checkbox_group()
Exemplo n.º 4
0
 def display(self, value: FilterHTTPVariables) -> None:
     html.begin_checkbox_group()
     for state, state_name in sorted(defines.interface_oper_states().items()):
         if not isinstance(state, int):  # needed because of silly types
             continue
         if state >= 8:
             continue  # skip artificial state 8 (degraded) and 9 (admin down)
         varname = self.ident + "_" + str(state)
         html.checkbox(varname, bool(value.get(varname, True)), label=state_name)
         if state in (4, 7):
             html.br()
     html.end_checkbox_group()
Exemplo n.º 5
0
 def __init__(self, *, inv_info: str, ident: str, title: str) -> None:
     super().__init__(
         title=title,
         sort_index=800,
         info=inv_info,
         query_filter=query_filters.MultipleOptionsQuery(
             ident=ident,
             options=[
                 (ident + "_" + str(state), title)
                 for state, title in defines.interface_oper_states().items()
                 # needed because of silly types
                 # skip artificial state 8 (degraded) and 9 (admin down)
                 if isinstance(state, int) and state < 8
             ],
             rows_filter=partial(query_filters.if_oper_status_filter_table, ident),
         ),
     )
Exemplo n.º 6
0
 def __init__(self):
     varnames = [self.ident + "_" + str(x) for x in defines.interface_oper_states()]
     Filter.__init__(self, self._invinfo, varnames, [])