Remove Applications & Services, Storage & Data, and Media & Social sections from web and api

This commit is contained in:
Stephen Schuresko
2026-09-25 09:33:24 -04:00
parent 8e177b0092
commit a8b4bedfbd
3 changed files with 12 additions and 122 deletions

View File

@@ -751,22 +751,7 @@ func (c *Collector) collectZeroScaleApps() []ZeroScaleApp {
}
func (c *Collector) parseIngressSites(raw []byte) []SiteGroup {
var ingList struct {
Items []struct {
Metadata struct {
Name string `json:"name"`
Namespace string `json:"namespace"`
} `json:"metadata"`
Spec struct {
Rules []struct {
Host string `json:"host"`
} `json:"rules"`
} `json:"spec"`
} `json:"items"`
}
_ = json.Unmarshal(raw, &ingList)
_ = raw
categories := map[string][]SiteLink{
"Core & Infrastructure": {
{
@@ -797,84 +782,9 @@ func (c *Collector) parseIngressSites(raw []byte) []SiteGroup {
Description: "Cluster metrics server, alerts, targets, and time-series graphing",
},
},
"Applications & Services": {},
"Storage & Data": {},
"Media & Social": {},
}
seenHosts := make(map[string]bool)
seenHosts["git.fairfaxmedia.net"] = true
seenHosts["kube.fairfaxmedia.net"] = true
seenHosts["prom-serv.kube.fairfaxmedia.net"] = true
seenHosts["bdash2.kube.fairfaxmedia.net"] = true
seenHosts["bdash2.fairfaxmedia.net"] = true
seenHosts["hopscotch.kube.fairfaxmedia.net"] = true
seenHosts["status.kube.fairfaxmedia.net"] = true
seenHosts["status.fairfaxmedia.net"] = true
seenHosts["kstat.fairfaxmedia.net"] = true
seenHosts["kstat.kube.fairfaxmedia.net"] = true
for _, item := range ingList.Items {
ns := item.Metadata.Namespace
for _, r := range item.Spec.Rules {
host := r.Host
if seenHosts[host] || host == "" {
continue
}
seenHosts[host] = true
link := SiteLink{
Name: formatSiteName(host, item.Metadata.Name),
Host: host,
URL: "https://" + host + "/",
Namespace: ns,
}
if strings.Contains(host, "minio") {
link.Category = "Storage & Data"
link.Icon = "🪣"
link.Description = "High-Performance S3 Compatible Distributed Object Store"
categories["Storage & Data"] = append(categories["Storage & Data"], link)
} else if strings.Contains(host, "sync") {
link.Category = "Storage & Data"
link.Icon = "🔄"
link.Description = "Continuous multi-device decentralized file synchronization"
categories["Storage & Data"] = append(categories["Storage & Data"], link)
} else if strings.Contains(host, "nextcloud") {
link.Category = "Applications & Services"
link.Icon = "☁️"
link.Description = "Private cloud productivity, files, calendars, and team collaboration"
categories["Applications & Services"] = append(categories["Applications & Services"], link)
} else if strings.Contains(host, "odoo") {
link.Category = "Applications & Services"
link.Icon = "💼"
link.Description = "Enterprise resource planning, CRM, accounting, and inventory"
categories["Applications & Services"] = append(categories["Applications & Services"], link)
} else if strings.Contains(host, "papi") {
link.Category = "Applications & Services"
link.Icon = "🔌"
link.Description = "Production platform API services and integration gateway"
categories["Applications & Services"] = append(categories["Applications & Services"], link)
} else if strings.Contains(host, "social") {
link.Category = "Media & Social"
link.Icon = "🐘"
link.Description = "Decentralized federated social network server"
categories["Media & Social"] = append(categories["Media & Social"], link)
} else if strings.Contains(host, "search") {
link.Category = "Applications & Services"
link.Icon = "🔍"
link.Description = "Decentralized web search engine and distributed web indexer"
categories["Applications & Services"] = append(categories["Applications & Services"], link)
} else {
link.Category = "Applications & Services"
link.Icon = "🌐"
link.Description = "Kubernetes Ingress deployed service"
categories["Applications & Services"] = append(categories["Applications & Services"], link)
}
}
}
order := []string{"Core & Infrastructure", "Applications & Services", "Storage & Data", "Media & Social"}
order := []string{"Core & Infrastructure"}
var result []SiteGroup
for _, cat := range order {
if len(categories[cat]) > 0 {
@@ -884,34 +794,6 @@ func (c *Collector) parseIngressSites(raw []byte) []SiteGroup {
return result
}
func formatSiteName(host, ingName string) string {
parts := strings.Split(host, ".")
if len(parts) > 0 {
first := parts[0]
switch first {
case "minio-console":
return "MinIO Object Storage Console"
case "minio":
return "MinIO S3 API"
case "nextcloud":
return "Nextcloud Cloud Hub"
case "odoo":
return "Odoo ERP"
case "social":
return "Mastodon Social"
case "search":
return "YaCy Search Lab"
case "sync":
return "Syncthing File Sync"
case "papi":
return "PAPI Production API"
default:
return strings.Title(strings.ReplaceAll(first, "-", " "))
}
}
return ingName
}
func formatDuration(d time.Duration) string {
days := int(d.Hours()) / 24
hours := int(d.Hours()) % 24

View File

@@ -119,7 +119,7 @@ function getAuthToken(){return sessionStorage.getItem("kube_token")||""}function
<a href="${e.url}" target="_blank" onclick="handleOpenApp()" class="btn btn-primary" style="flex:1; justify-content:center;">🌐 Open App</a>
<a href="${a}" target="_blank" class="btn btn-logs" style="flex:1; justify-content:center;">🔐 Logs</a>
</div>
`,s.appendChild(o)})}function handleOpenApp(){setTimeout(()=>{typeof loadStatus=="function"&&loadStatus()},400),setTimeout(()=>{typeof loadStatus=="function"&&loadStatus()},1500)}function renderOtherSites(e){const t=document.getElementById("sites-container");if(!t||!e)return;const n=document.getElementById("placeholder-sites");if(n&&n.remove(),t.children.length>0)return;e.forEach(e=>{const n=document.createElement("div");n.innerHTML=`
`,s.appendChild(o)})}function handleOpenApp(){setTimeout(()=>{typeof loadStatus=="function"&&loadStatus()},400),setTimeout(()=>{typeof loadStatus=="function"&&loadStatus()},1500)}function renderOtherSites(e){const t=document.getElementById("sites-container");if(!t||!e)return;const n=document.getElementById("placeholder-sites");n&&n.remove();const s=new Set(["Applications & Services","Storage & Data","Media & Social"]),o=e.filter(e=>!s.has(e.category));if(t.children.length>0)return;o.forEach(e=>{const n=document.createElement("div");n.innerHTML=`
<div class="section-header">
<div class="section-title">
<span>${e.category}</span>

View File

@@ -5,10 +5,18 @@ function renderOtherSites(otherSites) {
const ph = document.getElementById('placeholder-sites');
if (ph) ph.remove();
// Exclude sections from web display: Applications & Services, Storage & Data, Media & Social
const excludedCategories = new Set([
'Applications & Services',
'Storage & Data',
'Media & Social'
]);
const visibleGroups = otherSites.filter(group => !excludedCategories.has(group.category));
// Only render once if not yet built; avoid rebuilding static Ingress links every 10s
if (sitesCont.children.length > 0) return;
otherSites.forEach(group => {
visibleGroups.forEach(group => {
const section = document.createElement('div');
section.innerHTML = `
<div class="section-header">