federated-dash/cmd/web/app-links.go

145 lines
3.1 KiB
Go
Raw Normal View History

2024-06-25 20:17:08 +00:00
package main
2024-06-28 15:09:41 +00:00
import (
"slices"
"strings"
)
2024-06-25 20:17:08 +00:00
type AppLink struct {
Title string
Url string
Image string
Description string
}
func getAppLinks(tier, baseUri string) []AppLink {
2024-06-28 15:09:41 +00:00
var output []AppLink
//Get Links Based on Tier
2024-06-25 20:17:08 +00:00
if tier == "enterprise" {
2024-06-28 15:09:41 +00:00
output = getEnterpriseLinks(baseUri)
2024-06-25 20:17:08 +00:00
} else if tier == "creator" {
2024-06-28 15:09:41 +00:00
output = getCreatorLinks(baseUri)
2024-06-25 20:17:08 +00:00
} else if tier == "teams" {
2024-06-28 15:09:41 +00:00
output = getTeamsLinks(baseUri)
} else {
output = getStarterLinks(baseUri)
2024-06-25 20:17:08 +00:00
}
2024-06-28 15:09:41 +00:00
//Sort in alphabetical order
slices.SortFunc(output, func(a, b AppLink) int {
return strings.Compare(a.Title, b.Title)
})
return output
2024-06-25 20:17:08 +00:00
}
func getStarterLinks(baseUri string) []AppLink {
return []AppLink {
{
Title: "User Management",
2024-06-28 15:09:41 +00:00
Description: "Create and Manage Users",
2024-06-25 21:28:39 +00:00
Image: "/static/img/users.png",
2024-06-25 20:17:08 +00:00
Url: "https://panel." + baseUri,
},
{
Title: "Nextcloud",
Description: "Email, Files, Documents",
2024-06-25 21:28:39 +00:00
Image: "/static/img/nextcloud.png",
2024-06-25 20:17:08 +00:00
Url: "https://nextcloud." + baseUri,
},
{
Title: "Vaultwarden",
Description: "Password Management",
2024-06-25 21:28:39 +00:00
Image: "/static/img/vaultwarden.png",
2024-06-25 20:17:08 +00:00
Url: "https://vaultwarden." + baseUri,
},
2024-06-25 21:28:39 +00:00
{
Title: "Power DNS",
Description: "DNS Management",
Image: "/static/img/powerdns.png",
Url: "https://powerdns." + baseUri,
},
2024-06-25 20:17:08 +00:00
}
}
func getCreatorLinks(baseUri string) []AppLink {
creatorLinks := []AppLink {
{
Title: "Element and Matrix",
Description: "Team Chat",
2024-06-25 21:28:39 +00:00
Image: "/static/img/element.png",
2024-06-25 20:17:08 +00:00
Url: "https://element." + baseUri,
},
{
Title: "Wordpress",
Description: "Your website",
2024-06-25 21:28:39 +00:00
Image: "/static/img/wordpress.png",
2024-06-25 20:17:08 +00:00
Url: "https://" + baseUri,
},
}
return append(creatorLinks, getStarterLinks(baseUri)...)
}
func getTeamsLinks(baseUri string) []AppLink {
teamsLinks := []AppLink {
{
Title: "Espo CRM",
Description: "Customer relationship manager",
2024-06-25 21:28:39 +00:00
Image: "/static/img/espo.png",
2024-06-25 20:17:08 +00:00
Url: "https://espocrm." + baseUri,
},
{
Title: "FreeScout",
Description: "Customer Help Desk",
2024-06-25 21:28:39 +00:00
Image: "/static/img/freescout.png",
2024-06-25 20:17:08 +00:00
Url: "https://freescout." + baseUri,
},
}
return append(teamsLinks, getCreatorLinks(baseUri)...)
}
func getEnterpriseLinks(baseUri string) []AppLink {
enterpriseLinks := []AppLink{
{
Title: "Jitsi",
Description: "Video Chat",
2024-06-25 21:28:39 +00:00
Image: "/static/img/jitsi.png",
2024-06-25 20:17:08 +00:00
Url: "https://jitsi." + baseUri,
},
{
Title: "Listmonk",
Description: "Email Marketing",
2024-06-25 21:28:39 +00:00
Image: "/static/img/listmonk.png",
2024-06-25 20:17:08 +00:00
Url: "https://listmonk." + baseUri,
},
{
Title: "Baserow",
Description: "Visual Databases",
2024-06-25 21:28:39 +00:00
Image: "/static/img/baserow.png",
2024-06-25 20:17:08 +00:00
Url: "https://baserow." + baseUri,
},
{
Title: "Bookstack",
Description: "Wiki Knowledgebase",
2024-06-25 21:28:39 +00:00
Image: "/static/img/bookstack.png",
2024-06-25 20:17:08 +00:00
Url: "https://bookstack." + baseUri,
},
{
Title: "Gitea",
Description: "GIT Source Control",
2024-06-25 21:28:39 +00:00
Image: "/static/img/gitea.png",
2024-06-25 20:17:08 +00:00
Url: "https://gitea." + baseUri,
},
{
Title: "Castopod",
Description: "Podcast Distribution",
2024-06-25 21:28:39 +00:00
Image: "/static/img/castopod.png",
2024-06-25 20:17:08 +00:00
Url: "https://castopod." + baseUri,
},
}
return append(enterpriseLinks, getTeamsLinks(baseUri)...)
}