From 0e1dd2ddbef2edbe21bca495f95208364849516f Mon Sep 17 00:00:00 2001 From: "felix.gateru" Date: Tue, 5 Mar 2024 17:49:22 +0300 Subject: [PATCH] Make uuid pattern accessible to all modals Signed-off-by: felix.gateru --- ui/service.go | 3 ++ ui/web/templates/charts/alarmcountmodal.html | 4 +- ui/web/templates/charts/alarmstablemodal.html | 4 +- .../templates/charts/arealinechartmodal.html | 4 +- ui/web/templates/charts/barchartmodal.html | 4 +- ui/web/templates/charts/donutmodal.html | 4 +- .../templates/charts/doublebarchartmodal.html | 4 +- .../charts/dynamicdatachartmodal.html | 4 +- .../templates/charts/entitiestablemodal.html | 4 +- ui/web/templates/charts/entitycountmodal.html | 4 +- ui/web/templates/charts/gaugemodal.html | 4 +- .../charts/horizontalbarchartmodal.html | 4 +- ui/web/templates/charts/labelmodal.html | 4 +- ui/web/templates/charts/linechartmodal.html | 4 +- .../templates/charts/multibarchartmodal.html | 4 +- ui/web/templates/charts/multigaugemodal.html | 4 +- .../charts/multiplelinechartmodal.html | 4 +- ui/web/templates/charts/piechartmodal.html | 4 +- ui/web/templates/charts/progressbarmodal.html | 4 +- .../templates/charts/shareddatasetmodal.html | 4 +- ui/web/templates/charts/speedgaugemodal.html | 4 +- .../charts/stackedlinechartmodal.html | 4 +- ui/web/templates/charts/stepchartmodal.html | 4 +- ui/web/templates/charts/tempgaugemodal.html | 4 +- ui/web/templates/charts/valuecardmodal.html | 4 +- ui/web/templates/dashboard.html | 48 +++++++++---------- 26 files changed, 75 insertions(+), 72 deletions(-) diff --git a/ui/service.go b/ui/service.go index d846e1cf8..d52eda4f7 100644 --- a/ui/service.go +++ b/ui/service.go @@ -231,6 +231,7 @@ var ( domainRelations = []string{"administrator", "editor", "viewer", "member"} groupRelations = []string{"administrator", "editor", "viewer"} statusOptions = []string{"all", "enabled", "disabled"} + uuidPattern = "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$" ) // Service specifies service API. @@ -2552,6 +2553,7 @@ func (us *uiService) ViewDashboard(s Session, dashboardID string) ([]byte, error Dashboard Dashboard Breadcrumbs []breadcrumb Session Session + UUIDPattern string }{ dashboardsActive, dashboardsActive, @@ -2559,6 +2561,7 @@ func (us *uiService) ViewDashboard(s Session, dashboardID string) ([]byte, error dashboard, crumbs, s, + uuidPattern, } if err := us.tpls.ExecuteTemplate(&btpl, "dashboard", data); err != nil { diff --git a/ui/web/templates/charts/alarmcountmodal.html b/ui/web/templates/charts/alarmcountmodal.html index dfb9e449e..e9aea0f1f 100644 --- a/ui/web/templates/charts/alarmcountmodal.html +++ b/ui/web/templates/charts/alarmcountmodal.html @@ -28,7 +28,7 @@ Alarm Count Card Alarms Table Alarms Table Area Line Charts Area Line Charts Time Series Bar Chart Time Series Bar Chart Donut chart Donut chart Double Bar Chart Double Bar Chart Dynamic Data Chart Dynamic Data Chart Entities table Entities table Entity Count Card Entity Count Card Simple Analogue Gauge Simple Analogue Gauge Horizontal Bar ChartChannel ID Horizontal Bar ChartThing IDs Label Card Label Card Time Series Line Chart Time Series Line Chart Multiple Bar Chart Multiple Bar Chart Multi Gauge Chart Multi Gauge Chart Time series line charts Time series line charts Pie chart Pie chart Progress bar Progress bar Shared Dataset Chart Shared Dataset Chart Analogue Speed Gauge Analogue Speed Gauge Stacked Line Charts Stacked Line Charts Step Chart Step Chart Analogue Temperature Gauge Analogue Temperature Gauge Value card Value card Widgets - {{ template "gaugemodal" }} - {{ template "linechartmodal" }} - {{ template "barchartmodal" }} - {{ template "piechartmodal" }} - {{ template "donutmodal" }} - {{ template "speedgaugemodal" }} - {{ template "tempgaugemodal" }} - {{ template "stackedlinechartmodal" }} - {{ template "arealinechartmodal" }} - {{ template "horizontalbarchartmodal" }} - {{ template "dynamicdatachartmodal" }} - {{ template "doublebarchartmodal" }} - {{ template "multiplelinechartmodal" }} - {{ template "stepchartmodal" }} - {{ template "multigaugemodal" }} - {{ template "multibarchartmodal" }} - {{ template "shareddatasetmodal" }} - {{ template "valuecardmodal" }} - {{ template "alarmcountmodal" }} - {{ template "alarmstablemodal" }} - {{ template "entitiestablemodal" }} - {{ template "entitycountmodal" }} - {{ template "progressbarmodal" }} - {{ template "labelmodal" }} + {{ template "gaugemodal" . }} + {{ template "linechartmodal" . }} + {{ template "barchartmodal" . }} + {{ template "piechartmodal" . }} + {{ template "donutmodal" . }} + {{ template "speedgaugemodal" . }} + {{ template "tempgaugemodal" . }} + {{ template "stackedlinechartmodal" . }} + {{ template "arealinechartmodal" . }} + {{ template "horizontalbarchartmodal" . }} + {{ template "dynamicdatachartmodal" . }} + {{ template "doublebarchartmodal" . }} + {{ template "multiplelinechartmodal" . }} + {{ template "stepchartmodal" . }} + {{ template "multigaugemodal" . }} + {{ template "multibarchartmodal" . }} + {{ template "shareddatasetmodal" . }} + {{ template "valuecardmodal" . }} + {{ template "alarmcountmodal" . }} + {{ template "alarmstablemodal" . }} + {{ template "entitiestablemodal" . }} + {{ template "entitycountmodal" . }} + {{ template "progressbarmodal" . }} + {{ template "labelmodal" . }}