fix: Bug that caused duplicate links (eg Diagnostics and Logs) in the nav bar (#595)
This commit is contained in:
parent
74f0930dcc
commit
7110399d41
|
|
@ -5,8 +5,8 @@ package executor
|
|||
|
||||
import (
|
||||
"context"
|
||||
"os/exec"
|
||||
"os"
|
||||
"os/exec"
|
||||
)
|
||||
|
||||
func (e *Executor) Kill(execReq *InternalLogEntry) error {
|
||||
|
|
|
|||
|
|
@ -99,6 +99,7 @@ func cdToExecutableDir() {
|
|||
}
|
||||
}
|
||||
|
||||
//gocyclo:ignore
|
||||
func startServiceHandler(mode string) {
|
||||
cdToExecutableDir()
|
||||
|
||||
|
|
|
|||
|
|
@ -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"
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
package updatecheck
|
||||
|
||||
import (
|
||||
"testing"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestVersionLater(t *testing.T) {
|
||||
|
|
|
|||
|
|
@ -1,11 +1,19 @@
|
|||
export class NavigationBar {
|
||||
constructor() {
|
||||
constructor () {
|
||||
this.navbar = document.getElementsByTagName('nav')[0]
|
||||
this.mainLinks = document.getElementById('navigation-links')
|
||||
this.supplementalLinks = document.getElementById('supplemental-links')
|
||||
}
|
||||
|
||||
createLink(title, url, isSupplemental) {
|
||||
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,14 +22,10 @@ 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) {
|
||||
refreshSectionPolicyLinks (policy) {
|
||||
if (policy.showDiagnostics) {
|
||||
this.createLink('Diagnostics', '/diagnostics', true)
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue