debian-mirror-gitlab/lib/sidebars/groups/menus/kubernetes_menu.rb

53 lines
1.2 KiB
Ruby
Raw Normal View History

2021-10-27 15:23:28 +05:30
# frozen_string_literal: true
module Sidebars
module Groups
module Menus
class KubernetesMenu < ::Sidebars::Menu
override :link
def link
group_clusters_path(context.group)
end
override :title
def title
_('Kubernetes')
end
override :sprite_icon
def sprite_icon
'cloud-gear'
end
override :render?
def render?
2022-05-07 20:08:51 +05:30
clusterable = context.group
2022-07-16 23:28:13 +05:30
clusterable.certificate_based_clusters_enabled? &&
2022-05-07 20:08:51 +05:30
can?(context.current_user, :read_cluster, clusterable)
2021-10-27 15:23:28 +05:30
end
override :extra_container_html_options
def extra_container_html_options
{
class: 'shortcuts-kubernetes'
}
end
override :active_routes
def active_routes
{ controller: :clusters }
end
2023-05-27 22:25:52 +05:30
override :serialize_as_menu_item_args
def serialize_as_menu_item_args
super.merge({
super_sidebar_parent: ::Sidebars::Groups::SuperSidebarMenus::OperationsMenu,
item_id: :group_kubernetes_clusters
})
end
2021-10-27 15:23:28 +05:30
end
end
end
end