Commit 938210b2 authored by 徐豪's avatar 徐豪
Browse files

新增2个菜单

parent 1b5fffbb
# frozen_string_literal: true
class Dashboard::JenkinsController < Dashboard::ApplicationController
def index
# do something
end
end
# frozen_string_literal: true
class Dashboard::SonarQubeController < Dashboard::ApplicationController
def index
# do something
end
end
- page_title _("Jenkins")
%section
%iframe{ src: "http://10.21.0.42:8000", style: "position:absolute; height:100%; width: 85%; left: 15%; overflow: hidden; border: 0;"}
\ No newline at end of file
- page_title _("SonarQube")
%section
%iframe{ src: "http://10.21.0.42:9000", style: "position:absolute; height:100%; width: 85%; left: 15%; overflow: hidden; border: 0;"}
\ No newline at end of file
......@@ -12,7 +12,7 @@ def self.connect_src
end
def self.frame_src
"https://www.google.com/recaptcha/ https://www.recaptcha.net/ https://www.googletagmanager.com/ns.html"
"https://www.google.com/recaptcha/ https://www.recaptcha.net/ http://10.21.0.42:7000 http://10.21.0.42:8000 http://10.21.0.42:9000"
end
def self.script_src
......
# frozen_string_literal: true
module Sidebars
module YourWork
module Menus
class JenkinsMenu < ::Sidebars::Menu
override :link
def link
dashboard_jenkins_path
end
override :title
def title
_('Jenkins')
end
override :sprite_icon
def sprite_icon
'rocket'
end
override :render?
def render?
!!context.current_user
end
override :active_routes
def active_routes
{ path: 'dashboard/jenkins#index' }
end
end
end
end
end
# frozen_string_literal: true
module Sidebars
module YourWork
module Menus
class SonarQubeMenu < ::Sidebars::Menu
override :link
def link
dashboard_sonarqube_path
end
override :title
def title
_('SonarQube')
end
override :sprite_icon
def sprite_icon
'search'
end
override :render?
def render?
!!context.current_user
end
override :active_routes
def active_routes
{ path: 'dashboard/sonarqube#index' }
end
end
end
end
end
......@@ -32,6 +32,8 @@ def add_menus
add_menu(Sidebars::YourWork::Menus::MilestonesMenu.new(context))
add_menu(Sidebars::YourWork::Menus::SnippetsMenu.new(context))
add_menu(Sidebars::YourWork::Menus::ActivityMenu.new(context))
add_menu(Sidebars::YourWork::Menus::JenkinsMenu.new(context))
add_menu(Sidebars::YourWork::Menus::SonarQubeMenu.new(context))
end
end
end
......
......@@ -2987,6 +2987,12 @@ msgstr ""
msgid "Activity"
msgstr ""
 
msgid "Jenkins"
msgstr ""
msgid "SonarQube"
msgstr ""
msgid "Activity|An error occurred while retrieving activity. Reload the page to try again."
msgstr ""
 
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment