Launcher: groupe same app instances. added url inside tooltip.
Change-Id: Ib2f6ed3507ceae4c85aad024e62cab4bd460ee25
diff --git a/core/installer/welcome/launcher-tmpl/launcher.html b/core/installer/welcome/launcher-tmpl/launcher.html
index 9b243fd..fe85651 100644
--- a/core/installer/welcome/launcher-tmpl/launcher.html
+++ b/core/installer/welcome/launcher-tmpl/launcher.html
@@ -27,9 +27,12 @@
</div>
<div class="tooltip">
<p>{{ .Name }}</p>
- {{ if .Help }}
- <button class="help-button" id="help-button-{{ CleanAppName .Name }}">Help</button>
- {{ end }}
+ {{ if .Url }}
+ <p>{{ .Url }}</p>
+ {{ end }}
+ {{ if .Help }}
+ <button class="help-button" id="help-button-{{ CleanAppName .Name }}">Help</button>
+ {{ end }}
</div>
</div>
<dialog class="app-help-modal" id="modal-{{ CleanAppName .Name }}" close>
diff --git a/core/installer/welcome/launcher.go b/core/installer/welcome/launcher.go
index 51313eb..9d2b2f4 100644
--- a/core/installer/welcome/launcher.go
+++ b/core/installer/welcome/launcher.go
@@ -6,6 +6,7 @@
"html/template"
"log"
"net/http"
+ "sort"
"strings"
"github.com/giolekva/pcloud/core/installer"
@@ -58,6 +59,21 @@
Url: a.URL,
})
}
+ sort.Slice(ret, func(i, j int) bool {
+ if ret[i].Name == "app-manager" {
+ return true
+ }
+ if ret[j].Name == "app-manager" {
+ return false
+ }
+ if ret[i].Name == "headscale" {
+ return ret[j].Name != "app-manager"
+ }
+ if ret[j].Name == "headscale" {
+ return false
+ }
+ return ret[i].Name < ret[j].Name
+ })
return ret, nil
}