Przeglądaj źródła

fix: Folders in dashboard not showing up

jamesread 7 miesięcy temu
rodzic
commit
8c2c7e9169

+ 1 - 1
service/internal/grpcapi/grpcApiDashboard.go

@@ -60,7 +60,7 @@ func getDashboardComponentContents(dashboard *config.DashboardComponent, rr *Das
 }
 
 func buildDashboardComponentSimple(subitem *config.DashboardComponent, rr *DashboardRenderRequest) *apiv1.DashboardComponent {
-	if subitem.Type == "" || subitem.Type == "link" {
+	if (subitem.Type == "" || subitem.Type == "link") && (len(subitem.Contents) == 0) {
 		if !slices.Contains(rr.AllowedActionTitles, subitem.Title) {
 			return nil
 		}

+ 2 - 0
webui.dev/js/marshaller.js

@@ -651,6 +651,7 @@ function marshalDisplay (item, fieldset) {
 
 function marshalDirectoryButton (item, fieldset, path) {
   const directoryButton = document.createElement('button')
+  directoryButton.classList.add('directory')
   directoryButton.innerHTML = '<span class = "icon">' + item.icon + '</span> ' + item.title
   directoryButton.onclick = () => {
     showSection(path)
@@ -665,6 +666,7 @@ function marshalDirectory (item, section) {
 
   const directoryBackButton = document.createElement('button')
   directoryBackButton.innerHTML = window.settings.DefaultIconForBack
+  directoryBackButton.classList.add('directory')
   directoryBackButton.title = 'Go back one directory'
   directoryBackButton.onclick = () => {
     showSection('/' + section.title)

+ 11 - 0
webui.dev/style.css

@@ -279,6 +279,17 @@ button {
   user-select: none;
 }
 
+button.directory {
+  font-size: .85em;
+  font-weight: normal;
+  flex-grow: 1;
+  width: 100%;
+  z-index: 1;
+  padding: 1em;
+  box-shadow: 0 0 6px 0 #aaa;
+  transition: background-color 1s ease, color .3s ease;
+}
+
 action-button {
   display: flex;
   flex-direction: column;