feature: Show username in header (#270)
This commit is contained in:
parent
43c48aef17
commit
f60ab6ce85
|
|
@ -39,9 +39,12 @@ message Entity {
|
|||
|
||||
message GetDashboardComponentsResponse {
|
||||
string title = 1;
|
||||
|
||||
repeated Action actions = 2;
|
||||
repeated Entity entities = 3;
|
||||
repeated DashboardComponent dashboards = 4;
|
||||
|
||||
string authenticated_user = 5;
|
||||
}
|
||||
|
||||
message GetDashboardComponentsRequest {}
|
||||
|
|
|
|||
|
|
@ -221,6 +221,8 @@ func (api *oliveTinAPI) GetDashboardComponents(ctx ctx.Context, req *pb.GetDashb
|
|||
|
||||
dashboardCfgToPb(res, cfg.Dashboards)
|
||||
|
||||
res.AuthenticatedUser = user.Username
|
||||
|
||||
return res, nil
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -35,6 +35,8 @@
|
|||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
|
||||
<span id = "username"> </span>
|
||||
</header>
|
||||
|
||||
<main title = "main content">
|
||||
|
|
|
|||
|
|
@ -19,6 +19,8 @@ export function marshalDashboardComponentsJsonToHtml (json) {
|
|||
marshalActionsJsonToHtml(json)
|
||||
marshalDashboardStructureToHtml(json)
|
||||
|
||||
document.getElementById('username').innerText = json.authenticatedUser
|
||||
|
||||
changeDirectory(null)
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -72,9 +72,15 @@ nav ul li a:hover {
|
|||
text-align: center;
|
||||
display: inline-grid;
|
||||
place-items: center;
|
||||
margin-left: 1em;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
#username {
|
||||
margin-right: 1em;
|
||||
font-size: small;
|
||||
}
|
||||
|
||||
nav {
|
||||
display: none;
|
||||
left: -250px;
|
||||
|
|
@ -120,6 +126,7 @@ h1 {
|
|||
display: inline;
|
||||
font-size: small;
|
||||
padding-left: .5em;
|
||||
flex-grow: 1;
|
||||
}
|
||||
|
||||
nav ul {
|
||||
|
|
@ -375,7 +382,6 @@ header {
|
|||
flex-direction: row;
|
||||
z-index: 3;
|
||||
align-items: center;
|
||||
padding-left: 1em;
|
||||
padding-bottom: .2em;
|
||||
padding-top: 1em;
|
||||
position: fixed;
|
||||
|
|
|
|||
Loading…
Reference in New Issue