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
This commit is contained in:
David Kaltschmidt
2018-04-16 13:37:05 +02:00
parent ee303c03e9
commit 712212d6aa
3 changed files with 19 additions and 2 deletions

View File

@ -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",