Show Grafana version and build in Help menu

* establishes Help as the single place to look for the Grafana version
* version is passed as menu sub-title to side menu
* added rendering of sub-title, plus styles
* sub-title was used by profile menu (its value is the login string),
but was not shown; now showing this value on condition that login name
is different from user name
pull/11605/head
David Kaltschmidt 7 years ago
parent ee303c03e9
commit 712212d6aa
  1. 8
      pkg/api/index.go
  2. 5
      public/app/core/components/sidemenu/sidemenu.html
  3. 8
      public/sass/components/_sidemenu.scss

@ -118,9 +118,14 @@ func setIndexViewData(c *m.ReqContext) (*dtos.IndexViewData, error) {
})
if c.IsSignedIn {
// Only set login if it's different from the name
var login string
if c.SignedInUser.Login != c.SignedInUser.NameOrFallback() {
login = c.SignedInUser.Login
}
profileNode := &dtos.NavLink{
Text: c.SignedInUser.NameOrFallback(),
SubTitle: c.SignedInUser.Login,
SubTitle: login,
Id: "profile",
Img: data.User.GravatarUrl,
Url: setting.AppSubUrl + "/profile",
@ -284,6 +289,7 @@ func setIndexViewData(c *m.ReqContext) (*dtos.IndexViewData, error) {
data.NavTree = append(data.NavTree, &dtos.NavLink{
Text: "Help",
SubTitle: fmt.Sprintf(`Grafana version: %s+%s`, setting.BuildVersion, setting.BuildCommit),
Id: "help",
Url: "#",
Icon: "gicon gicon-question",

@ -70,9 +70,12 @@
{{::child.text}}
</a>
</li>
<li ng-if="item.subTitle" class="side-menu-subtitle">
<span class="sidemenu-item-text">{{::item.subTitle}}</span>
</li>
<li class="side-menu-header">
<span class="sidemenu-item-text">{{::item.text}}</span>
</li>
</ul>
</div>
</div>
</div>

@ -149,6 +149,14 @@
color: #ebedf2;
}
.side-menu-subtitle {
padding: 0.5rem 0.5rem 0.5rem 1rem;
font-size: $font-size-sm;
color: $text-color-weak;
border-top: 1px solid $dropdownDividerBottom;
margin-top: 0.25rem;
}
li.sidemenu-org-switcher {
border-bottom: 1px solid $dropdownDividerBottom;
}

Loading…
Cancel
Save