diff --git a/OliveTin.proto b/OliveTin.proto index 5503d36..0bc72b9 100644 --- a/OliveTin.proto +++ b/OliveTin.proto @@ -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 {} diff --git a/internal/grpcapi/grpcApi.go b/internal/grpcapi/grpcApi.go index 7d53d4d..25f3baa 100644 --- a/internal/grpcapi/grpcApi.go +++ b/internal/grpcapi/grpcApi.go @@ -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 } diff --git a/webui.dev/index.html b/webui.dev/index.html index 29807c3..a116ca1 100644 --- a/webui.dev/index.html +++ b/webui.dev/index.html @@ -35,6 +35,8 @@ + +  
diff --git a/webui.dev/js/marshaller.js b/webui.dev/js/marshaller.js index 30a0573..ebaf26b 100644 --- a/webui.dev/js/marshaller.js +++ b/webui.dev/js/marshaller.js @@ -19,6 +19,8 @@ export function marshalDashboardComponentsJsonToHtml (json) { marshalActionsJsonToHtml(json) marshalDashboardStructureToHtml(json) + document.getElementById('username').innerText = json.authenticatedUser + changeDirectory(null) } diff --git a/webui.dev/style.css b/webui.dev/style.css index 2699b8f..b4e2466 100644 --- a/webui.dev/style.css +++ b/webui.dev/style.css @@ -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;