@ -0,0 +1,23 @@
|
|||||||
|
# ---> Go
|
||||||
|
# If you prefer the allow list template instead of the deny list, see community template:
|
||||||
|
# https://github.com/github/gitignore/blob/main/community/Golang/Go.AllowList.gitignore
|
||||||
|
#
|
||||||
|
# Binaries for programs and plugins
|
||||||
|
*.exe
|
||||||
|
*.exe~
|
||||||
|
*.dll
|
||||||
|
*.so
|
||||||
|
*.dylib
|
||||||
|
|
||||||
|
# Test binary, built with `go test -c`
|
||||||
|
*.test
|
||||||
|
|
||||||
|
# Output of the go coverage tool, specifically when used with LiteIDE
|
||||||
|
*.out
|
||||||
|
|
||||||
|
# Dependency directories (remove the comment below to include it)
|
||||||
|
# vendor/
|
||||||
|
|
||||||
|
# Go workspace file
|
||||||
|
go.work
|
||||||
|
|
@ -0,0 +1,102 @@
|
|||||||
|
# options for analysis running
|
||||||
|
run:
|
||||||
|
# timeout for analysis, e.g. 30s, 5m, default is 1m
|
||||||
|
timeout: 1m
|
||||||
|
|
||||||
|
# exit code when at least one issue was found, default is 1
|
||||||
|
issues-exit-code: 0
|
||||||
|
|
||||||
|
# include test files or not, default is true
|
||||||
|
tests: false
|
||||||
|
|
||||||
|
# which dirs to skip: issues from them won't be reported;
|
||||||
|
# can use regexp here: generated.*, regexp is applied on full path;
|
||||||
|
# default value is empty list, but default dirs are skipped independently
|
||||||
|
# from this option's value (see skip-dirs-use-default).
|
||||||
|
# "/" will be replaced by current OS file path separator to properly work
|
||||||
|
# on Windows.
|
||||||
|
skip-dirs:
|
||||||
|
- wasm
|
||||||
|
- static
|
||||||
|
- node_modules
|
||||||
|
- documents
|
||||||
|
- docker
|
||||||
|
- bind-*
|
||||||
|
|
||||||
|
# default is true. Enables skipping of directories:
|
||||||
|
# vendor$, third_party$, testdata$, examples$, Godeps$, builtin$
|
||||||
|
skip-dirs-use-default: true
|
||||||
|
|
||||||
|
# by default isn't set. If set we pass it to "go list -mod={option}". From "go help modules":
|
||||||
|
# If invoked with -mod=readonly, the go command is disallowed from the implicit
|
||||||
|
# automatic updating of go.mod described above. Instead, it fails when any changes
|
||||||
|
# to go.mod are needed. This setting is most useful to check that go.mod does
|
||||||
|
# not need updates, such as in a continuous integration and testing system.
|
||||||
|
# If invoked with -mod=vendor, the go command assumes that the vendor
|
||||||
|
# directory holds the correct copies of dependencies and ignores
|
||||||
|
# the dependency descriptions in go.mod.
|
||||||
|
modules-download-mode: mod
|
||||||
|
|
||||||
|
# Allow multiple parallel golangci-lint instances running.
|
||||||
|
# If false (default) - golangci-lint acquires file lock on start.
|
||||||
|
allow-parallel-runners: true
|
||||||
|
|
||||||
|
|
||||||
|
# output configuration options
|
||||||
|
output:
|
||||||
|
# colored-line-number|line-number|json|tab|checkstyle|code-climate|junit-xml|github-actions
|
||||||
|
# default is "colored-line-number"
|
||||||
|
format: colored-line-number
|
||||||
|
|
||||||
|
# print lines of code with issue, default is true
|
||||||
|
print-issued-lines: true
|
||||||
|
|
||||||
|
# print linter name in the end of issue text, default is true
|
||||||
|
print-linter-name: true
|
||||||
|
|
||||||
|
# make issues output unique by line, default is true
|
||||||
|
uniq-by-line: true
|
||||||
|
|
||||||
|
# add a prefix to the output file references; default is no prefix
|
||||||
|
path-prefix: ""
|
||||||
|
|
||||||
|
# sorts results by: filepath, line and column
|
||||||
|
sort-results: false
|
||||||
|
|
||||||
|
|
||||||
|
# all available settings of specific linters
|
||||||
|
linters-settings:
|
||||||
|
gofmt:
|
||||||
|
# simplify code: gofmt with `-s` option, true by default
|
||||||
|
simplify: true
|
||||||
|
staticcheck:
|
||||||
|
# Select the Go version to target. The default is '1.13'.
|
||||||
|
go: "1.16"
|
||||||
|
# https://staticcheck.io/docs/options#checks
|
||||||
|
checks: ["all"]
|
||||||
|
stylecheck:
|
||||||
|
# Select the Go version to target. The default is '1.13'.
|
||||||
|
go: "1.18"
|
||||||
|
# https://staticcheck.io/docs/options#checks
|
||||||
|
checks: ["all"]
|
||||||
|
errcheck:
|
||||||
|
# report about assignment of errors to blank identifier: `num, _ := strconv.Atoi(numStr)`;
|
||||||
|
# default is false: such cases aren't reported by default.
|
||||||
|
check-blank: true
|
||||||
|
|
||||||
|
linters:
|
||||||
|
enable:
|
||||||
|
# go install github.com/kisielk/errcheck@latest
|
||||||
|
# go install github.com/gordonklaus/ineffassign@latest
|
||||||
|
# go install honnef.co/go/tools/cmd/staticcheck@latest
|
||||||
|
# go install gitlab.com/opennota/check/cmd/varcheck@latest
|
||||||
|
# go install github.com/go-critic/go-critic/cmd/gocritic@latest
|
||||||
|
- errcheck
|
||||||
|
- staticcheck
|
||||||
|
- stylecheck
|
||||||
|
- ineffassign
|
||||||
|
- varcheck
|
||||||
|
- gofmt
|
||||||
|
- gocritic
|
||||||
|
- wsl
|
||||||
|
fast: true
|
@ -0,0 +1,3 @@
|
|||||||
|
module codefirst.ddns.net/git/thomas.bellembois/codefirst-menu/v2
|
||||||
|
|
||||||
|
go 1.19
|
After Width: | Height: | Size: 446 B |
After Width: | Height: | Size: 620 B |
After Width: | Height: | Size: 537 B |
After Width: | Height: | Size: 832 B |
After Width: | Height: | Size: 633 B |
After Width: | Height: | Size: 491 B |
After Width: | Height: | Size: 762 B |
After Width: | Height: | Size: 290 KiB |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 981 B |
After Width: | Height: | Size: 543 B |
After Width: | Height: | Size: 1.3 KiB |
After Width: | Height: | Size: 1.3 KiB |
After Width: | Height: | Size: 892 B |
@ -0,0 +1,65 @@
|
|||||||
|
package main
|
||||||
|
|
||||||
|
import (
|
||||||
|
"encoding/base64"
|
||||||
|
"fmt"
|
||||||
|
"io/fs"
|
||||||
|
"io/ioutil"
|
||||||
|
"log"
|
||||||
|
"os"
|
||||||
|
"path"
|
||||||
|
"path/filepath"
|
||||||
|
"strings"
|
||||||
|
|
||||||
|
"codefirst.ddns.net/git/thomas.bellembois/codefirst-menu/v2/menu"
|
||||||
|
)
|
||||||
|
|
||||||
|
const (
|
||||||
|
iconSrcDirPath = "icons/src/"
|
||||||
|
iconOutputFile = "icons/icon.go"
|
||||||
|
)
|
||||||
|
|
||||||
|
func writeFile(f *os.File, s string) {
|
||||||
|
_, err := f.WriteString(s)
|
||||||
|
if err != nil {
|
||||||
|
log.Fatal(err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func main() {
|
||||||
|
var (
|
||||||
|
srcFiles []fs.FileInfo
|
||||||
|
outputFile *os.File
|
||||||
|
err error
|
||||||
|
)
|
||||||
|
|
||||||
|
if outputFile, err = os.Create(iconOutputFile); err != nil {
|
||||||
|
log.Fatal(err)
|
||||||
|
}
|
||||||
|
defer outputFile.Close()
|
||||||
|
|
||||||
|
writeFile(outputFile, "package icons\n")
|
||||||
|
|
||||||
|
if srcFiles, err = ioutil.ReadDir(iconSrcDirPath); err != nil {
|
||||||
|
log.Fatal(err)
|
||||||
|
}
|
||||||
|
|
||||||
|
for _, file := range srcFiles {
|
||||||
|
var bytes []byte
|
||||||
|
|
||||||
|
fileName := file.Name()
|
||||||
|
|
||||||
|
if bytes, err = ioutil.ReadFile(path.Join(iconSrcDirPath, fileName)); err != nil {
|
||||||
|
log.Fatal(err)
|
||||||
|
}
|
||||||
|
|
||||||
|
fileExt := filepath.Ext(fileName)
|
||||||
|
fileNameWithoutExt := fileName[:len(fileName)-len(fileExt)]
|
||||||
|
base64EncodedIcon := base64.StdEncoding.EncodeToString(bytes)
|
||||||
|
|
||||||
|
fileEntry := fmt.Sprintf("var %s = \"%s\"\n", strings.Title(fileNameWithoutExt), base64EncodedIcon)
|
||||||
|
writeFile(outputFile, fileEntry)
|
||||||
|
}
|
||||||
|
|
||||||
|
fmt.Println(menu.CodeFirstMenu)
|
||||||
|
}
|
@ -0,0 +1,53 @@
|
|||||||
|
package menu
|
||||||
|
|
||||||
|
import (
|
||||||
|
"bytes"
|
||||||
|
"html/template"
|
||||||
|
|
||||||
|
"codefirst.ddns.net/git/thomas.bellembois/codefirst-menu/v2/icons"
|
||||||
|
)
|
||||||
|
|
||||||
|
var CodeFirstMenu string
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
t := template.Must(template.New("").Funcs(template.FuncMap{
|
||||||
|
"safe": func(s string) template.HTML { return template.HTML(s) },
|
||||||
|
}).Parse(menuTemplate))
|
||||||
|
|
||||||
|
data := struct {
|
||||||
|
Background,
|
||||||
|
Logo,
|
||||||
|
LogoutIcon,
|
||||||
|
ChangePasswordIcon,
|
||||||
|
GitIcon,
|
||||||
|
DroneIcon,
|
||||||
|
SonarIcon,
|
||||||
|
RegistryIcon,
|
||||||
|
DockerIcon,
|
||||||
|
DocIcon,
|
||||||
|
PastebinIcon,
|
||||||
|
ChatIcon,
|
||||||
|
RunnerIcon string
|
||||||
|
}{
|
||||||
|
Background: icons.HomeBackground,
|
||||||
|
Logo: icons.Logo,
|
||||||
|
LogoutIcon: icons.Logout,
|
||||||
|
ChangePasswordIcon: icons.LockReset,
|
||||||
|
GitIcon: icons.Git,
|
||||||
|
DroneIcon: icons.Flash,
|
||||||
|
SonarIcon: icons.Radar,
|
||||||
|
RegistryIcon: icons.Docker,
|
||||||
|
DockerIcon: icons.Api,
|
||||||
|
DocIcon: icons.FileDocumentEditOutline,
|
||||||
|
PastebinIcon: icons.ContentPaste,
|
||||||
|
ChatIcon: icons.Wechat,
|
||||||
|
RunnerIcon: icons.WebSync,
|
||||||
|
}
|
||||||
|
|
||||||
|
var tpl bytes.Buffer
|
||||||
|
if err := t.Execute(&tpl, data); err != nil {
|
||||||
|
panic(err)
|
||||||
|
}
|
||||||
|
|
||||||
|
CodeFirstMenu = tpl.String()
|
||||||
|
}
|
@ -0,0 +1,172 @@
|
|||||||
|
package menu
|
||||||
|
|
||||||
|
var menuTemplate = `<div id="codefirstMenu" style="display: inline-block; width: 100%; background-color: white;">
|
||||||
|
|
||||||
|
<style type="text/css" scoped>
|
||||||
|
a.codefirstMenu {
|
||||||
|
color: black;
|
||||||
|
text-decoration: none;
|
||||||
|
font-size: 14px;
|
||||||
|
font-family: arial;
|
||||||
|
vertical-align: bottom;
|
||||||
|
}
|
||||||
|
img.codefirstMenu {
|
||||||
|
height: 20px;
|
||||||
|
}
|
||||||
|
span.codefirstMenu {
|
||||||
|
line-height: 2em;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
||||||
|
{{safe "<!--gitea"}}
|
||||||
|
<style type="text/css" scoped>
|
||||||
|
span#gitea {
|
||||||
|
text-decoration: underline;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
gitea-->
|
||||||
|
|
||||||
|
{{safe "<!--drone"}}
|
||||||
|
<style type="text/css" scoped>
|
||||||
|
span#drone {
|
||||||
|
text-decoration: underline;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
drone-->
|
||||||
|
|
||||||
|
{{safe "<!--sonar"}}
|
||||||
|
<style type="text/css" scoped>
|
||||||
|
span#sonar {
|
||||||
|
text-decoration: underline;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
sonar-->
|
||||||
|
|
||||||
|
{{safe "<!--dockerregistry"}}
|
||||||
|
<style type="text/css" scoped>
|
||||||
|
span#dockerregistry {
|
||||||
|
text-decoration: underline;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
dockerregistry-->
|
||||||
|
|
||||||
|
{{safe "<!--dockerrunner"}}
|
||||||
|
<style type="text/css" scoped>
|
||||||
|
span#dockerrunner {
|
||||||
|
text-decoration: underline;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
dockerrunner-->
|
||||||
|
|
||||||
|
{{safe "<!--documentation"}}
|
||||||
|
<style type="text/css" scoped>
|
||||||
|
span#documentation {
|
||||||
|
text-decoration: underline;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
documentation-->
|
||||||
|
|
||||||
|
<div style="float: left; padding: 5px; background: white; width: 100%">
|
||||||
|
|
||||||
|
<div title="home" style="float: left; margin-right: 50px;">
|
||||||
|
<a class="codefirstMenu" style="border-bottom: none;" href="https://CODEFIRST_HOSTNAME/home">
|
||||||
|
<img class="" src="data:image/png;base64,{{.Logo}}"/>
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
<div title="change password" style="float: left; margin-right: 5px;">
|
||||||
|
<a class="codefirstMenu" style="border-bottom: none;" href="https://CODEFIRST_HOSTNAME/keycloak/realms/master/account/?referrer=security-admin-console&referrer_uri=https%3A%2F%2FCODEFIRST_HOSTNAME%2Fkeycloak%2Fauth%2Fadmin%2Fmaster%2Fconsole%2F%23%2Fforbidden#/security/signingin">
|
||||||
|
<span class="codefirstMenu">Password</span>
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
-->
|
||||||
|
|
||||||
|
<div title="gitea" style="float: left; margin-right: 5px;">
|
||||||
|
<a class="codefirstMenu" style="border-bottom: none;" href="https://CODEFIRST_HOSTNAME/git/user/oauth2/keycloak">
|
||||||
|
<span id="gitea" class="codefirstMenu">
|
||||||
|
<img class="codefirstMenu" src="data:image/png;base64,{{.GitIcon}}"/>
|
||||||
|
Gitea
|
||||||
|
</span>
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div title="drone" style="float: left; margin-right: 5px;">
|
||||||
|
<a class="codefirstMenu" style="border-bottom: none;" href="https://CODEFIRST_HOSTNAME/login">
|
||||||
|
<span id="drone" class="codefirstMenu">
|
||||||
|
<img class="codefirstMenu" src="data:image/png;base64,{{.DroneIcon}}"/>
|
||||||
|
Drone
|
||||||
|
</span>
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div title="sonarqube" style="float: left; margin-right: 50px;">
|
||||||
|
<a class="codefirstMenu" style="border-bottom: none;" href="https://CODEFIRST_HOSTNAME/sonar/sessions/init/oidc?return_to=%2Fsonar%2F">
|
||||||
|
<span id="sonar" class="codefirstMenu">
|
||||||
|
<img class="codefirstMenu" src="data:image/png;base64,{{.SonarIcon}}"/>
|
||||||
|
SonarQube
|
||||||
|
</span>
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div title="documentation" style="float: left; margin-right: 50px;">
|
||||||
|
<a class="codefirstMenu" style="border-bottom: none;" href="https://CODEFIRST_HOSTNAME/documentation/">
|
||||||
|
<span id="documentation" class="codefirstMenu">
|
||||||
|
<img class="codefirstMenu" src="data:image/png;base64,{{.DocIcon}}"/>
|
||||||
|
CodeDoc
|
||||||
|
</span>
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
<div title="docker registry" style="float: left; margin-right: 5px;">
|
||||||
|
<a class="codefirstMenu" style="border-bottom: none;" href="https://pubhub.CODEFIRST_HOSTNAME">
|
||||||
|
<span id="dockerregistry" class="codefirstMenu">
|
||||||
|
<img class="codefirstMenu" src="data:image/png;base64,{{.RegistryIcon}}"/>
|
||||||
|
Registry
|
||||||
|
</span>
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
-->
|
||||||
|
|
||||||
|
<div title="docker runner" style="float: left; margin-right: 50px;">
|
||||||
|
<a class="codefirstMenu" style="border-bottom: none;" target="_blank" href="https://CODEFIRST_HOSTNAME/dockerrunner/static/html/">
|
||||||
|
<span id="dockerrunner" class="codefirstMenu">
|
||||||
|
<img class="codefirstMenu" src="data:image/png;base64,{{.RunnerIcon}}"/>
|
||||||
|
Runner
|
||||||
|
</span>
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div title="cinny" style="float: left; margin-right: 5px;">
|
||||||
|
<a class="codefirstMenu" style="border-bottom: none;" target="_blank" href="https://CODEFIRST_HOSTNAME/cinny/">
|
||||||
|
<span class="codefirstMenu">
|
||||||
|
<img class="codefirstMenu" src="data:image/png;base64,{{.ChatIcon}}"/>
|
||||||
|
Tchat
|
||||||
|
</span>
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div title="pastebin" style="float: left; margin-right: 5px;">
|
||||||
|
<a class="codefirstMenu" style="border-bottom: none;" target="_blank" href="https://CODEFIRST_HOSTNAME/pastebin/">
|
||||||
|
<span class="codefirstMenu">
|
||||||
|
<img class="codefirstMenu" src="data:image/png;base64,{{.PastebinIcon}}"/>
|
||||||
|
Pastebin
|
||||||
|
</span>
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div title="logout" style="float: right; margin-right: 5px;">
|
||||||
|
<a class="codefirstMenu" style="border-bottom: none;" href="https://CODEFIRST_HOSTNAME/keycloak/realms/master/protocol/openid-connect/logout">
|
||||||
|
<span class="codefirstMenu">
|
||||||
|
<img class="codefirstMenu" src="data:image/png;base64,{{.LogoutIcon}}"/>
|
||||||
|
Logout
|
||||||
|
</span>
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
`
|