fix: Bug that caused duplicate links (eg Diagnostics and Logs) in the nav bar (#595)

This commit is contained in:
James Read 2025-05-31 20:20:37 +01:00 committed by GitHub
parent 74f0930dcc
commit 7110399d41
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 34 additions and 29 deletions

View File

@ -5,8 +5,8 @@ package executor
import (
"context"
"os/exec"
"os"
"os/exec"
)
func (e *Executor) Kill(execReq *InternalLogEntry) error {

View File

@ -99,6 +99,7 @@ func cdToExecutableDir() {
}
}
//gocyclo:ignore
func startServiceHandler(mode string) {
cdToExecutableDir()

View File

@ -2,10 +2,10 @@ package updatecheck
import (
"encoding/json"
"github.com/Masterminds/semver"
config "github.com/OliveTin/OliveTin/internal/config"
"github.com/OliveTin/OliveTin/internal/installationinfo"
"github.com/robfig/cron/v3"
"github.com/Masterminds/semver"
log "github.com/sirupsen/logrus"
"io"
"net/http"

View File

@ -1,8 +1,8 @@
package updatecheck
import (
"testing"
"github.com/stretchr/testify/assert"
"testing"
)
func TestVersionLater(t *testing.T) {

View File

@ -6,6 +6,14 @@ export class NavigationBar {
}
createLink (title, url, isSupplemental) {
let parent = (isSupplemental) ? this.supplementalLinks : this.mainLinks
const existsAlready = Array.from(parent.querySelectorAll('li')).some(el => el.title === title)
if (existsAlready) {
return
}
const linkA = document.createElement('a')
linkA.href = url
linkA.innerText = title
@ -14,11 +22,7 @@ export class NavigationBar {
navigationLi.appendChild(linkA)
navigationLi.title = title
if (isSupplemental) {
this.supplementalLinks.appendChild(navigationLi)
} else {
this.mainLinks.appendChild(navigationLi)
}
parent.appendChild(navigationLi)
}
refreshSectionPolicyLinks (policy) {