yield from (MatchItem( title=rulespec.title, topic=self._topic(rulespec), url=makeuri_contextless( request, [("mode", "edit_ruleset"), ("varname", rulespec.name)], filename="wato.py", ), match_texts=[rulespec.title, rulespec.name], ) for group in self._rulespec_registry.get_all_groups() for rulespec in self._rulespec_registry.get_by_group(group) if rulespec.title) @staticmethod def is_affected_by_change(change_action_name: str) -> bool: return change_action_name.endswith("-package") @property def is_localization_dependent(self) -> bool: return True rulespec_registry = RulespecRegistry(rulespec_group_registry) match_item_generator_registry.register( MatchItemGeneratorRules( 'rules', rulespec_group_registry, rulespec_registry, ))
match_texts=[topic_menu_item.title], ) for topic_menu_topic in self._topic_generator() for topic_menu_item in topic_menu_topic.items) @staticmethod def is_affected_by_change(_change_action_name: str) -> bool: return False @property def is_localization_dependent(self) -> bool: return True match_item_generator_registry.register( MatchItemGeneratorSetupMenu( "setup", mega_menu_registry["setup"].topics, )) @snapin_registry.register class SidebarSnapinWATO(SidebarSnapin): @staticmethod def type_name(): return "admin" @classmethod def title(cls): return _("Setup") @classmethod
def _get_service_description(self, hostname: HostName, check_plugin_name: CheckPluginNameStr, item: Item) -> ServiceName: return cmk.base.export.service_description(hostname, check_plugin_name, item) class MatchItemGeneratorLogfilePatternAnalyzer(ABCMatchItemGenerator): def generate_match_items(self) -> MatchItems: title = ModePatternEditor.title_pattern_analyzer() yield MatchItem( title=title, topic=_("Miscellaneous"), url=makeuri_contextless( request, [("mode", ModePatternEditor.name())], filename="wato.py", ), match_texts=[title], ) @staticmethod def is_affected_by_change(_change_action_name: str) -> bool: return False @property def is_localization_dependent(self) -> bool: return True match_item_generator_registry.register( MatchItemGeneratorLogfilePatternAnalyzer("logfile_pattern_analyzer"))
url=makeuri_contextless( request, [("mode", edit_mode_name), ("varname", ident)], filename="wato.py", ), match_texts=[title, ident], ) def generate_match_items(self) -> MatchItems: mode = self._mode_class() yield from (self._config_variable_to_match_item( config_variable, mode.edit_mode_name) for _group, config_variables in mode.iter_all_configuration_variables() for config_variable in config_variables) @staticmethod def is_affected_by_change(_change_action_name: str) -> bool: return False @property def is_localization_dependent(self) -> bool: return True match_item_generator_registry.register( MatchItemGeneratorSettings( "global_settings", _("Global settings"), ModeEditGlobals, ))
title=topic_menu_item.title, topic=_("Setup"), url=topic_menu_item.url, match_texts=[topic_menu_item.title], ) for topic_menu_topic in mega_menu_registry["setup"].topics() for topic_menu_item in topic_menu_topic.items) def is_affected_by_change(self, _: str) -> bool: return False @property def is_localization_dependent(self) -> bool: return True match_item_generator_registry.register(MatchItemGeneratorSetupMenu("setup")) @snapin_registry.register class SidebarSnapinWATO(SidebarSnapin): @staticmethod def type_name(): return "admin" @classmethod def title(cls): return _("Setup") @classmethod def has_show_more_items(cls): return True