feat(hub): app telemetry analytics dashboard (v0.4.0)
- store/telemetry.go: new app_telemetry + app_log_issues tables with
SaveAppTelemetry, GetFleetAppSummary (with P95), GetAppTelemetryHistory,
GetAppCustomerBreakdown, GetCustomerAppSummary, GetAppIssues, prune methods
- api/handler.go: parse and save optional app_telemetry from report body,
backward-compatible with old controllers
- cmd/hub/main.go: prune app_telemetry (90d) and stale issues (30d)
- web/apps.go: handleApps + handleAppDetail + chart data aggregation helpers
- web/server.go: routes for /apps, /apps/{name}, /static/chart.min.js;
added memoryColor/accuracyClass/gt template functions
- web/embed.go: embed static/chart.min.js
- web/configs.go: add app telemetry section to handleCustomerUnified
- templates/apps.html: fleet-wide app list with summary cards and sortable table
- templates/app_detail.html: per-app page with Chart.js memory trend,
customer breakdown, and known issues table
- templates/customer_unified.html: new Alkalmazás telemetria card
- templates/style.css: badge, summary-card, chart, period-selector,
accuracy-dot, mem-color, data-table styles
- All templates: added Alkalmazások nav link
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
1 parent
8bed5ec339
commit
a757bee07a
20 files changed
+1323
-2
No files matched your search
@@ -0,0 +1,261 @@
|
||||
package web
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
"sort"
|
||||
"strconv"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"gitea.dooplex.hu/admin/felhom-hub/internal/store"
|
||||
)
|
||||
|
||||
// ChartData holds aggregated time-series data for Chart.js.
|
||||
type ChartData struct {
|
||||
Labels []string `json:"labels"`
|
||||
AvgMemory []float64 `json:"avg_memory"`
|
||||
PeakMemory []float64 `json:"peak_memory"`
|
||||
CatalogLimit float64 `json:"catalog_limit"`
|
||||
}
|
||||
|
||||
// handleApps renders the fleet-wide app list page.
|
||||
func (s *Server) handleApps(w http.ResponseWriter, r *http.Request) {
|
||||
period := r.URL.Query().Get("period")
|
||||
since := parsePeriod(period, 7*24*time.Hour)
|
||||
|
||||
sortBy := r.URL.Query().Get("sort")
|
||||
order := r.URL.Query().Get("order")
|
||||
|
||||
summary, err := s.store.GetFleetAppSummary(since)
|
||||
if err != nil {
|
||||
s.logger.Printf("[ERROR] GetFleetAppSummary: %v", err)
|
||||
http.Error(w, "Internal error", http.StatusInternalServerError)
|
||||
return
|
||||
}
|
||||
|
||||
sortFleetSummary(summary, sortBy, order)
|
||||
|
||||
totalApps := len(summary)
|
||||
totalDeployments := 0
|
||||
appsWithErrors := 0
|
||||
for _, app := range summary {
|
||||
totalDeployments += app.DeploymentCount
|
||||
if app.TotalErrors > 0 {
|
||||
appsWithErrors++
|
||||
}
|
||||
}
|
||||
|
||||
csrfToken := s.getCSRFToken(r)
|
||||
data := map[string]interface{}{
|
||||
"Apps": summary,
|
||||
"Period": period,
|
||||
"TotalApps": totalApps,
|
||||
"TotalDeployments": totalDeployments,
|
||||
"AppsWithErrors": appsWithErrors,
|
||||
"Sort": sortBy,
|
||||
"Order": order,
|
||||
"CSRFToken": csrfToken,
|
||||
}
|
||||
if err := s.templates.ExecuteTemplate(w, "apps.html", data); err != nil {
|
||||
s.logger.Printf("[ERROR] apps.html template: %v", err)
|
||||
}
|
||||
}
|
||||
|
||||
// handleAppDetail renders the per-app detail page.
|
||||
func (s *Server) handleAppDetail(w http.ResponseWriter, r *http.Request, appName string) {
|
||||
period := r.URL.Query().Get("period")
|
||||
since := parsePeriod(period, 7*24*time.Hour)
|
||||
|
||||
customers, _ := s.store.GetAppCustomerBreakdown(appName, since)
|
||||
history, _ := s.store.GetAppTelemetryHistory(appName, since)
|
||||
issues, _ := s.store.GetAppIssues(appName, 20)
|
||||
|
||||
// Get fleet summary to find this app's summary
|
||||
fleetAll, _ := s.store.GetFleetAppSummary(since)
|
||||
var appSummary *store.FleetAppSummary
|
||||
for i := range fleetAll {
|
||||
if fleetAll[i].AppName == appName {
|
||||
appSummary = &fleetAll[i]
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
// Suggested mem_limit: ceil(P95 * 1.2), rounded up to nearest 32M
|
||||
var suggestedLimit int
|
||||
if appSummary != nil && appSummary.P95MemoryMB > 0 {
|
||||
raw := appSummary.P95MemoryMB * 1.2
|
||||
suggestedLimit = ((int(raw) + 31) / 32) * 32
|
||||
}
|
||||
|
||||
chartData := aggregateHistoryForChart(history, appSummary)
|
||||
|
||||
csrfToken := s.getCSRFToken(r)
|
||||
data := map[string]interface{}{
|
||||
"AppName": appName,
|
||||
"Summary": appSummary,
|
||||
"Customers": customers,
|
||||
"Issues": issues,
|
||||
"ChartData": chartData,
|
||||
"SuggestedLimit": suggestedLimit,
|
||||
"Period": period,
|
||||
"CSRFToken": csrfToken,
|
||||
}
|
||||
if err := s.templates.ExecuteTemplate(w, "app_detail.html", data); err != nil {
|
||||
s.logger.Printf("[ERROR] app_detail.html template: %v", err)
|
||||
}
|
||||
}
|
||||
|
||||
// parsePeriod converts a period string to a time.Time cutoff.
|
||||
func parsePeriod(s string, defaultDur time.Duration) time.Time {
|
||||
switch s {
|
||||
case "24h":
|
||||
return time.Now().Add(-24 * time.Hour)
|
||||
case "7d":
|
||||
return time.Now().Add(-7 * 24 * time.Hour)
|
||||
case "30d":
|
||||
return time.Now().Add(-30 * 24 * time.Hour)
|
||||
default:
|
||||
return time.Now().Add(-defaultDur)
|
||||
}
|
||||
}
|
||||
|
||||
// sortFleetSummary sorts the fleet summary slice in place.
|
||||
func sortFleetSummary(summary []store.FleetAppSummary, sortBy, order string) {
|
||||
desc := order != "asc"
|
||||
sort.Slice(summary, func(i, j int) bool {
|
||||
var less bool
|
||||
switch sortBy {
|
||||
case "memory":
|
||||
less = summary[i].AvgMemoryMB < summary[j].AvgMemoryMB
|
||||
case "errors":
|
||||
less = summary[i].TotalErrors < summary[j].TotalErrors
|
||||
default: // deployments
|
||||
less = summary[i].DeploymentCount < summary[j].DeploymentCount
|
||||
}
|
||||
if desc {
|
||||
return !less
|
||||
}
|
||||
return less
|
||||
})
|
||||
}
|
||||
|
||||
// aggregateHistoryForChart groups history points into hourly buckets for Chart.js.
|
||||
func aggregateHistoryForChart(history []store.AppTelemetryPoint, summary *store.FleetAppSummary) ChartData {
|
||||
type bucket struct {
|
||||
avgMemSum float64
|
||||
peakMemMax float64
|
||||
count int
|
||||
}
|
||||
|
||||
buckets := make(map[string]*bucket)
|
||||
var bucketOrder []string
|
||||
|
||||
for _, p := range history {
|
||||
key := p.ReportedAt.UTC().Format("2006-01-02 15:00")
|
||||
if _, ok := buckets[key]; !ok {
|
||||
buckets[key] = &bucket{}
|
||||
bucketOrder = append(bucketOrder, key)
|
||||
}
|
||||
b := buckets[key]
|
||||
b.avgMemSum += p.MemoryAvgMB
|
||||
if p.MemoryPeakMB > b.peakMemMax {
|
||||
b.peakMemMax = p.MemoryPeakMB
|
||||
}
|
||||
b.count++
|
||||
}
|
||||
|
||||
cd := ChartData{
|
||||
Labels: make([]string, 0, len(bucketOrder)),
|
||||
AvgMemory: make([]float64, 0, len(bucketOrder)),
|
||||
PeakMemory: make([]float64, 0, len(bucketOrder)),
|
||||
}
|
||||
|
||||
for _, key := range bucketOrder {
|
||||
b := buckets[key]
|
||||
cd.Labels = append(cd.Labels, key)
|
||||
avgMem := 0.0
|
||||
if b.count > 0 {
|
||||
avgMem = b.avgMemSum / float64(b.count)
|
||||
}
|
||||
cd.AvgMemory = append(cd.AvgMemory, round2(avgMem))
|
||||
cd.PeakMemory = append(cd.PeakMemory, round2(b.peakMemMax))
|
||||
}
|
||||
|
||||
if summary != nil {
|
||||
cd.CatalogLimit = parseLimitMB(summary.CatalogLimit)
|
||||
}
|
||||
|
||||
return cd
|
||||
}
|
||||
|
||||
// parseLimitMB parses a memory limit string like "512M" or "2G" to MB float64.
|
||||
func parseLimitMB(s string) float64 {
|
||||
s = strings.TrimSpace(s)
|
||||
if s == "" {
|
||||
return 0
|
||||
}
|
||||
s = strings.ToUpper(s)
|
||||
if strings.HasSuffix(s, "G") {
|
||||
v, _ := strconv.ParseFloat(s[:len(s)-1], 64)
|
||||
return v * 1024
|
||||
}
|
||||
if strings.HasSuffix(s, "M") {
|
||||
v, _ := strconv.ParseFloat(s[:len(s)-1], 64)
|
||||
return v
|
||||
}
|
||||
v, _ := strconv.ParseFloat(s, 64)
|
||||
return v
|
||||
}
|
||||
|
||||
// round2 rounds a float64 to 2 decimal places.
|
||||
func round2(v float64) float64 {
|
||||
return float64(int(v*100+0.5)) / 100
|
||||
}
|
||||
|
||||
// memoryColor returns a CSS class based on current memory vs catalog limit.
|
||||
func memoryColor(currentMB float64, limitStr string) string {
|
||||
limit := parseLimitMB(limitStr)
|
||||
if limit <= 0 {
|
||||
return ""
|
||||
}
|
||||
ratio := currentMB / limit
|
||||
if ratio >= 1.0 {
|
||||
return "mem-danger"
|
||||
}
|
||||
if ratio >= 0.5 {
|
||||
return "mem-warn"
|
||||
}
|
||||
return "mem-ok"
|
||||
}
|
||||
|
||||
// accuracyClass returns accuracy indicator CSS class for P95 vs catalog limit.
|
||||
func accuracyClass(p95MB float64, limitStr string) string {
|
||||
if p95MB <= 0 || limitStr == "" {
|
||||
return ""
|
||||
}
|
||||
limit := parseLimitMB(limitStr)
|
||||
if limit <= 0 {
|
||||
return ""
|
||||
}
|
||||
if p95MB > limit {
|
||||
return "danger"
|
||||
}
|
||||
if p95MB*2 > limit {
|
||||
return "warn"
|
||||
}
|
||||
return "ok"
|
||||
}
|
||||
|
||||
// getCSRFToken retrieves the CSRF token from the session cookie.
|
||||
func (s *Server) getCSRFToken(r *http.Request) string {
|
||||
cookie, err := r.Cookie("hub_session")
|
||||
if err != nil {
|
||||
return ""
|
||||
}
|
||||
s.sessionsMu.RLock()
|
||||
defer s.sessionsMu.RUnlock()
|
||||
if sess, ok := s.sessions[cookie.Value]; ok {
|
||||
return sess.csrfToken
|
||||
}
|
||||
return ""
|
||||
}
|
||||
@@ -233,6 +233,8 @@ func (s *Server) handleCustomerUnified(w http.ResponseWriter, r *http.Request, c
|
||||
var events []store.Event
|
||||
var eventCounts map[string]int
|
||||
|
||||
var appTelemetry []store.CustomerAppSummary
|
||||
|
||||
if customer != nil {
|
||||
history, _ = s.store.GetCustomerHistory(customerID, 24*time.Hour)
|
||||
notifPrefs, _ = s.store.GetNotificationPrefs(customerID)
|
||||
@@ -243,6 +245,7 @@ func (s *Server) handleCustomerUnified(w http.ResponseWriter, r *http.Request, c
|
||||
}
|
||||
events, _ = s.store.GetRecentEvents(customerID, 50)
|
||||
eventCounts, _ = s.store.CountEventsBySeverity(customerID, time.Now().Add(-24*time.Hour))
|
||||
appTelemetry, _ = s.store.GetCustomerAppSummary(customerID, time.Now().Add(-7*24*time.Hour))
|
||||
}
|
||||
|
||||
type pageData struct {
|
||||
@@ -277,6 +280,9 @@ func (s *Server) handleCustomerUnified(w http.ResponseWriter, r *http.Request, c
|
||||
Events []store.Event
|
||||
EventCounts map[string]int // severity → count (last 24h)
|
||||
|
||||
AppTelemetry []store.CustomerAppSummary
|
||||
HasAppTelemetry bool
|
||||
|
||||
Flash string
|
||||
ActiveNav string
|
||||
CSRFField template.HTML
|
||||
@@ -315,6 +321,9 @@ func (s *Server) handleCustomerUnified(w http.ResponseWriter, r *http.Request, c
|
||||
Events: events,
|
||||
EventCounts: eventCounts,
|
||||
|
||||
AppTelemetry: appTelemetry,
|
||||
HasAppTelemetry: len(appTelemetry) > 0,
|
||||
|
||||
Flash: r.URL.Query().Get("flash"),
|
||||
ActiveNav: "configs",
|
||||
CSRFField: s.csrfField(r),
|
||||
|
||||
@@ -7,3 +7,6 @@ var templateFS embed.FS
|
||||
|
||||
//go:embed controller.yaml.default
|
||||
var defaultControllerTemplate string
|
||||
|
||||
//go:embed static/chart.min.js
|
||||
var chartJS []byte
|
||||
@@ -63,6 +63,9 @@ func New(store *store.Store, passwordHash, apiKey, version string, staleThreshol
|
||||
}
|
||||
return m[key]
|
||||
},
|
||||
"memoryColor": memoryColor,
|
||||
"accuracyClass": accuracyClass,
|
||||
"gt": func(a, b int) bool { return a > b },
|
||||
}
|
||||
|
||||
tmpl := template.Must(template.New("").Funcs(funcMap).ParseFS(templateFS, "templates/*.html"))
|
||||
@@ -131,6 +134,15 @@ func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
||||
s.handleDashboard(w, r)
|
||||
case path == "/style.css":
|
||||
s.handleCSS(w, r)
|
||||
case path == "/static/chart.min.js":
|
||||
w.Header().Set("Content-Type", "application/javascript")
|
||||
w.Header().Set("Cache-Control", "public, max-age=86400")
|
||||
w.Write(chartJS)
|
||||
case path == "/apps" || path == "/apps/":
|
||||
s.handleApps(w, r)
|
||||
case strings.HasPrefix(path, "/apps/"):
|
||||
appName := strings.TrimPrefix(path, "/apps/")
|
||||
s.handleAppDetail(w, r, appName)
|
||||
case path == "/login":
|
||||
s.handleLogin(w, r)
|
||||
case strings.HasPrefix(path, "/customers/") && strings.HasSuffix(path, "/trigger-update"):
|
||||
|
||||
Vendored
+20
@@ -0,0 +1,20 @@
|
||||
/**
|
||||
* Skipped minification because the original files appears to be already minified.
|
||||
* Original file: /npm/chart.js@4.4.7/dist/chart.umd.js
|
||||
*
|
||||
* Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files
|
||||
*/
|
||||
/*!
|
||||
* Chart.js v4.4.7
|
||||
* https://www.chartjs.org
|
||||
* (c) 2024 Chart.js Contributors
|
||||
* Released under the MIT License
|
||||
*/
|
||||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).Chart=e()}(this,(function(){"use strict";var t=Object.freeze({__proto__:null,get Colors(){return Go},get Decimation(){return Qo},get Filler(){return ma},get Legend(){return ya},get SubTitle(){return ka},get Title(){return Ma},get Tooltip(){return Ba}});function e(){}const i=(()=>{let t=0;return()=>t++})();function s(t){return null==t}function n(t){if(Array.isArray&&Array.isArray(t))return!0;const e=Object.prototype.toString.call(t);return"[object"===e.slice(0,7)&&"Array]"===e.slice(-6)}function o(t){return null!==t&&"[object Object]"===Object.prototype.toString.call(t)}function a(t){return("number"==typeof t||t instanceof Number)&&isFinite(+t)}function r(t,e){return a(t)?t:e}function l(t,e){return void 0===t?e:t}const h=(t,e)=>"string"==typeof t&&t.endsWith("%")?parseFloat(t)/100:+t/e,c=(t,e)=>"string"==typeof t&&t.endsWith("%")?parseFloat(t)/100*e:+t;function d(t,e,i){if(t&&"function"==typeof t.call)return t.apply(i,e)}function u(t,e,i,s){let a,r,l;if(n(t))if(r=t.length,s)for(a=r-1;a>=0;a--)e.call(i,t[a],a);else for(a=0;a<r;a++)e.call(i,t[a],a);else if(o(t))for(l=Object.keys(t),r=l.length,a=0;a<r;a++)e.call(i,t[l[a]],l[a])}function f(t,e){let i,s,n,o;if(!t||!e||t.length!==e.length)return!1;for(i=0,s=t.length;i<s;++i)if(n=t[i],o=e[i],n.datasetIndex!==o.datasetIndex||n.index!==o.index)return!1;return!0}function g(t){if(n(t))return t.map(g);if(o(t)){const e=Object.create(null),i=Object.keys(t),s=i.length;let n=0;for(;n<s;++n)e[i[n]]=g(t[i[n]]);return e}return t}function p(t){return-1===["__proto__","prototype","constructor"].indexOf(t)}function m(t,e,i,s){if(!p(t))return;const n=e[t],a=i[t];o(n)&&o(a)?b(n,a,s):e[t]=g(a)}function b(t,e,i){const s=n(e)?e:[e],a=s.length;if(!o(t))return t;const r=(i=i||{}).merger||m;let l;for(let e=0;e<a;++e){if(l=s[e],!o(l))continue;const n=Object.keys(l);for(let e=0,s=n.length;e<s;++e)r(n[e],t,l,i)}return t}function x(t,e){return b(t,e,{merger:_})}function _(t,e,i){if(!p(t))return;const s=e[t],n=i[t];o(s)&&o(n)?x(s,n):Object.prototype.hasOwnProperty.call(e,t)||(e[t]=g(n))}const y={"":t=>t,x:t=>t.x,y:t=>t.y};function v(t){const e=t.split("."),i=[];let s="";for(const t of e)s+=t,s.endsWith("\\")?s=s.slice(0,-1)+".":(i.push(s),s="");return i}function M(t,e){const i=y[e]||(y[e]=function(t){const e=v(t);return t=>{for(const i of e){if(""===i)break;t=t&&t[i]}return t}}(e));return i(t)}function w(t){return t.charAt(0).toUpperCase()+t.slice(1)}const k=t=>void 0!==t,S=t=>"function"==typeof t,P=(t,e)=>{if(t.size!==e.size)return!1;for(const i of t)if(!e.has(i))return!1;return!0};function D(t){return"mouseup"===t.type||"click"===t.type||"contextmenu"===t.type}const C=Math.PI,O=2*C,A=O+C,T=Number.POSITIVE_INFINITY,L=C/180,E=C/2,R=C/4,I=2*C/3,z=Math.log10,F=Math.sign;function V(t,e,i){return Math.abs(t-e)<i}function B(t){const e=Math.round(t);t=V(t,e,t/1e3)?e:t;const i=Math.pow(10,Math.floor(z(t))),s=t/i;return(s<=1?1:s<=2?2:s<=5?5:10)*i}function W(t){const e=[],i=Math.sqrt(t);let s;for(s=1;s<i;s++)t%s==0&&(e.push(s),e.push(t/s));return i===(0|i)&&e.push(i),e.sort(((t,e)=>t-e)).pop(),e}function N(t){return!isNaN(parseFloat(t))&&isFinite(t)}function H(t,e){const i=Math.round(t);return i-e<=t&&i+e>=t}function j(t,e,i){let s,n,o;for(s=0,n=t.length;s<n;s++)o=t[s][i],isNaN(o)||(e.min=Math.min(e.min,o),e.max=Math.max(e.max,o))}function $(t){return t*(C/180)}function Y(t){return t*(180/C)}function U(t){if(!a(t))return;let e=1,i=0;for(;Math.round(t*e)/e!==t;)e*=10,i++;return i}function X(t,e){const i=e.x-t.x,s=e.y-t.y,n=Math.sqrt(i*i+s*s);let o=Math.atan2(s,i);return o<-.5*C&&(o+=O),{angle:o,distance:n}}function q(t,e){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function K(t,e){return(t-e+A)%O-C}function G(t){return(t%O+O)%O}function Z(t,e,i,s){const n=G(t),o=G(e),a=G(i),r=G(o-n),l=G(a-n),h=G(n-o),c=G(n-a);return n===o||n===a||s&&o===a||r>l&&h<c}function J(t,e,i){return Math.max(e,Math.min(i,t))}function Q(t){return J(t,-32768,32767)}function tt(t,e,i,s=1e-6){return t>=Math.min(e,i)-s&&t<=Math.max(e,i)+s}function et(t,e,i){i=i||(i=>t[i]<e);let s,n=t.length-1,o=0;for(;n-o>1;)s=o+n>>1,i(s)?o=s:n=s;return{lo:o,hi:n}}const it=(t,e,i,s)=>et(t,i,s?s=>{const n=t[s][e];return n<i||n===i&&t[s+1][e]===i}:s=>t[s][e]<i),st=(t,e,i)=>et(t,i,(s=>t[s][e]>=i));function nt(t,e,i){let s=0,n=t.length;for(;s<n&&t[s]<e;)s++;for(;n>s&&t[n-1]>i;)n--;return s>0||n<t.length?t.slice(s,n):t}const ot=["push","pop","shift","splice","unshift"];function at(t,e){t._chartjs?t._chartjs.listeners.push(e):(Object.defineProperty(t,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[e]}}),ot.forEach((e=>{const i="_onData"+w(e),s=t[e];Object.defineProperty(t,e,{configurable:!0,enumerable:!1,value(...e){const n=s.apply(this,e);return t._chartjs.listeners.forEach((t=>{"function"==typeof t[i]&&t[i](...e)})),n}})})))}function rt(t,e){Line truncated
|
||||
/*!
|
||||
* @kurkle/color v0.3.2
|
||||
* https://github.com/kurkle/color#readme
|
||||
* (c) 2023 Jukka Kurkela
|
||||
* Released under the MIT License
|
||||
*/function _t(t){return t+.5|0}const yt=(t,e,i)=>Math.max(Math.min(t,i),e);function vt(t){return yt(_t(2.55*t),0,255)}function Mt(t){return yt(_t(255*t),0,255)}function wt(t){return yt(_t(t/2.55)/100,0,1)}function kt(t){return yt(_t(100*t),0,100)}const St={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},Pt=[..."0123456789ABCDEF"],Dt=t=>Pt[15&t],Ct=t=>Pt[(240&t)>>4]+Pt[15&t],Ot=t=>(240&t)>>4==(15&t);function At(t){var e=(t=>Ot(t.r)&&Ot(t.g)&&Ot(t.b)&&Ot(t.a))(t)?Dt:Ct;return t?"#"+e(t.r)+e(t.g)+e(t.b)+((t,e)=>t<255?e(t):"")(t.a,e):void 0}const Tt=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function Lt(t,e,i){const s=e*Math.min(i,1-i),n=(e,n=(e+t/30)%12)=>i-s*Math.max(Math.min(n-3,9-n,1),-1);return[n(0),n(8),n(4)]}function Et(t,e,i){const s=(s,n=(s+t/60)%6)=>i-i*e*Math.max(Math.min(n,4-n,1),0);return[s(5),s(3),s(1)]}function Rt(t,e,i){const s=Lt(t,1,.5);let n;for(e+i>1&&(n=1/(e+i),e*=n,i*=n),n=0;n<3;n++)s[n]*=1-e-i,s[n]+=e;return s}function It(t){const e=t.r/255,i=t.g/255,s=t.b/255,n=Math.max(e,i,s),o=Math.min(e,i,s),a=(n+o)/2;let r,l,h;return n!==o&&(h=n-o,l=a>.5?h/(2-n-o):h/(n+o),r=function(t,e,i,s,n){return t===n?(e-i)/s+(e<i?6:0):e===n?(i-t)/s+2:(t-e)/s+4}(e,i,s,h,n),r=60*r+.5),[0|r,l||0,a]}function zt(t,e,i,s){return(Array.isArray(e)?t(e[0],e[1],e[2]):t(e,i,s)).map(Mt)}function Ft(t,e,i){return zt(Lt,t,e,i)}function Vt(t){return(t%360+360)%360}function Bt(t){const e=Tt.exec(t);let i,s=255;if(!e)return;e[5]!==i&&(s=e[6]?vt(+e[5]):Mt(+e[5]));const n=Vt(+e[2]),o=+e[3]/100,a=+e[4]/100;return i="hwb"===e[1]?function(t,e,i){return zt(Rt,t,e,i)}(n,o,a):"hsv"===e[1]?function(t,e,i){return zt(Et,t,e,i)}(n,o,a):Ft(n,o,a),{r:i[0],g:i[1],b:i[2],a:s}}const Wt={x:"dark",Z:"light",Y:"re",X:"blu",W:"gr",V:"medium",U:"slate",A:"ee",T:"ol",S:"or",B:"ra",C:"lateg",D:"ights",R:"in",Q:"turquois",E:"hi",P:"ro",O:"al",N:"le",M:"de",L:"yello",F:"en",K:"ch",G:"arks",H:"ea",I:"ightg",J:"wh"},Nt={OiceXe:"f0f8ff",antiquewEte:"faebd7",aqua:"ffff",aquamarRe:"7fffd4",azuY:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"0",blanKedOmond:"ffebcd",Xe:"ff",XeviTet:"8a2be2",bPwn:"a52a2a",burlywood:"deb887",caMtXe:"5f9ea0",KartYuse:"7fff00",KocTate:"d2691e",cSO:"ff7f50",cSnflowerXe:"6495ed",cSnsilk:"fff8dc",crimson:"dc143c",cyan:"ffff",xXe:"8b",xcyan:"8b8b",xgTMnPd:"b8860b",xWay:"a9a9a9",xgYF:"6400",xgYy:"a9a9a9",xkhaki:"bdb76b",xmagFta:"8b008b",xTivegYF:"556b2f",xSange:"ff8c00",xScEd:"9932cc",xYd:"8b0000",xsOmon:"e9967a",xsHgYF:"8fbc8f",xUXe:"483d8b",xUWay:"2f4f4f",xUgYy:"2f4f4f",xQe:"ced1",xviTet:"9400d3",dAppRk:"ff1493",dApskyXe:"bfff",dimWay:"696969",dimgYy:"696969",dodgerXe:"1e90ff",fiYbrick:"b22222",flSOwEte:"fffaf0",foYstWAn:"228b22",fuKsia:"ff00ff",gaRsbSo:"dcdcdc",ghostwEte:"f8f8ff",gTd:"ffd700",gTMnPd:"daa520",Way:"808080",gYF:"8000",gYFLw:"adff2f",gYy:"808080",honeyMw:"f0fff0",hotpRk:"ff69b4",RdianYd:"cd5c5c",Rdigo:"4b0082",ivSy:"fffff0",khaki:"f0e68c",lavFMr:"e6e6fa",lavFMrXsh:"fff0f5",lawngYF:"7cfc00",NmoncEffon:"fffacd",ZXe:"add8e6",ZcSO:"f08080",Zcyan:"e0ffff",ZgTMnPdLw:"fafad2",ZWay:"d3d3d3",ZgYF:"90ee90",ZgYy:"d3d3d3",ZpRk:"ffb6c1",ZsOmon:"ffa07a",ZsHgYF:"20b2aa",ZskyXe:"87cefa",ZUWay:"778899",ZUgYy:"778899",ZstAlXe:"b0c4de",ZLw:"ffffe0",lime:"ff00",limegYF:"32cd32",lRF:"faf0e6",magFta:"ff00ff",maPon:"800000",VaquamarRe:"66cdaa",VXe:"cd",VScEd:"ba55d3",VpurpN:"9370db",VsHgYF:"3cb371",VUXe:"7b68ee",VsprRggYF:"fa9a",VQe:"48d1cc",VviTetYd:"c71585",midnightXe:"191970",mRtcYam:"f5fffa",mistyPse:"ffe4e1",moccasR:"ffe4b5",navajowEte:"ffdead",navy:"80",Tdlace:"fdf5e6",Tive:"808000",TivedBb:"6b8e23",Sange:"ffa500",SangeYd:"ff4500",ScEd:"da70d6",pOegTMnPd:"eee8aa",pOegYF:"98fb98",pOeQe:"afeeee",pOeviTetYd:"db7093",papayawEp:"ffefd5",pHKpuff:"ffdab9",peru:"cd853f",pRk:"ffc0cb",plum:"dda0dd",powMrXe:"b0e0e6",purpN:"800080",YbeccapurpN:"663399",Yd:"ff0000",Psybrown:"bc8f8f",PyOXe:"4169e1",saddNbPwn:"8b4513",sOmon:"fa8072",sandybPwn:"f4a460",sHgYF:"2e8b57",sHshell:"fff5ee",siFna:"a0522d",silver:"c0c0c0",skyXe:"87ceeb",UXe:"6a5acd",UWay:"708090",UgYy:"708090",snow:"fffafa",sprRggYF:"ff7f",stAlXe:"4682b4",tan:"d2b48c",teO:"8080",tEstN:"d8bfd8",tomato:"ff6347",Qe:"40e0d0",viTet:"ee82ee",JHt:"f5deb3",wEte:"ffffff",wEtesmoke:"f5f5f5",Lw:"ffff00",LwgYF:"9acd32"};let Ht;function jt(t){Ht||(Ht=function(){const t={},e=Object.keys(Nt),i=Object.keys(Wt);let s,n,o,a,r;for(s=0;s<e.length;s++){for(a=r=e[s],n=0;n<i.length;n++)o=i[n],r=r.replace(o,Wt[o]);o=parseInt(Nt[a],16),t[r]=[o>>16&255,o>>8&255,255&o]}return t}(),Ht.transparent=[0,0,0,0]);const e=Ht[t.toLowerCase()];return e&&{r:e[0],g:e[1],b:e[2],a:4===e.length?e[3]:255}}const $t=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;const Yt=t=>t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055,Ut=t=>t<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4);function Xt(t,e,i){if(t){let s=It(t);s[e]=Math.max(0,Math.min(s[e]+s[e]*i,0===e?360:1)),Line truncated
|
||||
//# sourceMappingURL=chart.umd.js.map
|
||||
@@ -0,0 +1,209 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="hu">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>{{.AppName}} — Felhom Hub</title>
|
||||
<link rel="stylesheet" href="/style.css">
|
||||
<script src="/static/chart.min.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div class="container">
|
||||
<header>
|
||||
<h1>Felhom Hub</h1>
|
||||
<nav class="nav-links">
|
||||
<a href="/" class="nav-link">Dashboard</a>
|
||||
<a href="/configs" class="nav-link">Customers</a>
|
||||
<a href="/apps" class="nav-link active">Alkalmazások</a>
|
||||
</nav>
|
||||
</header>
|
||||
|
||||
<a href="/apps{{if .Period}}?period={{.Period}}{{end}}" class="back-link">← Alkalmazások</a>
|
||||
|
||||
<!-- Period selector -->
|
||||
<div class="period-selector" style="margin-top: 1rem;">
|
||||
<a href="?period=24h" class="period-btn{{if eq .Period "24h"}} active{{end}}">24 óra</a>
|
||||
<a href="?period=7d" class="period-btn{{if or (eq .Period "7d") (eq .Period "")}} active{{end}}">7 nap</a>
|
||||
<a href="?period=30d" class="period-btn{{if eq .Period "30d"}} active{{end}}">30 nap</a>
|
||||
</div>
|
||||
|
||||
<!-- Overview card -->
|
||||
<section class="card">
|
||||
<h2>{{if .Summary}}{{if .Summary.DisplayName}}{{.Summary.DisplayName}}{{else}}{{.AppName}}{{end}}{{else}}{{.AppName}}{{end}}</h2>
|
||||
<div class="info-grid">
|
||||
<div class="info-item">
|
||||
<span class="label">App neve</span>
|
||||
<span class="value" style="font-family: var(--font-mono)">{{.AppName}}</span>
|
||||
</div>
|
||||
{{if .Summary}}
|
||||
<div class="info-item">
|
||||
<span class="label">Telepítések</span>
|
||||
<span class="value">{{.Summary.DeploymentCount}}</span>
|
||||
</div>
|
||||
<div class="info-item">
|
||||
<span class="label">Katalógus becslés</span>
|
||||
<span class="value">{{if .Summary.CatalogEstimate}}{{.Summary.CatalogEstimate}}{{else}}—{{end}}</span>
|
||||
</div>
|
||||
<div class="info-item">
|
||||
<span class="label">Katalógus limit</span>
|
||||
<span class="value">{{if .Summary.CatalogLimit}}{{.Summary.CatalogLimit}}{{else}}—{{end}}</span>
|
||||
</div>
|
||||
{{if .SuggestedLimit}}
|
||||
<div class="info-item">
|
||||
<span class="label">Javasolt limit (P95×1.2)</span>
|
||||
<span class="value" style="color: var(--yellow)">{{.SuggestedLimit}} MB</span>
|
||||
</div>
|
||||
{{end}}
|
||||
<div class="info-item">
|
||||
<span class="label">Átl. memória</span>
|
||||
<span class="value">{{formatFloat .Summary.AvgMemoryMB}} MB</span>
|
||||
</div>
|
||||
<div class="info-item">
|
||||
<span class="label">P95 memória</span>
|
||||
<span class="value {{accuracyClass .Summary.P95MemoryMB .Summary.CatalogLimit}}">{{formatFloat .Summary.P95MemoryMB}} MB</span>
|
||||
</div>
|
||||
<div class="info-item">
|
||||
<span class="label">Átl. CPU</span>
|
||||
<span class="value">{{formatFloat .Summary.AvgCPU}}%</span>
|
||||
</div>
|
||||
{{end}}
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<!-- Memory trend chart -->
|
||||
<section class="card">
|
||||
<h2>Memória trend</h2>
|
||||
<div class="chart-container">
|
||||
<canvas id="memoryChart"></canvas>
|
||||
</div>
|
||||
<script>
|
||||
(function() {
|
||||
var chartData = {{json .ChartData}};
|
||||
if (!chartData || !chartData.labels || chartData.labels.length === 0) {
|
||||
document.getElementById('memoryChart').parentElement.innerHTML = '<p class="text-muted">Nincs elegendő adat a grafikonhoz.</p>';
|
||||
return;
|
||||
}
|
||||
var ctx = document.getElementById('memoryChart').getContext('2d');
|
||||
var datasets = [
|
||||
{
|
||||
label: 'Átl. memória (MB)',
|
||||
data: chartData.avg_memory,
|
||||
borderColor: '#60a5fa',
|
||||
backgroundColor: 'rgba(96,165,250,0.1)',
|
||||
fill: true,
|
||||
tension: 0.3,
|
||||
pointRadius: 2
|
||||
},
|
||||
{
|
||||
label: 'Csúcs memória (MB)',
|
||||
data: chartData.peak_memory,
|
||||
borderColor: '#f87171',
|
||||
backgroundColor: 'transparent',
|
||||
fill: false,
|
||||
tension: 0.3,
|
||||
pointRadius: 2,
|
||||
borderDash: [4, 2]
|
||||
}
|
||||
];
|
||||
if (chartData.catalog_limit > 0) {
|
||||
datasets.push({
|
||||
label: 'Katalógus limit',
|
||||
data: chartData.labels.map(function() { return chartData.catalog_limit; }),
|
||||
borderColor: '#4ade80',
|
||||
backgroundColor: 'transparent',
|
||||
fill: false,
|
||||
pointRadius: 0,
|
||||
borderWidth: 1,
|
||||
borderDash: [6, 4]
|
||||
});
|
||||
}
|
||||
new Chart(ctx, {
|
||||
type: 'line',
|
||||
data: { labels: chartData.labels, datasets: datasets },
|
||||
options: {
|
||||
responsive: true,
|
||||
maintainAspectRatio: false,
|
||||
plugins: {
|
||||
legend: { labels: { color: '#94a3b8', font: { size: 11 } } }
|
||||
},
|
||||
scales: {
|
||||
x: { ticks: { color: '#64748b', font: { size: 10 }, maxTicksLimit: 10 }, grid: { color: 'rgba(100,116,139,0.15)' } },
|
||||
y: { ticks: { color: '#64748b', font: { size: 10 } }, grid: { color: 'rgba(100,116,139,0.15)' }, title: { display: true, text: 'MB', color: '#64748b' } }
|
||||
}
|
||||
}
|
||||
});
|
||||
})();
|
||||
</script>
|
||||
</section>
|
||||
|
||||
<!-- Customer breakdown -->
|
||||
{{if .Customers}}
|
||||
<section class="card">
|
||||
<h2>Ügyfél bontás</h2>
|
||||
<table class="data-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Ügyfél</th>
|
||||
<th>Átl. memória</th>
|
||||
<th>Csúcs memória</th>
|
||||
<th>Átl. CPU</th>
|
||||
<th>Hibák összesen</th>
|
||||
<th>Utolsó riport</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{{range .Customers}}
|
||||
<tr>
|
||||
<td><a href="/customers/{{.CustomerID}}">{{.CustomerID}}</a></td>
|
||||
<td>{{formatFloat .AvgMemoryMB}} MB</td>
|
||||
<td>{{formatFloat .PeakMemoryMB}} MB</td>
|
||||
<td>{{formatFloat .AvgCPU}}%</td>
|
||||
<td>{{if gt .TotalErrors 0}}<span class="badge badge-error">{{.TotalErrors}}</span>{{else}}0{{end}}</td>
|
||||
<td>{{timeAgo .LastReport}}</td>
|
||||
</tr>
|
||||
{{end}}
|
||||
</tbody>
|
||||
</table>
|
||||
</section>
|
||||
{{end}}
|
||||
|
||||
<!-- Known issues -->
|
||||
{{if .Issues}}
|
||||
<section class="card">
|
||||
<h2>Ismert hibák</h2>
|
||||
<table class="data-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Súlyosság</th>
|
||||
<th>Üzenet</th>
|
||||
<th>Előfordulások</th>
|
||||
<th>Érintett ügyfelek</th>
|
||||
<th>Első észlelés</th>
|
||||
<th>Utolsó észlelés</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{{range .Issues}}
|
||||
<tr>
|
||||
<td>
|
||||
{{if eq .Severity "error"}}<span class="badge badge-error">error</span>
|
||||
{{else}}<span class="badge badge-warn">warn</span>{{end}}
|
||||
</td>
|
||||
<td style="font-family: var(--font-mono); font-size: 0.8rem; max-width: 40ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;" title="{{.Message}}">{{.Message}}</td>
|
||||
<td>{{.OccurrenceCount}}</td>
|
||||
<td>{{len .AffectedCustomers}}</td>
|
||||
<td>{{timeAgo .FirstSeen}}</td>
|
||||
<td>{{timeAgo .LastSeen}}</td>
|
||||
</tr>
|
||||
{{end}}
|
||||
</tbody>
|
||||
</table>
|
||||
</section>
|
||||
{{end}}
|
||||
|
||||
<footer style="margin-top: 2rem; color: var(--text-muted); font-size: 0.8rem; text-align: center;">
|
||||
Felhom Hub <span style="font-family: var(--font-mono)">v{{hubVersion}}</span>
|
||||
</footer>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,97 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="hu">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Alkalmazások — Felhom Hub</title>
|
||||
<link rel="stylesheet" href="/style.css">
|
||||
</head>
|
||||
<body>
|
||||
<div class="container">
|
||||
<header>
|
||||
<h1>Felhom Hub</h1>
|
||||
<nav class="nav-links">
|
||||
<a href="/" class="nav-link">Dashboard</a>
|
||||
<a href="/configs" class="nav-link">Customers</a>
|
||||
<a href="/apps" class="nav-link active">Alkalmazások</a>
|
||||
</nav>
|
||||
</header>
|
||||
|
||||
<h2 style="margin-bottom: 1rem;">Alkalmazás telemetria</h2>
|
||||
|
||||
<!-- Period selector -->
|
||||
<div class="period-selector">
|
||||
<a href="?period=24h{{if .Sort}}&sort={{.Sort}}&order={{.Order}}{{end}}" class="period-btn{{if eq .Period "24h"}} active{{end}}">24 óra</a>
|
||||
<a href="?period=7d{{if .Sort}}&sort={{.Sort}}&order={{.Order}}{{end}}" class="period-btn{{if or (eq .Period "7d") (eq .Period "")}} active{{end}}">7 nap</a>
|
||||
<a href="?period=30d{{if .Sort}}&sort={{.Sort}}&order={{.Order}}{{end}}" class="period-btn{{if eq .Period "30d"}} active{{end}}">30 nap</a>
|
||||
</div>
|
||||
|
||||
<!-- Summary cards -->
|
||||
<div class="summary-cards">
|
||||
<div class="summary-card">
|
||||
<div class="card-number">{{.TotalApps}}</div>
|
||||
<div class="card-label">Alkalmazás összesen</div>
|
||||
</div>
|
||||
<div class="summary-card">
|
||||
<div class="card-number">{{.TotalDeployments}}</div>
|
||||
<div class="card-label">Telepítések száma</div>
|
||||
</div>
|
||||
<div class="summary-card">
|
||||
<div class="card-number" {{if gt .AppsWithErrors 0}}style="color: var(--red)"{{end}}>{{.AppsWithErrors}}</div>
|
||||
<div class="card-label">Hibás alkalmazások</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- App table -->
|
||||
{{if .Apps}}
|
||||
<section class="card" style="padding: 0; overflow: hidden;">
|
||||
<table class="data-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><a href="?period={{.Period}}&sort=name&order={{if eq .Sort "name"}}{{if eq .Order "asc"}}desc{{else}}asc{{end}}{{else}}asc{{end}}">Alkalmazás</a></th>
|
||||
<th><a href="?period={{.Period}}&sort=deployments&order={{if eq .Sort "deployments"}}{{if eq .Order "asc"}}desc{{else}}asc{{end}}{{else}}desc{{end}}">Telepítések</a></th>
|
||||
<th><a href="?period={{.Period}}&sort=memory&order={{if eq .Sort "memory"}}{{if eq .Order "asc"}}desc{{else}}asc{{end}}{{else}}desc{{end}}">Átl. memória</a></th>
|
||||
<th>P95 memória</th>
|
||||
<th>Katalógus becslés</th>
|
||||
<th>Katalógus limit</th>
|
||||
<th>Pontosság</th>
|
||||
<th><a href="?period={{.Period}}&sort=errors&order={{if eq .Sort "errors"}}{{if eq .Order "asc"}}desc{{else}}asc{{end}}{{else}}desc{{end}}">Hibák</a></th>
|
||||
<th>Figyelmeztetések</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{{range .Apps}}
|
||||
<tr>
|
||||
<td><a href="/apps/{{.AppName}}">{{if .DisplayName}}{{.DisplayName}}{{else}}{{.AppName}}{{end}}</a></td>
|
||||
<td>{{.DeploymentCount}}</td>
|
||||
<td>{{formatFloat .AvgMemoryMB}} MB</td>
|
||||
<td>{{formatFloat .P95MemoryMB}} MB</td>
|
||||
<td>{{if .CatalogEstimate}}{{.CatalogEstimate}}{{else}}—{{end}}</td>
|
||||
<td>{{if .CatalogLimit}}{{.CatalogLimit}}{{else}}—{{end}}</td>
|
||||
<td>
|
||||
{{$ac := accuracyClass .P95MemoryMB .CatalogLimit}}
|
||||
{{if eq $ac "ok"}}<span class="accuracy-dot accuracy-ok" title="P95 rendben"></span>
|
||||
{{else if eq $ac "warn"}}<span class="accuracy-dot accuracy-warn" title="P95 > limit 50%"></span>
|
||||
{{else if eq $ac "danger"}}<span class="accuracy-dot accuracy-danger" title="P95 meghaladja a limitet"></span>
|
||||
{{else}}—{{end}}
|
||||
</td>
|
||||
<td>{{if gt .TotalErrors 0}}<span class="badge badge-error">{{.TotalErrors}}</span>{{else}}0{{end}}</td>
|
||||
<td>{{if gt .TotalWarnings 0}}<span class="badge badge-warn">{{.TotalWarnings}}</span>{{else}}0{{end}}</td>
|
||||
</tr>
|
||||
{{end}}
|
||||
</tbody>
|
||||
</table>
|
||||
</section>
|
||||
{{else}}
|
||||
<div class="empty-state">
|
||||
<p>Nincs telemetria adat a kiválasztott időszakra.</p>
|
||||
<p class="hint">Az alkalmazás telemetria a következő riport beérkezése után jelenik meg (v0.28.0+ vezérlő szükséges).</p>
|
||||
</div>
|
||||
{{end}}
|
||||
|
||||
<footer style="margin-top: 2rem; color: var(--text-muted); font-size: 0.8rem; text-align: center;">
|
||||
Felhom Hub <span style="font-family: var(--font-mono)">v{{hubVersion}}</span>
|
||||
</footer>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -13,6 +13,7 @@
|
||||
<nav class="nav-links">
|
||||
<a href="/" class="nav-link">Dashboard</a>
|
||||
<a href="/configs" class="nav-link active">Customers</a>
|
||||
<a href="/apps" class="nav-link">Alkalmazások</a>
|
||||
</nav>
|
||||
</header>
|
||||
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
<nav class="nav-links">
|
||||
<a href="/" class="nav-link">Dashboard</a>
|
||||
<a href="/configs" class="nav-link active">Customers</a>
|
||||
<a href="/apps" class="nav-link">Alkalmazások</a>
|
||||
</nav>
|
||||
</header>
|
||||
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
<nav class="nav-links">
|
||||
<a href="/" class="nav-link">Dashboard</a>
|
||||
<a href="/configs" class="nav-link active">Customers</a>
|
||||
<a href="/apps" class="nav-link">Alkalmazások</a>
|
||||
</nav>
|
||||
</header>
|
||||
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
<nav class="nav-links" style="margin-bottom: 0.5rem;">
|
||||
<a href="/" class="nav-link">Dashboard</a>
|
||||
<a href="/configs" class="nav-link">Customers</a>
|
||||
<a href="/apps" class="nav-link">Alkalmazások</a>
|
||||
</nav>
|
||||
<a href="/" class="back-link">← Back to Dashboard</a>
|
||||
<h1>
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
<nav class="nav-links" style="margin-bottom: 0.5rem;">
|
||||
<a href="/" class="nav-link">Dashboard</a>
|
||||
<a href="/configs" class="nav-link active">Customers</a>
|
||||
<a href="/apps" class="nav-link">Alkalmazások</a>
|
||||
</nav>
|
||||
<a href="/configs" class="back-link">← All Customers</a>
|
||||
<h1>
|
||||
@@ -470,6 +471,39 @@
|
||||
{{end}}
|
||||
</section>
|
||||
|
||||
<!-- Alkalmazás telemetria -->
|
||||
{{if .HasAppTelemetry}}
|
||||
<section class="card">
|
||||
<h2>Alkalmazás telemetria <span class="text-muted" style="font-size: 0.85em; font-weight: normal;">(utolsó 7 nap)</span></h2>
|
||||
<table class="data-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Alkalmazás</th>
|
||||
<th>Memória (jelenlegi)</th>
|
||||
<th>Memória (átlag 7d)</th>
|
||||
<th>Memória (csúcs 7d)</th>
|
||||
<th>Katalógus limit</th>
|
||||
<th>Hibák</th>
|
||||
<th>Figyelmeztetések</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{{range .AppTelemetry}}
|
||||
<tr>
|
||||
<td><a href="/apps/{{.AppName}}">{{if .DisplayName}}{{.DisplayName}}{{else}}{{.AppName}}{{end}}</a></td>
|
||||
<td class="{{memoryColor .MemoryCurrentMB .CatalogLimit}}">{{formatFloat .MemoryCurrentMB}} MB</td>
|
||||
<td>{{formatFloat .MemoryAvgMB}} MB</td>
|
||||
<td>{{formatFloat .MemoryPeakMB}} MB</td>
|
||||
<td>{{if .CatalogLimit}}{{.CatalogLimit}}{{else}}—{{end}}</td>
|
||||
<td>{{if gt .LogErrors 0}}<span class="badge badge-error">{{.LogErrors}}</span>{{else}}0{{end}}</td>
|
||||
<td>{{if gt .LogWarnings 0}}<span class="badge badge-warn">{{.LogWarnings}}</span>{{else}}0{{end}}</td>
|
||||
</tr>
|
||||
{{end}}
|
||||
</tbody>
|
||||
</table>
|
||||
</section>
|
||||
{{end}}
|
||||
|
||||
<!-- Notifications -->
|
||||
<section class="card">
|
||||
<h2>Notifications</h2>
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
<nav class="nav-links">
|
||||
<a href="/" class="nav-link active">Dashboard</a>
|
||||
<a href="/configs" class="nav-link">Customers</a>
|
||||
<a href="/apps" class="nav-link">Alkalmazások</a>
|
||||
</nav>
|
||||
</header>
|
||||
|
||||
|
||||
@@ -618,6 +618,137 @@ code {
|
||||
.diff-hub_only td { color: #3b82f6; }
|
||||
.diff-controller_only td { color: #fb923c; }
|
||||
|
||||
/* Badge styles */
|
||||
.badge {
|
||||
display: inline-block;
|
||||
padding: 0.15rem 0.5rem;
|
||||
border-radius: 0.25rem;
|
||||
font-size: 0.8rem;
|
||||
font-weight: 600;
|
||||
font-family: var(--font-mono);
|
||||
}
|
||||
.badge-error {
|
||||
background: rgba(248, 113, 113, 0.2);
|
||||
color: var(--red);
|
||||
}
|
||||
.badge-warn {
|
||||
background: rgba(250, 204, 21, 0.2);
|
||||
color: var(--yellow);
|
||||
}
|
||||
|
||||
/* Summary cards row */
|
||||
.summary-cards {
|
||||
display: flex;
|
||||
gap: 1rem;
|
||||
margin-bottom: 1.5rem;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
.summary-card {
|
||||
flex: 1;
|
||||
min-width: 160px;
|
||||
background: var(--bg-card);
|
||||
border: 1px solid var(--border);
|
||||
border-radius: 0.5rem;
|
||||
padding: 1rem 1.25rem;
|
||||
}
|
||||
.summary-card .card-number {
|
||||
font-size: 2rem;
|
||||
font-weight: 700;
|
||||
color: var(--text-primary);
|
||||
font-family: var(--font-mono);
|
||||
line-height: 1.1;
|
||||
}
|
||||
.summary-card .card-label {
|
||||
font-size: 0.8rem;
|
||||
color: var(--text-muted);
|
||||
margin-top: 0.25rem;
|
||||
}
|
||||
|
||||
/* Chart container */
|
||||
.chart-container {
|
||||
position: relative;
|
||||
width: 100%;
|
||||
height: 280px;
|
||||
margin: 1rem 0;
|
||||
}
|
||||
|
||||
/* Period selector button group */
|
||||
.period-selector {
|
||||
display: flex;
|
||||
gap: 0.25rem;
|
||||
margin-bottom: 1rem;
|
||||
}
|
||||
.period-btn {
|
||||
padding: 0.3rem 0.75rem;
|
||||
border: 1px solid var(--border);
|
||||
border-radius: 0.25rem;
|
||||
background: var(--bg-secondary);
|
||||
color: var(--text-secondary);
|
||||
font-size: 0.85rem;
|
||||
text-decoration: none;
|
||||
cursor: pointer;
|
||||
transition: background 0.15s, color 0.15s;
|
||||
}
|
||||
.period-btn:hover, .period-btn.active {
|
||||
background: var(--accent);
|
||||
color: var(--bg-primary);
|
||||
border-color: var(--accent);
|
||||
}
|
||||
|
||||
/* Accuracy dot */
|
||||
.accuracy-dot {
|
||||
display: inline-block;
|
||||
width: 10px;
|
||||
height: 10px;
|
||||
border-radius: 50%;
|
||||
margin-left: 0.25rem;
|
||||
}
|
||||
.accuracy-ok { background: var(--green); }
|
||||
.accuracy-warn { background: var(--yellow); }
|
||||
.accuracy-danger { background: var(--red); }
|
||||
|
||||
/* Memory color classes */
|
||||
.mem-ok { color: var(--green); }
|
||||
.mem-warn { color: var(--yellow); }
|
||||
.mem-danger { color: var(--red); }
|
||||
|
||||
/* Data table (apps page) */
|
||||
.data-table {
|
||||
width: 100%;
|
||||
border-collapse: collapse;
|
||||
font-size: 0.9rem;
|
||||
}
|
||||
.data-table th {
|
||||
text-align: left;
|
||||
padding: 0.6rem 0.75rem;
|
||||
font-weight: 600;
|
||||
color: var(--text-secondary);
|
||||
font-size: 0.8rem;
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 0.04em;
|
||||
border-bottom: 1px solid var(--border);
|
||||
white-space: nowrap;
|
||||
}
|
||||
.data-table td {
|
||||
padding: 0.6rem 0.75rem;
|
||||
border-bottom: 1px solid rgba(100,116,139,0.15);
|
||||
color: var(--text-primary);
|
||||
font-family: var(--font-mono);
|
||||
font-size: 0.875rem;
|
||||
}
|
||||
.data-table td a {
|
||||
color: var(--accent);
|
||||
text-decoration: none;
|
||||
font-family: var(--font-sans, sans-serif);
|
||||
}
|
||||
.data-table td a:hover { text-decoration: underline; }
|
||||
.data-table th a {
|
||||
color: var(--text-secondary);
|
||||
text-decoration: none;
|
||||
}
|
||||
.data-table th a:hover { color: var(--text-primary); }
|
||||
.data-table tr:hover td { background: rgba(96,165,250,0.04); }
|
||||
|
||||
/* Responsive */
|
||||
@media (max-width: 768px) {
|
||||
.container { padding: 1rem; }
|
||||
|
||||
Reference in new issue
Block a user