refactor(web): remove deprecated dashboard components and enhance KPI grid
quality / commitlint (push) Skipped
quality / changes (push) Successful in 9s
quality / docker-check (push) Skipped
quality / openapi (push) Successful in 46s
quality / web (push) Successful in 1m16s
quality / go (push) Successful in 2m42s
quality / bird2 (push) Successful in 16s
CD / quality (push) Successful in 5m19s
CD / publish (push) Successful in 7m19s

- Deleted unused components: `DashboardActivityTimeline`, `DashboardFramePanel`, `DashboardModulesGrid`, `DashboardRecentJobsGrid`, and `DashboardRecentRevisionsGrid` to streamline the dashboard.
- Updated `DashboardKpiGrid` to improve KPI display logic, including progress indicators and enhanced badge functionality.
- Refactored `DashboardNetworkHealth` to provide better status representation based on loading states and network conditions.
- Introduced new properties for KPI cards to support progress tracking and improved visual feedback.

This cleanup aims to enhance performance and maintainability of the dashboard while providing a better user experience.
This commit is contained in:
Denozordec
2026-08-31 10:15:59 +07:00
parent e469c421ca
commit dc803bcb34
51 changed files with 1895 additions and 1078 deletions
+24 -4
View File
@@ -81,6 +81,7 @@ func (m *Memory) UpdateModule(tenantID, moduleID string, patch *ModulePatch) (*M
t := patch.LastRefreshedAt.UTC()
mod.LastRefreshedAt = &t
}
mod.InputHash = ""
return cloneModule(mod), nil
}
@@ -152,6 +153,7 @@ func (m *Memory) CreateCDNSource(tenantID, moduleID string, in *CDNSource) (*CDN
LastRefreshedAt: in.LastRefreshedAt,
}
m.cdnSources[id] = s
mod.InputHash = ""
return s, nil
}
@@ -161,7 +163,8 @@ func (m *Memory) UpdateCDNSource(tenantID, moduleID, sourceID string, patch *CDN
}
m.mu.Lock()
defer m.mu.Unlock()
if _, err := m.moduleWriteOK(tenantID, moduleID); err != nil {
mod, err := m.moduleWriteOK(tenantID, moduleID)
if err != nil {
return nil, err
}
s, ok := m.cdnSources[sourceID]
@@ -195,6 +198,9 @@ func (m *Memory) UpdateCDNSource(tenantID, moduleID, sourceID string, patch *CDN
t := patch.LastRefreshedAt.UTC()
s.LastRefreshedAt = &t
}
if CDNPatchAffectsInputHash(patch) {
mod.InputHash = ""
}
return s, nil
}
@@ -209,6 +215,7 @@ func (m *Memory) DeleteCDNSource(tenantID, moduleID, sourceID string) error {
return ErrNotFound
}
delete(m.cdnSources, sourceID)
m.clearModuleInputHashLocked(moduleID)
return nil
}
@@ -247,6 +254,7 @@ func (m *Memory) CreateASEntry(tenantID, moduleID string, in *ASEntry) (*ASEntry
id := uuid.NewString()
e := &ASEntry{ID: id, ModuleID: moduleID, ASN: in.ASN, CommunityID: in.CommunityID}
m.asEntries[id] = e
mod.InputHash = ""
return e, nil
}
@@ -256,7 +264,8 @@ func (m *Memory) UpdateASEntry(tenantID, moduleID, entryID string, patch *ASEntr
}
m.mu.Lock()
defer m.mu.Unlock()
if _, err := m.moduleWriteOK(tenantID, moduleID); err != nil {
mod, err := m.moduleWriteOK(tenantID, moduleID)
if err != nil {
return nil, err
}
e, ok := m.asEntries[entryID]
@@ -283,6 +292,7 @@ func (m *Memory) UpdateASEntry(tenantID, moduleID, entryID string, patch *ASEntr
e.PrefixCount = nil
e.ASNResolvedAt = nil
}
mod.InputHash = ""
return e, nil
}
@@ -324,6 +334,7 @@ func (m *Memory) DeleteASEntry(tenantID, moduleID, entryID string) error {
return ErrNotFound
}
delete(m.asEntries, entryID)
m.clearModuleInputHashLocked(moduleID)
return nil
}
@@ -362,6 +373,7 @@ func (m *Memory) CreateDomainEntry(tenantID, moduleID string, in *DomainEntry) (
id := uuid.NewString()
e := &DomainEntry{ID: id, ModuleID: moduleID, FQDN: strings.TrimSpace(in.FQDN), CommunityID: in.CommunityID}
m.domainEnt[id] = e
mod.InputHash = ""
return e, nil
}
@@ -371,7 +383,8 @@ func (m *Memory) UpdateDomainEntry(tenantID, moduleID, entryID string, patch *Do
}
m.mu.Lock()
defer m.mu.Unlock()
if _, err := m.moduleWriteOK(tenantID, moduleID); err != nil {
mod, err := m.moduleWriteOK(tenantID, moduleID)
if err != nil {
return nil, err
}
e, ok := m.domainEnt[entryID]
@@ -389,6 +402,7 @@ func (m *Memory) UpdateDomainEntry(tenantID, moduleID, entryID string, patch *Do
e.CommunityID = &v
}
}
mod.InputHash = ""
return e, nil
}
@@ -403,6 +417,7 @@ func (m *Memory) DeleteDomainEntry(tenantID, moduleID, entryID string) error {
return ErrNotFound
}
delete(m.domainEnt, entryID)
m.clearModuleInputHashLocked(moduleID)
return nil
}
@@ -441,6 +456,7 @@ func (m *Memory) CreateIPRangeEntry(tenantID, moduleID string, in *IPRangeEntry)
id := uuid.NewString()
e := &IPRangeEntry{ID: id, ModuleID: moduleID, Prefix: strings.TrimSpace(in.Prefix), CommunityID: in.CommunityID}
m.ipRanges[id] = e
mod.InputHash = ""
return e, nil
}
@@ -450,7 +466,8 @@ func (m *Memory) UpdateIPRangeEntry(tenantID, moduleID, entryID string, patch *I
}
m.mu.Lock()
defer m.mu.Unlock()
if _, err := m.moduleWriteOK(tenantID, moduleID); err != nil {
mod, err := m.moduleWriteOK(tenantID, moduleID)
if err != nil {
return nil, err
}
e, ok := m.ipRanges[entryID]
@@ -468,6 +485,7 @@ func (m *Memory) UpdateIPRangeEntry(tenantID, moduleID, entryID string, patch *I
e.CommunityID = &v
}
}
mod.InputHash = ""
return e, nil
}
@@ -482,6 +500,7 @@ func (m *Memory) DeleteIPRangeEntry(tenantID, moduleID, entryID string) error {
return ErrNotFound
}
delete(m.ipRanges, entryID)
m.clearModuleInputHashLocked(moduleID)
return nil
}
@@ -551,6 +570,7 @@ func (m *Memory) UpdateDohProfile(tenantID, id string, patch *DohProfilePatch) (
if patch.SecretRef != nil {
p.SecretRef = patch.SecretRef
}
m.clearTenantModuleHashesLocked(tenantID)
return p, nil
}