def top_menu(self, request): if jails_enabled(): return [ { 'name': _('Plugins'), 'icon': 'images/ui/menu/plugins.png', 'onclick': 'Menu.openPlugins();', 'weight': 0, }, ] return []
def top_menu(self, request): if jails_enabled(): return [ { 'name': _('Jails'), 'icon': 'images/ui/menu/jails.png', 'onclick': 'Menu.openJails();', 'weight': 5, }, ] return []
def init(tree_roots, nav, request): if not jails_enabled(): tree_roots.unregister(nav) global O_INDEX self = Base() jails = Jails.objects.all() for jail in jails: # # XXX Revist this... for jail types that don't # XXX match a given type, check the template # XXX type, otherwise, check OS # if jail.jail_type == WARDEN_TYPE_PLUGINJAIL: icon = 'JailPluginIcon' elif jail.jail_type == WARDEN_TYPE_STANDARD: icon = 'BeastieIcon' elif jail.jail_type == WARDEN_TYPE_PORTJAIL: icon = 'BobbleIcon' elif jail.is_linux_jail(): icon = 'TuxIcon' else: icon = 'BeastieIcon' jail_node = self.new_jail_node(jail, icon) jail_node.order = O_INDEX O_INDEX += 1 nav.append_child(jail_node) jail_node_view = self.new_jail_node_view(jail) jail_node_view.order = 1 jail_node.append_child(jail_node_view) storage_node = self.new_storage_node(jail) storage_node.order = 2 jail_node.append_child(storage_node) storage_order = 1 nmps = JailMountPoint.objects.filter(jail=jail.jail_host) for nmp in nmps: storage_node_view = self.new_storage_node_view(nmp) storage_node_view.order = storage_order storage_node.append_child(storage_node_view) storage_order += 1 storage_node_add = self.new_storage_node_add(jail) storage_node_add.order = storage_order storage_node.append_child(storage_node_add)
def init(tree_roots, nav, request): if not jails_enabled(): tree_roots.unregister(nav)
def top_menu(self, request): if jails_enabled(): return [ {"name": _("Jails"), "icon": "images/ui/menu/jails.png", "onclick": "Menu.openJails();", "weight": 5} ] return []